Practical Solutions for Resolving Full PVE Disk Occupancy
Addressing the practical issue of a full PVE disk.
Purpose
Addressing the practical issue of a full PVE disk.
Solution 1: Cleaning PVE Space
To clean PVE, log in to PVE’s SSH:
View the sizes of files in various directories, sorted by size from largest to smallest:
1
du -s /* | sort -nr
Here, /* can be any directory, for example, /lib/* would show the file sizes in the lib directory.
Delete unnecessary files
1
2
3
4
5find / -size +800M -exec ls -lh {} \;
-r-------- 1 root root 128T Nov 19 19:24 /proc/kcore
...
Check for abnormally large log filesDelete unnecessary log files
- rm -rf /log/*.gz
- rm -rf /var/log/*.1
Configure the size of log files
journalctl –vacuum-size=512M
Automatic removal of logs older than 2 days
journalctl –vacuum-time=2d
If there is a need to move large files from the PVE docker in Debian:
- Approach: debian docker data-root
- Change Docker Default Root Data Directory
For a more detailed record, see: PVE Synology NAS Repair Notes 》 Taking measures
Solution 2: Adding a New Disk
- Connect a 1TB external hard drive to the USB port
View the status of each disk (including its name), or use the command
1 | ls /dev/disk/by-id |
Or in the PVE interface under Datacenter > PVE Name > Disks
- Add a new directory under the mnt folder, for example: mkdir usbToshiBa1T
If you see /dev/sdc2 as a partition
1 | mount /dev/sdc2 /mnt/usbToshiBa1T |
In the interface, select the disk partition: “Erase Disk”; or manage partitions using the command:
1
fdisk /dev/sdc
Add the partition as a ‘directory’ for PVE
Select in the UI: Datacenter > PVE Name > Disks > Directory
Button: Create Directory
When creating a new virtual machine, please manually select this new “directory”