zpool export/import "by id" on live raid SSD

Inlakesh

Well-Known Member
Jan 13, 2019
74
4
48
Hello

I've built my zpool to use disk assignment (/dev/sda etc)

I've now after setup and proxmox is live with lxc's and kvm on the disks, read and experienced that this is a bad move and that I should have used /dev/disk/by-id/ instead.

Does anyone know how to convert an existing raid zpool to use /dev/disk/by-id, and is it safe to do so when there is active lxc and kvm on these raid discs?

This is how the pool look now:

pool: zfs_vm_ct
state: ONLINE
scan: scrub repaired 0B in 0h12m with 0 errors on Sun Jul 14 00:36:25 2019
config:
NAME STATE READ WRITE CKSUM
zfs_vm_ct ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
errors: No known data errors

Would really appreciate some guidance to my problem.

Thanks in advance
 
Does anyone know how to convert an existing raid zpool to use /dev/disk/by-id, and is it safe to do so when there is active lxc and kvm on these raid discs?

Normally you need to export and re-import the pool by using the "-d /dev/disk/by-id" flag, for example something like:
Code:
zpool export <POOLNAME>
zpool import -d /dev/disk/by-id <POOLNAME>

But that cannot be done if the pool is "busy" (i.e., has active users), so if you want to do this change I'd suggest to do it before your next scheduled maintenance reboot (e.g., if a new kernel gets installed/upgraded). Stop or move all VMs/CTs and then execute above procedure.
 
Thank you for your help.

As this pool consists 2 raid1 configurations how would I do to export and import them then?
NAME STATE READ WRITE CKSUM
zfs_vm_ct ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0

Can I do like this?

Code:
zpool export zfs_vm_ct
zpool import -d mirror /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3YBNB0K824884X /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3YBNB0K824886L zfs_vm_ct
zpool import -d mirror /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3YBNB0K824875N /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3YBNB0K824874Y zfs_vm_ct
 
Can I do like this?

The two imports shouldn't be needed, it should work with literally doing:
Code:
zpool export zfs_vm_ct
zpool import -d /dev/disk/by-id zfs_vm_ct
in your setup. (ZFS sees that the pool consists of two mirrors, and tries to import all of them, with "-d" you tell ZFS to search in the specified directory for the devices (and then use those) instead of "/dev" directly)
 
The two imports shouldn't be needed, it should work with literally doing:
Code:
zpool export zfs_vm_ct
zpool import -d /dev/disk/by-id zfs_vm_ct
in your setup. (ZFS sees that the pool consists of two mirrors, and tries to import all of them, with "-d" you tell ZFS to search in the specified directory for the devices (and then use those) instead of "/dev" directly)
Ok, great. I will try this next time when updates is due.

Thanks a lot.
 
The two imports shouldn't be needed, it should work with literally doing:
Code:
zpool export zfs_vm_ct
zpool import -d /dev/disk/by-id zfs_vm_ct
in your setup. (ZFS sees that the pool consists of two mirrors, and tries to import all of them, with "-d" you tell ZFS to search in the specified directory for the devices (and then use those) instead of "/dev" directly)
YES! That worked great, thanks a lot.
 
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!