linux根目录被移动走了怎么办

今天本来打算把yum源移走一下,结果命令输入成了 mv /* /mnt,然后整个人都不好了

所有命令都没有用了

[root@localhost yum.repos.d]# ls
CentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo
[root@localhost yum.repos.d]# mv /* /mnt/
mv: cannot move ‘/boot’ to ‘/mnt/boot’: Device or resource busy
mv: cannot move ‘/dev’ to ‘/mnt/dev’: Device or resource busy
mv: cannot move ‘/home’ to ‘/mnt/home’: Device or resource busy
mv: cannot move ‘/mnt’ to a subdirectory of itself, ‘/mnt/mnt’
mv: cannot move ‘/proc’ to ‘/mnt/proc’: Device or resource busy
mv: cannot move ‘/run’ to ‘/mnt/run’: Device or resource busy
mv: cannot move ‘/sys’ to ‘/mnt/sys’: Device or resource busy
[root@localhost yum.repos.d]# ls
-bash: /usr/bin/ls: No such file or directory
[root@localhost yum.repos.d]# ls
-bash: /usr/bin/ls: No such file or directory

去网上寻求解决方法看了一篇博文https://blog.csdn.net/mayao11/article/details/7692350

他上面有一个方法

/ztmp/lib/ld-linux.so.2 --library-path /ztmp/lib /ztmp/bin/cp -rfp /ztmp/* /

---------------------

本文来自 善良的兽人Goodorc 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/mayao11/article/details/7692350?utm_source=copy 

然后我发现lib下并没有这玩应。。。原来我是64位的

[root@localhost etc]# /mnt/lib64/ld-linux-x86-64.so.2 --library-path /mnt/lib /mnt/bin/cp -rvf /mnt/* /
-rvf: error while loading shared libraries: -rvf: cannot open shared object file: No such file or directory

并没有用。。靠

然后发现额。。。原来后面也应该是lib64......

[root@localhost mnt]# lib64/ld-linux-x86-64.so.2 --library-path lib64/ bin/cp -rfp /mnt/* /
[root@localhost mnt]# ls
bin  etc  lib  lib64  media  opt  root  sbin  srv  tmp  usr  var

64位下linux应该是

你动到的地址/lib64/ld-linux-x86-64.so.2 --library-path 你移动到的地址/lib64/ 你移动到的地址/bin/cp -rfp /mnt/* /

 

你可能感兴趣的:(其他)