CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
  • Week 1
    • 1.Operating Systems and Linux: What the Kernel Does
    • 2.Free Software and Distributions: The Ecosystem Built by Licenses
    • 3.Installation and Booting: From the Moment You Power On
    • 4.Filesystem Structure and File Types: Everything Is a File
    • 5.Week 1 Comprehensive Review: Time to See Through the Concepts
  • Week 2
  • Week 3
  • Week 4
  • Week 5
    • 1.Filesystem Types and Structure: ext2/3/4 · xfs · btrfs · Journaling · Inodes and Blocks
    • 2.Partitions and Mounting: fdisk · gdisk · parted · mkfs · mount/umount · the 6 Fields of /etc/fstab
    • 3.LVM and Swap: PV·VG·LV Layers · From pvcreate to lvextend·resize2fs · mkswap·swapon
    • 4.RAID, Quotas, and Disk Inspection: RAID 0/1/5/6/10 · mdadm · quota/edquota · fsck/df/du/lsblk/blkid
    • 5.Week 5 Comprehensive Review: Filesystems · Partitions · LVM · Swap · RAID · Quotas Wrap-up and Practice
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
  • Week 14
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← Linux Master 1/Week 5/Day 5

Based on the Linux Master 1 exam syllabus·Report an error

Linux Master 1· AssociateWeek 5 · Day 5~21 min read

Day 5 - Week 5 Comprehensive Review: Filesystems · Partitions · LVM · Swap · RAID · Quotas Wrap-up and Practice

📌 Key Takeaways

  • The flow in one sentence: physical disk → partition → (optional: RAID/LVM) → mkfs → mount/fstab → quotas and inspection.
  • Day 1 is data representation (inode, block, journal), and Day 2 is space partitioning and connection (partition, mkfs, fstab).
  • Day 3 is flexibility and virtual memory (3 LVM layers, 2-step extension, swap), and Day 4 is safety, fairness, and diagnosis (RAID, quotas, inspection).
  • The 6 essentials: fstab 6 fields · LVM 2-step extension · RAID minimum disks · quota soft/hard · df vs du · fsck unmounted.
  • Memorize the commands, but if you group them by "which layer solves what", you won't be shaken by variant questions.

The Whole Flow at a Glance — From Disk to Operation

[Physical disk]
   │  fdisk/gdisk/parted (partitioning)
   ▼
[Partition]  ──(several)──> [RAID: mdadm] or [LVM: pvcreate→vgcreate→lvcreate]
   │
   ▼  mkfs.ext4 / mkfs.xfs (format)
[Filesystem]
   │  mount (temporary) / /etc/fstab (permanent)
   ▼
[Mounted directory]
   │  quota (usage limits) / df·du·fsck (inspection)
   ▼
[Operation]
StageToolsDay
Understanding the filesystem (inode/block/journal)stat, tune2fs, dumpe2fsDay1
Partitioningfdisk, gdisk, partedDay2
Formattingmkfs.*, mke2fsDay2
Mounting/making permanentmount, umount, /etc/fstabDay2
Flexible volumespvcreate, vgcreate, lvcreate, lvextendDay3
Virtual memorymkswap, swapon, swapoffDay3
Redundancymdadm (RAID)Day4
Usage limitsquotacheck, quotaon, edquotaDay4
Inspectionfsck, df, du, lsblk, blkidDay4

Day 1 Key Recap — Filesystems and Structure

  • inode: A file's metadata (permissions, owner, size, block pointers, timestamps). The file name is not in the inode — the parent directory holds "name→inode number".
  • Block: The smallest unit of space allocation (usually 4KB). Even a small file occupies one block → internal fragmentation.
  • Superblock: The map of the whole FS. If damaged, recover with a backup superblock using fsck -b.
  • Journaling: For crash recovery. The ext3/4 default ordered guarantees metadata consistency (not lossless data). Modes: journal > ordered > writeback.
  • ext lineage: ext2 (no journal) → ext3 (journal) → ext4 (extents, 16TB file, 1EB FS).
  • xfs: Large capacity, grow-only (cannot shrink). btrfs: CoW, snapshots, checksums.
  • Inode exhaustion: File creation fails even with free capacity → diagnose with df -i.

df -h (capacity) and df -i (inodes) look at different things. "Plenty of capacity but can't create a file" = inode exhaustion, "out of capacity" = block exhaustion. The habit of diagnosing the two separately is important.

Day 2 Key Recap — Partitions, Mounting, fstab

  • MBR vs GPT: MBR = 2TB, 4 primaries, single backup; GPT = unlimited, 128, UUID, front-and-back dual backup. MBR logical partitions start at 5.
  • Tools: fdisk (MBR-centric), gdisk (GPT only), parted (both, scriptable). In fdisk, w saves and q cancels.
  • Type codes: 83=Linux, 82=swap, 8e=LVM, fd=RAID.
  • mkfs: mkfs.ext4 /dev/sdb1 = mkfs -t ext4 .... Deletes existing data.
  • mount/umount: umount refused ("busy") = a process is using it (fuser -m/lsof). umount -l=lazy.
  • /etc/fstab 6 fields: device (UUID) · mount point · type · options · dump (0) · pass (root 1/the rest 2/none 0).

⚠️ Pitfall Review: The order of the 6 fstab fields and the values of fields 5 and 6 (dump=almost always 0, pass=root 1·the rest 2·swap 0) are essential. If you don't verify with mount -a after editing, there is a risk of boot failure.

fstab in a table-like form once more:

UUID=abc  /data  ext4  defaults       0  2    ← Regular FS
UUID=def  /      ext4  defaults       0  1    ← Root (pass=1)
/dev/sdb2 none   swap  sw             0  0    ← Swap (pass=0)

Day 3 Key Recap — LVM and Swap

  • LVM 3 layers: PV (disk) → VG (pool) → LV (unit of use). Creation: pvcreate→vgcreate→lvcreate.
  • LV extension in 2 steps: lvextend (container) + resize2fs (ext) or xfs_growfs (xfs, mount point argument). If the VG is short, vgextend comes first.
  • Command mapping: display pvs/vgs/lvs, extend vgextend/lvextend. -L (capacity) / -l (PEs or %, 100%FREE).
  • Swap: Not a filesystem. mkswap (initialize) → swapon (activate) → swapoff. fstab: none swap sw 0 0. Check with swapon -s/free -h.

"Extended the LV but df is unchanged" = resize2fs/xfs_growfs missing. The container and the contents are grown separately. xfs cannot be shrunk.

Day 4 Key Recap — RAID, Quotas, Inspection

The RAID table (in full):

LevelMethodMin. disksFailures toleratedEfficiency
0Stripe20100%
1Mirror2150%
5Distributed parity31(N-1)/N
6Double parity42(N-2)/N
10Mirror + stripe41 per pair50%
  • mdadm: --create --level --raid-devices. Status via /proc/mdstat, mdadm --detail.
  • Quotas: fstab usrquota → remount → quotacheck → quotaon → edquota. soft (grace/warning) vs hard (immediate block). Block and inode limits are separate.
  • Inspection: df (FS capacity) · du (path usage) · lsblk (device tree) · blkid (UUID) · fsck (integrity, unmount required). xfs repair is xfs_repair.

⚠️ Pitfall Review: The minimum disk counts (0·1=2, 5=3, 6·10=4) and "RAID 1 and 0 have no parity" are the essentials. fsck only on an unmounted state.

Integrated Cheat Sheet of Key Commands

# Partition
fdisk /dev/sdb        # MBR (n/d/t/p/w/q)
gdisk /dev/sdb        # GPT
parted /dev/sdb --script mklabel gpt mkpart primary ext4 0% 100%
 
# Format & mount
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt/data
umount /mnt/data
blkid /dev/sdb1       # Check UUID → register in fstab → mount -a
 
# LVM
pvcreate /dev/sdb1; vgcreate vg0 /dev/sdb1; lvcreate -L 10G -n lv0 vg0
lvextend -L +5G /dev/vg0/lv0; resize2fs /dev/vg0/lv0
vgextend vg0 /dev/sdc1
 
# Swap
mkswap /dev/sdb2; swapon /dev/sdb2; swapon -s
 
# RAID
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sd{b,c,d}1
cat /proc/mdstat
 
# Quota
quotacheck -cugm /home; quotaon /home; edquota -u user1; repquota /home
 
# Inspection
df -hT; df -i; du -sh /var; lsblk -f; fsck -y /dev/sdb1

Connected view: In practice these layers are stacked on top of one another. A typical configuration is disks → mdadm RAID → LVM PV → VG → LV → ext4/xfs → mount → quota. That is, RAID handles safety, LVM handles flexibility, the filesystem handles data structure, and quotas handle fairness. If you understand the design philosophy in which each layer independently solves one problem, applied questions can be solved too.

Check yourself with the 12 questions below.

📖 Glossary

  • inode : A metadata structure holding a file's permissions, owner, size, and block locations. The file name is not here.
  • Superblock : The map of the entire filesystem. If broken, recover from a backup copy with fsck -b.
  • Journaling ordered mode : ext's default. Guarantees only metadata consistency and does not guarantee lossless data.
  • Inode exhaustion : A state where inodes are used up so files cannot be created even though capacity remains. Diagnose with df -i.
  • MBR / GPT : The old table with 2TB and 4-primary-partition limits, and the modern table with 128 partitions and practically unlimited size.
  • Partition type code : 83=Linux, 82=swap, 8e=LVM, fd=RAID.
  • fstab 6 fields : device (UUID) · mount point · type · options · dump · pass. pass is 1 for root, 2 for the rest, 0 for no check.
  • mount -a : A verification command that tries applying all of fstab. A mandatory step before rebooting.
  • PV / VG / LV : LVM's three layers — an incorporated disk, the pool bundling them, and the unit of use cut from the pool.
  • 2-step extension : Grow the container with lvextend and the contents with resize2fs/xfs_growfs. You need both for df to reflect it.
  • Swap : A disk area that evacuates pages when RAM is short. Create it with mkswap and turn it on with swapon.
  • Parity : The XOR sum of data. Used only by RAID 5 and 6, and the basis for recomputing a dead disk's contents.
  • /proc/mdstat : The file showing software RAID status and rebuild progress.
  • soft / hard limit : A limit that only warns during the grace period, and an absolute ceiling that blocks writes immediately.
  • df vs du : Viewing remaining capacity through filesystem metadata versus walking paths to count occupancy.
  • fsck / xfs_repair : Tools for checking and repairing filesystem integrity. fsck requires unmounting, and xfs uses its dedicated tool.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

Which correctly describes where a file's name is stored in a Linux filesystem?

Question 2

What does ordered, the default journaling mode of ext3/ext4, guarantee?

Question 3

Which is NOT a characteristic of the MBR partition scheme?

Question 4

In /etc/fstab, what value should be specified in the 6th field (fsck pass) for the root filesystem (/)?

Question 5

Which lists the LVM components in the correct order from physical to logical?

Question 6

After extending an LV with lvextend, which command actually reflects the capacity in an ext4 filesystem?

Question 7

Which statement about the swap area is correct?

Question 8

Which correctly gives RAID 5's minimum number of disks and the number of simultaneous disk failures it tolerates?

Question 9

Which statement about RAID levels is NOT correct?

Question 10

Which statement about the soft limit of a disk quota is correct?

Question 11

Which correctly describes the difference between df and du?

Question 12

Which is a correct precaution when using fsck, the filesystem integrity check tool?

PreviousRAID, Quotas, and Disk Inspection: RAID 0/1/5/6/10 · mdadm · quota/edquota · fsck/df/du/lsblk/blkidWeek 5 · Day 4Next Process Management: From PIDs to Signals and PrioritiesWeek 6 · Day 1

Official references

  • Linux Master 1 official exam syllabus(opens in a new tab)

On this page

  • Key Takeaways
  • The Whole Flow at a Glance — From Disk to Operation
  • Day 1 Key Recap — Filesystems and Structure
  • Day 2 Key Recap — Partitions, Mounting, fstab
  • Day 3 Key Recap — LVM and Swap
  • Day 4 Key Recap — RAID, Quotas, Inspection
  • Integrated Cheat Sheet of Key Commands
  • Glossary
  • Practice Questions