Http://www.cnblogs.com/ggjucheng/archive/2012/08/24/2653512.html
Start Mount/etc/fstab and/etc/mtab
Just above said a lot, then can be started when the file system I want to hang up? So I don't need to go to the Linux system every time I have to mount it again! Of course you can! Then go straight to the /etc/fstab and fix it! But before we start, let's talk about some of the limitations of the system mount:
The root directory/must be mounted, and will have to be mounted before the other mount point.
Other mount point must be a directory that has been created and can be arbitrarily specified, but must adhere to the required system directory schema principles
All mount point can be mounted only once at the same time.
All partition can only be mounted once within the same time.
In the removal process, you must first move the working directory outside of Mount point (and its subdirectories).
Let's look directly at the contents of the/etc/fstab file!
[Email protected] ~]# cat/etc/fstab# Device Mount Point filesystem parameters dump FSCKLABEL=/1 / ext3 Defaults 1 1label=/home/home ext3 defaults 1 2label=/boot/ boot Ext3 Defaults 1 2tmpfs /dev/shm tmpfs defaults 0 0devpts /dev/pts devpts gid=5,mode=620 0 0sysfs /sys sysfs defaults 0 0proc /proc proc Defaults 0 0label=swap-hdc5 swap swap defaults 0 0# The parts of these special fonts are related to the actual disk! The other is the virtual file system or # associated with memory replacement space (swap).
There are six fields in the contents of this file, and these six fields are very important! You "must carry up" to be good! The detailed data for each field is as follows: In fact/etc/fstab (filesystem table) is the one that will write all the options and parameters to this file when we mount it with the Mount command. In addition to this,/etc/fstab also added the support of dump for this backup command! It is related to commands such as the file system check fsck at startup.
First column: Disk appliance file name or Label for this device:
This field please fill in the file system's device file name. However, the default value of the table above we know that the system uses the Label name by default! In this test system of bird brother/dev/hdc2 is called/1, so "LABEL=/1" in the above table can also be substituted for "/dev/hdc2". The label can be consulted using the DUMPE2FS command.
Second column: mount point::
It's a mount point! What is a mount point? Must be a directory AH ~ to know AH!
Column three: file system for disk partition slots:
The system can be mounted automatically when manually mounted, but in this file we have to write the file system manually! Includes ext3, ReiserFS, NFS, VFAT, and more.
Column four: File system parameters:
Remember that we talked about a lot of special file system parameters in Mount's command? And the "-O iocharset=cp950" we used? These special parameters are written in this field! Although it has been mentioned before in mount, here we use the form of the way to send a whole:
Parameters |
Content meaning |
Async/sync Asynchronous/Synchronous |
Configure whether the disk runs asynchronously! Default to Async (better performance) |
Auto/noauto Automatic/non-automatic |
Whether the file system will be mounted by an active test when Mount-a is released. The default is auto. |
Rw/ro Erasable/Read-only |
Let the splitter slot be mounted as erasable or read-only, and if the data you want to share is not changed to the user at will, it can be configured as read-only. No matter if the file system's files are configured with W permissions, they cannot be written to Oh! |
Exec/noexec Can run/not run |
Is it possible to restrict "run" work within this file system? If it is purely to store data, then can be configured as noexec will be more secure, relative, will be more troublesome! |
User/nouser Allow/disallow users to Mount |
Do you want to allow users to mount with the Mount command? In general, we certainly do not want the generic user to be able to use mount, because it is too insecure, so this should be configured as Nouser! |
Suid/nosuid has/does not have SUID permissions |
Does the file system allow the presence of SUID? If you are not running the file drop directory, you can also configure it as Nosuid to cancel this feature! |
Usrquota |
Note that the name is " Usrquota " Do not misspell the wrong! This is the boot filesystem support disk quota mode, more data we'll talk about in the fourth chapter. |
Grpquota |
Note the name is "Grpquota" and starts filesystem support for the group disk quota mode. |
Defaults |
It also has rw, suid, dev, exec, auto, nouser, async and other parameters. Basically, using the defaults configuration by default is possible! |
Column Five: Can be the dump backup command function:
Dump is a command used as a backup (we'll talk about this command in the 25th chapter of the backup strategy), and we can specify which filesystem must be dump backed up through Fstab! 0 means do not do dump backup, 1 represents the daily dump action. 2 also represents other variable date dump backup actions, usually this value is not 0 is 1!
Column Six: Whether to test the sector with FSCK:
During startup, the system defaults to fsck to verify that our filesystem is complete (clean). However, some filesystem do not need to be tested, such as memory replacement space (swap), or special file systems such as/proc and/sys, and so on. So, in this field, we can configure whether to test the filesystem with fsck. 0 is not to test, 1 means the earliest test (usually only the root directory will be configured to 1), 2 is to be tested, but 1 will be more early test! In general, the root directory is configured to 1, and the other filesystem to be tested are configured to be 2.
/etc/fstab is the configuration file at startup, however, the actual filesystem is recorded in the two files/etc/mtab and/proc/mounts. Each time we change the filesystem, we also change the two files.
However, in case of the data you entered in the/etc/fstab error, resulting in the failure to successfully start the success, and into the single maintenance mode, then the/but read only state, of course, you can not modify the/etc/fstab, can not upgrade/etc/mtab what to do? It doesn't matter, you can use the following trick:
[Email protected] ~]# mount-n-o REMOUNT,RW/
Start mount [Go]