Replace /lib on Linux with one command: "rename li lib lib li" (new was "li", old became "libb")
If you need atomicity, make lib a symlink and: mkdir lib_tmp ln -s lib_new lib_tmp/lib mv lib_tmp/lib . rmdir lib_tmp
-
-
Sure, but I needed this on a running system that already had /lib as a directory
-
Yeah, I usually just use a static-linked busybox for stuff like that, but rename is a nice trick.
End of conversation
New conversation -
-
-
Perhaps using a bind mount, replacing the masked directory and then getting rid of the bind mount.
-
How would you replace the directory masked by the bind mount?
-
if your kernel is new enough, just use renameat2() with RENAME_EXCHANGE
-
http://man7.org/linux/man-pages/man2/rename.2.html … - atomic exchange operation
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.