軟體 RAID 未在啟動時安裝的 LUKS

軟體 RAID 未在啟動時安裝的 LUKS

我正在嘗試使用 LUKS 在軟體 RAID 上設定加密磁碟,該軟體 RAID 是mdadm在 14.04.1 LTS (GNU/Linux 3.8.13.26 armv7l) (Odroid U3) 上設定的。

問題是 LUKS 容器在啟動時不會自動解鎖,我不知道為什麼或在哪裡尋找問題。

問題

ext4如果我用它格式化軟體 RAID並將其放入 fstab 中進行自動掛載,則軟體 RAID 工作正常。另外,如果我單獨使用 LUKS(沒有 RAID,僅在),它可以正常工作,並且在 中配置時/dev/sda1設備會顯示在 中。/dev/mapper/etc/crypttab

當兩者結合起來時就會出現問題。 RAID 設備顯示為,/dev/md0但 LUKS 容器不會自動安裝到/dev/mapper/crypt.另一方面,sudo cryptdisks_start crypt啟動後使用沒有任何問題。另外,我sudo update-initramfs -u -k all在設定後運行/etc/crypttab(請參閱下面的輸出)。

米達德姆

sudo cat /proc/mdstat給出以下輸出:

Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      976596800 blocks super 1.2 [2/2] [UU]
      [>....................]  resync =  0.6% (6345024/976596800) finish=1342.7min speed=12042K/sec

unused devices: <none>

並且/etc/mdadm/mdadm.conf有以下行:

ARRAY /dev/md/0 metadata=1.2 UUID=f2c7b09f:71620ae5:7b6ec321:e9ce02cc name=odroid:0

密碼表

# <target name> <source device>         <key file>      <options>
usb-crypt       /dev/md0                None            luks,keyscript=/home/user/key.sh

系統日誌

Oct 22 06:34:40 odroid kernel: [    9.283025] md: bind<sda1>
Oct 22 06:34:40 odroid kernel: [    9.302273] md: raid1 personality registered for level 1
Oct 22 06:34:40 odroid kernel: [    9.302817] md/raid1:md0: not clean -- starting background reconstruction
Oct 22 06:34:40 odroid kernel: [    9.302826] md/raid1:md0: active with 2 out of 2 mirrors
Oct 22 06:34:40 odroid kernel: [    9.302878] md0: detected capacity change from 0 to 1000035123200
Oct 22 06:34:40 odroid kernel: [    9.305140] md: resync of RAID array md0
Oct 22 06:34:40 odroid kernel: [    9.305149] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
Oct 22 06:34:40 odroid kernel: [    9.305153] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for resync.
Oct 22 06:34:40 odroid kernel: [    9.305162] md: using 128k window, over a total of 976596800k.
Oct 22 06:34:40 odroid kernel: [    9.305166] md: resuming resync of md0 from checkpoint.
Oct 22 06:34:41 odroid kernel: [    9.499399]  md0: unknown partition table

更新 initramfs

sudo update-initramfs -u -k all:

update-initramfs: Generating /boot/initrd.img-3.8.13.26
update-initramfs: Generating /boot/initrd.img-3.8.13.23
WARNING: missing /lib/modules/3.8.13.23
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.8.13.23: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_PDBSh1/lib/modules/3.8.13.23/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_PDBSh1/lib/modules/3.8.13.23/modules.builtin: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.8.13.18
grep: /boot/config-3.8.13.18: No such file or directory
WARNING: missing /lib/modules/3.8.13.18
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.8.13.18: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_r2PYwd/lib/modules/3.8.13.18/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_r2PYwd/lib/modules/3.8.13.18/modules.builtin: No such file or directory

據我了解,這還算可以。

相關內容