红联Linux门户
Linux帮助

Linux下挂载光盘

发布时间:2006-09-23 16:34:39来源:红联作者:严寒
原始配置文件:
auto.master:
[code]#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 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 --timeout=60
#/misc /etc/auto.misc
#/net /etc/auto.net[/code]

auto.misc:
[code]#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd[/code]

如果你挂载光盘的目录为/media/cdrom,那么配置文件应该是:
auto.master:
[code]#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 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).
/media /etc/auto.misc --timeout=60 ##指向/目录下的media目录。
#/misc /etc/auto.misc
#/net /etc/auto.net[/code]
auto.misc:
[code]#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cdrom -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom ##我的/dev/cdrom指向的是/dev/hdc,所以这里也可以写成/dev/hdc
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd[/code]
如果光盘已经放入光驱,这里只需要:#service autofs start/restart就可以实现光盘挂载了。
文章评论

共有 51 条评论

  1. tan19880105 于 2012-04-09 17:47:49发表:

    a

  2. tan19880105 于 2012-04-09 17:47:47发表:

    a

  3. tan19880105 于 2012-04-09 17:47:45发表:

    a

  4. tan19880105 于 2012-04-09 17:47:44发表:

    a

  5. tan19880105 于 2012-04-09 17:47:42发表:

    a

  6. tan19880105 于 2012-04-09 17:47:39发表:

    a

  7. tan19880105 于 2012-04-09 17:47:32发表:

    a

  8. tan19880105 于 2012-04-09 17:47:29发表:

    a

  9. tan19880105 于 2012-04-09 17:47:27发表:

    a

  10. tan19880105 于 2012-04-09 17:47:25发表:

    a

  11. tan19880105 于 2012-04-09 17:47:19发表:

    a