所以...我想删除位于 /dev/dm-0 的交换文件。我不小心删除了整个 /dev/dm-0 目录,而不是交换文件。
有什么办法可以重新安装吗?
我尝试安装 extundelete 来恢复它。我需要输入分区的名称,但我不知道那里是否有正确的名称。我输入了 /dev/sda2/ 并使用 fsck 卸载了它,然后运行了下面的命令。无论如何,我认为它不起作用。请帮助我 (ELI5)!Ubuntu 20.04 LTS。
root@server:~# sudo extundelete --restore-directory /dev/dm-0/ /dev/sda2
NOTICE: Extended attributes are not restored.
Loading filesystem metadata ... 61 groups loaded.
Loading journal descriptors ... 3459 descriptors loaded.
Failed to restore file /dev/dm-0/
Could not find correct inode number past inode 2.
Try altering the filename to one of the entries listed below.
File name | Inode number | Deleted status
. 2
.. 2
lost+found 11
config-4.15.0-135-generic 6146
grub 10241
config-5.4.0-65-generic 6150
System.map-4.15.0-135-generic 6145
vmlinuz-4.15.0-135-generic 6147
initrd.img-4.15.0-135-generic 6152
vmlinuz-5.4.0-65-generic 6151
System.map-5.4.0-65-generic 6148
initrd.img-5.4.0-65-generic.new 6153 Deleted
initrd.img-5.4.0-65-generic 6153
initrd.img-5.4.0-65-generic.dpkg-bak 6149 Deleted
initrd.img-4.15.0-135-generic.new 6152 Deleted
extundelete: Operation not permitted while restoring directory.
extundelete: Operation not permitted when trying to examine filesystem
root@server:~# ls /dev/dm-0
ls: cannot access '/dev/dm-0': No such file or directory