Chinaunix

标题: 挂载问题 [打印本页]

作者: wy26464    时间: 2012-05-29 07:06
标题: 挂载问题
linux装在虚拟机上   mount 显示光盘挂载在/media下  可是/etc/fstab中没有这个挂载  /etc/auto.master中光盘挂载在/misc中  这是什么情况?
作者: dooros    时间: 2012-05-29 16:14
/etc/fstab
的cdrom的挂载是这样写的

/dev/xxx   /media/cdrom0   udf,iso9660  user,noauto  0  0

作者: dooros    时间: 2012-05-29 16:15
一般是插入光盘后自动挂载。
作者: ulovko    时间: 2012-05-29 16:24
回复 1# wy26464

  1. 以前的笔记,供您参考!
  2. > cat nfs.txt
  3. # NFS (Network FileSystem)
  4. # NFS ==> nfs-utils
  5. RPC(Remote Procedure Call) rpc.nfsd rpc.mountd rpc.lockd rpc.statd
  6. # ===> ATTENTION: <===
  7. # Replace x with an unused port number
  8. vim /etc/sysconfig/nfs
  9. MOUNTD_PORT="x" STATD_PORT="x" LOCKD_TCPPORT="x" LOCKD_UDPPORT="x"

  10. #  To configure a firewall to allow NFS:
  11. 1.Allow TCP and UDP port 2049 for NFS.
  12. 2.Allow TCP and UDP port 111 (portmap/sunrpc).
  13. 3.Allow the TCP and UDP port specified with MOUNTD_PORT="x"
  14. 4.Allow the TCP and UDP port specified with STATD_PORT="x"
  15. 5.Allow the TCP port specified with LOCKD_TCPPORT="x"
  16. 6.Allow the UDP port specified with LOCKD_UDPPORT="x"
  17. RQUOTAD_PORT="4005"
  18. STATD_OUTGOING_PORT="4006"

  19. /etc/exports                (NFS file systems being exported (for Kernel based NFS)
  20. /usr/sbin/exportfs        (Maintain list of NFS exported file systems)
  21. /usr/sbin/showmount        (show mount information for an NFS server)
  22. /var/lib/nfs/etab        (Records the NFS shared Dir and Permission)
  23. /var/lib/nfs/xtab        (Client's connection records)
  24. /var/lib/nfs/*.tab

  25. # man exports        (Read the Specification)
  26. vim /etc/exports
  27. /tmp        192.168.0.0/24(ro)        localhost(rw,async)        *.example.com(ro,sync)
  28. /tmp        *(rw,root_squash)
  29. /home/public        192.168.0.0/24(rw)        *(ro)
  30. # all_squash ==> (Map all uids and gids to the anonymous user)
  31. cat /etc/passwd |egrep 'nobody|nfsnobody'
  32. nobody ==> 99
  33. nfsnobody ==> 65534
  34. /home/linux        *.example.com(rw,all_squash,anonuid=99,anongid=99,sync)
  35. # sample /etc/exports file
  36.        /               master(rw) trusty(rw,no_root_squash)
  37.        /projects       proj*.local.domain(rw)
  38.        /usr            *.local.domain(ro) @trusted(rw)
  39.        /home/joe       pc001(rw,all_squash,anonuid=150,anongid=100)
  40.        /pub            (ro,insecure,all_squash)

  41. /etc/init.d/portmap restart
  42. /etc/init.d/nfs restart
  43. /etc/init.d/nfslock restart
  44. rpcinfo -p localhost
  45. cat /var/lib/nfs/etab

  46. showmount -e localhost  
  47. exportfs -arv
  48. exportfs -auv
  49. exportfs -o async django:/usr/tmp
  50. mount -t nfs -o nosuid,noexec,nodev,bg,rw,soft 192.168.0.2:/home/public /home/nfs
  51. mount -t nfs 192.168.0.2:/home/public /home/nfs
  52. #chkconfig netfs on
  53. #service netfs restart
  54. vim /etc/fstab
  55. 192.168.0.2:/home/public        /home/nfs        nfs nosuid,noexec,nodev,bg,rw,soft,rsize=32768,wsize=32768        0 0

  56. # TCP Wrappers Control
  57. vim /etc/hosts.allow
  58. mountd,portmap: 192.168.0.0/255.255.255.0
  59. mountd: 192.168.0.

  60. # AutoMounter for NFS
  61. chkconfig autofs on
  62. service autofs restart
  63. vim /etc/auto.master
  64. /home/guests        /etc/auto.guests        --timeout=60
  65. cp /etc/auto.misc /etc/auto.guests
  66. vim /etc/auto.guests
  67. * -rw,soft,intr        192.168.1.1:/home/guests/&
复制代码

作者: wy26464    时间: 2012-05-29 16:47
我也知道是自动挂载 可是/etc/auto.master显示挂载到/misc中  可是实际上挂载到了/media 下了e回复 3# dooros


   
作者: wy26464    时间: 2012-05-29 16:48
大神 你弄了个nfs。。。。。能不能给我解决一些问题。。。回复 4# ulovko


   
作者: ulovko    时间: 2012-05-29 16:49
回复 7# wy26464


    说真的,我没看明白!所以给你个笔记让你自己研究!
作者: ulovko    时间: 2012-05-29 16:53
本帖最后由 ulovko 于 2012-05-29 17:03 编辑

回复 1# wy26464

    /etc/auto.master中光盘挂载在/misc中


这句话是错误的,光盘挂在哪里您并没有设置 /misc 是配置文件,在里面去配置光盘挂在到哪里!
如果想要自动挂 光盘需要这样做:
  1. > vim /etc/auto.misc
  2. cd               -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
  3. :wq
复制代码
但是,从截图看出您的光盘已经挂上了,所以您打开 /etc/auto.misc里面肯定有这句话!

作者: wy26464    时间: 2012-05-29 17:06
嗯嗯  是有这句话 可是在/etc/auto.master 开头写的是/misc 这不是表示挂载到这个目录下么  在/etc/auto.misc中也没有哪里写有/media 那他是怎么挂到/media下的???谢谢你 呵呵回复 9# ulovko


   
作者: ulovko    时间: 2012-05-29 17:13
回复 10# wy26464


    这是自动的! http://linux.vbird.org/linux_server/0330nfs.php#nfsclient_autofs
作者: wy26464    时间: 2012-05-29 17:19
恩 好的 谢谢了。。。。你有没有鸟哥私房菜中文版的?我下载的怎么都是一部分 不全?回复 11# ulovko


   




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2