Operations 31 min read

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.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux Disk Quota, LVM, and RAID: Step-by-Step Configuration Guide

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=y

Verify 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/vdb

Generate quota files

# quotacheck -ugv /dev/vdb

Edit quotas

# edquota -u lyshark
# edquota -g temp

Enable/disable quota

# quotaon -augv
# quotaoff -augv

View quotas

# quota -ugvs

LVM (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/sdd

Create a volume group

# vgcreate -s 4M my_vg /dev/sdb /dev/sdc

Extend the volume group

# vgextend my_vg /dev/sdd

Create a logical volume

# lvcreate -L 10G -n my_lv my_vg

Format and mount the LV

# mkfs.ext4 /dev/my_vg/my_lv
# mount /dev/my_vg/my_lv /LVM

Resize LV (increase)

# lvextend -L +5G /dev/my_vg/my_lv
# resize2fs -f /dev/my_vg/my_lv

Resize 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 /LVM

LV snapshot

# lvcreate -s -n mylv_back -L 200M /dev/my_vg/my_lv

RAID (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 /RAID

RAID maintenance (fail, remove, add)

# mdadm --manage /dev/md0 --fail /dev/sdb
# mdadm --manage /dev/md0 --remove /dev/sdb
# mdadm --manage /dev/md0 --add /dev/sdb
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSystem AdministrationLVMRAIDDisk QuotaShell Commands
MaGe Linux Operations
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.