A new 200 GB EBS volume is attached to an EC2 instance. How do you make it usable and persistent across reboots?
BeginnerScenarioStorage, disks and filesystems
Answer
Situation read → Partition (optional), format, mount, fstab by UUID.
What I'd do →
lsblk # find it, e.g. /dev/nvme1n1
sudo mkfs.xfs /dev/nvme1n1
sudo mkdir -p /data
sudo blkid /dev/nvme1n1 # copy the UUID
echo 'UUID=<uuid> /data xfs defaults,nofail 0 2' | sudo tee -a /etc/fstab
sudo mount -a && df -h /data
Why → Device names like /dev/nvme1n1 can change between boots; UUIDs don't. nofail keeps the instance booting if the volume is detached.
Interview tip → Always run mount -a after editing fstab, before rebooting, to catch mistakes.
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.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`?IntermediateA 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?BeginnerYou 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