红联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. larmbr 于 2012-05-04 15:02:51发表:

    感谢分享,学习了,谢谢!!!

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

    a

  3. tan19880105 于 2012-04-09 17:49:06发表:

    a

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

    a

  5. tan19880105 于 2012-04-09 17:49:03发表:

    a

  6. tan19880105 于 2012-04-09 17:49:01发表:

    a

  7. tan19880105 于 2012-04-09 17:48:59发表:

    a

  8. tan19880105 于 2012-04-09 17:48:58发表:

    a

  9. tan19880105 于 2012-04-09 17:48:56发表:

    a

  10. tan19880105 于 2012-04-09 17:48:52发表:

    a

  11. tan19880105 于 2012-04-09 17:48:50发表:

    a

  12. tan19880105 于 2012-04-09 17:48:48发表:

    a

  13. tan19880105 于 2012-04-09 17:48:44发表:

    a

  14. tan19880105 于 2012-04-09 17:48:42发表:

    a

  15. tan19880105 于 2012-04-09 17:48:41发表:

    a

  16. tan19880105 于 2012-04-09 17:48:39发表:

    a

  17. tan19880105 于 2012-04-09 17:48:38发表:

    a

  18. tan19880105 于 2012-04-09 17:48:36发表:

    a

  19. tan19880105 于 2012-04-09 17:48:35发表:

    a

  20. tan19880105 于 2012-04-09 17:48:33发表:

    a

  21. tan19880105 于 2012-04-09 17:48:31发表:

    a

  22. tan19880105 于 2012-04-09 17:48:26发表:

    a

  23. tan19880105 于 2012-04-09 17:48:25发表:

    a

  24. tan19880105 于 2012-04-09 17:48:23发表:

    a

  25. tan19880105 于 2012-04-09 17:48:21发表:

    a

  26. tan19880105 于 2012-04-09 17:48:19发表:

    a

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

    a

  28. tan19880105 于 2012-04-09 17:48:16发表:

    a

  29. tan19880105 于 2012-04-09 17:48:14发表:

    a

  30. tan19880105 于 2012-04-09 17:48:12发表:

    a

  31. tan19880105 于 2012-04-09 17:48:09发表:

    a

  32. tan19880105 于 2012-04-09 17:48:07发表:

    a

  33. tan19880105 于 2012-04-09 17:48:05发表:

    a

  34. tan19880105 于 2012-04-09 17:48:04发表:

    a

  35. tan19880105 于 2012-04-09 17:48:02发表:

    a

  36. tan19880105 于 2012-04-09 17:48:01发表:

    a

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

    a

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

    a

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

    a

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

    a