自動掛載u盤到根目錄

tonykorn97發表於2008-07-13
想讓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到達隨身碟目錄中。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-1007217/,如需轉載,請註明出處,否則將追究法律責任。

相關文章