ZFS: raid disks

Alessandro 123

Well-Known Member
May 22, 2016
653
24
58
40
I think that PVE should not use /dev/sdX when creating the RAID. It's a common practise (and suggested) to use something unique that doesn't change when moving disks (or on reboots) like /dev/disks/by-id o /dev/disks/by-path
 
I think that PVE should not use /dev/sdX when creating the RAID. It's a common practise (and suggested) to use something unique that doesn't change when moving disks (or on reboots) like /dev/disks/by-id o /dev/disks/by-path
It has been mentioned multiple times in these forums and overall this is the recommended way. I have no idea why PVE folks still don't follow it. I changed the device naming by stopping server booting at the mount state and did a "zfs import -d /dev/disk/by-id/ poolname" where it was necessary.
 
I don't know if it is necessary or not, but I also disabled the zfs import by scan service.
 
The last import state is cached so basically you don't need to. Other than that I wonder if it could cause any problems...
 
Just playing safe. I noticed they run the cache scan service *and* the disk scan service...
 
This is why I always create the pool manually :)
Sure, but as PVE natively support ZFS, i would expect that PVE is creating a pool in a proper way.

Adding support for ZFS and still create a pool in a very bad practise way is non-sense. If you support something, you should support in the proper way.

It's too easy add ZFS support just to say "we support ZFS"
 
It has been mentioned multiple times in these forums and overall this is the recommended way. I have no idea why PVE folks still don't follow it. I changed the device naming by stopping server booting at the mount state and did a "zfs import -d /dev/disk/by-id/ poolname" where it was necessary.

Can you explain exactly step by step ? I'm new to ZFS and I don't know how to change device names after install from the live cd.
 
Export the pool, and then re-import it 'the right way'. At that point, it should be in the cachfile and be imported properly on subsequent boots.
 
No, you import pools, not disks. e.g. if your pool is called 'tank', then do:

zpool export tank
zpool import -d /dev/disks/by-id tank
 
  • Like
Reactions: dbayer
You can safely do it from initrd:
- reboot, and when grub displays the menu, press 'e' on the first line
- edit the linux line so it has break=mount at the end and then press ctrl-x
- when you get the promt, do 'modprobe zfs'
- now do a 'zpool import -d /dev/disk/by-id/ rpool'
- verify status with 'zpool status' - you should see device ids in place of the standard device names
- ctrl-d to continue booting

From now on you should see your pool based on device ids.
 
You can safely do it from initrd:
- reboot, and when grub displays the menu, press 'e' on the first line
- edit the linux line so it has break=mount at the end and then press ctrl-x
- when you get the promt, do 'modprobe zfs'
- now do a 'zpool import -d /dev/disk/by-id/ rpool'
- verify status with 'zpool status' - you should see device ids in place of the standard device names
- ctrl-d to continue booting

From now on you should see your pool based on device ids.

Thank you for that detailed explanation!
 
it's been on our agenda for quite a while, but unfortunately importing/creating via /dev/disk/by-id is not possible in the installer chroot. regarding the scan vs. cache services - although both are enabled by default, only one of them actually runs depending on whether a cache file exists or not (check "systemctl cat 'zfs-import-*'" for how this is done using systemd units ;)).

since PVE imports pools belonging to configured storages automatically anyway, you probably don't actually need either service unless you have non-rpool zpools that are not known to PVE.
 

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!