zpool creation failing in Proxmox GUI

While trying to create a brand new zpool from Proxmox GUI, I was facing an error.

# /sbin/zpool create -o ashift=12 odin-zfs1 raidz /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000
cannot create 'odin-zfs1': one or more vdevs refer to the same device, or one of
the devices is part of an active md or lvm device
TASK ERROR: command '/sbin/zpool create -o 'ashift=12' odin-zfs1 raidz /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000 /dev/disk/by-id/scsi-30000000000000000' failed: exit code 1

This was partly solved by New SSDs not showing correct Serial# in Proxmox Disk Manager so at least in Proxmox, correct Serial#s were showing in the zpool creation screen (see below).

In looking further, the by-id links are not present, and the two that are present are incorrect.

ls -la /dev/disk/by-id

The remaining work is to update udev rules so the correct IDs are used for linking.

Create a backup copy of the original file

sudo cp /lib/udev/rules.d/60-persistent-storage.rules /lib/udev/rules.d/60-persistent-storage.rules.original

Then edit the /lib/udev/rules.d/60-persistent-storage.rules file.

Go to SCSI devices section, and replace ID_SERIAL with ID_SCSI_SERIAL.

# SCSI devices
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi"
KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SCSI_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss"
KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}"
KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SCSI_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SCSI_SERIAL}-part%n"

Save file, and run following commands.

sudo udevadm control --reload-rules
sudo udevadm trigger

You should see correct links now under /dev/disk/by-id.

After doing this, the zpool creation in Proxmox GUI was successful.

References

https://unix.stackexchange.com/questions/117500/is-there-a-way-to-change-a-device-id-in-dev-disk-by-id

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.