~2 min read • Updated Jul 16, 2025
Linux provides strong capabilities for handling storage devices, both physical (e.g., hard disks and USB drives) and virtual (e.g., RAID, LVM). This guide covers key command-line tools for common tasks such as mounting devices, formatting partitions, and creating CD-ROM images without deep system-level configuration.
Essential Commands
mount: Attach a file systemumount: Detach a file systemfsck: Check and repair file systemsfdisk: Partition table manipulationmkfs: Create a file systemdd: Clone or convert datagenisoimage: Build ISO 9660 fileswodim: Burn data to optical mediamd5sum: Verify data integrity
Mounting and Unmounting Devices
Mounting integrates a device into Linux's unified file system. Unlike Windows (C:, D:, etc.), Linux uses a single tree. The /etc/fstab file defines mount points for system boot:
LABEL=/12 / ext4 defaults 1 1
LABEL=/home /home ext4 defaults 1 2
LABEL=/boot /boot ext4 defaults 1 2fstab Fields
| Field | Description |
|---|---|
| Device | Name, label, or UUID (e.g., /dev/sda1) |
| Mount Point | Where to attach device (e.g., /home) |
| File System Type | e.g., ext4, ntfs, vfat, iso9660 |
| Options | Mount flags (e.g., rw, ro) |
| Frequency | Backup setting for dump |
| Order | Check order for fsck |
Viewing Mounted Systems
mount/dev/sda2 on / type ext4
/dev/sda5 on /home type ext4
/dev/sdb1 on /media/disk type vfatMounting a CD-ROM
sudo mkdir /mnt/cdrom
sudo mount -t iso9660 /dev/sdc /mnt/cdromAccessing the Contents
cd /mnt/cdrom
lsUnmounting a Device
cd
umount /dev/sdcIf a device is in use (e.g., current working directory), umount fails until released.
Why Unmounting Matters
Linux uses RAM buffering for performance. Unmounting flushes writes and prevents data loss.
Identifying Devices
ls /dev
tail -f /var/log/messagesExample log when connecting USB:
sdb: sdb1
Attached SCSI removable diskMounting a Flash Drive
sudo mkdir /mnt/flash
sudo mount /dev/sdb1 /mnt/flash
dfCreating File Systems
Using fdisk
sudo umount /dev/sdb1
sudo fdisk /dev/sdbp: Show partitionst: Set type (e.g., 83 = Linux)w: Write and exitq: Quit without saving
Formatting with mkfs
mkfs -t ext4 /dev/sdb1
mkfs -t vfat /dev/sdb1Testing and Repairing with fsck
umount /dev/sdb1
fsck /dev/sdb1/dev/sdb1: clean, 11/3904 files, 1661/15608 blocksCopying Data with dd
dd if=/dev/sdb of=/dev/sdc
dd if=/dev/sdb of=flash_drive.imgCreating CD-ROM Images
Clone a CD-ROM
dd if=/dev/cdrom of=ubuntu.isoCreate ISO from Directory
genisoimage -o cd-rom.iso -R -J ~/cd-rom-filesMounting ISO Files
mkdir /mnt/iso_image
sudo mount -t iso9660 -o loop image.iso /mnt/iso_image
umount /mnt/iso_imageErasing and Burning CD-RWs
wodim dev=/dev/cdrw blank=fast
wodim dev=/dev/cdrw image.isoVerifying ISO Integrity
md5sum image.isoCompare ISO to Disc:
md5sum dvd-image.iso
dd if=/dev/dvd bs=2048 count=$(( $(stat -c "%s" dvd-image.iso) / 2048 ))Conclusion
Tools like mount, fdisk, mkfs, and dd give Linux users deep control over storage media. Mastering these commands helps ensure safe device handling, efficient backups, and solid system management.
Written & researched by Dr. Shahin Siami