How to add VDev with the Serial Number of HDDs

WhiteTiger

Member
May 16, 2020
86
2
13
Italy
I want to create a zpool with 3 vdevs, each with 7 HDDs in RAID-Z2.
The first Zpool I create it in the GUI and I am assigned 7 disks with the name SCSI-#SerialNumber.

If I use the zpool add command with the other 7 /dev/sd, they are added to me with the device name, no longer with the Serial Number.

How do I always have the Serial Number?
Is there no way to add the new VDev directly from the GUI?
 
Don't use the /dev/sdX paths but checkout the contents of /dev/disk/by-id/
Code:
ls -l /dev/disk/by-id

As you can see, it maps certain properties of the disk to the /dev/sdX device with a symlink. You can use these paths instead :)
 
Don't use the /dev/sdX paths but checkout the contents of /dev/disk/by-id/
Code:
ls -l /dev/disk/by-id

As you can see, it maps certain properties of the disk to the /dev/sdX device with a symlink. You can use these paths instead :)
Thank you por the reply.
If I create the pool from the GUI (Datacenter-Server-Disks-ZFS-Create: ZFS) the names are created by Proxmox.
So, when I run the zpool status command I see
Name Pool
> RAIDZ2
>> Disks with the serial name

The problem is how to add another 7 disks to the Pool, but in a second disk group, while keeping the same classification.
My goal is to have a single Zpool called MyPool with three sets of 7 disks in RAIDZ2.
 
Ah okay, so you want to add another 2 RAIDz2 vdevs consisting of 7 disks?

Please be aware that ZFS cannot redistribute data, so the current data will stay on the already existing raidz vdev and only new data will be spread across all of them. This is just something to keep in mind as newly written data will be accessed with better performance as the read operation can be spread out over more vdevs.

Not having it tested, but something like:

Code:
zpool add <pool> raidz2 /dev/disk/by-id/<disk1> /dev/disk/by-id/<disk2> ....

You could do this twice, or once you have all the disks for the second raidz vdev, add another "block" of raidz2 /dev/disk/.... for the second vdev.

Please be careful and maybe test it out somewhere, where you can just destroy the pool, should the result not be what you wanted.
 
Ah okay, so you want to add another 2 RAIDz2 vdevs consisting of 7 disks?

Please be aware that ZFS cannot redistribute data, so the current data will stay on the already existing raidz vdev and only new data will be spread across all of them. This is just something to keep in mind as newly written data will be accessed with better performance as the read operation can be spread out over more vdevs.

Not having it tested, but something like:

Code:
zpool add <pool> raidz2 /dev/disk/by-id/<disk1> /dev/disk/by-id/<disk2> ....

You could do this twice, or once you have all the disks for the second raidz vdev, add another "block" of raidz2 /dev/disk/.... for the second vdev.

Please be careful and maybe test it out somewhere, where you can just destroy the pool, should the result not be what you wanted.
ZPool is yet to be created, so there is no more data to redistribute.
I didn't understand how to use the syntax /dev/disk/by-id/<disk1>
instead of disk1 disk2 disk 3 I still have to use sdj sdk sdl ... ?

and with by-id I take the serial number?

I want to create 3x7 HDDs vdevs in RAID-Z2 because reading on the net I seem to understand that it is better this way than 21 disks in RAIDZ3.
I sacrifice 3x300GB HDDs, but it is more performing. Right?
 
Last edited:
ZPool is yet to be created
Okay, then you can create it by adding them during creation. For example:
Code:
zpool create -o ashift=12 <pool name> raidz2 /dev/disk/by-id/<disk1> /dev/disk/by-id/<disk2> .... raidz2 /dev/disk/by-id/<disk 8> /dev/disk/by-id/<disk 9> ... raidz2 /dev/disk/by-id/<disk 15> /dev/disk/by-id/<disk 16> ....
Of course you will need to add all the disks that should create each raidz vdev.

I didn't understand how to use the syntax /dev/disk/by-id/<disk1>
instead of disk1 disk2 disk 3 I still have to use sdj sdk sdl ... ?
No, you either give it just the sdX names or a path. Both works. So instead of sda you might use /dev/disk/by-id/ata-HGST_HTS721010A9E630_JR1000D300Y. Depending on what disks you have.

and with by-id I take the serial number?
You are free to choose which one you use. Usually, the variant with <type>-<vendor>_<model>_<serial> will be the most useful one to identify the disk.

I want to create 3x7 HDDs vdevs in RAID-Z2 because reading on the net I seem to understand that it is better this way than 21 disks in RAIDZ3.
I sacrifice 3x300GB HDDs, but it is more performing. Right?
You will get more IOPS than in one large raidz3. What do you plan to store on that pool? VMs? Depending on the disks used and your expectations, such a setup might not give you what you want.
For VMs, IOPS is much more important than actual bandwidth because the storage needs to handle a lot of parallel and very different IO from all the VMs. Therefore, the recommendation is to use mirror vdevs which will give you the best performance, but will cost you the most in how much disk space you need to purchase in ratio to how much you can actually use. There is also another behavior for any raidz vdev pool in combination with volume datasets (used for VM disks) which might give you quite some overhead and reduce the actual usable space!

The documentation has a whole chapter about all this: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_zfs_raid_considerations
 
I am trying to create the Zpool, but I realize now that I have not understood how:

If I use /dev/sdc /dev/sdd /dev/sde it is clear that I am referring to well identified disks.

But if I use /dev/disk/by-id/hdd-hp-xyz-000111222 /dev/disk/by-id/hdd-hp-xyz-000111333 /dev/disk/by-id/hdd-hp-xyz-000111444 how can I identify the third disk, fourth and fifth in the SSA chain?

I have to use an encoding that already identifies the disks internally; I don't think it is possible to use an arbitrary name to the disks.
It would be enough for me to use a label such as: f-03-hdd f-04-hdd f-05-hdd
That is the third, fourth, fifth HDD present in the Front panel.
 
Last edited:
I am trying to create the Zpool, but I realize now that I have not understood how:

If I use /dev/sdc /dev/sdd /dev/sde it is clear that I am referring to well identified disks.

But if I use /dev/disk/by-id/hdd-hp-xyz-000111222 /dev/disk/by-id/hdd-hp-xyz-000111333 /dev/disk/by-id/hdd-hp-xyz-000111444 how can I identify the third disk, fourth and fifth in the SSA chain?

I have to use an encoding that already identifies the disks internally; I don't think it is possible to use an arbitrary name to the disks.
It would be enough for me to use a label such as: f-03-hdd f-04-hdd f-05-hdd
That is the third, fourth, fifth HDD present in the Front panel.

Use this command to see the disk ids and assignment to device name (sdX). Here you can identify all disks that are available in the system.


Code:
root@pve01:~# ls -l /dev/disk/by-id/* | grep /sd*
lrwxrwxrwx 1 root root  9 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF049107CB240AGN -> ../../sdb
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF049107CB240AGN-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF049107CB240AGN-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF049107CB240AGN-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  9 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF0501010B240AGN -> ../../sda
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF0501010B240AGN-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF0501010B240AGN-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/ata-INTEL_SSDSC2KB240G8_PHYF0501010B240AGN-part3 -> ../../sda3
lrwxrwxrwx 1 root root  9 Sep 29 09:37 /dev/disk/by-id/usb-AMI_Virtual_CDROM0_AAAABBBBCCCC1-0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531cbb97 -> ../../sdb
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531cbb97-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531cbb97-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531cbb97-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  9 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531e0f89 -> ../../sda
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531e0f89-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531e0f89-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 29 09:37 /dev/disk/by-id/wwn-0x55cd2e41531e0f89-part3 -> ../../sda3
 
  • Like
Reactions: WhiteTiger

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!