The Filesystem · Lesson 5 of 12
Creating Filesystems
0 / 4 checkpoints answered
Creating a filesystem writes new allocation and metadata structures to a block device. It is a destructive initialization step, not merely a label change. Use only disposable storage for practice and maintain a tested backup before formatting a device that ever held valuable data.
Understanding mkfs
mkfs is commonly a front end that dispatches to a filesystem-specific program such as mkfs.ext4, mkfs.xfs, or mkfs.btrfs. A generic command has this form:
$ sudo mkfs -t ext4 /dev/VERIFIED-PARTITION
The placeholder must be replaced only after verification. Equivalent format-specific syntax is commonly:
$ sudo mkfs.ext4 /dev/VERIFIED-PARTITION
Supported options, defaults, feature sets, and overwrite prompts differ between implementations. Read the local manual for the exact formatter rather than assuming all mkfs back ends behave alike.
CheckWhat does mkfs -t ext4 TARGET request?
press 1/2/3 to answer · → next lesson
Verify Every Storage Layer
Before formatting, identify the target by model, serial, size, topology, persistent link, and intended role:
$ lsblk -o NAME,PATH,TYPE,SIZE,MODEL,SERIAL,FSTYPE,UUID,MOUNTPOINTS
$ findmnt --real
$ sudo wipefs --no-act /dev/VERIFIED-PARTITION
wipefs --no-act reports recognized signatures without erasing them. Also check swap, LVM, RAID, encryption, virtual-machine, container, and application use. A device can be active even when MOUNTPOINTS is empty.
Unmount or deactivate every relevant layer through its own tool. Recheck identity immediately before the formatter because enumeration names can change.
CheckWhat does wipefs --no-act TARGET provide in this workflow?
press 1/2/3 to answer · → next lesson
Select the Filesystem Deliberately
Choose a type supported by the distribution, boot environment, backup tooling, repair tooling, and workload. Consider required limits, snapshots, checksums, quotas, encryption layering, growth or shrink behavior, and cross-platform access.
Do not select a format solely because it is popular. For example, ext4, XFS, and Btrfs have different operational features and recovery procedures. A removable interoperability device may require another format with different Unix permission semantics.
CheckWhich is a sound basis for selecting a filesystem type?
press 1/2/3 to answer · → next lesson
Labels, UUIDs, and Verification
Formatters normally generate a filesystem UUID and can often set a human-readable label. Use labels that are unique enough for the environment, and ensure cloned filesystems do not retain conflicting identifiers when mounted together.
After successful creation, inspect without mounting:
$ lsblk -f /dev/VERIFIED-PARTITION
$ sudo blkid /dev/VERIFIED-PARTITION
Record the UUID for later mount configuration. Creating a filesystem does not mount it, create application directories, populate backups, or make it persistent across boot.
CheckWhat remains a separate step after a filesystem is created?
press 1/2/3 to answer · → next lesson
Use Manage Linux Partitions and Filesystems only on the lab's disposable secondary disk.
Summary
You can now describe filesystem creation as a verified destructive operation.
- Treat
mkfsas a dispatcher to format-specific tooling. - Verify persistent identity, signatures, and every active consumer.
- Select a filesystem using support and recovery requirements.
- Inspect generated type, label, and UUID before mounting.
Lesson complete
You finished Creating Filesystems. Nice work — keep the momentum going.