It might sound unusual, but my root partition is limited to just 8 GB. Unfortunately, due to my current setup, reinstalling the system isn’t an option. Now, I urgently need to update it, and as you can probably imagine, I’ve run out of space. Let’s get started.
To determine the space occupied by files on the system.
du -h <folder> /dev/null | grep '[0-9\.]\+G'
du -h /var/backups /dev/null | grep '[0-9\.]\+G'
Now what we have to do is to try to see if there is any old kernel left. If there is old kernel left.
# Find out you're current kernel and if kernel is 6. XXX you can safely remove 5.* all
uname -a
# Now to find all old kernels
dpkg --list | grep pve-kernel
# Now remove the all kernels that are 5.*
apt remove --purge pve-kernel-5*
# clean apt from old packets
apt clean
apt autoclean
apt autoremove
# Discard unused disk data.
# Reboot - the system
reboot
Clear old logs
# Let's see what's take large amount of space
du -h /var /dev/null | grep '[0-9\.]\+G'
cd /var/log
# I discovered after consultation with my friend that it might be logs. They were 1.1GB
rm syslog
# Now restart syslog by clicking on it in gui.
And that’s it after this operation you’re proxmox install should have enough space to perform the update of the system.
Let's update the system
apt update
apt dist-upgrade
That’s it it should be able to update.
So next way is to fix the out of space issue. You may ask how this is even possible.
Addressing Disk Space Allocation in Proxmox
When installing Proxmox, the system allocates a percentage of the drive for both the pve/root and data partitions. However, this default allocation may not be optimal for all scenarios. Specifically, the space allocated to the data partition can be considered wasteful, as it primarily serves for disk images and container storage.
For example, if your drive capacity is 30 GB, approximately 8 GB is reserved for the system, leaving the remaining space for data storage.
* I’m not responsible for you’re action.
Do it only if you are 100% sure that you will not break you’re system.
* if you do any of shown comands especialy for resizde and lvm remove you do them on you’re own.
Playing with storage on live system is not as nice as it might be all should work well but life is life.
# Show all volumes | Note the size of data.
lvdisplay
# Delete curent data volume | You will lose all data stored in there by doing this.
lvremove /dev/pve/data -y
# Create new data volume smaller than deleted one.
lvreate -L 10G -n data pve -T
# Expand root volume to get all avalible space.
lversize -l +100%FREE /dev/pve/root
# Resize pve-root file system
resize2fs /dev/mapper/pve-root