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:

  1. 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
    5
    > find / -size +800M -exec ls -lh {} \;         

    -r-------- 1 root root 128T Nov 19 19:24 /proc/kcore
    ...
    # Check for abnormally large log files
  2. Delete unnecessary log files

    1. rm -rf /log/*.gz
    2. rm -rf /var/log/*.1
  3. Configure the size of log files

    1. journalctl –vacuum-size=512M

    2. Automatic removal of logs older than 2 days

      journalctl –vacuum-time=2d

  4. If there is a need to move large files from the PVE docker in Debian:

    1. Approach: debian docker data-root
    2. Change Docker Default Root Data Directory
  5. For a more detailed record, see: PVE Synology NAS Repair Notes 》 Taking measures

Solution 2: Adding a New Disk

  1. 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

  1. 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
  1. In the interface, select the disk partition: “Erase Disk”; or manage partitions using the command:

    1
    fdisk /dev/sdc
  2. 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”

Related Content

Source of Inspiration

PVE Synology NAS Repair Notes