Sagar.BlogArticle
All posts
All posts
Linux

mount & umount — Mounting Drives in Linux

Learn how Linux mounts storage devices to the directory tree, how to mount/unmount manually, and how to configure automatic mounts via /etc/fstab.

March 22, 20255 min read
linuxdiskmountfstabstorage

How Mounting Works

In Linux, every storage device (USB, hard drive, ISO) must be mounted to a directory to be accessible. When mounted, its files appear under that directory path.

View Current Mounts

mount                          # All current mounts
mount | grep /dev/sd           # Physical disks only
df -h                          # Mounted filesystems with space info
lsblk                          # Block device tree view
findmnt                        # Clean tree view of all mounts

Mounting Devices

# Mount a USB drive
sudo mount /dev/sdb1 /mnt/usb

# Mount with explicit filesystem type
sudo mount -t ext4 /dev/sdb1 /mnt/data

# Mount read-only
sudo mount -o ro /dev/sdb1 /mnt/data

# Mount an ISO file (loopback)
sudo mount -o loop image.iso /mnt/iso

Unmounting

sudo umount /mnt/usb           # Unmount by mount point
sudo umount /dev/sdb1          # Unmount by device
sudo umount -l /mnt/usb        # Lazy unmount (when busy)

/etc/fstab — Auto-mount at Boot

Filesystems listed in /etc/fstab mount automatically when the system boots.

cat /etc/fstab

# Format: device  mountpoint  fstype  options  dump  pass
# /dev/sda1  /        ext4  defaults  0  1
# /dev/sda2  /home    ext4  defaults  0  2
# UUID=xxx   /data    ext4  defaults  0  0

# Mount everything in fstab
sudo mount -a

Always run sudo umount before physically removing a USB drive. Removing without unmounting can corrupt data.

Quick Check

What file controls which filesystems are automatically mounted at boot?

Exercise

Use lsblk to list all block devices. Then use findmnt to see the mount tree.