[conspire] symlinks vs mount --bind [Re: Partitioning revisited briefly]

Tony Godshall tony at of.net
Sun Oct 17 17:21:00 PDT 2010

> In some cases, symlinking /usr/local/src/foo/bar to, say, /root/bar is
> just less awful than symlinking to ../../../root/bar (as you say) -- but
> ../usr/local/opt/ as a target is certainly more than tolerable.

A little off the direct topic, but using symlinks can cause trouble-
I've been using mount --bind lately instead of symlinks since I've
found a couple of instances[1][2] where symlinking gave trouble.

You (Rick) certainly don't need an example, but here's an example of
converting a symlink to a bind-mount for those who aren't old hands:

# ls -l /usr
lrwxrwxrwx   1 root root     12 2010-07-18 21:15 /usr -> /raid488/usr
# mv /usr /usr.old && mkdir /usr && mount --bind /raid488/usr /usr
# cat /etc/mtab |grep usr
/raid488/usr /usr none rw,bind 0 0
# cat /etc/mtab |grep usr >> /etc/fstab

I was a little reckless and didn't go to runlevel 1 before doing this
but didn't suffer any harmful effects (yet)


[1] AppArmour on last couple of revs of Ubuntu- broke network-manager
IIRC when I moved /usr from its original partition to a larger one and
/usr was made a symlink.

[2] vsftpd on a legacy system would not follow symlinks- it was a
security "feature"

More information about the conspire mailing list