When you move the /usr/lib directory to another location (due to lack of diskspace for instance) and replace them with symlinks to the new location, lots and lots of Gentoo packages fail to build, because many libraries can no longer be found by the system. The source of the problem is that /usr/lib contains many relative symlinks. For example: lrwxrwxrwx 1 root root 20 Jun 29 09:50 /usr/lib/libdl.so -> ../../lib/libdl.so.2 This symlink will break as soon as /usr/lib is moved to /mnt/more_space/lib for instance, because the symlink will no longer point to /lib but to /mnt. IMHO Gentoo Linux policy should be to not use relative paths in symlinks, or *at least* to have portage check if /usr/lib is not a symlink before emerging an ebuild, and display a clear warning when this is the case. Reproducible: Always Steps to Reproduce: 1. move /usr/lib to another location 2. replace /usr/lib with symlink to new location 3. ldconfig -v will display errors. Actual Results: Many ebuilds failed to build, lots of compiler/linker errors. Expected Results: * A clear error message indicating what the problem is
> When you move the /usr/lib directory to another location then you should use mount --bind instead symlinks.
Symlinking is wholly inappropriate. Either: 1) Migrate the contents of /usr/lib to an independent filesystem then mount the filesystem at /usr/lib 2) Bind mount the new location to /usr/lib (mount -o bind /mnt/more_space/lib /usr/lib) Suggesting that symlinks should not be used in a useful context so that a user-imlemented symlink may be used in a daft context or that portage should be modified on account of this will almost certainly be given short shrift.
I am totally unfamiliar with the bind option of mount, and when I look at the Gentoo forums, I see that am not the only one why screwed the system by symlinking. It would be really nice for me and other users who are unfamiliar with the mount trick, to display a hint that says using symlinks will probably cause portage to fail.
Did you have to manually redo all of the symlinks? I just did the same thing.
*** Bug 134506 has been marked as a duplicate of this bug. ***
*** Bug 126873 has been marked as a duplicate of this bug. ***
*** Bug 154934 has been marked as a duplicate of this bug. ***
*** Bug 184862 has been marked as a duplicate of this bug. ***
What is considered the appropriate place to perform a bind mount of /usr? Is it supported to have /usr be a symlink during initial booting and then overlay it with a mount --bind once local.start runs? I'd rather not make usr its own partition, but it won't fit on the root...
(In reply to comment #9) > What is considered the appropriate place to perform a bind mount of /usr? /etc/fstab supports bind mounts just fine :)