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.
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 integrityMounting 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| 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 |
mount/dev/sda2 on / type ext4
/dev/sda5 on /home type ext4
/dev/sdb1 on /media/disk type vfatsudo mkdir /mnt/cdrom
sudo mount -t iso9660 /dev/sdc /mnt/cdromcd /mnt/cdrom
lscd
umount /dev/sdcIf a device is in use (e.g., current working directory), umount fails until released.
Linux uses RAM buffering for performance. Unmounting flushes writes and prevents data loss.
ls /dev
tail -f /var/log/messagesExample log when connecting USB:
sdb: sdb1
Attached SCSI removable disksudo mkdir /mnt/flash
sudo mount /dev/sdb1 /mnt/flash
dfsudo umount /dev/sdb1
sudo fdisk /dev/sdbp: Show partitionst: Set type (e.g., 83 = Linux)w: Write and exitq: Quit without savingmkfs -t ext4 /dev/sdb1
mkfs -t vfat /dev/sdb1umount /dev/sdb1
fsck /dev/sdb1/dev/sdb1: clean, 11/3904 files, 1661/15608 blocksdd if=/dev/sdb of=/dev/sdc
dd if=/dev/sdb of=flash_drive.imgdd if=/dev/cdrom of=ubuntu.isogenisoimage -o cd-rom.iso -R -J ~/cd-rom-filesmkdir /mnt/iso_image
sudo mount -t iso9660 -o loop image.iso /mnt/iso_image
umount /mnt/iso_imagewodim dev=/dev/cdrw blank=fast
wodim dev=/dev/cdrw image.isomd5sum image.isomd5sum dvd-image.iso
dd if=/dev/dvd bs=2048 count=$(( $(stat -c "%s" dvd-image.iso) / 2048 ))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.