2014-02-27 17:05:07 +00:00
|
|
|
# mount
|
|
|
|
|
|
|
|
> Provides access to an entire filesystem in one directory.
|
2021-10-05 17:20:42 +01:00
|
|
|
> More information: <https://manned.org/mount.8>.
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Show all mounted filesystems:
|
2014-02-27 17:05:07 +00:00
|
|
|
|
|
|
|
`mount`
|
|
|
|
|
2016-07-21 22:46:44 +01:00
|
|
|
- Mount a device to a directory:
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2016-07-21 22:46:44 +01:00
|
|
|
`mount -t {{filesystem_type}} {{path/to/device_file}} {{path/to/target_directory}}`
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2022-11-28 19:22:44 +00:00
|
|
|
- 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}}`
|
|
|
|
|
2022-12-02 04:22:55 +00:00
|
|
|
- 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}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Mount a CD-ROM device (with the filetype ISO9660) to `/cdrom` (readonly):
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2014-02-27 21:02:50 +00:00
|
|
|
`mount -t {{iso9660}} -o ro {{/dev/cdrom}} {{/cdrom}}`
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Mount all the filesystem defined in `/etc/fstab`:
|
2014-02-27 17:05:07 +00:00
|
|
|
|
|
|
|
`mount -a`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Mount a specific filesystem described in `/etc/fstab` (e.g. `/dev/sda1 /my_drive ext2 defaults 0 2`):
|
2014-02-27 17:05:07 +00:00
|
|
|
|
2014-02-27 21:02:50 +00:00
|
|
|
`mount {{/my_drive}}`
|
2019-08-21 17:52:14 +01:00
|
|
|
|
|
|
|
- Mount a directory to another directory:
|
|
|
|
|
|
|
|
`mount --bind {{path/to/old_dir}} {{path/to/new_dir}}`
|