moving bootloader and partitions from 2 big vdevs to 1 new smaller vdev?

Dunuin

Distinguished Member
Jun 30, 2020
14,796
4,718
258
Germany
Hi,

In the past I used 2 vdevs per debian VM. One vdev on SSD pool for root mountpoint and one vdev on HDD pool for "/var" mountpoint. And I created really big vdevs because I thought that might not be a problem because of thin provisioning. I just realized later that it is easy possible to increase the size of a vdev and backuping takes way to long because all the big empty space needs to be read first. Right now it takes 2 hours to backup the VMs while they need to be stopped but all data is just 80GB.
And by now I'm just using one big endurable ssd pool for all the vdevs and no second hdd pool anymore.

I really would like to just add another smaller vdev to the VMs, boot from a live cd, mount the old vdevs to that live linux and copy the bootloader and resized ext4 partitions to the new vdev. So I don't need to setup all the VMs again.
Is that the right procedure? Can someone recommend a tutorial on how to do that?
 
You VM has two vdevs: root and var, and you want to merge it.
1. Grow size of root vdev as you need (in Proxpox VE gui)
2.1. Boot VM from live cd, expand filesystem on root vdev, and check them.
2.2. Mount both vdevs and copy var from second vdev to first
2.3. In fstab comment out mount record for second vdev
3. Reboot to VM