~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 system
  • umount: Detach a file system
  • fsck: Check and repair file systems
  • fdisk: Partition table manipulation
  • mkfs: Create a file system
  • dd: Clone or convert data
  • genisoimage: Build ISO 9660 files
  • wodim: Burn data to optical media
  • md5sum: 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 2

fstab Fields


FieldDescription
DeviceName, label, or UUID (e.g., /dev/sda1)
Mount PointWhere to attach device (e.g., /home)
File System Typee.g., ext4, ntfs, vfat, iso9660
OptionsMount flags (e.g., rw, ro)
FrequencyBackup setting for dump
OrderCheck order for fsck

Viewing Mounted Systems


mount

/dev/sda2 on / type ext4
/dev/sda5 on /home type ext4
/dev/sdb1 on /media/disk type vfat

Mounting a CD-ROM


sudo mkdir /mnt/cdrom
sudo mount -t iso9660 /dev/sdc /mnt/cdrom

Accessing the Contents


cd /mnt/cdrom
ls

Unmounting a Device


cd
umount /dev/sdc

If 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/messages

Example log when connecting USB:


sdb: sdb1
Attached SCSI removable disk

Mounting a Flash Drive


sudo mkdir /mnt/flash
sudo mount /dev/sdb1 /mnt/flash
df

Creating File Systems


Using fdisk


sudo umount /dev/sdb1
sudo fdisk /dev/sdb

  • p: Show partitions
  • t: Set type (e.g., 83 = Linux)
  • w: Write and exit
  • q: Quit without saving

Formatting with mkfs


mkfs -t ext4 /dev/sdb1
mkfs -t vfat /dev/sdb1

Testing and Repairing with fsck


umount /dev/sdb1
fsck /dev/sdb1

/dev/sdb1: clean, 11/3904 files, 1661/15608 blocks

Copying Data with dd


dd if=/dev/sdb of=/dev/sdc
dd if=/dev/sdb of=flash_drive.img

Creating CD-ROM Images


Clone a CD-ROM


dd if=/dev/cdrom of=ubuntu.iso

Create ISO from Directory


genisoimage -o cd-rom.iso -R -J ~/cd-rom-files

Mounting ISO Files


mkdir /mnt/iso_image
sudo mount -t iso9660 -o loop image.iso /mnt/iso_image
umount /mnt/iso_image

Erasing and Burning CD-RWs


wodim dev=/dev/cdrw blank=fast
wodim dev=/dev/cdrw image.iso

Verifying ISO Integrity


md5sum image.iso

Compare 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