ITPub博客

首页 > 应用开发 > IT综合 > 自动挂载u盘到根目录

自动挂载u盘到根目录

原创 IT综合 作者:tonykorn97 时间:2008-07-13 19:57:53 0 删除 编辑
想让u盘自动挂载到/目录下面的backup文件夹中,具体的操作步骤为:[@more@]

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/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: redhat5 raw 的管理
请登录后发表评论 登录
全部评论

注册时间:2007-12-05

  • 博文量
    1854
  • 访问量
    2088311