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
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.
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)
*** Bug 51576 has been marked as a duplicate of this bug. ***
*** Bug 68477 has been marked as a duplicate of this bug. ***
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.
*** Bug 20167 has been marked as a duplicate of this bug. ***
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 ?
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 ...
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?
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.
seemant: could you update coreutils for us ? the symlinks should be changed from '../../bin/prog' to '/bin/prog'
err seemant: please see comment #11
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?
ln -sf ${ROOT}/usr/bin/blah ${ROOT}/bin/blah ??
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)
5.2.1-r3 uses absolute symlinks