zfs spare disk change reference by-id to /dev/sdb after reboot

abutrico

New Member
Aug 1, 2020
1
0
1
55
Hi,
I have been create a zfs mirror with 1 spare disk and all works fine refereced by-id after reboot.



1) BEFORE ADD SPARE DISK

# ls -alh /dev/disk/by-id/
lrwxrwxrwx 1 root root 9 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 9 18:18 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part3 -> ../../sdb3

# zpool status
pool: rpool
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part3 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part3 ONLINE 0 0 0





2) AFTER ADD SPARE DISK FIRST TIME

NOTICE that old /dev/sdb pointing to scsi1 now point to scsi2 disk (the new one)

# ls -alh /dev/disk/by-id/
lrwxrwxrwx 1 root root 9 Jun 9 18:28 ata-QEMU_DVD-ROM_QM00003 -> ../../sr0
lrwxrwxrwx 1 root root 9 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part3 -> ../../sda3
lrwxrwxrwx 1 root root 9 Jun 9 18:28 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1 -> ../../sdc
lrwxrwxrwx 1 root root 10 Jun 9 18:28 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Jun 9 18:28 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part2 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Jun 9 18:28 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part3 -> ../../sdc3
lrwxrwxrwx 1 root root 9 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi2 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi2-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi2-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 9 18:29 scsi-0QEMU_QEMU_HARDDISK_drive-scsi2-part3 -> ../../sdb3


zpool status
pool: rpool
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part3 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part3 ONLINE 0 0 0
spares
scsi-0QEMU_QEMU_HARDDISK_drive-scsi2-part3 AVAIL

OK NO PROBLEM WITH THE SWAP OF sdb / sdc due I added it with by-id !!!!!




3) REBOOT AFTER SPARE ADDED

WHATS HAPPENED !!!!!!!!! spare reference has changed and now is /dev/sdb

# zpool status
pool: rpool
state: ONLINE
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part3 ONLINE 0 0 0
scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-part3 ONLINE 0 0 0
spares
sdb3 AVAIL <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




This is a problem if disk scsi1 fail, due zpool will not be able to start at boot time because the /dev/sdb3 spare disk reference (and not by-id like I configured previously)
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!