Lion Cipher Lab
Partition, format, and mount storage on Linux (safely, with a loopback file)
- Foundations
- Intermediate
- ~60 min
- Free · no account required
Why it matters
Adding storage is one of those tasks that feels rare until suddenly it isn't: a VM runs out of room, a cloud volume needs attaching, a log partition fills at 3 a.m., or you're recovering data off someone else's drive. The commands — partition, format, mount, fstab — are the same on a laptop, a server, and a cloud box, and they're the exact commands sitting one layer under disk encryption, forensics imaging, and every 'the disk is full' incident. They're also genuinely dangerous: one wrong device name wipes real data with no undo. Learning them on a throwaway loopback file means you build the…
What you'll learn
- block devices and lsblk
- partitioning with parted (GPT vs MBR)
- creating filesystems (mkfs, ext4 vs xfs vs btrfs)
- mounting and unmounting
- persistent mounts with /etc/fstab and UUIDs
- loop devices for safe practice
- LVM basics
- recognizing destructive disk operations before you run them
Steps in this lab
- The one rule that makes everything else safe
- See what's already on the machine (lsblk, fdisk -l)
- Create a virtual disk as a file (truncate)
- Attach the file as a loop device (losetup)
- Partition the virtual disk (parted, GPT vs MBR)
- Put a filesystem on the partition (mkfs.ext4)
- Mount it, use it, unmount it (mount, df, du, umount)
- Make the mount survive a reboot — the right way (blkid, /etc/fstab, UUID)
- LVM in five minutes — why you'd add a layer (pvcreate, vgcreate, lvcreate)
- Clean up completely — leave the machine as you found it
- When, why, and the better way (judgment to carry out)