一、挂载,卸载
挂载:将新的文件系统关联至当前根文件系统
卸载:将某文件系统与当前根文件系统的关联关系移除
cat /etc/mtab 存储着已经挂载的文件系统 (跟 mount 一样)
mount:显示当前系统已经挂载的设备及挂载点
mount [options] [-o options] DEVICE MOUNT_POINT
设备:
设备文件:/dev/sda5
卷标:LABEL=""UUID: UUID=""挂载点:目录
要求:1、此目录没有被其他进程使用;2、目录得事先存在;3、目录中的原有的文件将会暂时隐藏;
选项:-a:表示挂载/etc/fstab文件中定义的所有文件系统-n:默认情况下,mount命令每挂载一个设备,都会把挂载的设备信息保存到/etc/mtab.加了-n就不写入/etc/mtab中-r:以只读方式挂载-w:以读写的方式挂载-L:指明卷标-U:用UUID挂载-t:指明文件系统类型,默认通过blkid来识别指定-o:指定挂载时候选项的内容
async All I/O to the filesystem should be done asynchronously. (See also the syncoption.)
atime Update inode accesstime for each access. See also the strictatime mountoption.
noatime
Do not update inode access times on this filesystem (e.g,forfaster access on the news spool
to speed up news servers).
auto Can be mounted with the-a option.
noauto Can only be mounted explicitly (i.e., the-a option will not cause the filesystem to be
mounted).
context=context, fscontext=context, defcontext=context and rootcontext=context
The context= option is useful when mounting filesystems that donot support extended
attributes, such as a floppy or hard disk formatted with VFAT, or systems that are not nor-mally running under SELinux, such as an ext3 formatted disk from a non-SELinux workstation.
You can also use context= on filesystems you do not trust, such as a floppy. It also helps incompatibility with xattr-supporting filesystems on earlier 2.4.kernel versions. Even where
xattrs are supported, you can savetime not having to label every fileby assigning the entire
disk one security context.
A commonly used optionfor removable media is context=system_u:object_r:removable_t.
Two other options are fscontext= and defcontext=, both of whichare mutually exclusive of the
context option. This means you can use fscontext and defcontext with each other, but neither
can be used with context.
The fscontext= option works for all filesystems, regardless of their xattr support. The fscon-text option sets the overarching filesystem label to a specific security context. This
filesystem label is separate from the individual labels on the files. It represents the entire
filesystemfor certain kinds of permission checks, such as during mount or filecreation.
Individualfilelabels are still obtained from th