when someone accidentally did

cd /

mv * /mnt/

Thus, suppose you have an empty root, and normal unix filesystem layout in /mnt

You can’t do chroot. You even cannot run /mnt/bin/cp, to copy it all back to filesystem root.

it is however still possible to recover system without rebooting machine and booting from livcd/liveusb

first, export new library path:

LD_LIBRARY_PATH=/mnt/lib:/mnt/lib64:/mnt/usr/lib:/mnt/usr/lib64:$LD_LIBRARY_PATH

then, run cp with ld-linux loader like this:

/mnt/lib64/ld-linux-x86-64.so.2 /mnt/bin/cp -a /mnt/lib64 /

#unix #chroot #os #system #path #bash #fs

բնօրինակ սփիւռքում(եւ մեկնաբանութիւննե՞ր)

unix  chroot  os  system  path  bash  fs