← 返回命令列表

Linux command

mount 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

mount

Mount

mount [path/to/device] [path/to/target_directory]

Example

mount -o uid=[user_id],gid=[group_id] [device] [directory]

Example

mount -t iso9660 -o ro /dev/cdrom /cdrom

Example

mount -a

Bind mount

mount --bind [old_directory] [new_directory]

Example

mount -m [device] [directory]

说明

mount attaches a filesystem found on a device to the directory tree. Without arguments, it displays currently mounted filesystems. The filesystem type can be auto-detected in most cases.

参数

-t, --types type
Specify filesystem type (ext4, ntfs, iso9660, vfat, etc.)
-o, --options options
Mount options (ro, rw, noexec, nosuid, uid, gid, etc.)
-a, --all
Mount all filesystems in /etc/fstab
-B, --bind
Bind mount (mount directory to another location)
-m, --mkdir
Create mount point directory if it doesn't exist
-r, --read-only
Mount read-only (equivalent to -o ro)
-w, --rw
Mount read-write (default)
-v, --verbose
Verbose mode
-n
Mount without writing to /etc/mtab
-L label
Mount partition by label
-U uuid
Mount partition by UUID

FAQ

What is the mount command used for?

mount attaches a filesystem found on a device to the directory tree. Without arguments, it displays currently mounted filesystems. The filesystem type can be auto-detected in most cases.

How do I run a basic mount example?

Run `mount` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --types type do in mount?

Specify filesystem type (ext4, ntfs, iso9660, vfat, etc.)