mount
Overview
The mount
command attaches the filesystem found on a device to the Linux directory tree. It’s essential for accessing data on various storage devices and network shares.
Syntax
mount [-t type] [-o options] device directory
Common Options
Option | Description |
---|---|
-t type |
Specify filesystem type |
-o options |
Mount options |
-a |
Mount all filesystems in fstab |
-r |
Mount read-only |
-w |
Mount read-write |
-v |
Verbose mode |
-L label |
Mount by label |
-U UUID |
Mount by UUID |
Key Use Cases
- Mount storage devices
- Access network shares
- Mount ISO images
- Temporary filesystems
- System maintenance
Examples with Explanations
Example 1: Basic Mount
mount /dev/sdb1 /mnt/usb
Mounts device sdb1 to /mnt/usb directory
Example 2: Mount with Type
mount -t ntfs /dev/sda2 /mnt/windows
Mounts NTFS filesystem
Example 3: Mount ISO
mount -o loop image.iso /mnt/iso
Mounts an ISO file
Understanding Output
- Device name
- Mount point
- Filesystem type
- Mount options
- Status messages
Common Usage Patterns
Mount with specific options:
mount -o rw,user,exec /dev/sdc1 /media/data
Mount network share:
mount -t nfs server:/share /mnt/nfs
View mounted filesystems:
mount | grep "/dev/sd"
Performance Analysis
- Consider filesystem type for performance
- Use appropriate mount options
- Monitor I/O performance
- Check filesystem status