Skip to content
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

Created pool with by-id but on reboot it uses sdX #4669

Closed
hippie131 opened this issue May 19, 2016 · 11 comments
Closed

Created pool with by-id but on reboot it uses sdX #4669

hippie131 opened this issue May 19, 2016 · 11 comments

Comments

@hippie131
Copy link

I'm on Ubuntu 14.04 with the latest zfs installed for the PPA. Here is the history:
zpool history
History for 'mypool':
2016-05-17.21:20:56 zpool create -m none -o ashift=12 mypool raidz2 /dev/disk/by-id/ata-WDC_WD6002FFWX-68TZ4N0_K1G0YB8B /dev/disk/by-id/ata-WDC_WD6001FFWX-68Z39N0_WD-WXB1HB4MYU7M /dev/disk/by-id/ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB5140D1 /dev/disk/by-id/ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB51457V /dev/disk/by-id/ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB514Y1L /dev/disk/by-id/ata-WDC_WD6001FFWX-68Z39N0_WD-WXB1HB4TDJL4
2016-05-18.07:40:43 zpool import -N mypool
2016-05-18.11:45:12 zpool import -N mypool

The last 2 entries were created from system reboots causing the pool to be imported like this:
zpool status
pool: mypool
state: ONLINE
scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    mypool      ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
        sdi     ONLINE       0     0     0
        sdk     ONLINE       0     0     0
        sdj     ONLINE       0     0     0

errors: No known data errors

I tried to use the deprecated ZPOOL_IMPORT_PATH="/dev/disk/by-id" in /etc/default/zfs but it had no effect. The zpool.cache file has references in it for the by-id drives. What can I do to ensure on reboot it imports with the by-id paths? Is it possible to manually set the import command issued automatically on reboot to import by the by-id paths?

@behlendorf
Copy link
Contributor

This was fixed in the zfs-0.6.5.7 release which was tagged last week. It looks like the ppa has been updated to include these packages, can you verify the exact zfs version number.

@hippie131
Copy link
Author

dpkg -l | grep zfs
ii dkms 2.2.0.3-1.1ubuntu5.14.04.1+zfs10trusty all Dynamic Kernel Module Support Framework
ii libzfs2 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem library for Linux
ii mountall 2.53-zfs1 amd64 filesystem mounting tool
ii ubuntu-zfs 8trusty amd64 Native ZFS filesystem metapackage for Ubuntu.
ii zfs-dkms 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem kernel modules for Linux
ii zfs-doc 0.6.5.7-1trusty amd64 Native OpenZFS filesystem documentation and examples.
ii zfs-initramfs 0.6.5.7-1
trusty amd64 Native OpenZFS root filesystem capabilities for Linux
ii zfsutils 0.6.5.7-1~trusty amd64 Native OpenZFS management utilities for Linux

@behlendorf
Copy link
Contributor

@hippie131 can please try the following:

$ zpool export mypool
$ zpool import -d /dev/disk/by-id mypool

# Verify by-id names are used.
$ zpool status
$ reboot

# Verify by-id names are used.
$ zpool status

@hippie131
Copy link
Author

hippie131 commented May 19, 2016

same thing happens:

$zpool export mypool
$zpool import -d /dev/disk/by-id mypool
$zpool status
pool: mypool
state: ONLINE
scan: none requested
config:

    NAME                                            STATE     READ WRITE CKSUM
    mypool                                          ONLINE       0     0     0
      raidz2-0                                      ONLINE       0     0     0
        ata-WDC_WD6002FFWX-68TZ4N0_K1G0YB8B         ONLINE       0     0     0
        ata-WDC_WD6001FFWX-68Z39N0_WD-WXB1HB4MYU7M  ONLINE       0     0     0
        ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB5140D1  ONLINE       0     0     0
        ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB51457V  ONLINE       0     0     0
        ata-WDC_WD6001FFWX-68Z39N0_WD-WX11DB514Y1L  ONLINE       0     0     0
        ata-WDC_WD6001FFWX-68Z39N0_WD-WXB1HB4TDJL4  ONLINE       0     0     0

errors: No known data errors

$reboot
$zpool status
pool: mypool
state: ONLINE
scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    mypool      ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
        sdi     ONLINE       0     0     0
        sdk     ONLINE       0     0     0
        sdj     ONLINE       0     0     0

errors: No known data errors

@hippie131
Copy link
Author

Is there a way to alter the command used at boot time? if there is I can just change it from "zpool import -N mypool" to "zpool import -d /dev/disk/by-id mypool"

@kingneutron
Copy link

--I was having this exact same issue on Ubuntu 14.04-64-LTS; thank you for fixing it :)

/ currently using kernels 4.2.0-30-generic #3614.04.1-Ubuntu SMP and
// 4.2.0-36-generic #42
14.04.1-Ubuntu SMP

(main PC, kernel 4.2.0-30)
$ dpkg -l|grep zfs
ii dkms 2.2.0.3-1.1ubuntu5.14.04.1+zfs10trusty all Dynamic Kernel Module Support Framework
ii libzfs2 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem library for Linux
ii mountall 2.53-zfs1 amd64 filesystem mounting tool
ii ubuntu-zfs 8trusty amd64 Native ZFS filesystem metapackage for Ubuntu.
ii zfs-dkms 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem kernel modules for Linux
ii zfs-doc 0.6.5.7-1trusty amd64 Native OpenZFS filesystem documentation and examples.
ii zfsutils 0.6.5.7-1
trusty amd64 Native OpenZFS management utilities for Linux

( 2nd server, kernel 4.2.0-36 )
$ dpkg -l|grep zfs
ii dkms 2.2.0.3-1.1ubuntu5.14.04.1+zfs10trusty all Dynamic Kernel Module Support Framework
ii libzfs2 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem library for Linux
ii mountall 2.53-zfs1 amd64 filesystem mounting tool
ii ubuntu-zfs 8trusty amd64 Native ZFS filesystem metapackage for Ubuntu.
ii zfs-dkms 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem kernel modules for Linux
ii zfs-doc 0.6.5.7-1trusty amd64 Native OpenZFS filesystem documentation and examples.
ii zfsutils 0.6.5.7-1
trusty amd64 Native OpenZFS management utilities for Linux

@kingneutron
Copy link

@hippie131 , what kernel version are you using, maybe try upgrading to 4.2.0-30 or -36?

@hippie131
Copy link
Author

Im at the highest i can be without going to the next LTS which isnt recommended until the first point release comes out

-------- Original message --------
From: kingneutron notifications@github.com
Date: 2016-06-07 5:29 PM (GMT-05:00)
To: zfsonlinux/zfs zfs@noreply.github.com
Cc: hippie131 pieman131@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [zfsonlinux/zfs] Created pool with by-id but on reboot it uses sdX (#4669)

@hippie131 , what kernel version are you using, maybe try upgrading to 4.2.0-30 or -36?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#4669 (comment)

@hippie131
Copy link
Author

hippie131 commented Jun 7, 2016

uname -a
Linux Media 4.2.0-36-generic #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@hippie131
Copy link
Author

updated to the new hardware stack and now it seems to be mounting properly with the disk IDs. Here is the kernel version I'm on now:
uname -a
Linux Media 4.4.0-34-generic #53~14.04.1-Ubuntu SMP Wed Jul 27 16:56:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

@behlendorf
Copy link
Contributor

behlendorf commented Aug 22, 2016

For the sake of completeness this was addressed in the release branch by c9ca152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants