mdadm
我正在尝试在 14.04.1 LTS(GNU/Linux 3.8.13.26 armv7l)(Odroid U3)上设置的软件 RAID 上使用 LUKS 设置加密磁盘。
问题是 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
据我所知,这还算可以。