Root on ZFS using /dev/sdX device names?

mattlach

Member
Mar 23, 2016
154
13
18
Boston, MA
Hey all,

I installed Proxmox to a mirrored pair of SSD's quite a while ago. I noticed almost immediately that the resultant rpool used old fashioned linux device names:

Code:
    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
      mirror-0  ONLINE       0     0     0
        sdj2    ONLINE       0     0     0
        sdr2    ONLINE       0     0     0
Firstly, I recommend changing this behavior in the installer to use /dev/disk/by-id references instead, as I have been told this is pretty poor practice, as things can get confused as device names can change around.

Secondly, I've meant to change this ever since, and could use some assistance.

I have been trying to fix this on my own by offlining the members of the pool one at a time, and replacing them with themselves using the best practice "by-id" reference.

Code:
root@proxmox:~# zpool offline rpool /dev/sdr2
root@proxmox:~# zpool replace rpool /dev/sdr2 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S21HNXAGCXXXXXX-part2
invalid vdev specification
use '-f' to override the following errors:
/dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S21HNXAGCXXXXXX-part2 is part of active pool 'rpool'
ok, let's try -f

Code:
root@proxmox:~# zpool replace -f rpool /dev/sdr2 /dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S21HNXAGCXXXXXX-part2
invalid vdev specification
the following errors must be manually repaired:
/dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S21HNXAGCXXXXXX-part2 is part of active pool 'rpool'
Well, that didn't work.

...ok, let's get rid of whatever label is causing the partition to be identified as a member of the pool...

Code:
root@proxmox:~# zpool labelclear -f /dev/sdr2
labelclear operation failed.
    Vdev /dev/sdr2 is a member (ACTIVE), of pool "rpool".
    To remove label information from this device, export or destroy
    the pool, or remove /dev/sdr2 from the configuration of this pool
    and retry the labelclear operation.
So, it looks like ZFS thinks it is smarter than I am and is trying to prevent me from doing something stupid.

I'll obviously have to find another way of doing this. Maybe clearing the entire partition by overwriting it with zeroes using dd if=/dev/zero of=/dev/sdr2 ?

Thoughts? Is there any reason I SHOULDNT do this? I know it can work just fine, as I set up the rpool manually on my Ubuntu server using this guide, and it worked just fine using /dev/disk/by-id device identification.

Appreciate any thoughts.

--Matt
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!