DarkElvenAngel
Posts: 1037
Joined: Tue Mar 20, 2018 9:53 pm

[PATCHED ?]Initramfs can't always mount boot partition

Wed Apr 29, 2020 9:48 pm

Hello everyone,

I have a RPI 4B and a custom initramfs and it mounts the boot partition to get access to files. This sometimes fails when booting. This was rare but after the last firmware it happens on cold boots more often.

Any ideas why this is happening?
Last edited by DarkElvenAngel on Thu Apr 30, 2020 9:32 pm, edited 1 time in total.

DarkElvenAngel
Posts: 1037
Joined: Tue Mar 20, 2018 9:53 pm

Re: Initramfs can't always mount boot partition

Thu Apr 30, 2020 5:01 pm

I have verified that my firmware was out of date and not the newest version as I previously thought.

Seeing as this is a random issue what debug information should be recorded that would be useful? The initramfs is able to detect and recover from this issue and the system boots normally with just an error message.

Thank you.

User avatar
dividuum
Posts: 228
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Initramfs can't always mount boot partition

Thu Apr 30, 2020 7:51 pm

DarkElvenAngel wrote:
Thu Apr 30, 2020 5:01 pm
Seeing as this is a random issue what debug information should be recorded that would be useful? The initramfs is able to detect and recover from this issue and the system boots normally with just an error message.
I've observed that it sometimes takes a short moment before /dev/mmcblk0p1 is available. I test for existence explicitly before trying to mount.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

DarkElvenAngel
Posts: 1037
Joined: Tue Mar 20, 2018 9:53 pm

Re: Initramfs can't always mount boot partition

Thu Apr 30, 2020 8:15 pm

dividuum wrote:
Thu Apr 30, 2020 7:51 pm
DarkElvenAngel wrote:
Thu Apr 30, 2020 5:01 pm
Seeing as this is a random issue what debug information should be recorded that would be useful? The initramfs is able to detect and recover from this issue and the system boots normally with just an error message.
I've observed that it sometimes takes a short moment before /dev/mmcblk0p1 is available. I test for existence explicitly before trying to mount.
I have cheated a little and have saved the node in the initramfs, so it's always going to exist. Would it be then that if I do a three try approach to mount this might solve the issue?

Something like

Code: Select all

# Mount_Boot
n=0
until [ $n -ge 3 ]
do
   mount -o ro /dev/mmcblk0p1 /mnt/boot &> /dev/null  && break 
   let "n=n+1"
   sleep .5
done

User avatar
dividuum
Posts: 228
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Initramfs can't always mount boot partition

Thu Apr 30, 2020 8:20 pm

DarkElvenAngel wrote:
Thu Apr 30, 2020 8:15 pm
Would it be then that if I do a three try approach to mount this might solve the issue?
I guess that would work if that's indeed the issue here. My memory is a bit fuzzy as that has been year ago and I didn't touch that part since then, so it might also be someting completely different root cause.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

DarkElvenAngel
Posts: 1037
Joined: Tue Mar 20, 2018 9:53 pm

Re: Initramfs can't always mount boot partition

Thu Apr 30, 2020 8:57 pm

dividuum wrote:
Thu Apr 30, 2020 8:20 pm
DarkElvenAngel wrote:
Thu Apr 30, 2020 8:15 pm
Would it be then that if I do a three try approach to mount this might solve the issue?
I guess that would work if that's indeed the issue here. My memory is a bit fuzzy as that has been year ago and I didn't touch that part since then, so it might also be someting completely different root cause.
Well it doesn't hurt to throw it in there it will only delay my boot by about 2 seconds if there is an issue, It's one of those you set it and forget things isn't it?

My memory is fuzzy when it comes to writing scripts for sh I always seem to slip some bash syntax in there.

It must be something with the device not being ready because the system boots and I have to mount /dev/mmcblk0p2 to do that.

Return to “Troubleshooting”