我创建了一个带有uefi引导和加密lvm分区的服务器安装程序,您可以在这里看到:
root@debian:~# lsblk -o name,uuid,type,size
NAME UUID TYPE SIZE
sda disk 52G
|-sda1 6EE2-5855 part 512M
|-sda2 2dcfe94a-3c21-e08f-805c-8ef32eabf50f part 954M
| `-md128 8e000041-b831-4aea-b46d-85efdcdd5371 raid1 953M
`-sda3 a6172091-d026-463f-ac1b-8edfe2419cb8 part 50.5G
`-md129 429397a0-8620-4b87-ac2d-aec37bd26b36 raid1 50.1G
`-md129_crypt YR7iyx-6ELU-Vg6F-bPtB-mSOA-LYJw-JQYPpK crypt 50G
|-vgroot-main ddf156a7-3b64-4c9e-a9cc-eb15755f1995 lvm 14G
|-vgroot-swap 0a1af000-c578-4d94-a90a-2cd685409f99 lvm 1.9G
`-vgroot-vm0 lvm 14G
sdb disk 52G
|-sdb1 03F8-4D52 part 512M
|-sdb2 2dcfe94a-3c21-e08f-805c-8ef32eabf50f part 954M
| `-md128 8e000041-b831-4aea-b46d-85efdcdd5371 raid1 953M
`-sdb3 a6172091-d026-463f-ac1b-8edfe2419cb8 part 50.5G
`-md129 429397a0-8620-4b87-ac2d-aec37bd26b36 raid1 50.1G
`-md129_crypt YR7iyx-6ELU-Vg6F-bPtB-mSOA-LYJw-JQYPpK crypt 50G
|-vgroot-main ddf156a7-3b64-4c9e-a9cc-eb15755f1995 lvm 14G
|-vgroot-swap 0a1af000-c578-4d94-a90a-2cd685409f99 lvm 1.9G
`-vgroot-vm0 lvm 14G
sdc disk 8G
`-sdc1 236c1834-cc33-9303-0905-1bd4de8c1399 part 8G
`-md127 25cdc3e1-d3cf-4592-9db9-538e0c9205bd raid1 8G
sdd disk 8G
`-sdd1 236c1834-cc33-9303-0905-1bd4de8c1399 part 8G
`-md127 25cdc3e1-d3cf-4592-9db9-538e0c9205bd raid1 8G
sr0 rom 1024M该is基于Debian 10。分区按以下方式挂载:
root@debian:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 2003472 0 2003472 0% /dev
tmpfs 404052 5564 398488 2% /run
/dev/mapper/vgroot-main 14647296 1041884 11566020 9% /
tmpfs 2020252 0 2020252 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 2020252 0 2020252 0% /sys/fs/cgroup
/dev/md128 960504 51472 860240 6% /boot
/dev/sdb1 523248 10432 512816 2% /boot/efi
tmpfs 404048 0 404048 0% /run/user/0根分区位于vgroot-main上。这必须在引导时用luks解密,也可以用raid1镜像。
root@debian:~# mdadm --detail /dev/md/129
/dev/md/129:
Version : 1.2
Creation Time : Thu Oct 3 18:53:03 2019
Raid Level : raid1
Array Size : 52487168 (50.06 GiB 53.75 GB)
Used Dev Size : 52487168 (50.06 GiB 53.75 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Fri Oct 4 21:55:24 2019
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Consistency Policy : resync
Name : debian:129 (local to host debian)
UUID : a6172091:d026463f:ac1b8edf:e2419cb8
Events : 517
Number Major Minor RaidDevice State
3 8 3 0 active sync /dev/sda3
2 8 19 1 active sync /dev/sdb3这个装置很好用。但是当我删除一个磁盘时,系统无法挂载根文件系统。超时之后,它将返回到initramfs shell。令人惊讶的是,md129被显示为非活动,并显示为raid0。
有谁知道为什么内核要将raid组装为0级,除非分区sda3本身显示为raid1?
发布于 2019-10-04 22:25:10
这可能是这个bugzilla报告中描述的相同问题的一个实例。这是因为dracut和应该组装根数组的系统单元之间的交互很差。
确保更新您的系统,因为问题可以/应该通过dracut更新来解决。作为解决办法,尝试将rd.retry=30传递给内核cmdline (在grub提示符处)。
更多的细节摘自bugzill,解释了事件的顺序:
降低rd.retry超时(如手册页所示)使dracut能够强制启动数组,从而允许systemctl服务成功。
发布于 2019-10-14 11:47:12
最后,我在initramfs中手动组装了raid。退出initramfs shell后,内核继续引导。我无法找到初始行为的修复,但我现在知道如何处理它。
https://serverfault.com/questions/986838
复制相似问题