Discussion:
replacing drive
(too old to reply)
yee379
2012-03-02 04:21:38 UTC
Permalink
i'm been using zfs-fuse for over two years now and am very happy with
it :) keep up the good work guys!

so one of the disks in my striped zfs pool is going bad. i have a
spare, but not enough internal sata ports on my controller to just
plug another disk in.

no problems, as i have an external esata drive. however, i would like
to just use this external drive temporarily for the zpool replace and
swap it out with the bad drive after it's re-silvered. it should be
easy, but i'm unsure whether the drive names will 'migrate':

so my current pool is

NAME STATE
READ WRITE CKSUM
tank ONLINE
0 0 0
disk/by-id/wwn-0x50014ee2581a4c2e ONLINE
0 0 0
disk/by-id/scsi-SATA_WDC_WD20EADS-00_WD-WCAVY1315742 ONLINE
0 0 13
disk/by-id/ata-WDC_WD20EARS-00S8B1_WD-WCAVY2851098 ONLINE
0 0 0

(don't ask me why i'm using different names!)

smartctl seems to validate that the second drive is iffy.

my external drive shows up as

ata-WD_My_Book_WD-WMAZA5413633 -> ../../sdi
scsi-SATA_WD_My_Book_WD-WMAZA5413633 -> ../../sdi

so my question is does the 'WD_My_Book" string matter? as i suspect
that after i plug this external drive onto my internal disk
controller, it will not have this string.

i understand that export and import allows me to migrate entire pools;
will it automagically work out that this external disk is good after i
make it an internal disk?

thanks,
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Fajar A. Nugraha
2012-03-02 04:32:21 UTC
Permalink
Post by yee379
i'm been using zfs-fuse for over two years now and am very happy with
it :) keep up the good work guys!
so one of the disks in my striped zfs pool is going bad.
striped? As it NOT raidz or mirror? YIKES!
Post by yee379
i have a
spare, but not enough internal sata ports on my controller to just
plug another disk in.
no problems, as i have an external esata drive. however, i would like
to just use this external drive temporarily for the zpool replace and
swap it out with the bad drive after it's re-silvered. it should be
Probably it will.

Depending on how your enclosure works, you MIGHT have the same
by-id/wwn-* link. However there's no guarantee zfs-fuse will choose
that instead of the other (e.g. usb-*) link.
Post by yee379
i understand that export and import allows me to migrate entire pools;
will it automagically work out that this external disk is good after i
make it an internal disk?
It should.
--
Fajar
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
yee379
2012-03-02 05:14:24 UTC
Permalink
thanks for the quick reply Fajar,
Post by Fajar A. Nugraha
striped? As it NOT raidz or mirror? YIKES!
yeah, i'm too cheap :) besides, thanks to zfs, with the checksumming
and smartctl i normally get plenty of notice in preparation (and
western digitals rma is pretty good) :)
Post by Fajar A. Nugraha
Post by yee379
i understand that export and import allows me to migrate entire pools;
will it automagically work out that this external disk is good after i
make it an internal disk?
It should.
i do not currently get a wwn-* link for my external drive; i don't
even get a usb-* link because it's esata.

is there a file i can hack/edit to basically tell zfs to use a
specific drive? or can i tell zfs with the import command to
explicitly use the replacement drive's by-id/<blah> link after i've
moved it?

cheers,
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Fajar A. Nugraha
2012-03-02 05:47:08 UTC
Permalink
Post by yee379
is there a file i can hack/edit to basically tell zfs to use a
specific drive? or can i tell zfs with the import command to
explicitly use the replacement drive's by-id/<blah> link after i've
moved it?
It will use links in by-id by default. If a block device has multiple
links (e.g. wwn-*, usb-*, ata-*) I'm not sure which one it will use.

If you want to force it to use a particular link, you can do something
like this:
- create a directory (e.g /etc/zfs/devices)
- create symlinks in that directory (e.g. drive1 ->
/dev/disk-by/id/ata-Corsair_CSSD-F60GB2-A_1110651334000462002E)
- tell zpool import to use that directory (e.g. zpool import -d
/etc/zfs/devices)

zfsonlinux does something like that using /etc/zfs/zdev.conf and
/lib/udev/rules.d/60-zpool.rules
--
Fajar
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
yee379
2012-03-02 06:19:29 UTC
Permalink
Post by Fajar A. Nugraha
- create a directory (e.g /etc/zfs/devices)
- create symlinks in that directory (e.g. drive1
-> /dev/disk-by/id/ata-Corsair_CSSD-F60GB2-A_1110651334000462002E)
- tell zpool import to use that directory (e.g. zpool import
-d /etc/zfs/devices)
fantastic! i haven't started the replace yet, but i did as you suggested
and created symlinks in a directory and (re) imported that directory:

tank ONLINE 0 0 0
/etc/zfs/devices/WD-WCAVY0221974 ONLINE 0 0 0
/etc/zfs/devices/WD-WCAVY1315742 ONLINE 0 0 0
/etc/zfs/devices/WD-WCAVY2851098 ONLINE 0 0 0

this works great and i'm sure the replace will be fine. many thanks!
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Christ Schlacta
2012-03-02 05:50:40 UTC
Permalink
You can rm the links you want zfs to not use, then import, then reboot to
restore the links. Works like a charm, that's how I get my drives to use
by-wwn
Post by yee379
thanks for the quick reply Fajar,
Post by Fajar A. Nugraha
striped? As it NOT raidz or mirror? YIKES!
yeah, i'm too cheap :) besides, thanks to zfs, with the checksumming
and smartctl i normally get plenty of notice in preparation (and
western digitals rma is pretty good) :)
Post by Fajar A. Nugraha
Post by yee379
i understand that export and import allows me to migrate entire pools;
will it automagically work out that this external disk is good after i
make it an internal disk?
It should.
i do not currently get a wwn-* link for my external drive; i don't
even get a usb-* link because it's esata.
is there a file i can hack/edit to basically tell zfs to use a
specific drive? or can i tell zfs with the import command to
explicitly use the replacement drive's by-id/<blah> link after i've
moved it?
cheers,
--
To visit our Web site, click on http://zfs-fuse.net/
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
Loading...