Cheat Sheet #day68 - mount

mount Command Cheatsheet
The mount command in Unix-like systems is used to mount filesystems and network shares onto the directory tree. It is essential for managing storage devices and network shares efficiently. Here’s a quick reference guide:
Basic Syntax
mount [OPTION]... [DEVICE] [DIRECTORY]
Common Options
-t TYPE,--types TYPE: Specify the filesystem type (e.g., ext4, nfs).mount -t ext4 /dev/sdb1 /mnt/data-o OPTIONS,--options OPTIONS: Mount options (e.g.,rwfor read-write,rofor read-only).mount -o rw /dev/sdb1 /mnt/data-a,--all: Mount all filesystems listed in/etc/fstab(exceptnoautoentries).mount -a-r,--read-only: Mount the filesystem read-only.mount -o ro /dev/sdb1 /mnt/data-v,--verbose: Verbose mode, print detailed information during the mount operation.mount -v /dev/sdb1 /mnt/data
Examples
Mount a device to a directory:
mount /dev/sdb1 /mnt/dataMount a filesystem specifying type and options:
mount -t ext4 -o rw /dev/sdb1 /mnt/dataMount all filesystems listed in
/etc/fstab:mount -aMount a remote NFS share:
mount -t nfs server:/share /mnt/nfsUnmount a mounted filesystem:
umount /mnt/data
Additional Information
List mounted filesystems:
mountHelp option:
mount --helpView manual page for
mount:man mount
The mount command is crucial for managing filesystems and network shares in Unix-like systems. It allows administrators to control storage devices and network resources effectively. For more detailed options and usage scenarios, refer to the man page or use mount --help.




