我的硬盘有一个映像备份文件,它由三个分区 ( sudo fdisk -l /mnt/hdd/19_02.img
) 组成:
Device Start End Sectors Size Type
/mnt/hdd/19_02.img1 2048 1050623 1048576 512M EFI System
/mnt/hdd/19_02.img2 1050624 34686975 33636352 16G Linux swap
/mnt/hdd/19_02.img3 34686976 976773134 942086159 449.2G Linux filesystem
Run Code Online (Sandbox Code Playgroud)
第三个分区 ist 类型crypto_LUKS
。如果它不会被加密,我可以用 挂载它sudo mount -o loop,offset=$(expr 512 \* 34686976) /mnt/hdd/19_02.img /mnt/img
,这会导致mount: /mnt/img: unknown filesystem type 'crypto_LUKS'.
sudo cryptsetup luksOpen /mnt/hdd/19_02.img3 img
结果是 Device /mnt/hdd/19_02.img3 doesn't exist or access denied.
sudo cryptsetup plainOpen --offset=$(expr 512 \* 34686976) /mnt/hdd/19_02.img img …