Issue
- CentOS 6/7, RHEL6/7 with XFS file system
- My / Filesystem is full
- I have extended the size from VMware datastore or SAN LUN
Note
- Reboot is necessary (6/7) if it is an OS parition ie /.
- Makesure you have a backup / snapshot of the `sda` disk
Solution
In this example, we are assuming that the disk is /dev/sda and the partition is /dev/sda3 mounted on /.
- Rescan the disk after extending the disk from VMware or SAN.
echo 1 > /sys/block/sda/device/rescan
- Now
fisk -l /dev/sdawill show the disks new size. - Now we have to extend the partition, for that run fdisk on the disk and re-create the parition.
fdisk /dev/sda
- Press
pto print the partion table, and note your partion id for / (In our case its 3) - press
dto delete the partition - Enter the number
3and your partion is deleted. - Now press
cto create a new partion and select3again, then just presssENTERandENTERwhen it as for starting and ending cylindar number. - Press
pagain to see the parion list and presswto write the partition table. - Now reboot your system
- After rebooting, run
xfsgrow / - Now run
df -hand your partion will be extended.
Please Comment and share if found helpful 🙂
