Mount Cheatsheet
#
The mount
command is used to attach filesystems to the directory tree in Unix-like operating systems.
Basic Commands
#
Command/Option | Example | Description |
---|
mount <device> <mount_point> | mount /dev/sda1 /mnt | Mount the device to the specified mount point |
mount -t <type> <device> <mount_point> | mount -t ext4 /dev/sda1 /mnt | Specify the filesystem type when mounting |
mount -o <options> <device> <mount_point> | mount -o ro /dev/sda1 /mnt | Mount with specific options (e.g., read-only) |
Common Options
#
Option | Example | Description |
---|
-t <type> | -t ext4 | Specify the filesystem type (e.g., ext4 , ntfs , vfat ) |
-o <options> | -o rw,noexec | Specify mount options (e.g., rw for read-write, noexec to disallow execution) |
-a | mount -a | Mount all filesystems mentioned in /etc/fstab |
-r | mount -r /dev/sda1 /mnt | Mount the filesystem as read-only |
-v | mount -v | Verbose mode; show detailed information |
Unmounting Filesystems
#
Command/Option | Example | Description |
---|
umount <mount_point> | umount /mnt | Unmount the filesystem from the specified mount point |
umount -a | umount -a | Unmount all filesystems mentioned in /etc/mtab |
Checking Mounts
#
Command/Option | Example | Description |
---|
mount | mount | Display all currently mounted filesystems |
`mount | grep ` | `mount |
Troubleshooting
#
Command/Option | Example | Description |
---|
`dmesg | tail` | `dmesg |
This cheatsheet provides fundamental mount
commands for attaching and managing filesystems on Unix-like operating systems.