![恢复 $HOME 目录中的单个文件](https://linux22.com/image/39596/%E6%81%A2%E5%A4%8D%20%24HOME%20%E7%9B%AE%E5%BD%95%E4%B8%AD%E7%9A%84%E5%8D%95%E4%B8%AA%E6%96%87%E4%BB%B6.png)
我不小心跑了rm -r /home/xralf
,很快就用Ctrl+杀死了它C。
似乎一切都很好,但我注意到对.vimrc
我来说很重要的 my 丢失了。
我尝试了命令:
$ extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
extundelete: failed to read-only open device "/dev/sda5": Error code 13
要恢复文件,但似乎有问题,我需要卸载设备。
它安装在这里:/dev/sda5 on /home type ext4 (rw)
- 是否有可能恢复该文件
.vimrc
? - 你会如何重新安装它?我需要目录时出现问题
$HOME
。
我无法使用LiveCD
,因为它现在在我的笔记本电脑上丢失了。USB
我的笔记本电脑也不支持从以下位置启动。
使用以下命令运行命令sudo
:
sudo extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
WARNING: Extended attributes are not restored.
WARNING: EXT3_FEATURE_INCOMPAT_RECOVER is set.
The partition should be unmounted to undelete any files without further data loss.
If the partition is not currently mounted, this message indicates
it was improperly unmounted, and you should run fsck before continuing.
If you decide to continue, extundelete may overwrite some of the deleted
files and make recovering those files impossible. You should unmount the
file system and check it with fsck before using extundelete.
Would you like to continue? (y/n)
答案1
Error code 13
是EACCES
- 访问冲突。
您无权从设备读取。以超级用户身份运行命令,即 use sudo extundelete ...
。
答案2
该错误是因为您的 sda 是 ext4 而您正在尝试使用 ext3