Luks

cryptsetup luksDumpcryptsetup luksHeaderBackup 不生成輸出

  • September 9, 2020

Luks 卷在安裝、讀取和寫入方面執行良好。但是,當它嘗試為其標頭創建備份時,cryptsetup luksDumpcryptsetup 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).

您顯示的錯誤似乎表明您正在針對映射名稱執行命令(搜尋man 8 cryptsetup“映射”以查看它所指的內容),即設備映射器創建的解密設備,而不是實際加密的設備。

例如,如果您使用命令打開 LUKS 設備

cryptsetup luksOpen /dev/sda2 sda2_crypt

您將在 中找到設備sda2_crypt映射名稱/dev/mapper,但您必須執行

cryptsetup luksDump /dev/sda2

轉儲位於加密設備上的標頭。

引用自:https://unix.stackexchange.com/questions/608628