Block devices & partitions.
A disk is a long strip of bytes. The partition table divides it into named regions you can format and mount. Watch a fresh disk grow partitions one at a time, learn MBR vs GPT, and the difference between lsblk, blkid, and /proc/partitions.
Block devices and partitions animated tutorial. lsblk and /proc/partitions, MBR vs GPT partition tables, parted interactive and script modes, partition alignment, partprobe, blkid for UUIDs. RHCSA EX200 ready.A disk is a strip of bytes. A partition table divides it into named regions. Watch a fresh disk grow partitions one at a time.
- Β·Know that /dev/sda etc. are disks
- Β·Helpful: the filesystems lesson (next)
- Β·Comfortable as root
Read lsblk/blkid, pick MBR vs GPT, create properly aligned partitions with parted, and make the kernel notice them.
pace: 9 minutes
lsblk β what disks does Linux see?
`lsblk` prints the tree of block devices: physical disks (sda, nvme0n1, vda) and their partitions, sizes, mount points, and types. It reads from sysfs (no root needed). Add -f to also show filesystem type and UUID. /proc/partitions is the raw equivalent. Always start with lsblk to know what you're working on β it's the cheapest way to avoid `parted /dev/sda` (your boot disk) when you meant `/dev/sdb`.
$lsblk$lsblk -f$lsblk -o NAME,SIZE,TYPE,MOUNTPOINT$cat /proc/partitionsThree tools, three jobs: lsblk for layout (what disks/partitions exist), blkid for identity (UUID + fs type), findmnt for mounts (what's mounted where). Master those before reaching for parted, and you'll never accidentally repartition the wrong disk.
$lsblk / lsblk -f$/proc/partitions$blkid [DEV]$findmnt /path$parted /dev/sdX print$parted /dev/sdX mklabel gpt$parted /dev/sdX mklabel msdos$parted /dev/sdX mkpart primary ext4 1MiB 1025MiB$parted /dev/sdX rm 1$parted /dev/sdX print free$partprobe /dev/sdX$partx -u /dev/sdX$fdisk -l$wipefs -a /dev/sdXn$dd if=/dev/zero of=/dev/sdX bs=1M count=10$smartctl -a /dev/sdXYou're about to repartition a disk. Which command do you run FIRST to be sure you're working on the right one?
Difference between MBR and GPT partition tables?
You ran parted to create a new partition; lsblk still doesn't show it. What's the missing step?
Why reference partitions by UUID in /etc/fstab instead of /dev/sdXn?
These aren't graded β they're just for active recall, which is what actually makes the lesson stick.
File systems & mounts
A partition is just bytes until you mkfs and mount it. See how XFS, ext4, mount, and /etc/fstab fit together.
Read this lesson as text6 chapters Β· quiz answers
01lsblk β what disks does Linux see?
lsblkprints the tree of block devices: physical disks (sda, nvme0n1, vda) and their partitions, sizes, mount points, and types. It reads from sysfs (no root needed). Add -f to also show filesystem type and UUID. /proc/partitions is the raw equivalent. Always start with lsblk to know what you're working on β it's the cheapest way to avoidparted /dev/sda(your boot disk) when you meant/dev/sdb.$ lsblkβ tree of block devices$ lsblk -fβ + filesystem + UUID$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINTβ custom columns$ cat /proc/partitionsβ raw kernel view
02MBR vs GPT β pick a partition table
Before you can put partitions on a fresh disk, it needs a partition TABLE. MBR (Master Boot Record) is the legacy format: max 2 TiB disks, max 4 primary partitions (or 3 + an extended container). GPT (GUID Partition Table) is the modern one: huge disks, 128 partitions by default, redundant copies at both ends, required for UEFI boot. New systems use GPT; you'll see MBR only on legacy gear.
$ parted /dev/sdb mklabel gptβ make a GPT table (destructive!)$ parted /dev/sdb mklabel msdosβ make an MBR table$ parted /dev/sdb printβ show table type + partitions
03Create a partition with parted
partedis the modern partition editor (fdisk also works, especially the rewritten util-linux one). Script form:parted /dev/sdb mkpart primary ext4 1MiB 1025MiBmakes a 1 GiB partition. Always start at 1MiB for proper alignment β older defaults could land you in slow-spot misalignment territory. Repeat with different ranges to add more.$ parted /dev/sdb mkpart primary ext4 1MiB 1025MiBβ 1 GiB partition$ parted /dev/sdb printβ verify
04Add more β and watch alignment
Adding another? Start where the last one ended.
parted /dev/sdb mkpart primary linux-swap 1025MiB 3073MiBβ a 2 GiB swap region. Useprint freeto see unallocated space.unit MiBin interactive mode shows everything in mebibytes so you can do the arithmetic. Misalignment kills SSD/NVMe performance; parted aligns to 1MiB boundaries by default β keep it that way.$ parted /dev/sdb mkpart primary linux-swap 1025MiB 3073MiBβ 2 GiB swap$ parted /dev/sdb print freeβ see free space too$ parted /dev/sdb unit MiB printβ force MiB units
05Tell the kernel β partprobe
parted writes the new partition table to disk, but the kernel may not re-read it if the disk is in use.
partprobe /dev/sdb(orpartx -u) asks the kernel to reload the partition table. After this, /dev/sdb1, /dev/sdb2 exist and you canmkfson them. A reboot also works β partprobe just avoids the reboot.$ partprobe /dev/sdbβ re-read partition table$ partx -u /dev/sdbβ alternative$ lsblk /dev/sdbβ kernel sees them now
06Find existing partitions β blkid + UUIDs
blkidshows what's ON each partition: filesystem type and UUID. Always reference partitions in /etc/fstab by UUID, not by /dev/sdXn β those names can change when you add or remove disks.blkid /dev/sdb1shows just one;findmnt /mountpointgoes the other way (which device is mounted here). Together: lsblk for layout, blkid for identity, findmnt for mounts.$ blkidβ fs + UUID for every device$ blkid /dev/sdb1β just one$ findmnt /varβ what's mounted there$ wipefs -a /dev/sdb1β erase fs signatures (careful!)
Quiz β answers
- You're about to repartition a disk. Which command do you run FIRST to be sure you're working on the right one?
- βlsblk β shows every disk, partition, size, type, and mount point. Find the right device BEFORE handing it to parted.lsblk is the cheapest sanity check β it tells you which device is your boot disk, which is the new one, and what's mounted where. Using parted on the wrong device is one of the fastest ways to lose data.
- Difference between MBR and GPT partition tables?
- βMBR: legacy, max 2 TiB, max 4 primaries (or 3 + extended). GPT: modern, huge disks, 128 partitions by default, redundant copies, required for UEFI boot.MBR is a 1980s design with hard 2 TiB / 4 partition limits and no built-in redundancy. GPT was designed for modern hardware (UEFI requires it for boot disks). Default to GPT on new systems.
- You ran parted to create a new partition; lsblk still doesn't show it. What's the missing step?
- β
partprobe /dev/sdX(orpartx -u /dev/sdX) asks the kernel to re-read the partition table without a reboot.parted writes to the disk's partition table, but the running kernel may still hold the old layout. partprobe (or partx -u) forces a re-read so the new /dev/sdXn nodes appear. - Why reference partitions by UUID in /etc/fstab instead of /dev/sdXn?
- βBecause /dev/sdXn names depend on enumeration order β add or remove a disk and sda may become sdb. UUIDs are stable per-filesystem and survive that.Stable identifiers matter when /etc/fstab is your boot-time mount list. blkid gives you the UUID; use
UUID=...in fstab so reordering disks doesn't break boot.
keep going β these pair well with what you just learned.
SELinux contexts
Why Apache can't read your file. Watch the policy engine decide β and learn the workflow for fixing denials. RHCSA-ready.
Linux boot process
From power button to login prompt. Every stage in the chain β UEFI, GRUB, kernel, initramfs, systemd β with the rescue moves that save you. RHCSA-ready.
LVM stacking
Layer-by-layer build of an LVM stack: disks β PVs β VG β LVs β filesystem. Then extend live and snapshot. RHCSA-ready.