自动挂载u盘到根目录

想让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博客 ” ,链接:http://blog.itpub.net/312079/viewspace-1007217/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/312079/viewspace-1007217/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值