0

I've setup a RAID1 device with mdadm on CentOS 7. The system boots fine when both disks are inserted but hangs when there is only one.

The error occurs at boot with the following message from systemd:

A start job is running for dev-md125.device (54s / no limit)

The problem here is the "no limit" part. How do I add a limit so that I can allow the system to boot?

There is nothing I can see in my mdadm.conf:

$cat /etc/mdadm.conf
MAILADDR root
AUTO +imsm +1.x -all
ARRAY /dev/md/archive:boot level=raid1 num-devices=2 UUID=1104ad14:c378ffcd:5d2c92be:ffaace05
ARRAY /dev/md/archive:root level=raid1 num-devices=2 UUID=f30b5fcf:d194f469:404a464f:c1b0ba0a
ARRAY /dev/md/archive:swap level=raid1 num-devices=2 UUID=d6490a08:3c6a7311:cb7ddd3f:9eac77ff

I tried adding timeouts to fstab:

$cat /etc/fstab
UUID=309bc32c-d75b-4ddb-9141-f234be9b72ca /        xfs     defaults,x-systemd.device-timeout=5  1 1
UUID=b336e2bb-f5d2-4065-9aed-9de77c02c0e2 /boot    xfs     defaults,x-systemd.device-timeout=5  1 2
UUID=93434118-d16e-4cc7-8ff0-c0891bcbcb72 swap     swap    defaults,x-systemd.device-timeout=5  0 0

I thought that /etc/systemd/system/sysinit.target.wants/dmraid-activation.service might be responsible but adding a timeout did not change the behavior (still no limit):

$cat /etc/systemd/system/sysinit.target.wants/dmraid-activation.service
[Unit]
Description=Activation of DM RAID sets
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-udev-settle.service
Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
Wants=systemd-udev-settle.service

[Service]
ExecStart=/lib/systemd/rhel-dmraid-activation
Type=oneshot
TimeoutSec=5

[Install]
WantedBy=sysinit.target
0

I haven't tried myself but according to RedHat official site you need to proceed as follows:

Imagine you want to specify a timeout for httpd.service.

  1. Copy the file:

    cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service

  2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.
  3. Reload the configuracion.

    systemctl daemon-reload

Please refer to here for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.