我正在运行 Fedora Server Edition 26,并且有两个外部 USB 驱动器,每个驱动器上都有一个分区,我已将它们合并到 RAID1 中。我的 /etc/fstab 文件包含以下行用于自动挂载阵列:
UUID=B0C4-A677 /mnt/backup-raid exfat uid=strwrsdbz,gid=strwrsdbz,umask=022,windows_names,locale=en.utf8,nobootwait,nofail 0 2
但是,启动完成后,/mnt/backup-raid 处的阵列并未安装。如果我检查日志日志我会看到
Oct 28 21:32:07 hostname systemd[1]: Started File System Check on /dev/disk/by-uuid/B0C4-A677.
Oct 28 21:32:07 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-fsck@dev-disk-by\x2duuid-B0C4\x2dA677 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:07 hostname kernel: audit: type=1130 audit(1509240727.851:75): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-fsck@dev-disk-by\x2duuid-B0C4\x2dA677 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:08 hostname systemd[1]: Mounting /mnt/backup-raid...
Oct 28 21:32:08 hostname systemd[1]: Mounted /mnt/c.
Oct 28 21:32:08 hostname ntfs-3g[702]: Version 2017.3.23 integrated FUSE 28
Oct 28 21:32:08 hostname ntfs-3g[702]: Mounted /dev/sda1 (Read-Write, label "", NTFS 3.1)
Oct 28 21:32:08 hostname ntfs-3g[702]: Cmdline options: rw,uid=1000,gid=1000,umask=022,windows_names,locale=en.utf8
Oct 28 21:32:08 hostname ntfs-3g[702]: Mount options: rw,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sda1,blkdev,blksize=4096
Oct 28 21:32:08 hostname ntfs-3g[702]: Global ownership and permissions enforced, configuration type 7
Oct 28 21:32:08 hostname lvm[599]: 3 logical volume(s) in volume group "fedora" now active
Oct 28 21:32:08 hostname systemd[1]: Started LVM2 PV scan on device 8:5.
Oct 28 21:32:08 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=lvm2-pvscan@8:5 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:08 hostname kernel: audit: type=1130 audit(1509240728.594:76): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=lvm2-pvscan@8:5 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:08 hostname systemd[1]: Found device /dev/mapper/fedora-home.
Oct 28 21:32:08 hostname systemd[1]: Mounting /home...
Oct 28 21:32:08 hostname kernel: XFS (dm-2): Mounting V4 Filesystem
Oct 28 21:32:08 hostname systemd[1]: Mounted /mnt/igel1.
Oct 28 21:32:08 hostname systemd-fsck[666]: /dev/sda3: clean, 376/128016 files, 291819/512000 blocks
Oct 28 21:32:08 hostname systemd[1]: Mounted /mnt/igel2.
Oct 28 21:32:08 hostname systemd[1]: Mounted /mnt/backup-raid.
*剪断*
Oct 28 21:32:33 hostname systemd[1]: Created slice system-mdadm\x2dlast\x2dresort.slice.
Oct 28 21:32:33 hostname systemd[1]: Starting Activate md array even though degraded...
Oct 28 21:32:33 hostname systemd[1]: Unmounting /mnt/backup-raid...
Oct 28 21:32:34 hostname systemd[1]: Started Activate md array even though degraded.
Oct 28 21:32:34 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mdadm-last-resort@md0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:34 hostname audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mdadm-last-resort@md0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 28 21:32:34 hostname kernel: md0:
Oct 28 21:32:34 hostname systemd[1]: Unmounted /mnt/backup-raid.
所以看起来它被安装在第一个日志块中,但后来它被卸载,因为它显示为降级。但是一旦完成启动,我就可以运行sudo mount -a
并且阵列安装不会出现问题。内容正确显示在 /mnt/backup-raid 中并检查 /proc/mdstat 显示
Personalities : [raid1]
md0 : active raid1 sdc2[0] sdb2[2]
485345344 blocks super 1.2 [2/2] [UU]
bitmap: 0/4 pages [0KB], 65536KB chunk
unused devices: <none>
所以一切看起来都很健康。如果有帮助,我的 /etc/mdadm.conf 包含
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=hostname:backup-raid UUID=6c8bf3df:c4147eb1:4c3f88d8:e94d1dbc devices=/dev/sdb2,/dev/sdc2
我发现此电子邮件线程它似乎正在处理类似的情况,但在我看来它只是沉默了。如果答案就在该电子邮件主题中而我错过了,我很抱歉,但它对我来说有点太密集了,无法理解。
答案1
“错误检测降级数组”systemd-devel 线程与 udev 和 mdadm-last-resort 计时器/服务之间的竞争条件有关。然后该Conflicts=sys-devices-virtual-block-%i.device
行触发先前安装的文件系统的卸载。
线程也提到了一个解决方法这也应该可以解决您的问题:Conflicts=...
用一行替换该行ConditionPathExissts=...
:
# cp /usr/lib/systemd/system/mdadm-last-resort@.* /etc/systemd/system/
# sed -i 's@^Conflicts=sys-devices-virtual-block-%i.device@ConditionPathExists=/sys/devices/virtual/block/%i@' \
/etc/systemd/system/mdadm-last-resort@.*
# shutdown -r now
请注意,通过以下方式进行直接替换/etc/systemd/system/.../override.conf
不适用于删除该Conflicts=
行。
您可以订阅相关的上游systemd问题需要一个单向版本的“冲突”获得有关根本问题的更改的通知。
另请参阅我的Fedora 27 错误报告此问题表现为/boot/efi
放置在 RAID-1 镜像上时无法安装。