To attach a certain file system, use the Show
The device can be identified by:
Note that while a file system is mounted, the original content of the directory is not accessible. Linux does not prevent a user from mounting a file system to a directory with a file system already attached to it. To determine whether a particular directory serves as a mount point, run the
If no file system is attached to the directory, the given command returns When you run
the
To determine the UUID and—if the device uses it—the label of a particular device, use the
For example, to display information about
19.2.1. Specifying the File System Type In most cases,
Table 19.1. Common File System Types
Example 19.2. Mounting a USB Flash Drive Older USB flash drives often use the FAT file system. Assuming that such drive uses the ~]#
19.2.2. Specifying the Mount OptionsTo specify additional mount options, use the command in the following form:
When supplying multiple options, do not insert a space after a comma, or Table 19.2. Common Mount Options
Example 19.3. Mounting an ISO Image An ISO image (or a disk image in general) can be mounted by using the loop device. Assuming that the ISO image of the Fedora 14 installation disc is present in the current working directory and that the
Note that ISO 9660 is by design a read-only file system. 19.2.3. Sharing Mounts Occasionally, certain system administration tasks require access to the same file system from more than one place in the directory tree (for example, when preparing a chroot environment). This is possible, and Linux allows you to mount the same file system to as many directories as necessary. Additionally, the
Although this command allows a user to access the file system from both places, it does not apply on the file systems that are mounted within the original directory. To include these mounts as well, use the following command:
Additionally, to provide as much flexibility as possible, Red Hat Enterprise Linux 7 implements the functionality known as shared subtrees. This feature allows the use of the following four mount types: Shared Mount A shared mount allows the creation of an exact replica of a given mount point. When a mount point is marked as a shared mount, any mount within the original mount point is reflected in it, and vice versa. To change the type of a mount point to a shared mount, type the following at a shell prompt:
Alternatively, to change the mount type for the selected mount point and all mount points under it: Slave Mount A slave mount allows the creation of a limited duplicate of a given mount point. When a mount point is marked as a slave mount, any mount within the original mount point is reflected in it, but no mount within a slave mount is reflected in its original. To change the type of a mount point to a slave mount, type the following at a shell prompt:
Alternatively, it is possible to change the mount type for the selected mount point and all mount points under it by typing:
Example 19.5. Creating a Slave Mount Point This
example shows how to get the content of the ~]# Then create its duplicate in ~]# Now verify that a mount within ~]# Also verify that file systems mounted in the ~]#Private Mount A private mount is the default type of mount, and unlike a shared or slave mount, it does not receive or forward any propagation events. To explicitly mark a mount point as a private mount, type the following at a shell prompt:
Alternatively, it is possible to change the mount type for the selected mount point and all mount points under it:
Example 19.6. Creating a Private Mount Point Taking into account the scenario in
Example 19.4, “Creating a Shared Mount Point”, assume that a shared mount point has been previously created by using the following commands as ~]# To mark the ~]# It is now possible to verify that none
of the mounts within ~]# It is also possible to verify that file systems mounted in the ~]#Unbindable Mount In order to prevent a given mount point from being duplicated whatsoever, an unbindable mount is used. To change the type of a mount point to an unbindable mount, type the following at a shell prompt:
Alternatively, it is possible to change the mount type for the selected mount point and all mount points under it:
Example 19.7. Creating an Unbindable Mount Point To prevent the
This way, any subsequent attempt to make a duplicate of this mount fails with an error:
19.2.4. Moving a Mount PointTo change the directory in which a file system is mounted, use the following command:
Example 19.8. Moving an Existing NFS Mount Point An NFS storage contains user directories and is already mounted in
To verify the mount point has been moved, list the content of both directories:
19.2.5. Setting Read-only Permissions for rootSometimes, you need to mount the root file system with read-only permissions. Example use cases include enhancing security or ensuring data integrity after an unexpected system power-off. 19.2.5.1. Configuring |