Skip to contentSkip to conversation

Failed to start Remount Root and Kernel File Systems.

Buildroot Didier Trosset 2 participants 2 messages Jan 24, 2024 – Jan 30, 2024

lore
Share & tools
lore
#0 lore raw

I'm setting up a buildroot for an x86_64 system that I'd want on a USB stick.

I've setup buildroot to build x86_64, with initial RAM filesystem linked into kernel as cpio. Bootloader is grub2 as x64-efi.

The USB stick has three partitions:
- sdx1: EFI with bootloader and grub.cfg
- sdx2: ext2 with bzImage (and initial rootfs)
- sdx3: ext4 with full root filesystem

The system boots correctly, within grub.cfg, linux has the correct "root=/dev/sdx3" (also tried "root=UUID=xxx..."). I can read it from /proc/cmdline

My trouble is the systemd error in title: "[FAILED] Failed to start Remount Root and Kernel File Systems." The system keeps the initial rootfs as /. It did not change to /dev/sdx3

Within the boot log, I can see that my USB stick partitions are discovered after the remount root error. Furthermore, they appear with a timestamp [  5.9121] instead of [ OK  ].
I tried to add rootdelay=10 to linux cmdline without success.

My understanding is that the remount cannot be successful because the USB partition is not known to the kernel at the time the remount is done. My main question is how to solve this? (Also: Does systemd really start before the kernel has finished discovering everything?)

Thanks for your help.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

Hi Didier,

Quoted 9 lines · Didier Trosset

I'm setting up a buildroot for an x86_64 system that I'd want on a USB stick.

I've setup buildroot to build x86_64, with initial RAM filesystem linked into kernel as cpio. Bootloader is grub2 as x64-efi.

The USB stick has three partitions:
- sdx1: EFI with bootloader and grub.cfg
- sdx2: ext2 with bzImage (and initial rootfs)
- sdx3: ext4 with full root filesystem

There is nothing in Buildroot that helps you to support a scenario with an
initial rootfs that later gets replaced by a full root filesystem. (Actually I'm lying - there is dracut, but you don't mention it so I assume you're not using it.)

Therefore, you must be using something else that does the necessary pivot_root
magic. Perhaps there's something built in in systemd that does it? Then you'll need to consult systemd's manual to find how that works exactly...

How to you generate the initial rootfs and the full rootfs?

Quoted 5 lines

The system boots correctly, within grub.cfg, linux has the correct "root=/dev/sdx3" (also tried "root=UUID=xxx..."). I can read it from /proc/cmdline

My trouble is the systemd error in title: "[FAILED] Failed to start Remount Root and Kernel File Systems."

In systemd there are units for everything. You should be able to remove the
root=.... option entirely, which probably triggers systemd to skip that service. That should allow you to boot with just the initial rootfs, and then you can use systemctl to search the service that does this remount and get more info from it.

Quoted 3 lines

The system keeps the initial rootfs as /. It did not change to /dev/sdx3

Within the boot log, I can see that my USB stick partitions are discovered after the remount root error.

That sounds like there's something wrong in that Remount Root service then -
it should have a dependency on the mount unit for that partition, and that itself has a dependency on the udev discovery of the partition.

Perhaps the mount unit has a timeout that is too small? But the default would
typically one minute or more...

Quoted 2 lines

Furthermore, they appear with a timestamp [  5.9121] instead of [ OK  ]. I tried to add rootdelay=10 to linux cmdline without success.

rootdelay is probably not going to help - it's only used by the kernel's
mounting of the root filesystem, but the kernel doesn't mount a rootfilesystem by itself when there's an initrd.

Regards,
Arnout

Quoted 10 lines

My understanding is that the remount cannot be successful because the USB partition is not known to the kernel at the time the remount is done. My main question is how to solve this? (Also: Does systemd really start before the kernel has finished discovering everything?)

Thanks for your help.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot