Mount_Points

Understanding mount points and how to attach filesystems to the Linux directory tree

Mount points are directories where filesystems are attached to the Linux directory tree. They provide access to storage devices, network shares, and virtual filesystems by integrating them into the unified file hierarchy starting from root (/).

Key Concepts

  • Mount Point: Directory where filesystem is attached
  • Filesystem: Structure organizing data on storage
  • Device: Physical/virtual storage being mounted
  • fstab: Configuration file for automatic mounts
  • Temporary Mount: Manual mount until unmount/reboot
  • Persistent Mount: Automatic mount at boot via fstab

Command Syntax

mount [options] device mountpoint

  • Attach filesystem to directory tree
  • Device can be partition, file, or network share
  • Mount point must be existing directory

umount [options] device|mountpoint

  • Detach filesystem from directory tree

Common Options

-t fstype - Specify filesystem type -o options - Mount options (rw, ro, noexec, etc.) -a - Mount all filesystems in fstab -v - Verbose output -n - Don’t write to /etc/mtab

Practical Examples

Example 1: View current mounts

1
2
3
mount
# or
df -h

Shows all currently mounted filesystems with usage

Example 2: Mount USB drive

1
2
3
sudo mkdir /mnt/usb
sudo mount /dev/sdb1 /mnt/usb
ls /mnt/usb

Creates mount point and mounts USB device

Example 3: Mount with specific options

1
sudo mount -t ext4 -o ro,noexec /dev/sdc1 /mnt/backup

Mounts as read-only with no execution permissions

Example 4: Network filesystem

1
sudo mount -t nfs server:/path /mnt/nfs

Mounts NFS share from remote server

Example 5: Unmount filesystem

1
2
3
sudo umount /mnt/usb
# or
sudo umount /dev/sdb1

Safely detaches the mounted filesystem

Use Cases

  • Access external storage (USB, external drives)
  • Mount network shares (NFS, CIFS/SMB)
  • Access different partitions
  • Mount ISO files for installation
  • Bind mount directories to different locations
  • Mount temporary filesystems (tmpfs)

lsblk - List block devices and mount points findmnt - Display mounted filesystems in tree blkid - Show filesystem UUIDs and types fdisk -l - List all disk partitions

Tips & Troubleshooting

  • Always create mount point directory first
  • Use lsof to find processes using mounted fs
  • Check /proc/mounts for kernel view of mounts
  • Device busy error: processes still accessing files
  • Use umount -l for lazy unmount if stuck
  • Add to /etc/fstab for permanent mounts
  • Use UUIDs in fstab instead of device names
  • Test fstab changes with mount -a before reboot