Quickly create filesystems on block devices using the mkfs family of tools. 15.11.2025 | reading time: 2 min Want to turn a raw block device or image into usable storage? Use the `mkfs` family to build a filesystem so the kernel and userspace can write files; this short guide shows how to act, not just read. Practice: format a loop device ```sh # create a 100 MiB file, attach it as a loop device, format as ext4, mount and test $ dd if=/dev/zero of=disk.img bs=1M count=100 status=none $ losetup -f --show disk.img /dev/loop0 $ sudo mkfs.ext4 -L data /dev/loop0 mke2fs 1.45.6 (20-Mar-2020) Creating filesystem with 262144 4k blocks and 65536 inodes Filesystem label="data" created. $ mkdir -p /mnt/test $ sudo mount /dev/loop0 /mnt/test $ sudo touch /mnt/test/hello.txt $ sudo umount /mnt/test ``` Options that matter Pick the right mkfs variant first: `mkfs.ext4`, `mkfs.xfs`, `mkfs.vfat`, `mkfs.btrfs` each creates a different on-disk layout; set a label with `-L`, force with `-F` when needed, and use UUIDs or labels in `/etc/fstab` to avoid device-name surprises; remember that formatting is destructive, so verify the device path before you press Enter. Before and after tasks Prepare partitions with tools like `parted` or `fdisk`, inspect block devices with `lsblk` or `blkid`, and tune or check filesystems after creation using `tune2fs` or `e2fsck`; backups and clear device selection make the workflow safe and repeatable. Next steps Formatting is the start; learn to manage filesystem features, snapshots, quotas and recovery next, and consider formalizing skills with certifications such as CompTIA Linux+ or LPIC-1; for focused exam preparation, bitsandbytes.academy offers intensive training. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem storage utilities