Sep 4, 2026

Proxmox VE : Upgrade existing OS HDD (LVM)

Proxmox VE, upgrade existing OS HDD.

A single SATA HDD with LVM (ext4), OS drive configurations, without losing any PVE configurations & data. This methods only works with LVM type, not ZFS type.

Firstly, you need to have CloneZilla downloaded and ready (refer here for more info https://danielcheah.blogspot.com/2023/08/clonezilla-backup-restore-computer-disk.html).

You also need a "Blank" external HDD/SSD or any storage with sufficient capacity to store the backup image, recommended to have at least 1TB. But if your existing OS drive is already 1TB then you need a larger capacity such as 2TB. The storage of the backup must always be larger than the size of the HDD you want to backup.


Let's get started :-

1. Backup the existing PVE OS drive into an image via CloneZilla (more info here https://danielcheah.blogspot.com/2023/08/clonezilla-backup-restore-computer-disk.html).


2. Replace the OS drive with a brand new drive, in this case a larger capacity (eg. from 256GB to 1TB).


3. Restore the image into the new drive using CloneZilla. Ensure you select "Use partition table & size from the image" option during restore.


4. Boot-up the system with the new drive, there should not be any problems because PVE will recognized it as the same drive as before.


5. Login to the PVE server, now we need to truncate8 the systemd journal log files to the last 50MB, open --> Shell

journalctl --vacuum-size=50M


6. Next, is to delete the .deb cached installation packages.

apt-get clean


7. Next, is to clear all temporary files.

rm -rf /tmp/* /var/tmp/*


8. To delete old system log files.

rm -f /var/log/*.gz /var/log/*.1 /var/log/*.[0-9]


9. To delete old or unused ISO files (eg. ubutnu.iso). This step is optional but recommended.

rm -f /var/lib/vz/template/iso/ubuntu.iso


10. Remove backup files generated locally by PVE.

rm -f /var/lib/vz/dump/*


11. Then we need to update the repositories.

apt update


12. Next, we need to install a utility to extend the space of the newly added drive.

apt install cloud-guest-utils -y


13. First, relocate the GPT Backup Header.

sgdisk -e /dev/sda


14. Extend the Third Partition (the physical LVM Volume) to use the 100% capacity of the remaining unallocated disk space.

growpart /dev/sda 3


15. Resize the LVM Physical Volume.

pvresize /dev/sda3


16. Finally is to verify the expansion.

lvs
OR

df -h
OR

df -T


17. Reboot the system and double check again for confirmation.


18. End.



!!! HAPPY COMPUTING !!!

No comments:

Post a Comment