Migrating to a smaller SSD

WillGFC

Member
Oct 4, 2020
14
2
23
44
Hello,


I currently have Proxmox running my home servers but have been doing a bit of storage maintenance.

I upgraded my VM (zfs mirrored pool) storage to 2 x consumer SSDs last year due to some crazy IO delays I was facing at the time and for a while it worked well enough but recently they started misbehaving too so I picked up 2 Micron 5110 pros to take over that duty. Obviously moving Vm storage is nice and easy with the tools Proxmox provides.

But at the minute, Proxmox itself is installed on a single 256GB nvme drive but in the 4 years since I installed it, the drive is sitting at 16% wearout and obviously it has zero redundancy

I also picked up 2 intel SSD Pro 5400s that are 180GB which is actually more than enough for Proxmox since I don't use the lvm-thin storage for anything other than 2 very small (6gb & 3gb) vms that run my PiHole and OpenVPN servers, but the thought of transferring from the 256gb existing storage to a mirrored ZFS pool with the 2 new 180gb drives is a little off putting.

I've cloned disks before but only going to the same size or larger. I understand the risks of shrinking a volume so my process would likely be to clone the Proxmox drive to a larger drive first, keeping the original safe, then shrink the size on the temporary drive to one that can be cloned to the new zfs pool, then check to see if it all worked, but is it likely to confuse Proxmox itself if its drive suddenly reduces in size?
I've already moved the 2 container storages to the main VM storage so the only thing currently on the NVME drive is the Proxmox install but I'm a little confused about how the storage is actually configured.
When I use a disk as a logical volume with a thin-pool, it assigns the entire partition or disk as the thin pool.
Yet my main Proxmox LVM is the entire disk, minus the efi and boot partitions. The LVM-thin volume was setup by the Proxmox installation as a 150(ish)gb volume out of the Proxmox 250gb LVM volume, so I'm a little reluctant to just delete the thin-pool and recreate it since I don't really know if I'll be able to given that when I want to create a thin-pool, it seems to be an all or nothing thing on the LVM
 
https://github.com/kneutron/ansites...replace-zfs-mirror-boot-disks-with-smaller.sh

TRY THIS IN A VM 1ST and make a full backup of your install before making major (or any) changes

https://github.com/kneutron/ansitest/tree/master/proxmox

I would also recommend setting up and running the bkpcrit script and store the backups somewhere non-rootfs (or NAS) and run it frequently (I have mine nightly in cron and also run it ad-hoc)

You don't necessarily need an lvm-thin pool if none of your guests run ZFS or other COW filesystems. But you should always be able to recreate it with commandline tools if the GUI is falling short
 
  • Like
Reactions: justinclift
https://github.com/kneutron/ansites...replace-zfs-mirror-boot-disks-with-smaller.sh

TRY THIS IN A VM 1ST and make a full backup of your install before making major (or any) changes

https://github.com/kneutron/ansitest/tree/master/proxmox

I would also recommend setting up and running the bkpcrit script and store the backups somewhere non-rootfs (or NAS) and run it frequently (I have mine nightly in cron and also run it ad-hoc)

You don't necessarily need an lvm-thin pool if none of your guests run ZFS or other COW filesystems. But you should always be able to recreate it with commandline tools if the GUI is falling short
Thank you for the reply,

That's a useful script but my problem is I'm currently running a LVM single disk as my main PVE storage, not a ZFS pool. From the looks of your script, it's going to add two new disks to the pool, wait for them to resilver the existing data, remove the old disks then fix the boot of the new mirrored pool.

I need to somehow move from a single disk (with boot, EFI and storage partitions) to a zfs pool with the 3 separate partitions.

I had the idea of passing the two new disks through to a VM and installing proxmox so at least now I have my disks with the correct geometry.
Obviously I don't want to attempt this until I have the time to follow it through and I'm busy next weekend, but do you think I could RSYNC the existing PVE partition to the new one and run your commands to fix the boot on the new disks? Or will running the boot tool remove the booting capability of the current SSD? I'd obviously prefer to leave it entirely untouched if at all possible until the new ZFS pool is working.

Code:
proxmox-boot-tool format /dev/${newdisk1}2 --force # <new disk's ESP partn>
proxmox-boot-tool format /dev/${newdisk2}2 --force # <new disk's ESP partn>
time sync; sleep 2

proxmox-boot-tool init /dev/${newdisk1}2 $addgrub # <new disk's ESP partn>
proxmox-boot-tool init /dev/${newdisk2}2 $addgrub # <new disk's ESP partn>

The existing install is on nvme0n1, the new disks are sda/sdb already set up with the rpool ZFS pool
 

Attachments

  • prox.png
    prox.png
    481.4 KB · Views: 1
Last edited:
> I need to somehow move from a single disk (with boot, EFI and storage partitions) to a zfs pool with the 3 separate partitions

What you're thinking of doing (migrating directly from lvm+ext4 to zfs mirrored boot/root) is entirely unsupported, not to mention untested.

You're better off doing a fresh install of pve from ISO to 2x ZFS mirror boot/root disks, restore your critical files from backup if necessary, and restore your VMs and CTRs from backup.

You gotta nuke it from orbit, it's the only way to be sure ;-)
 
Ugh, that was my fear.

In hindsight even a full successful clone wouldn't work because the zfs pool wouldn't import properly with the old config.

There's nothing too major in the main proxmox config beyond my networking, some disks passed through to one of my vms and the ssh keys that are used to transfer my ssl certs when they update. That reminds me, I did install something that only allows that one command to copy the keys over ssh since it has to be run on a password-less certificate so I'll have to hunt and see what I did.

I guess I'll have to get to work, thank you for the help.
 
  • Like
Reactions: Kingneutron

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!