在未加密的情况下对 LUKS 驱动器进行映像处理,现在无法挂载

在未加密的情况下对 LUKS 驱动器进行映像处理,现在无法挂载

在对 LUKS 驱动器进行映像时,我意外地在它未加密时对其进行了映像(仅对 sdx1 进行了映像,而不是对整个驱动器进行了映像,sdx2 是启动)。现在它无法安装。我尝试了几乎所有方法来尝试安装它,但都没有成功。它仍然可以通过磁盘工具或 luksOpen 命令解锁和锁定,这可以挽救吗?

我尝试过将映像复制到单独的驱动器、losetup、挂载、挂载映像等。解锁后,它会设置一个循环,但实际上不会挂载任何东西。

在磁盘实用程序中解锁后:

sudo mount -t ext4 diskimg.img /mnt
[sudo] password for user: 
mount: /mnt: /dev/loop5 already mounted or mount point busy.

sudo mount -t ext4 diskimg.img /media
mount: /media: wrong fs type, bad option, bad superblock on                          
/dev/loop32, missing codepage or helper program, or other error.

在磁盘工具中:

Device /dev/mapper/luks-eff2a9f0-4edb-460c-908a-4a3384b0246f
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mapper/luks-eff2a9f0-4edb-460c-908a-4a3384b0246f, missing codepage or helper program, or other error.

我尝试过的:

user@user:~/Documents$ mke2fs -n /dev/sdb1
mke2fs 1.45.7 (28-Jan-2021)
/dev/sdb1 contains a crypto_LUKS file system
Proceed anyway? (y,N) y
Creating filesystem with 30629632 4k blocks and 7659520 inodes
Filesystem UUID: e8c13120-2388-4147-a6e8-7591dee60d8e
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872

user@user:~/Documents$ sudo fsck -t ext4 /dev/sdb1
fsck from util-linux 2.36.1

user@user:~/Documents$ e2fsck -b 32768 /dev/sdb1
e2fsck 1.45.7 (28-Jan-2021)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdb1 contains a crypto_LUKS file system

有什么方法可以保存图像/设备中的数据吗?

我也尝试在解锁时在设备或 LVM 层上使用相同的方法:

e2fsck -b 163840 /dev/mapper/luks-eff2a9f0-4edb-460c-908a-     4a3384b0246f
e2fsck 1.45.7 (28-Jan-2021)
e2fsck: Bad magic number in super-block while trying to open /dev/mapper/luks-eff2a9f0-4edb-460c-908a-4a3384b0246f

答案1

您需要通过键入不带参数的 mount 来检查错误。因此,您可以检查 /mount 是否可用,以及/或者 /dev/loop5 是否已安装

相关内容