cheat.sheets:mount
# mount
# Mount a filesystem
# Mount a temporary filesystem (TMPFS) of 4GB to '/mnt'. The contents will
# vanish when you reboot, but this can be very useful when working with things
# like bootstrap tarballs or temporary storages for sensitive data.
mount -t tmpfs -o mode=755,size=4096M tmpfs /mnt
cheat:mount
# To mount / partition as read-write in repair mode:
mount -o remount,rw /
# To bind mount path to a second location:
mount --bind <source> <destination>
# To mount Usb disk as user writable:
mount -o uid=username,gid=usergroup /dev/sdx /mnt/xxx
# To mount a remote NFS directory:
mount -t nfs <host>:<remote-dir> <local-dir>
# To mount an ISO:
mount -o loop disk1.iso /mnt/disk
tldr:mount
# mount
# Provides access to an entire filesystem in one directory.
# More information: <https://manned.org/mount.8>.
# Show all mounted filesystems:
mount
# Mount a device to a directory:
mount -t filesystem_type path/to/device_file path/to/target_directory
# Create a specific directory if it does not exist and mount a device to it:
mount --mkdir path/to/device_file path/to/target_directory
# Mount a device to a directory for a specific user:
mount -o uid=user_id,gid=group_id path/to/device_file path/to/target_directory
# Mount a CD-ROM device (with the filetype ISO9660) to `/cdrom` (readonly):
mount -t iso9660 -o ro /dev/cdrom /cdrom
# Mount all the filesystem defined in `/etc/fstab`:
mount -a
# Mount a specific filesystem described in `/etc/fstab` (e.g. `/dev/sda1 /my_drive ext2 defaults 0 2`):
mount /my_drive
# Mount a directory to another directory:
mount --bind path/to/old_dir path/to/new_dir
$
cheat.sh