Discussion:
changed drive /dev/devices, zpool confusion
(too old to reply)
Peter Tripp
2008-10-26 08:03:12 UTC
Permalink
So I have a 4x1TB raidz pool setup. My /dev/sd[a-f] got reordered.
Zpool seems stuck on the old devicenames for the drives. Any way to
fix this?

Currently those four drives are attached as /dev/sd[c-f]. Previously
they were /dev/sd[a-d].

So zpool gives the following output:
NAME STATE READ WRITE CKSUM
andre UNAVAIL 0 0 0 insufficient replicas
raidz1 UNAVAIL 0 0 0 insufficient replicas
sda1 UNAVAIL 0 0 0 cannot open
sdb1 UNAVAIL 0 0 0 corrupted data
sdc1 ONLINE 0 0 0
sdd1 ONLINE 0 0 0

Which is relatively sane, it's confused by sda/sdb because they are
ext3 (sda1 is mounted).

How can I get zpool to try and use sd[c-f]? I tried with no luck
running:
zpool import -d /dev/disk/by-id/ andre

I think this may be caused/complicated by a power outage that happened
this afternoon. My roommate tripped the breaker.

I'm realizing now that I probably should've created the zpool using /
dev/disk/by-id, but anyone have any suggestions on how to go forward?

Thanks in advance
-Peter

P.S. If I'd had one other drive in this situation (just sda), might've
I never even noticed? If zpool would've tried sd[b-d] and found three
drives, my pool would be degraded, but still accessible, right?
Ricardo M. Correia
2008-10-26 10:09:31 UTC
Permalink
Hi Peter,
Post by Peter Tripp
How can I get zpool to try and use sd[c-f]? I tried with no luck
zpool import -d /dev/disk/by-id/ andre
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?

Thanks,
Ricardo
Peter Tripp
2008-10-26 20:15:08 UTC
Permalink
Post by Ricardo M. Correia
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?
Nope. Didn't get a chance to try that. I gave up last night and shut
down the computer and let it sit for 12hours for making another crack
at this. Of course, Linux decided to revert its drive letters back to
the previous /dev/sd[a-d] instead of /dev/[c-f] dunno why, don't
really care honestly.

So to convert/switch from /dev/sda1 type devices to /dev/disk/by-id/
bus_mfgr_-part1 devices I just did the following (andre is the name of
my raidz set)
zpool export andre
zpool import -d /dev/disk/by-id/ andre

zpool status now shows:


NAME
STATE READ WRITE CKSUM

andre
ONLINE 0 0 0

raidz1
ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0656557-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0619534-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0629426-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0656552-
part1 ONLINE 0 0 0

Yay! Hopefully it should follow the disks however they happen to be
named.
Thanks a bunch,
--Peter
Tim Faust
2013-06-25 18:53:57 UTC
Permalink
Although this reply is 5 years late, I'd like to give my thanks for
resolving my issue (changing device names after reboot) so easily. =)
Post by Peter Tripp
Post by Ricardo M. Correia
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?
Nope. Didn't get a chance to try that. I gave up last night and shut
down the computer and let it sit for 12hours for making another crack
at this. Of course, Linux decided to revert its drive letters back to
the previous /dev/sd[a-d] instead of /dev/[c-f] dunno why, don't
really care honestly.
So to convert/switch from /dev/sda1 type devices to /dev/disk/by-id/
bus_mfgr_-part1 devices I just did the following (andre is the name of
my raidz set)
zpool export andre
zpool import -d /dev/disk/by-id/ andre
NAME
STATE READ WRITE CKSUM
andre
ONLINE 0 0 0
raidz1
ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0656557-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0619534-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0629426-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_WD1000FYPS-01ZKB0_WD-WCASJ0656552-
part1 ONLINE 0 0 0
Yay! Hopefully it should follow the disks however they happen to be
named.
Thanks a bunch,
--Peter
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Emmanuel Anne
2013-06-25 18:57:10 UTC
Permalink
Wow, 5 years, I think you have an absolute record here ! ;-)
Post by Tim Faust
Although this reply is 5 years late, I'd like to give my thanks for
resolving my issue (changing device names after reboot) so easily. =)
Post by Peter Tripp
Post by Ricardo M. Correia
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?
Nope. Didn't get a chance to try that. I gave up last night and shut
down the computer and let it sit for 12hours for making another crack
at this. Of course, Linux decided to revert its drive letters back to
the previous /dev/sd[a-d] instead of /dev/[c-f] dunno why, don't
really care honestly.
So to convert/switch from /dev/sda1 type devices to /dev/disk/by-id/
bus_mfgr_-part1 devices I just did the following (andre is the name of
my raidz set)
zpool export andre
zpool import -d /dev/disk/by-id/ andre
NAME
STATE READ WRITE CKSUM
andre
ONLINE 0 0 0
raidz1
ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0656557-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0619534-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0629426-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0656552-
part1 ONLINE 0 0 0
Yay! Hopefully it should follow the disks however they happen to be
named.
Thanks a bunch,
--Peter
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
my zfs-fuse git repository :
http://rainemu.swishparty.co.uk/cgi-bin/gitweb.cgi?p=zfs;a=summary
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Tim Faust
2013-06-25 19:12:59 UTC
Permalink
This thread was the only one with the right fix. =D I was definitely
freaking out after I rebooted my system & learned that my zpools weren't
showing up.
Post by Emmanuel Anne
Wow, 5 years, I think you have an absolute record here ! ;-)
Post by Tim Faust
Although this reply is 5 years late, I'd like to give my thanks for
resolving my issue (changing device names after reboot) so easily. =)
Post by Peter Tripp
Post by Ricardo M. Correia
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?
Nope. Didn't get a chance to try that. I gave up last night and shut
down the computer and let it sit for 12hours for making another crack
at this. Of course, Linux decided to revert its drive letters back to
the previous /dev/sd[a-d] instead of /dev/[c-f] dunno why, don't
really care honestly.
So to convert/switch from /dev/sda1 type devices to /dev/disk/by-id/
bus_mfgr_-part1 devices I just did the following (andre is the name of
my raidz set)
zpool export andre
zpool import -d /dev/disk/by-id/ andre
NAME
STATE READ WRITE CKSUM
andre
ONLINE 0 0 0
raidz1
ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0656557-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0619534-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0629426-
part1 ONLINE 0 0 0
disk/by-id/scsi-1ATA_WDC_**WD1000FYPS-01ZKB0_WD-**WCASJ0656552-
part1 ONLINE 0 0 0
Yay! Hopefully it should follow the disks however they happen to be
named.
Thanks a bunch,
--Peter
--
--
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups
"zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
http://rainemu.swishparty.co.uk/cgi-bin/gitweb.cgi?p=zfs;a=summary
--
--
To post to this group, send email to zfs-fuse-/***@public.gmane.org
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Peter Tripp
2008-10-26 20:21:21 UTC
Permalink
Post by Ricardo M. Correia
How can I get zpool to try and use sd[c-f]?  I tried with no luck
zpool import -d /dev/disk/by-id/ andre
Did you try running "zpool export andre" before running zpool import?
If so, what was the output of that zpool import command?
I did get a chance to try running that, I suspect it might have
helped. Instead, I just powered off the machine overnight and when it
came back it had assigned /dev/sd[a-d] as before. No idea why, don't
really care.

For those interested, I converted my four drive raidz zpool ('andre')
from /dev/sda1 type devices to /dev/disk/by-id/ device by doing the
following:

zpool export andre
zpool import -d /dev/disk/by-id/ andre

Ta-da! That's it. 'zpool status' now shows sane output.

Thanks, I'm happily chugging along again. :)
--Peter
David Abrahams
2008-10-26 11:31:25 UTC
Permalink
Post by Peter Tripp
So I have a 4x1TB raidz pool setup. My /dev/sd[a-f] got reordered.
Zpool seems stuck on the old devicenames for the drives. Any way to
fix this?
Currently those four drives are attached as /dev/sd[c-f]. Previously
they were /dev/sd[a-d].
Yeah, that happened to me too, so I replaced each /dev/sd[c-f] by a
corresponding /dev/by-uuid/*. I *think* I may have used zpool replace
for that.

Advice to build pools by UUID should be presented on the zfs-fuse page,
because /dev/sd[c-f] renaming can happen simply by booting with an
external USB disk plugged in.
--
Dave Abrahams
BoostPro Computing
http://www.boostpro.com
Frank
2008-10-26 22:17:52 UTC
Permalink
Been there. Done that. Got the t-shirt: https://new.horow.net/franksblog/?p=483

My suggestion is that rather than /dev/disk/by-uuid one uses /dev/disk/
bi-id nomenclature. I've had an external USB case holding two drives
that couldn't deal with the uuid style. (From memory, it reported the
same uuid for *both* disks. I know that's ridiculous, but maybe the
bug has been fixed in more recent kernels?) Using the "by-id" style, a
sufficiently different id was reported for each drive to disambiguate.

Bottom line, "zpool export" and "zpool import -d" are your friends in
situations like this.

Good luck.

Frank Horowitz
Post by David Abrahams
So I have a 4x1TB raidz pool setup.  My /dev/sd[a-f] got reordered.
Zpool seems stuck on the old devicenames for the drives.  Any way to
fix this?
Currently those four drives are attached as /dev/sd[c-f].  Previously
they were /dev/sd[a-d].
Yeah, that happened to me too, so I replaced each /dev/sd[c-f] by a
corresponding /dev/by-uuid/*.  I *think* I may have used zpool replace
for that.
Advice to build pools by UUID should be presented on the zfs-fuse page,
because /dev/sd[c-f] renaming can happen simply by booting with an
external USB disk plugged in.
--
Dave Abrahams
BoostPro Computinghttp://www.boostpro.com
sehe
2008-11-04 10:12:03 UTC
Permalink
disk/by-uuid applies to partitions (slices) not disks (volumes).
Therefore, it is *not* ridiculous to have duplicate UUIDs:

Steps to reproduce:

$ mke2fs /dev/sda1
$ dd if=/dev/sda1 of=/dev/sda2

$ tune2fs /dev/sda1 -l | grep UUID
Filesystem UUID: ad873e61-3676-4c50-a1b9-977930c44f97
$ tune2fs /dev/sda2 -l | grep UUID
Filesystem UUID: ad873e61-3676-4c50-a1b9-977930c44f97

Can you spot the silly factor? It's sitting at the keyboard as most
times is the case. Fix it with 'tune2fs /dev/sda2 -U random' for
ext2/3 or similar incantations for your favourite filesystems. Yes
filesystems. They matter even though you are using ZFS. (On
partitions, that is)

Of course, the only ane approach is to use whole-disk pool members
only and use disk/by-id addressing. Been there, got the tuxedo!

Regards,
Seth
Been there. Done that. Got the t-shirt:https://new.horow.net/franksblog/?p=483
My suggestion is that rather than /dev/disk/by-uuid one uses /dev/disk/
bi-id nomenclature. I've had an external USB case holding two drives
that couldn't deal with the uuid style. (From memory, it reported the
same uuid for *both* disks. I know that's ridiculous, but maybe the
bug has been fixed in more recent kernels?) Using the "by-id" style, a
sufficiently different id was reported for each drive to disambiguate.
Bottom line, "zpool export" and "zpool import -d" are your friends in
situations like this.
Good luck.
Frank Horowitz
Post by David Abrahams
So I have a 4x1TB raidz pool setup.  My /dev/sd[a-f] got reordered.
Zpool seems stuck on the old devicenames for the drives.  Any way to
fix this?
Currently those four drives are attached as /dev/sd[c-f].  Previously
they were /dev/sd[a-d].
Yeah, that happened to me too, so I replaced each /dev/sd[c-f] by a
corresponding /dev/by-uuid/*.  I *think* I may have used zpool replace
for that.
Advice to build pools by UUID should be presented on the zfs-fuse page,
because /dev/sd[c-f] renaming can happen simply by booting with an
external USB disk plugged in.
--
Dave Abrahams
BoostPro Computinghttp://www.boostpro.com
s***@public.gmane.org
2008-11-04 10:33:44 UTC
Permalink
nuancing myself, please read
http://groups.google.com/group/zfs-fuse/browse_thread/thread/d6768766f8a6d7bf
for more (better?) advice from Riccardo
Post by sehe
disk/by-uuid applies to partitions (slices) not disks (volumes).
$ mke2fs /dev/sda1
$ dd if=/dev/sda1 of=/dev/sda2
$ tune2fs /dev/sda1 -l | grep UUID
Filesystem UUID: ad873e61-3676-4c50-a1b9-977930c44f97
$ tune2fs /dev/sda2 -l | grep UUID
Filesystem UUID: ad873e61-3676-4c50-a1b9-977930c44f97
Can you spot the silly factor? It's sitting at the keyboard as most
times is the case. Fix it with 'tune2fs /dev/sda2 -U random' for
ext2/3 or similar incantations for your favourite filesystems. Yes
filesystems. They matter even though you are using ZFS. (On
partitions, that is)
Of course, the only ane approach is to use whole-disk pool members
only and use disk/by-id addressing. Been there, got the tuxedo!
Regards,
Seth
Been there. Done that. Got the t-shirt:https://new.horow.net/franksblog/?p=483
My suggestion is that rather than /dev/disk/by-uuid one uses /dev/disk/
bi-id nomenclature. I've had an external USB case holding two drives
that couldn't deal with the uuid style. (From memory, it reported the
same uuid for *both* disks. I know that's ridiculous, but maybe the
bug has been fixed in more recent kernels?) Using the "by-id" style, a
sufficiently different id was reported for each drive to disambiguate.
Bottom line, "zpool export" and "zpool import -d" are your friends in
situations like this.
Good luck.
Frank Horowitz
Post by David Abrahams
Post by Peter Tripp
So I have a 4x1TB raidz pool setup. My /dev/sd[a-f] got reordered.
Zpool seems stuck on the old devicenames for the drives. Any way to
fix this?
Currently those four drives are attached as /dev/sd[c-f]. Previously
they were /dev/sd[a-d].
Yeah, that happened to me too, so I replaced each /dev/sd[c-f] by a
corresponding /dev/by-uuid/*. I *think* I may have used zpool replace
for that.
Advice to build pools by UUID should be presented on the zfs-fuse page,
because /dev/sd[c-f] renaming can happen simply by booting with an
external USB disk plugged in.
--
Dave Abrahams
BoostPro Computinghttp://www.boostpro.com
Loading...