Hi all,
I have a container on a thinly provisioned LVM volume. I want to extract the disk that backs the thin volume out of the system running Proxmox, but run into the issue that thin volumes don't support shrinking.
After moving stuff out of the way, there is a lot of air in the container, but the thin volume is, of course, still the original size. Some (approximate) numbers :
I ran a short test to see whether Proxmox refuses to move the container to a target that is too small. It will diligently start moving.
What are my options, while also minimizing downtime?
My plan is to:
I have a container on a thinly provisioned LVM volume. I want to extract the disk that backs the thin volume out of the system running Proxmox, but run into the issue that thin volumes don't support shrinking.
After moving stuff out of the way, there is a lot of air in the container, but the thin volume is, of course, still the original size. Some (approximate) numbers :
- PV / VG backing the thin pool : 7,3 TiB
- Thin pool : 4,5 TiB
- The containers thin volume : 3,6 TiB
- Container :
- Size of the file system : 3,6 TiB
- Actual storage used: 0,5 TiB
- Available target for moving : 3,5 TiB disk
I ran a short test to see whether Proxmox refuses to move the container to a target that is too small. It will diligently start moving.
What are my options, while also minimizing downtime?
- I have backups, but I suspect restoring such a backup will run into the same problem eventually as moving the volume (to be tested, after I have a backup of the new smaller size)
- The container used about 3,3 TiB before moving data elsewhere. The last 0,3 TiB are, I presume, never used or claimed by LVM. I would not lose extends that got data if the container got cut off at 3,5 TiB, but LVM will probably stress over losing integrity
- File level move to a new container may work
- create a new 0,7 TiB container on target storage
- shutdown both containers
- mount the filesystems on the host
- rsync from the existing container to the new one
- comes with downtime
- I don't really have an option at the moment to put larger disks in the system, nor is the container expected to grow to its old size anymore
My plan is to:
- shutdown the container, resize2fs to shrink the filesystem
- create a backup of the container with the large amount of unused space
- restore to the smaller HDD on a regular logical volume
- in case the restore does not fail, continue
- fsck.ext4 the file system (it's probably confused about the missing tail of the filesystem)
- check whether the container boots, shutdown
- resize2fs the file system (shrink to some 0,7 TiB)
- lvresize -r the volume to some 0,7 TiB
- see whether the container still boots, shutdown
- rsync the delta from the running original running container since creating the backup
- shutdown both containers, rsync once more
- boot the new container
Last edited: