[默认] 在Linux中mount目录到另一个目录

Dec 12th, 2008

转载本站文章请注明,转载自:扶凯[http://www.php-oa.com]

本文链接: http://www.php-oa.com/2008/12/12/%e5%9c%a8linux%e4%b8%admount%e7%9b%ae%e5%bd%95%e5%88%b0%e5%8f%a6%e4%b8%80%e4%b8%aa%e7%9b%ae%e5%bd%95.html

有个比较破,但又不得不用的软件.它的目录都没法修改,但是空间又太少了.本来想用ls -n软链接一个目录到他原来的目录,但不能启动,报错

Too many levels of symbolic links for directory

软链接不行就硬链接吧…也不行.nnd

ln: `/data/files/’: hard link not allowed for directory
 

没法子,只有出杀手锏了

mount –bind /data/files /files

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
Tags: ,
  1. yxcx
    Aug 6th, 2009 at 16:11
    Reply | Quote | #1

    你这招太狠了
    学习啦
    今天我也遇到Too many levels of symbolic links for directory
    呵呵

  2. admin
    Aug 6th, 2009 at 16:26
    Reply | Quote | #2

    不错不错

  3. root
    Nov 27th, 2009 at 18:32
    Reply | Quote | #3

    似乎少了一个“-”。以下节选自man mount :
    The bind mounts.
    Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is
    mount –bind olddir newdir
    or fstab entry is:
    /olddir /newdir none bind

    After this call the same contents is accessible in two places. One can also remount a single file (on a single file).

    This call attaches only (part of) a single filesystem, not possible submounts. The entire file hierarchy including submounts is attached a second
    place using
    mount –rbind olddir newdir

    Note that the filesystem mount options will remain the same as those on the original mount point, and cannot be changed by passing the -o option
    along with –bind/–rbind.

  4. root
    Nov 27th, 2009 at 18:37
    Reply | Quote | #4

    抱歉,上文中除了-o 之外其他单个的“-”都应该是“–”。不知为何从man里直接粘贴过来就少了一个“-”

  5. root
    Nov 27th, 2009 at 18:40
    Reply | Quote | #5

    真郁闷。连续两个“-”一发布就变成了一个“-”。这什么破系统啊!

  6. jevaempitte
    Mar 16th, 2010 at 17:22
    Reply | Quote | #6

    Enjoying reading the posts here, thanks.