[zfs-discuss] How to use by-id disk device nodes creating a zpool

Christ Schlacta aarcane at aarcane.org
Wed Jul 6 16:13:17 EDT 2011


On 7/6/2011 10:29, Alexey Ermilov wrote:
> I had similar problem and resolved it by exporting and importing a
> zpool using "by-id" notation:
> zpool import -d /dev/disk/by-id/<pool name>
>
> Hope it will help.
>
> On Wed, Jul 6, 2011 at 10:16 AM, Selim<selimbaygin at gmail.com>  wrote:
>> I created a zpool using the /dev/disk/by-id/... device nodes to ensure
>> that sdX style notation doesn't get messed with other USB HDD's in the
>> system.  However, when I reboot my system, the zpool status shows the
>> sdX style device nodes.
>>
>> How can I convince zpool to keep the /dev/disk/by-id style device
>> nodes?
>>
>> This is what I have in my system (wwn-style ID's are links to the sdX
>> style device nodes):
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee20201fa4d ->  ../../sde
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee20201fa4d-part1 ->  ../../sde1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee20201fa4d-part9 ->  ../../sde9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202577a99 ->  ../../sdg
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202577a99-part1 ->  ../../sdg1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202577a99-part9 ->  ../../sdg9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202579b4f ->  ../../sdf
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202579b4f-part1 ->  ../../sdf1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee202579b4f-part9 ->  ../../sdf9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257accab4 ->  ../../sdh
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257accab4-part1 ->  ../../sdh1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257accab4-part9 ->  ../../sdh9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257acfd73 ->  ../../sdb
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257acfd73-part1 ->  ../../sdb1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257acfd73-part9 ->  ../../sdb9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0cd5 ->  ../../sdd
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0cd5-part1 ->  ../../sdd1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0cd5-part9 ->  ../../sdd9
>> lrwxrwxrwx 1 root root  9 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0fc1 ->  ../../sdc
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0fc1-part1 ->  ../../sdc1
>> lrwxrwxrwx 1 root root 10 2011-07-06 08:26 by-id/
>> wwn-0x50014ee257ad0fc1-part9 ->  ../../sdc9
>>
>> Started with:
>> zpool create /dev/disk/by-id/ata-WDC_WD10EACS-00D6B0_WD-WCAU42707634
>> (repeat 6 more times)
>>
>> After a reboot, I saw that the zpool was referring to the actual sdX
>> devices.  When this happens, if I am booting up with some USB HDD's
>> connected, the sdX nodes change, and render the zpool in an unusable
>> state.  This is because, what *used to be* "/dev/sdb" becomes "/dev/
>> sdc", etc.
>>
>> Any thoughts?
>>
also, you should considder using /etc/zfs/zdev.conf to map devices to 
friendly names, or at least /dev/disk/by-path.



More information about the zfs-discuss mailing list