To check whether the file system in Linux is successfully mounted, you can use the following methods:
Use the df command: Use the df command to view the file system information that has been mounted in the current system. Execute the following command:
df -h
This command will display detailed information about all file systems that have been mounted in the current system, including mount points, file system types, total capacity, used space, and free space.
Use the mount command: Use the mount command to view all mounted file system information in the current system. Execute the following command:
mount
This will list all mounted file systems, including mount points, file system types, devices and other information.
Check the /etc/fstab file: The /etc/fstab
file contains file system information that needs to be mounted when the system starts. You can check this file to confirm that the file system mount is configured correctly. Execute the following command:
cat /etc/fstab
This will display the contents of the /etc/fstab file and check whether it contains the correct mount information.
Check the mount point: Directly enter the mount point directory to see if the files and directories in it can be accessed normally to determine whether the mount is successful. For example, if you want to check the mounting status of the /mnt
directory, you can execute the following command:
ls /mnt
If the files and directories in the /mnt directory can be listed, the mounting is successful.
Using the above method, you can check the mounting status of the file system in the Linux system to ensure that the file system has been successfully mounted to the specified mount point.
The above is the detailed content of How to check whether the file system in Linux is successfully mounted?. For more information, please follow other related articles on the PHP Chinese website!