Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55620 - symlinks /usr/bin pointing to ../../bin bad when /usr resides on a separate filesystem
Summary: symlinks /usr/bin pointing to ../../bin bad when /usr resides on a separate f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 20167 51576 68477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-29 14:44 UTC by Ali Ijaz Sheikh
Modified: 2004-12-21 20:29 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Ijaz Sheikh 2004-06-29 14:44:02 UTC
Many utilities in /usr/bin are symlinks to the real instances in /bin however
the files are symlinked as /usr/bin/<util> -> ../../bin/<util>.  For example:


(root@gravity:~)# ls -l /usr/bin/echo
lrwxrwxrwx    1 root     root           14 Jun 20 18:20 /usr/bin/echo -> ../../bin/echo

However, the symlink fails to work when the /usr filesystem resides on a different partition than the /bin directory.  For example, I mount a filesysterm called /v0 which has my usr and home directories.  /usr is a symlink to /v0/usr. 

Suggested fix is to provide the absolute tool location rather than the relative path.


Reproducible: Always
Steps to Reproduce:
1.mount the usr filesystem somewhere other than /
2.execute /usr/bin/echo
3.fail

Actual Results:  
zsh: no such file or directory: /usr/bin/echo

Expected Results:  
executed echo properly
Comment 1 Mr. Bones. (RETIRED) gentoo-dev 2004-06-29 16:49:54 UTC
My understanding of things leads me to believe that you're not supposed to
be mounting /usr on some other place and symlinking but instead mounting /v0/usr
directly on /usr but I could be wrong.  I'll let someone in base-system talk
more about this.
Comment 2 SpanKY gentoo-dev 2004-06-29 17:19:31 UTC
absolute links fail under 'odd' mounting scenarios just as you can show that relative symlinks fail under your 'odd' scenario

if you have /usr on a different partition then mount it onto /usr or utilize the `mount --bind` hack (mount --bind /v0/usr /usr)
Comment 3 SpanKY gentoo-dev 2004-08-02 19:38:15 UTC
*** Bug 51576 has been marked as a duplicate of this bug. ***
Comment 4 SpanKY gentoo-dev 2004-10-21 18:04:32 UTC
*** Bug 68477 has been marked as a duplicate of this bug. ***
Comment 5 Prenom Nom 2004-10-29 04:42:08 UTC
Suggested workaround, usefull for unexperienced gentoo installer :
In the web site http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=4, modify the following paragraph :
"However, multiple partitions have one big disadvantage: if not configured properly, you might result in having a system with lots of free space on one partition and none on another."
by adding to this sentence the following new sentence :
"Do not try to circumvent this disadvantage by putting, e.g., /var/tmp/portage in the partition of /home with a symbolic link, it may break the gentoo ; more generally, user-added symlink in the gentoo filesystem are dangerous because many gentoo-generated symlink rely on the folder name .. (two dots, for the parent folder)."

Of course, this sentence can be abridged by a native english speaker (my english is not very good).

This suggestion is not a fix, but rather a useful workaround.
Comment 6 SpanKY gentoo-dev 2004-10-30 19:36:10 UTC
*** Bug 20167 has been marked as a duplicate of this bug. ***
Comment 7 Prenom Nom 2004-10-31 03:14:58 UTC
Please, if you are author of the page http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=4,
could you add to this page a sentence saying that user-added symlinks are not possible in the system-part of gentoo ?

There is already four first-time gentoo installers who have been disapointed because this symlink problem is not documented !


Would it be possible to reassign this bug to Sven Vermeulen <swift@gentoo.org> or to docs-team@gentoo.org ?
Comment 8 SpanKY gentoo-dev 2004-10-31 03:23:29 UTC
actually, i think we're moving away from the relative stuff ...

ive been looking into other distro's and they all seem to use absolute links when going across parent trees ... looked at redhat/fedora/slackware/debian ...
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2004-10-31 05:14:12 UTC
Isn't it rather trivial that user-made changes to Gentoo can break Gentoo if the changes aren't well thought off? I mean, where would we stop if we started documenting what users shouldn't do?
Comment 10 Prenom Nom 2004-11-01 04:30:15 UTC
Sven> I mean, where would we stop if we started documenting what users shouldn't do?
You may stop where there is no bug-report with XXX duplicates.

For this particular symlink bug-report, it should be sufficient to recommend in the documentation the /+/boot+swap configuration to gentoo-beginners without plenty of disk space.
Comment 11 SpanKY gentoo-dev 2004-11-24 09:01:49 UTC
seemant: could you update coreutils for us ?

the symlinks should be changed from '../../bin/prog' to '/bin/prog'
Comment 12 SpanKY gentoo-dev 2004-11-24 09:02:23 UTC
err seemant: please see comment #11
Comment 13 Seemant Kulleen (RETIRED) gentoo-dev 2004-11-24 12:42:13 UTC
spanky, yep, I'm working on a new coreutils release. However, this sort of concerns me -- if you install into ROOT=/some/other/place will it link to the wrong ones?
Comment 14 Chris Gianelloni (RETIRED) gentoo-dev 2004-11-24 15:28:33 UTC
ln -sf ${ROOT}/usr/bin/blah ${ROOT}/bin/blah ??
Comment 15 SpanKY gentoo-dev 2004-11-29 17:47:01 UTC
no to both the last comments

yes, the symlinks in $ROOT will be pointing to things in /, but really that doesnt matter with binaries (since you would be running them)
Comment 16 SpanKY gentoo-dev 2004-12-21 20:29:00 UTC
5.2.1-r3 uses absolute symlinks