Luks 卷在安装、读取和写入方面工作良好。但是,当它尝试为其标头创建备份时,我什么cryptsetup luksDump
也cryptsetup luksHeaderBackup
得不到,甚至没有错误消息。
我在 sudocryptsetup luksDump /dev/mapper/<device>
和下尝试过cryptsetup luksDump /media/user/partition
。也尝试了未安装的卷。
sudo cryptsetup -v luksDump /media/<user>/LUKS
Command failed with code -4 (wrong device or file specified).
sudo cryptsetup -v luksDump /media/<user>/LUKS/
Command failed with code -4 (wrong device or file specified).
sudo cryptsetup -v luksDump /dev/mapper/LUKS
Command failed with code -1 (wrong or missing parameters).
sudo cryptsetup -v luksDump /dev/mapper/LUKS/
Device /dev/mapper/LUKS/ doesn't exist or access denied.
Command failed with code -4 (wrong device or file specified).
和
cryptsetup -v isLuks /dev/mapper/LUKS
Command failed with code -1 (wrong or missing parameters).
答案1
您显示的错误似乎表明您正在针对映射名称(搜索man 8 cryptsetup
“映射”以查看它所指的内容),即由设备映射器创建的解密设备,而不是针对实际的加密设备。
例如,如果您使用以下命令打开 LUKS 设备
cryptsetup luksOpen /dev/sda2 sda2_crypt
你会发现该设备sda2_crypt
(映射名称) 中/dev/mapper
,但你必须运行
cryptsetup luksDump /dev/sda2
转储位于加密设备上的标头。