Article Title: common methods for automatically mounting Windows File System partitions. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
A dual-system is installed on a PC, and sometimes Windows resources are used in Linux. Therefore, disk D is automatically mounted when Linux is started. The method is simple, that is, to modify the/etc/fstab file. First, we will introduce the/etc/fstab file format.
The/etc/fstab file configures mounting options for all file systems and disk devices. Each file system and disk device have independent lines. Each option in the row is separated by spaces or tabs. The format of each line is as follows:
Fs_spec [tab] fs_file [tab] fs_type [tab] fs_option [tab] fs_dump [tab] fs_pass
1 fs_spec -- this field defines the device or remote file system where the file system to be loaded is located.
2 fs_file -- File System loading point. This field is none for the swap device. If the directory name contains spaces, 40 is used to indicate spaces.
3 fs_type -- defines the file system type
4 fs_option -- specify the specific parameter options used to load the file system of the device. Multiple parameters are separated by commas.
Ro -- load the file system in read-only mode
Sync-do not buffer the write operations on the device, which can prevent file system damage during abnormal shutdown, but reduce the computer speed.
User -- allows normal users to load the File System
Quota-force disk quota limit on the file system
Noauto -- no longer use mount-a (for example, when the system starts) to load the File System
5 fs_dump -- this option is used by the "dump" command to check how often a file system should be dumped. If no dump is required, it is set to 0.
6 fs_pass -- this field is used by The fsck command to determine the sequence of the file system to be scanned at startup. The value of the "/" pair of the root file system should be 1, other file systems should be 2. If the file system does not need to scan at startup, set this field to 0.
It is easy to define the format. Perform the following operations with root permissions:
(1) create a mount point
# Mkdir/mnt/windows
(2) Find the file system partition to be mounted
# Fdisk-l
My D disk is/dev/hdc5 in Linux.
(3) modify the/etc/fstab file
# Vim/etc/fstab
Add a row:
/Dev/hdc5 [tab]/mnt/windows [tab] vfat [tab] auto, umask = 0 [tab] 0 [tab] 0
Save the file and exit vim.
(4) Restart Test
# Reboot
...
# Ls/mnt/windows
If the contents in the directory are displayed, the mounting is successful.
If Chinese characters cannot be displayed after mounting ???? To replace Chinese, you should change it:
/Dev/hdc5 [tab]/mnt/windows [tab] vfat [tab] auto, umask = 0, iocharset = cp936, codepage = 936 [tab] 0 [tab] 0