Interview Prep/Linux/Users, groups and access control

A user's home directory is on a server with quotas, and one person filled the shared `/home`. How do you stop this happening again?

IntermediateScenarioUsers, groups and access control
Answer

Situation read → Enforce per-user disk quotas.

What I'd do →

  1. For XFS, mount with uquota in /etc/fstab (/dev/vg0/home /home xfs defaults,uquota 0 0) and remount/reboot.
  2. Set limits:
sudo xfs_quota -x -c 'limit bsoft=9g bhard=10g alice' /home
sudo xfs_quota -x -c 'report -h' /home
  1. For ext4 use usrquota, then quotacheck -cum /home, quotaon /home, setquota -u alice 9G 10G 0 0 /home.

Why → Hard limits stop a single user from starving everyone; soft limits give a warning first.

Interview tip → XFS quota must be enabled at mount time; remount is not enough for the root filesystem.

All Linux questions Roadmap: Linux

More on Users, groups and access control