Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 670370

Summary: sys-fs/mdadm - mdadm-last-resort prevents logins, brings down services
Product: Gentoo Linux Reporter: Carsten Böcker <news>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: news, systemd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=670472
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 670472    
Bug Blocks:    
Attachments: emerge --info
journalctl -b with loglevel debug

Description Carsten Böcker 2018-11-05 14:02:53 UTC
Created attachment 554130 [details]
emerge --info

After upgrade to systemd-239-r2 it was impossible to login if I waited to long or partitions are not mounted and services not running if I login fast enough.

After searching a while I think I found the reason.

systemd has a job mdadm-last-resort which seems to be allways called and starts to unmount all mdadm-devices and also stopping nearly all services.

I found the solution in a debian-bug-report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892257

Applying the patch mentioned to /lib/systemd/system/mdadm-last-resort\@.service resolved the boot-problems.

Relevant part of the Patch is:
+-Conflicts=sys-devices-virtual-block-%i.device
++ConditionPathExists=!/sys/devices/virtual/block/%i/md/sync_action

Appended output of emerge --info and also output of journalctl -b with LogLevel=debug from a failed boot
Comment 1 Carsten Böcker 2018-11-05 14:04:08 UTC
Created attachment 554132 [details]
journalctl -b with loglevel debug
Comment 2 Mike Gilbert gentoo-dev 2018-11-05 15:36:21 UTC
This is a bug in sys-fs/mdadm. It has been fixed in the latest version (4.1).
Comment 3 Carsten Böcker 2018-11-05 15:54:56 UTC
Thanks for the information. I added ~adm64-keyword for mdadm and 
mdadm-last-resort\@.service has the change and everything works as expected.

Perhaps mdadm-4.1 should be stabilized ..... but perhaps I am the only one with systemd and mdadm so it is not necessary anymore
Comment 4 Mike Gilbert gentoo-dev 2018-11-05 16:01:25 UTC
Agreed, we should stabilize 4.1 or backport the change to the current stable version.
Comment 5 Carsten Böcker 2018-11-05 16:10:24 UTC
Yes backporting would be a very good Idea. I can confirm that this change is working with current stable mdadm, it is a small change and perhaps it saves someone some time to debug this startup-problems.