Filesystem Mounting Basics
What is Filesystem Mounting?
Filesystem mounting is a fundamental operation in Linux systems that allows users to make file systems accessible at a specific point in the directory hierarchy. When a filesystem is mounted, it becomes part of the system's directory structure, enabling users to read, write, and interact with its contents.
Core Concepts of Mounting
Filesystem Types
Linux supports multiple filesystem types, each with unique characteristics:
Filesystem Type |
Description |
Common Use Cases |
ext4 |
Standard Linux filesystem |
System partitions, local storage |
NTFS |
Windows filesystem |
External drives, Windows compatibility |
FAT32 |
Legacy filesystem |
USB drives, memory cards |
NFS |
Network filesystem |
Shared network resources |
Mount Points
A mount point is a directory where a filesystem is attached. When you mount a filesystem, it replaces the contents of the mount point directory with the contents of the mounted filesystem.
graph TD
A[Root Directory /] --> B[/home]
A --> C[/mnt]
A --> D[/media]
C --> E[External Disk Mounted Here]
D --> F[USB Drive Mounted Here]
Basic Mounting Commands
mount Command
The primary command for mounting filesystems is mount
:
## Basic mount syntax
mount [options] device mountpoint
## Example: Mount a USB drive
mount /dev/sdb1 /mnt/usb
umount Command
To detach a mounted filesystem, use the umount
command:
## Unmount a filesystem
umount /mnt/usb
Filesystem Mounting Considerations
Permissions
- Root access is typically required for system-wide mounting
- User-level mounting depends on system configuration
- Filesystem permissions determine read/write access
Persistent Mounting
For permanent mounts, edit /etc/fstab
:
## /etc/fstab format
## device mountpoint type options dump pass
/dev/sdb1 /mnt/data ext4 defaults 0 2
Common Mounting Scenarios
- External storage devices
- Network filesystems
- Temporary filesystem access
- System backup and recovery
LabEx Tip
When learning filesystem mounting, practice in a controlled environment like LabEx Linux labs to gain hands-on experience without risking system configurations.