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
|
|
Shows all currently mounted filesystems with usage
Example 2: Mount USB drive
|
|
Creates mount point and mounts USB device
Example 3: Mount with specific options
|
|
Mounts as read-only with no execution permissions
Example 4: Network filesystem
|
|
Mounts NFS share from remote server
Example 5: Unmount filesystem
|
|
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)
Related Commands
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
lsofto find processes using mounted fs - Check
/proc/mountsfor kernel view of mounts - Device busy error: processes still accessing files
- Use
umount -lfor lazy unmount if stuck - Add to
/etc/fstabfor permanent mounts - Use UUIDs in fstab instead of device names
- Test fstab changes with
mount -abefore reboot