LinuxTutorial2 min read

How to Mount and Unmount Drives on Linux

Attach and detach drives on Linux with mount and umount, understand /etc/fstab for automatic mounts, and avoid common pitfalls when handling external storage.

Developer terminal on a laptop in low light

How Mounting Works on Linux

Unlike Windows, Linux doesn't automatically assign drive letters. Instead, you "mount" a drive to an existing directory (called a mount point), and its contents become accessible there. When you're done, you "unmount" it.

List Connected Drives

lsblk                    # block devices in a tree view
lsblk -f                 # include filesystem type and UUID
fdisk -l                 # detailed partition info (needs sudo)
df -h                    # mounted filesystems and disk usage

Drives are usually named /dev/sda, /dev/sdb, etc. Partitions add numbers: /dev/sda1, /dev/sda2.

Mount a Drive

# Create a mount point directory
sudo mkdir -p /mnt/usb

# Mount a partition to that directory
sudo mount /dev/sdb1 /mnt/usb

# Mount a specific filesystem type
sudo mount -t vfat /dev/sdb1 /mnt/usb

# Mount an ISO file
sudo mount -o loop disk.iso /mnt/iso

Unmount a Drive

sudo umount /mnt/usb          # unmount by mount point
sudo umount /dev/sdb1         # unmount by device

Important: Always unmount before physically removing a USB drive or external disk. If umount says "target is busy", a terminal is still inside that directory — navigate away first.

Find Why a Drive Is Busy

lsof /mnt/usb         # list open files on the mount point
fuser -m /mnt/usb     # show PIDs using the mount

Automatic Mounts with /etc/fstab

/etc/fstab defines filesystems that mount at boot. Each line has: device, mount point, filesystem type, options, dump, pass.

cat /etc/fstab

To add a permanent mount, first get the UUID of the drive (safer than device names):

blkid /dev/sdb1

Add a line to /etc/fstab:

UUID=1234-ABCD  /mnt/data  ext4  defaults  0  2

Test without rebooting:

sudo mount -a        # mount everything in fstab that isn't mounted yet

Mount a Network Share (NFS)

sudo mount -t nfs 192.168.1.10:/shared /mnt/nas

Common Filesystems

  • ext4 — standard Linux filesystem
  • vfat / FAT32 — USB drives, cross-platform
  • ntfs — Windows drives (install ntfs-3g)
  • exfat — large external drives, cross-platform