cb@coreboot-bm-4:~$ pwd /home/cb cb@coreboot-bm-4:~$ sudo mv /* ADL-P/
and now I can't do anything
when I try something like:
cb@coreboot-bm-4:~$ ls -bash: /bin/ls: No such file or directory
The problem is not only the the binaries in
/usr/bin are moved. But even if you run them directly, they won't be able to find their libraries. In other words,you won't be able to move back
/ from that shell.
Many VM providers offer you the option to mount a rescue system, or other ISO. If you can upload your own ISO, I recommend: https://www.system-rescue.org/. Or use an installer ISO and try to access the shell.
For example, the standard Debian installer offers "rescue mode" by selecting
Advanced options ->
Rescue mode. Click through the dialogs and when it asks which filesystem root to use select
Do not use a root filesystem and
Execute a shell in the installer environment.
Regardless if you used debian, systemrescuecd or any other method. Once you have a shell:
mkdir -p /mnt/root && mount /dev/vda1 /mnt/root. (replace
/dev/vda1 with the actual device!)
mv /mnt/root/ADL-P/* /mnt/root
In some rescue shells, like the debian one, you can get an error:
Can't rename ... : Directory not empty. Only in that case you need to use the
mv -n /mnt/root/ADL-P/* /mnt/root
reboot (perhaps you need to manually remove the ISO from your provider's dashboard)
Try /ADL-P/usr/bin/sudo /ADL-P/usr/bin/mv /ADL-P /
Edit: Just found this one https://askubuntu.com/questions/951134/accidentally-moved-usr-bin