The content of linux/etc/fstab mainly includes six items: for example, the following two lines: LABEL/ext3defaults11/dev/sda2/mnt/D/vfatdefaults00 first column: device Name or device volume name (/dev/sda10 or LABEL/) column 2: Device Mount Directory (for example, the above/or/mnt/D/) column 3: device file system
Linux/etc/fstab contains six items:
For example, the following two rows:
LABEL = // ext3 defaults 1 1
/Dev/sda2/mnt/D/vfat defaults 0 0
Column 1: Device name or device volume name (/dev/sda10 or LABEL = /)
Column 2: Device Mount Directory (for example, the above "/" or "/mnt/D /")
Column 3: device file system (for example, the above "ext3" or "vfat ")
Column 4: mount parameters (see Help man 8 mount)
For a mounted device, such as the/dev/sda2 above, you need to change the Mount parameter. you do not need to detach the device,
You can use the following command (the remount parameter is invalid if no mounted device exists)
# Mount/mnt/D/-o remount, ro (change defaults to ro)
To ensure security, you can specify other mount parameters, such:
Noexec,
Even the mount command cannot be used. in this case, only the system is re-built !)
Nodev (device files cannot be mounted)
Nosuid and nosgid (suid and sgid attributes are not allowed)
Nouser)
Column 5: indicates whether to back up data (0 indicates no backup, 1 indicates backup, and generally the root partition must be backed up)
Column 6: indicates the order of self-check (0 indicates no self-check, 1 or 2 indicates self-check. if the root partition is set to 1, other partitions can only be 2)
My Red Hat Enterprise Linux AS 4/etc/fstab example:
-------------------------- File begin ------------------------------------------------------
# This file is edited by fstab-sync-see 'Man fstab-sync' fordetails
/Dev/hda1/boot ext3 defaults 1 2
/Dev/hda2/data ext3 defaults 1 2
/Dev/hda3/ext3 defaults 1 1
/Dev/hda5/oracle ext3 defaults 1 2
/Dev/hda6/home ext3 defaults 1 2
/Dev/hda7 swap defaults 0 0
None/dev/pts devpts gid = 5, mode = 620 0 0
None/dev/shm tmpfs defaults 0 0
None/proc defaults 0 0
/Dev/hdc/media/cdrom1 auto pamconsole, exec, noauto, managed 0 0
-------------------------- File end -------------------------------------------------------