Sys 文件已删除 (rm -rf /*) 帮助

0 linux rm

今天我通过运行犯了一个错误:

rm -rf /*
0200:00/power/control': Operation not permitted
rm: cannot remove /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:01/PNP0200:00/power/runtime_suspended_time': Operation not permitted
Run Code Online (Sandbox Code Playgroud)

所以现在我不能使用任何命令甚至reboot不起作用。

root@HLCommunity12:/var/www# ls
-bash: /bin/ls: No such file or directory
root@HLCommunity12:/var/www# ps x
-bash: /bin/ps: No such file or directory
root@HLCommunity12:/var/www# cd
-bash: cd: /root: No such file or directory
root@HLCommunity12:/var/www# umount /dev/sdb
-bash: umount: command not found
root@HLCommunity12:/var/www# grub-install '(hd0)'
-bash: /usr/sbin/grub-install: /bin/sh: bad interpreter: No such file or directory
root@HLCommunity12:/var/www# fsck /dev/sda1
-bash: fsck: command not found
root@HLCommunity12:/var/www# umount /home
-bash: umount: command not found
root@HLCommunity12:/var/www# apt-get
-bash: /usr/bin/apt-get: No such file or directory
root@HLCommunity12:/var/www# yum
-bash: yum: command not found
root@HLCommunity12:/var/www# chmod ugo+w .
-bash: /bin/chmod: No such file or directory
root@HLCommunity12:/var/www# grep -a -C 500 'known pattern' /dev/sda | tee /tmp/recover
-bash: grep: command not found
-bash: /usr/bin/tee: No such file or directory
root@HLCommunity12:/var/www# init=/bin/bash
root@HLCommunity12:/var/www# mount -rw -o remount /
-bash: mount: command not found
root@HLCommunity12:/var/www# pwconv
-bash: /usr/sbin/pwconv: No such file or directory
root@HLCommunity12:/var/www# reboot
-bash: reboot: command not found
Run Code Online (Sandbox Code Playgroud)

Joh*_*ohn 8

是的,你已经破坏了你的系统。重新安装操作系统并恢复备份。

  • @dev0L 您可以从错误中吸取教训。根据我的经验,我建议有一个单独的 `/home` 分区,因此重新安装操作系统可以让您保留文件,但是 1) 为时已晚,2) 在这种情况下可能无法正常工作。并且永远记住备份。 (3认同)
  • 可能有一些“取消删除”实用程序可用,但在这一点上,使用它们会比重新安装/恢复更麻烦并且花费更多时间,尤其是考虑到您必须一次有效地取消删除整个系统一个文件。 (2认同)