13.1 Create, Mount, and Use VFAT, ext4, and XFS File Systems
Key Takeaways
- Create file systems with mkfs.ext4, mkfs.xfs, and mkfs.vfat (or mkfs -t TYPE) only on the intended new partition or LV—never format live root or data you must keep.
- Mount with mount [-t TYPE] DEVICE DIR; unmount with umount PATH or DEVICE; busy mounts fail until processes release the tree (lsof/fuser, leave the directory).
- XFS is the common RHEL default for data volumes; ext4 remains fully supported; VFAT (vfat/msdos) is for interoperability with Windows/firmware-style media, not SELinux-rich Linux app data.
- Using a file system on the exam means create → mount → read/write proof (touch, cp) → umount when required → often persist with UUID fstab (related storage objectives).
- Verify with lsblk -f, blkid, findmnt, and df -h; wrong TYPE in mount/fstab or formatting the wrong device are the highest-cost mistakes.
13.1 Create, Mount, and Use VFAT, ext4, and XFS File Systems
Quick Answer: Format with
mkfs.ext4,mkfs.xfs, ormkfs.vfaton the correct device,mkdira mountpoint,mountthe device, prove you can create files, thenumountwhen the task requires unmounting. Confirm TYPE/UUID withblkid/lsblk -f. On EX200, “use” means a working mounted tree—and often a reboot-safe setup via fstab from related objectives.
Official skill and exam language
Under Create and configure file systems, Red Hat expects you to create, mount, unmount, and use VFAT, ext4, and XFS file systems. Lab wording often looks like:
- “Create an XFS file system on the new LV and mount it at
/data.” - “Format
/dev/sdb1as ext4; mount it temporarily at/mnt/backupand copy files.” - “Create a VFAT file system on the partition; ensure it can be mounted and written.”
- “Unmount
/sharedcleanly after the transfer.”
This section is the file-system layer: superblock and TYPE, not GPT carving (earlier storage chapters) and not solely “UUID in fstab” (mount-at-boot objective)—though real tasks chain them.
Three types you must handle
| Type | mkfs tool | Typical use on RHEL | Notes |
|---|---|---|---|
| XFS | mkfs.xfs | Default-style data volumes, large files | Cannot shrink easily; grow with xfs_growfs after LV extend |
| ext4 | mkfs.ext4 | General Linux FS, still common in tasks | Grow with resize2fs; mature tools (e2fsck, tune2fs, e2label) |
| VFAT | mkfs.vfat / mkfs.fat | Cross-platform sticks, some firmware/shared media | Limited permissions/ownership model; no native Linux ACL/SELinux richness |
RHEL 10 install media and cloud images commonly use XFS for root or large data LVs. EX200 still tests that you can create all three when asked—do not assume every disk is XFS.
Safety: only format what you should
lsblk -f
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
findmnt
blkid
sudo pvs; sudo lvs # if the target is an LV
Never mkfs a mounted root, an active PV you still need as LVM metadata only after careful planning, or a partition that already holds required exam data unless the task explicitly reformats it. mkfs is destructive to previous file-system contents.
If the device is mounted:
findmnt /dev/sdb1
sudo umount /dev/sdb1 # or umount /mountpoint
Format only after unmount (except specialized online tools—not the EX200 create path).
Create file systems: mkfs family
XFS
sudo mkfs.xfs /dev/sdb1
sudo mkfs.xfs -f /dev/vgdata/lvapp # -f force if prior signature exists (only if intentional)
sudo mkfs.xfs -L APPDATA /dev/sdb1 # set label at create time
blkid /dev/sdb1
Default mkfs.xfs is fine for most exam sizes. Force (-f) only when you deliberately overwrite an old signature and the task allows it.
ext4
sudo mkfs.ext4 /dev/sdb1
sudo mkfs.ext4 -L BACKUP /dev/sdc1
sudo mkfs.ext4 -m 1 /dev/sdb1 # reserved blocks % for root (optional awareness)
blkid /dev/sdb1
Equivalents: mkfs -t ext4 /dev/sdb1. Labels also settable later with e2label / tune2fs -L.
VFAT
sudo mkfs.vfat /dev/sdb1
sudo mkfs.vfat -F 32 /dev/sdb1 # FAT32 when size warrants
sudo mkfs.vfat -n SHARE /dev/sdb1 # volume name (label-like)
# sometimes written as:
sudo mkfs -t vfat /dev/sdb1
blkid /dev/sdb1
TYPE in blkid often shows vfat. Mount type is usually vfat.
Generic form
sudo mkfs -t xfs /dev/mapper/vg-lv
sudo mkfs -t ext4 /dev/sdb2
sudo mkfs -t vfat /dev/sdb3
After mkfs, always re-read identity:
lsblk -f
blkid /dev/sdb1
You need TYPE (and later UUID) for mount and fstab.
Mount: make the file system usable
Manual mount
sudo mkdir -p /data
sudo mount /dev/sdb1 /data
# or explicit type:
sudo mount -t xfs /dev/sdb1 /data
sudo mount -t ext4 /dev/vgdata/lv1 /mnt/ext
sudo mount -t vfat /dev/sdb2 /mnt/winshare
Mount by UUID or LABEL (same as fstab teaching):
sudo mount UUID=a1b2c3d4-e5f6-7890-abcd-ef1234567890 /data
sudo mount LABEL=APPDATA /data
Prove “use”
Graders and your own checklist should show the FS is writable (unless the task says read-only):
findmnt /data
df -h /data
touch /data/exam_proof.txt
echo "ok" | sudo tee /data/exam_proof.txt
ls -la /data
cp /etc/hosts /data/
If touch fails with “Read-only file system” or “Permission denied,” diagnose mount options, ownership, or VFAT mount options—not more mkfs.
Common mount options (awareness)
| Option | Role |
|---|---|
defaults | Standard rw mount bundle |
ro / rw | Read-only / read-write |
noexec | Disallow execution (sometimes security tasks) |
uid= / gid= / umask= | Often relevant on vfat so Linux users can write |
Example VFAT write access for a shared stick-style volume:
sudo mount -t vfat -o uid=1000,gid=1000,umask=0002 /dev/sdb2 /mnt/winshare
Only add exotic options when the task needs them; many labs accept plain mount with defaults.
Unmount: umount cleanly
sudo umount /data
sudo umount /dev/sdb1
sudo umount -a -t vfat # all of a type—use carefully
Busy mount errors mean a process still uses the tree:
# You are sitting inside the mountpoint?
pwd
cd /
sudo umount /data
# Find holders
sudo lsof +f -- /data
sudo fuser -vm /data
# fuser -km /data # kills holders—last resort on exam if appropriate
Do not reboot as your first unmount strategy; leave the directory, stop the writing service, then umount.
Lazy unmount (umount -l) detaches when idle—know it exists; prefer a clean umount for exam clarity.
Persistence vs temporary use
| Goal | What to do |
|---|---|
| Temporary lab mount | mount only; may not survive reboot |
| Survive reboot | /etc/fstab with UUID= or LABEL= + correct TYPE + mount -a (prior chapter skill) |
| Swap | Not a VFAT/ext4/XFS data FS—mkswap path |
If the task says “mount at boot” or “persistently,” fstab is required. If it only says “create and mount at /data for use,” a correct live mount may be enough—read the verb carefully. When unsure and time allows, durable UUID fstab plus mount -a is safer for “configure storage” style wording on RHEL exams that always stress reboot survival.
End-to-end exam workflows
Workflow A — XFS on new LV at /data
sudo lvs
sudo mkfs.xfs /dev/vgstorage/data
blkid /dev/vgstorage/data
sudo mkdir -p /data
sudo mount /dev/vgstorage/data /data
touch /data/ok
findmnt /data
# If persistence required:
# UUID=... /data xfs defaults 0 0 in fstab; mount -a
Workflow B — ext4 partition, temporary use, then unmount
sudo mkfs.ext4 /dev/sdb1
sudo mkdir -p /mnt/backup
sudo mount -t ext4 /dev/sdb1 /mnt/backup
cp -a /var/tmp/project /mnt/backup/
sudo umount /mnt/backup
Workflow C — VFAT share volume
sudo mkfs.vfat -n EXAMSHARE /dev/sdc1
sudo mkdir -p /mnt/share
sudo mount -t vfat /dev/sdc1 /mnt/share
echo test | sudo tee /mnt/share/hello.txt
findmnt /mnt/share
blkid /dev/sdc1
Workflow D — Wrong type recovery
sudo mount -t ext4 /dev/sdb1 /data
# mount: wrong fs type...
blkid /dev/sdb1 # TYPE="xfs"
sudo mount -t xfs /dev/sdb1 /data
Or omit -t and let mount use blkid helpers when the superblock is valid.
XFS vs ext4 operational differences (exam-relevant)
| Topic | XFS | ext4 |
|---|---|---|
| Create | mkfs.xfs | mkfs.ext4 |
| Label | mkfs.xfs -L / xfs_admin -L | mkfs.ext4 -L / e2label |
| Online grow (after LV extend) | xfs_growfs mountpoint | resize2fs device (often after extend) |
| Shrink | Not a normal admin path | Possible offline with care—not a typical EX200 ask |
| Check FS | xfs_repair (unmounted) | e2fsck |
For this section, creation/mount/use/unmount dominate; grow tools appear when you extend logical volumes (next section).
VFAT traps on a Linux exam host
- Permissions look wrong — VFAT does not store Unix mode bits the same way; use mount
uid/gid/umaskif writes fail for a non-root user. - Filename case / special characters — stay with simple names in demos.
- Not for
/var/libapp data requiring SELinux contexts—if the task wants VFAT, use it as a portable volume, not as a substitute for ext4/XFS application FS. - TYPE spelling —
vfatin mount/fstab; do not inventfat32as the primary fstab type on RHEL teaching materials (kernel type is vfat).
Verification checklist
| Check | Command |
|---|---|
| FS exists | blkid, lsblk -f shows TYPE |
| Mounted where intended | findmnt /path, df -h /path |
| Writable | touch / tee test file |
| Unmounted when required | findmnt no longer shows path; umount succeeded |
| Correct type | TYPE matches task (xfs vs ext4 vs vfat) |
Relationship to other objectives
| Skill | Where |
|---|---|
| Partitions / PV / VG / LV create | Storage LVM chapters |
| Mount at boot by UUID/label | Storage mount chapter |
| Create/mount/use VFAT, ext4, XFS | This section |
| Extend LV + grow FS | Section 13.2 |
| Permission diagnosis on Linux trees | Section 13.3 |
Common traps
mkfson the wrong disk — double-checklsblksize and emptiness.- Formatting while mounted — unmount first.
- Creating XFS when the task required ext4 (or vice versa) — read the FS type in the prompt.
- Mount succeeds but empty application path — wrong mountpoint directory.
- Forgetting to create the mountpoint —
mkdir -pfirst. - Leaving cwd inside the mount —
umountfails with target busy. - Assuming VFAT preserves chmod the way ext4 does — different model.
- Stopping after mkfs without mount when the task said “use” or “mount at.”
- fstab TYPE mismatch after creating XFS but writing
ext4in fstab. - Using
mkfs.xfson a tiny USB-style VFAT-required partition against the task text.
Section checkpoint
You should invent nothing about mystery disks: identify the device, create ext4, XFS, or VFAT with the matching mkfs.* tool, mount it on an existing directory, demonstrate file create/copy, unmount cleanly with umount, and verify with blkid, lsblk -f, findmnt, and df. That is the EX200 bar for creating, mounting, unmounting, and using local VFAT, ext4, and XFS file systems on RHEL 10.
Which command creates an XFS file system on the logical volume /dev/vgdata/app?
You need a VFAT volume on /dev/sdb1 mounted at /mnt/share so files can be exchanged with non-Linux systems. Which sequence is correct?
umount /data fails with “target is busy.” What is the best first response on an exam system?
After mkfs.ext4 /dev/sdc1, blkid shows TYPE="ext4". A mount command using -t xfs fails. What should you do?