A cloud VM's root disk was enlarged from 30 GB to 80 GB in the console, but `df` still shows 30 GB. What do you do?
BeginnerScenarioStorage, disks and filesystems
Answer
Situation read → The block device grew, but the partition and filesystem did not.
What I'd do →
lsblk # disk 80G, partition still 30G
sudo growpart /dev/nvme0n1 1 # from cloud-guest-utils / cloud-utils-growpart
sudo xfs_growfs / # XFS
# or: sudo resize2fs /dev/nvme0n1p1 # ext4
df -h /
If root is on LVM: growpart, then pvresize /dev/nvme0n1p3, then lvextend -r.
Why → Three layers must each be resized: disk, partition, filesystem.
Interview tip → Note that cloud-init's growpart module does this automatically at boot on many images.
More on Storage, disks and filesystems
You get paged at 3 AM: the root filesystem on a production server is at 98% and climbing. Walk through your response.BeginnerA new 200 GB EBS volume is attached to an EC2 instance. How do you make it usable and persistent across reboots?BeginnerThe `/var` LVM logical volume is nearly full and there is free space in the volume group. How do you grow it online?BeginnerThe volume group has no free space. You've been given a new disk. How do you add it to grow `/var`?IntermediateYou need to move a busy MySQL data directory from the root disk to a new, faster volume. Plan it.IntermediateA team wants a shared directory mounted on 10 app servers. How do you set up NFS?Beginner