首页 > 应用开发 > IT综合 > 自动挂载u盘到根目录
1,修改/etc/auto.master 文件:
增加下面一行:/- /etc/auto.direct
具体例子为:
[root@tonykorn97 /]# cat /etc/auto.master
#
# $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
/misc /etc/auto.misc
/net -hosts
/- /etc/auto.direct
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
[root@tonykorn97 /]#
2,新建立/etc/auto.direct文件
[root@tonykorn97 /]# cat /etc/auto.direct
/backup -fstype=auto :/dev/sdb1
[root@tonykorn97 /]#
3,重启autofs文件
[root@tonykorn97 /]# service autofs restart
停止 automount: [确定]
启动 automount: [确定]
[root@tonykorn97 /]#
4,通过cd /backup到达U盘目录中。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/312079/viewspace-1007217/ ,如需转载,请注明出处,否则将追究法律责任。