One of my VMs filled up the root filesystem today so I had to remember how to fix it.
- Shutdown the VM and increase the size of the disk image using VSphere or XenCenter or whatever.
- Boot the VM off the CentOS ISO and choose the “Troubleshooting” then “Rescue a CentOS Linux system” options. Once it boots, choose the “Skip to shell” option to get to a prompt.
- Recreate the partition:
- Delete partition 2 and recreate it using the defaults. It should start at the same point as the original and end and the end of the disk now.
- Write the new partitions and quit.
pvresize /dev/xvdato resize the PV
vgchange -ayto update the mapper
lvresize -l +100%FREE /dev/centos_dev/rootto resize the LV
xfs_repair /dev/mapper/centos_dev-rootto check the FS
- Reboot the machine then