How would you decide disk layout (partitions/LVs) for a new production Linux server?
AdvancedScenarioStorage, disks and filesystems
Answer
Situation read → Isolation, growth room and security options.
What I'd do →
- Small
/boot(1 GB) and/boot/efi. - LVM for everything else, leaving free space in the VG.
- Separate LVs:
/,/var,/var/log,/var/log/audit,/home,/tmp, and the app data volume. - Mount options:
nodev,nosuid,noexecon/tmpand/var/tmp;nodevon/home. - In the cloud, keep data on separate volumes so instances can be rebuilt.
Why → A runaway log can't fill root, and CIS benchmarks expect these separations.
Interview tip → Mention leaving unallocated VG space so you can extend whichever LV grows.
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`?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.Intermediate