实验09.设置自定义触发挂载

     实验目标

         将分区/dev/sdb2配置触发挂载监控+访问为/data/tools

tools –fstpe=ext3  /dev/sdb2

         访问/data/tools查看是否有分区/dev/sdb2的文档

         检查已挂载的文件系统查看触发挂载结果

 

     实验环境

在虚拟机Linux系统下已经划分好的磁盘分区并且格式化过。

1       将分区/dev/sdb2配置触发挂载

 

/data   /etc/tools.misc     // 在/etc/auto.master

tools   -fstype=ext3    :/dev/sdb2 //在/etc/tools.misc

 

 

2       访问/misc/tools 查看分区文档

 

[root@localhost ~]# cd /data/tools

bash: cd: /data/tools: 没有那个文件或目录

[root@localhost ~]# service autofsrestart

停止 automount                                           [确定]

启动 automount                                           [确定]

[root@localhost ~]# cd /data/tools

[root@localhost tools]# ls

lost+found

 

3       检查已挂载的文件系统查看触发挂载结果

 

 

[root@localhost tools]# mount

/dev/sda2 on / type ext3 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts(rw,gid=5,mode=620)

/dev/sda1 on /boot type ext3 (rw)

tmpfs on /dev/shm type tmpfs (rw)

/dev/sdb1 on /home type ext3 (rw)

none on /proc/sys/fs/binfmt_misc typebinfmt_misc (rw)

none on /proc/fs/vmblock/mountPointtype vmblock (rw)

sunrpc on /var/lib/nfs/rpc_pipefs typerpc_pipefs (rw)

/dev/hdc on /media/RHEL_5.9 x86_64 DVDtype iso9660 (ro,nosuid,nodev,uid=0)

/dev/sdb2 on/data/tools type ext3 (rw)   //触发挂载