1

i just swapped out my old rpi sd card with raspbian stretch for one with raspian bullseye because stretch didnt gave me kernel 5.x and it felt outdated. everything worked so far except that my usb hard drive doesn't mount because it gets seen too late by the kernel. any ideas?

raspberry pi 3 b+ armv7l linux 5.10.63-v7+ raspbian (debian) bullseye

sudo dmesg:

...
[    6.531430] systemd[1]: dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.device: Job dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.device/start timed out.
[    6.542488] systemd[1]: Timed out waiting for device /dev/disk/by-uuid/b3f635b5-bc12-4196-b384-fff32368c9e4.
[    6.555582] systemd[1]: Dependency failed for File System Check on /dev/disk/by-uuid/b3f635b5-bc12-4196-b384-fff32368c9e4.
[    6.568154] systemd[1]: Dependency failed for /srv/nfs.
[    6.577123] systemd[1]: srv-nfs.mount: Job srv-nfs.mount/start failed with result 'dependency'.
[    6.585016] systemd[1]: systemd-fsck@dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.service: Job systemd-fsck@dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.service/start failed with result 'dependency'.
[    6.597635] systemd[1]: dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.device: Job dev-disk-by\x2duuid-b3f635b5\x2dbc12\x2d4196\x2db384\x2dfff32368c9e4.device/start failed with result 'timeout'.
...

...
[   10.288933] scsi 1:0:0:0: Direct-Access     ST950042 3AS              0041 PQ: 0 ANSI: 0
[   10.290492] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   10.290544] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[   10.291134] sd 1:0:0:0: [sdb] Write Protect is off
[   10.291158] sd 1:0:0:0: [sdb] Mode Sense: 03 00 00 00
[   10.291908] sd 1:0:0:0: [sdb] No Caching mode page found
[   10.291929] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[   10.306171] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   10.306347] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   10.313173] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Nov  1 2021 00:37:25 version 7.45.241 (1a2f2fa CY) FWID 01-703fd60
[   10.421495]  sdb: sdb1 sdb2 sdb3 sdb4
[   10.426561] sd 1:0:0:0: [sdb] Attached SCSI disk
...

fstab line:

UUID=b3f635b5-bc12-4196-b384-fff32368c9e4   /srv/nfs    ext4    nofail,x-systemd.device-timeout=100ms       0 2
12
  • Could be an adjustment is needed in the systemd sequence... you might look at systemd-analyze to gain insight. Can you mount the drive manually after your system has fully booted using mount -a? If not, can it be mounted manually?
    – Seamus
    Dec 18, 2021 at 16:44
  • both mount -a and mount /dev/sdb1 work
    – Antoni
    Dec 18, 2021 at 17:24
  • $ systemd-analyze Startup finished in 4.158s (kernel) + 16.120s (userspace) = 20.278s graphical.target reached after 15.615s in userspace
    – Antoni
    Dec 18, 2021 at 17:24
  • Based on that, I'll guess that the cure for your issue is to have systemd postpone the mount operation on this drive. How to do that? I'm not well-versed in systemd, and our resident systemd GURU @ingo is on sabbatical. All I can suggest is this: If you don't get a useful answer here, post a similar question on the Super User -or- Unix & Linux SE sites.
    – Seamus
    Dec 18, 2021 at 17:40
  • P.S. to ensure I see your comments, preface your comment with my handle: @seamus.
    – Seamus
    Dec 18, 2021 at 17:41

2 Answers 2

1

Increase the value you pass with the parameter x-systemd.device-timeout which is currently set to 100ms.
Maybe try 250ms

2
  • 1
    will that work? the device is seen 4 seconds later than systemd tries to mount its filesystem
    – Antoni
    Dec 19, 2021 at 19:17
  • it complains about timing out, so your timeout option is probably it. How much it must be increased depends on your drive. I'd just remove the timeout option and leave only the nofail option. But that could delay the entire boot process a bit depending on the drive.
    – svin83
    Dec 20, 2021 at 13:17
1

x-systemd.device-timeout=100ms is ridiculously small for a mechanical drive, which can easily take 5-10 seconds to spin-up. The fact that it worked in Stretch is just a coincidence. Since the partition data which defines the existence of e.g. /dev/sda1 resides on the drive, such device files will not be created until the disk is fully operational.

I recommend you simply remove this option from your fstab, unless you actually want to avoid mounting slower drives. If you just want to avoid delaying the boot process then nofail alone is sufficient, as if effectively says local-fs.target should not wait for the mount process to complete.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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