-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pool imported as sdX instead of /dev/disk/by-id #3043
Comments
I can now report that after the dailies fix, If a pool is export it is imported back automatically with /dev/disk/by-id after a reboot (tested in VirtualBox). This wasn't the case before the fix. However if the pool is imported manually, unless the "-d /dev/disk/by-id" option is used it gets imported as /dev/sdX. It would be nice if "zpool import tank" remembered the disk naming format from either, zpool create tank mirror /dev/disk/by-id /dev/disk/by-id Or a previous import, zpool import -d /dev/disk/by-id tank But that is a minor concern. |
Also, make sure that USE_DISK_BY_ID='yes' in /etc/default/zfs (before recreating the initrd).= |
Okay will try this out right now. I assume the command to recreate the initrd is, mv initrd.img-3.16.0-4-amd64 initrd.img-3.16.0-4-amd64.old |
No change. An exported pool is always imported back as /dev/disk/by-id after reboot.'zpool import spool' is always imported as /dev/sdX I am assuming it is better to have 'cachefile=none' specified as the default look to be '-', so I guess I should specify this setting moving on for all pool creation. nano /etc/default/zfs zpool set cachefile=none spool update-initramfs -c -k all |
I think you might be running into this: |
I was experiencing identical issue until I removed It is possible that this issue might also be caused by iniramfs script importing indiscriminately all pools at boot time, rather than using |
I ran into this problem recently. The legacy /dev/sdX is getting more and more unreliable. |
@alexanderhaensch you can change the default search order with the ZPOOL_IMPORT_PATH environment variable. See
That said, you may be right and it's time to change the default. The primary reason it was left as It would be great if you set ZPOOL_IMPORT_PATH on your systems to simulate a change in the default search paths. |
@behlendorf setting the environment variable works great. Now i can import my pool much easier without having the sdX which is changing every boot. :) |
@alexanderhaensch what did you end up setting it to. The default search order is as follows starting with
|
For some reason, the function zfs_resolve_shortname does not use vdev to label. On my system always /dev is used. |
I tested a little bit:
with ZPOOL_IMPORT_PATH="/dev/disk/by-vdev" :
without any ZPOOL_IMPORT_PATH :
interestingly, the cache is always detected correct with the by-id name. It is the first matching entry. sda,sdd,sdf never match. |
This came up in the Ubuntu bug tracker as well: https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1571241 |
Additional info (I logged the Ubuntu bug report): I was not able to get the ZPOOL_IMPORT_PATH working for the root filesystem on Ubuntu 16.04, i.e. adding it to /etc/default/zfs does not propagate this into the initrd. |
Is |
When importing a pool using the blkid cache only the device node path was added to the list of known paths for a device. This results in 'zpool import' always using the sdX names in preference to the 'path' name stored in the label. To fix the issue the blkid import path has been updated to add both the 'path', 'devid', and 'devname' names from the label to known paths. Sanity check is done to ensure these paths do refer to the same device identified by blkid. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#3043
@behlendorf I tested that patch. Applying only that patch fixes the issue observed in Ubuntu. That is, if I have a pool which was last imported using /dev/disk/by-id names, the patch causes zpool import to import it using /dev/disk/by-id names. |
When importing a pool using the blkid cache only the device node path was added to the list of known paths for a device. This results in 'zpool import' always using the sdX names in preference to the 'path' name stored in the label. To fix the issue the blkid import path has been updated to add both the 'path', 'devid', and 'devname' names from the label to known paths. Sanity check is done to ensure these paths do refer to the same device identified by blkid. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#3043
When importing a pool using the blkid cache only the device node path was added to the list of known paths for a device. This results in 'zpool import' always using the sdX names in preference to the 'path' name stored in the label. To fix the issue the blkid import path has been updated to add both the 'path', 'devid', and 'devname' names from the label to the known paths. A sanity check is done to ensure these paths do refer to the same device identified by blkid. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#4523 Closes openzfs#3043
When importing a pool using the blkid cache only the device node path was added to the list of known paths for a device. This results in 'zpool import' always using the sdX names in preference to the 'path' name stored in the label. To fix the issue the blkid import path has been updated to add both the 'path', 'devid', and 'devname' names from the label to the known paths. A sanity check is done to ensure these paths do refer to the same device identified by blkid. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#4523 Closes openzfs#3043
When importing a pool using the blkid cache only the device node path was added to the list of known paths for a device. This results in 'zpool import' always using the sdX names in preference to the 'path' name stored in the label. To fix the issue the blkid import path has been updated to add both the 'path', 'devid', and 'devname' names from the label to the known paths. A sanity check is done to ensure these paths do refer to the same device identified by blkid. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#4523 Closes openzfs#3043
Hi,
Exporting then importing a pool shows devices listed as sdX under zpool status.
Pool was created as
zpool create spool mirror /dev/disk/by-id/... /dev/disk/by-id/...
Unless the -d options is used each time the pool is imported.
zpool import -d /dev/disk/by-id spool
This is not the case with v0.6.3-766_gfde0d6d.
Not sure if this is somehow related to,
#2482
Using:
VirtualBox
(fresh install) Debian Jessie
(dailies) zfs v0.6.3-22
2d9d57jessieThanks,
Azeem
The text was updated successfully, but these errors were encountered: