I have a Raspberry Pi running Raspbian GNU/Linux 10 (buster). The Pi is running on a microSD-Card with a read-only boot partition and activated overlay-filesystem (both is currently deactivated for testing).
The fake-hwclock.data
(current system time) is written to (and read from) a mounted USB, so that when the machine reboots, it starts on the "current" time (last time before reboot) and not the time from before the overlay filesystem has been enabled.
To make sure that important logs are also saved, these are written to the USB too.
The USB is mounted with the following line (/etc/fstab
):
/dev/sda1 /mnt/storage ext4 defaults,user,noatime 0 0
All of this is (or was) working fine. But since i removed the sudoer privileges from the pi user aswell as set a password for the root user, the RasPi starts (about every 2nd time) in emergency mode - even though, the pi user should have the privileges to mount the USB (see "user"
in /etc/fstab
).
In emergency mode I'm able to print the journal logs, using journalctl -xb
:
mnt-storage.mount: Found ordering cycle on local-fs-pre.target/start
mnt-storage.mount: Found dependency on systemd-remount-fs.service/start
mnt-storage.mount: Found dependency on systemd-fsck-root.service/start
mnt-storage.mount: Found dependency on fake-hwclock.service/start
mnt-storage.mount: Found dependency on mnt-storage.mount/start
mnt-storage.mount: Job local-fs-pre.target/start deleted to break ordering cycle starting with mnt-storage.mount/start
[ SKIP ] Ordering cycle found, skipping Local File Systems (Pre)
When reading this, I understand (please correct me if I'm wrong) that local-fs-pre.target
has a dependency on fake-hwclock.service
which in turn has a dependency on mnt-storage.mount
- which then breaks the boot cycle.
- Does the pi user need sudoer rights to mount the USB on startup?
- Shouldn't the
"user"
param in/etc/fstab
solve that problem? - Could the root user be causing problems because I set its password? (???)
/mnt/storage
-->mnt-storage.mount
. I am not really familiar with systemd, so please tell me if I'm off the track here.