Master Linux Disk Quota, LVM, and RAID: Step-by-Step Configuration Guide
This comprehensive tutorial explains how to set up and manage Linux disk quotas, logical volume management (LVM), and various RAID levels using command‑line tools, providing clear examples for checking kernel support, configuring limits, creating volumes, resizing, snapshotting, and handling RAID arrays.
When multiple users share a Linux server, disk quota helps enforce fair disk usage, while LVM and RAID provide flexible storage management.
Quota configuration
Quota limits the amount of disk space and number of files per user or group, with soft and hard limits and a grace period.
Quota limit types: • Limit space usage for users and groups • Limit number of files for users and groups
Quota limit levels: • Soft limit – can be exceeded temporarily, triggers warnings and a grace period. • Hard limit – absolute limit, cannot be exceeded. • Grace days – default 7 days before soft‑excess is reclaimed.
Install quota tools with yum install -y quota.
Check kernel support
# cat /boot/config-... | grep CONFIG_QUOTA
CONFIG_QUOTA=y
CONFIG_QUOTA_NETLINK_INTERFACE=y
CONFIG_QUOTA_TREE=y
CONFIG_QUOTACTL=y
CONFIG_QUOTACTL_COMPAT=yVerify mount options
# dumpe2fs -h /dev/vdb | grep "Default mount options"
Default mount options: user_xattr acl
# Ensure usrquota and grpquota are present, otherwise remount with them.
# mount -o remount,usrquota,grpquota /dev/vdbGenerate quota files
# quotacheck -ugv /dev/vdbEdit quotas
# edquota -u lyshark
# edquota -g tempEnable/disable quota
# quotaon -augv
# quotaoff -augvView quotas
# quota -ugvsLVM (Logical Volume Manager)
LVM aggregates physical volumes (PV) into volume groups (VG) and creates logical volumes (LV) that can be resized and snapshotted.
Create physical volumes
# pvcreate /dev/sdb /dev/sdc /dev/sddCreate a volume group
# vgcreate -s 4M my_vg /dev/sdb /dev/sdcExtend the volume group
# vgextend my_vg /dev/sddCreate a logical volume
# lvcreate -L 10G -n my_lv my_vgFormat and mount the LV
# mkfs.ext4 /dev/my_vg/my_lv
# mount /dev/my_vg/my_lv /LVMResize LV (increase)
# lvextend -L +5G /dev/my_vg/my_lv
# resize2fs -f /dev/my_vg/my_lvResize LV (decrease)
# umount /dev/my_vg/my_lv
# e2fsck -f /dev/my_vg/my_lv
# resize2fs -f /dev/my_vg/my_lv 10G
# lvreduce -L 10G /dev/my_vg/my_lv
# mount /dev/my_vg/my_lv /LVMLV snapshot
# lvcreate -s -n mylv_back -L 200M /dev/my_vg/my_lvRAID (Redundant Array of Independent Disks)
RAID provides redundancy and performance. Common levels include RAID 0 (striping), RAID 1 (mirroring), RAID 10 (mirrored striping), and RAID 5 (distributed parity).
Create RAID 5 with mdadm
# mdadm --create --auto=yes /dev/md0 --level=5 --raid-devices=3 --spare-devices=1 /dev/sd{b,c,d,e}Format and mount the RAID device
# mkfs.ext4 /dev/md0
# mkdir /RAID
# mount /dev/md0 /RAIDRAID maintenance (fail, remove, add)
# mdadm --manage /dev/md0 --fail /dev/sdb
# mdadm --manage /dev/md0 --remove /dev/sdb
# mdadm --manage /dev/md0 --add /dev/sdbSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
