J. *_*est 5 encryption boot grub2
我在 1TB SSD 上安装了 Ubuntu 14.04 的加密安装(完整驱动器,不仅是主目录)。我确实知道解密所有内容的密码。现在只是查找文件的问题。这是发生的事情;昨天,在安装了该 SSD 的同一台计算机上,我插入了另一个 SSD 并安装了全新的 Windows 7 Ultimate,以测试 Windows 键盘是否正常工作。确实如此,所以我完成了(没有接触 Ubuntu SSD),关闭计算机,用 Windows 7 拔下 SSD,然后继续正常启动。一旦我这样做了,我就进入了 Grub Rescue“进入救援模式......”并且从那以后一直被困在其中。我整个上午都在环顾谷歌,试图找到一个解决方案来回到 Ubuntu,但我很难过。这就是我
grub rescue> ls
(hd0) (hd0,msdos5) (hd0,msdos1)
grub rescue> ls (hd0)
(hd0): Filesystem is unknown.
grub rescue> ls (hd0,msdos1)
(hd0,msdos1): Filesystem is ntfs.
grub rescue> ls (hd0,msdos5)
(hd0,msdos5): Filesystem is ntfs.
grub rescue> ls (hd0,5)/boot
error: file '/boot' not found.
grub rescue> ls (hd0,1)/boot
error: file '/boot' not found.
grub rescue> ls (hd0,msdos5)/boot
error: file '/boot' not found.
grub rescue> ls (hd0,msdos1)/boot
error: file '/boot' not found.
Run Code Online (Sandbox Code Playgroud)
我确实尝试从引导修复磁盘运行推荐修复,即使应用程序表示该过程成功,也没有任何变化。我不是要双启动这个系统,Ubuntu 是这个 SSD 上唯一的东西。在这一点上,我只是想恢复我的文件。
这是我正在尝试恢复的 /dev/sda:
$ sudo fdisk -l
Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/loop0: 1.3 GiB, 1433468928 bytes, 2799744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2ca9a8a1
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 7 HPFS/NTFS/exFAT
/dev/sda2 1001470 1953523711 1952522242 931G 5 Extended
/dev/sda5 1001472 1953523711 1952522240 931G 7 HPFS/NTFS/exFAT
Run Code Online (Sandbox Code Playgroud)
我已经通过 LiveCD USB 驱动器(在 Trying Ubuntu 中)尝试过 ecryptfs 恢复并得到了这个:
$ sudo ecryptfs-recover-private
INFO: Searching for encrypted private directories (this might take a while)...
find: '/run/user/999/gvfs': Permission denied
find: File system loop detected; 'sys/kernal/debug/pinctrl' is part of the same file system loop as '/sys/kernal/debug'.
Run Code Online (Sandbox Code Playgroud)
看起来它不想找到加密的文件。当我尝试浏览驱动器时,我看到的只是 $RECYCLE.BIN 和 System Volume Information 文件夹。我有大约一半的驱动器装满了东西,所以如果我们能找到我的东西,我正在寻找大约 500GB 的恢复。有人可以帮忙吗?
是用LUKS加密的吗?我已经在 SSD 上的 LUKS 容器中运行 Ubuntu 14.04。启动并运行后,/boot 并未加密,但其他所有内容均已加密。因此 df -h 将 /dev/sda1 报告为 /boot 的源,将 /dev/dm-1 报告为 / 的源。dm-1 的实际容器是 /dev/sda5
如果您确实有 LUKS,您应该能够启动救援磁盘并使用cryptsetup它来访问它。
cryptsetup open <device> <mapping name>
Run Code Online (Sandbox Code Playgroud)
用于打开设备(因此允许我从通过 LiveCD 启动的系统挂载 /dev/sda5)
cryptsetup isLuks <device>会告诉您该设备是否为 LUKS
cryptsetup repair <device>可能会修复你的分区。就我个人而言,我已经通过电子邮件给自己发送了 luks 标头的加密副本,因此如果标头损坏,我仍然可以修复磁盘。
您在 LiveCD 上的 /proc/partitions 中看到了什么?在我看来,尽管分区类型不同,但您的分区设置与我相同。
您可能会发现 sda1 实际上是 /boot,而 sda5 是您的加密驱动器。在我的系统上,fdisk 报告 sda1 和 sda5 的 ID 为 83。您的系统已将其更改为 7。您应该能够将它们更改回来,而不会损坏任何数据。如果他们错了,它可能会混淆引导加载程序,就像您的情况一样。
fdisk /dev/sda t 1 83 t 5 83 w q 应该测试一下。如果它有效,您应该能够像原来一样重新启动。如果没有再次运行,并将分区 1 和 5 上的类型更改回 7,然后您就回到了开始的地方。