×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Boot partition

  • Posts: 85
  • Thank you received: 19

Boot partition was created by David James

Every now and then, my Astroberry RPi3B+ crashes or its power is cut while running or somesuch.

And inevitably, the boot partition, which is a Windows Fat32 or vfat partition, ends up with a "dirty bit", and the Pi won't boot.

So I have to shut it back off, pull the MicroSD card out, insert it into another computer and repair the partition with fsck:

~$ fsck /dev/sdf1
(sometimes it's on /dev/mmcblk* if the computer is a laptop with an integral SD card reader)

It finds there's a dirty bit, asks me if I want to remove it, and once removed and reinserted into the Pi, it boots normally.

But this is something of a nuissance, realistically.

Is there a reason the boot partition is a vfat partition? It just doesn't seem terribly robust for something that might well be used in the field where power problems can be an issue.


Fwiw, my card is a 64 GB Samsung EVO Select U3 MicroSDXC. In addition to the boot and root partitions created from the Astroberry image, I've added another vfat partition for photo storage (vfat so I can access it on 'doze machines if needs be) and an ext partition that holds several gigabytes worth of FITS files for astrometric plate solving.
3 years 11 months ago #51491

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Boot partition

You won't be able to do anything with vfat partition. It is the only one supported by raspberry boot loader. I would rather focus on determining a root case for reboots. Unreliable PSU?
3 years 11 months ago #51549

Please Log in or Create an account to join the conversation.

  • Posts: 85
  • Thank you received: 19

Replied by David James on topic Boot partition

There's no root cause... it could be a cable snagging, the Pi falling off the mount when the velcro let go, an actual power outage or interruption (at our family's cottage this happens a fair bit - the power just goes off for a few seconds), etc - just anything random that can cause an interruption in power supply. During one especially cold night (<-25°) the Pi even got too cold to keep running and sort of slow-crashed as I lost access to it (I had to attach foam insulation to it to prevent it from happening again).

It's just that once it has happened it is a pain to recover from.

But your post indicated that it was a Raspberry Pi issue more generally, so I searched on that. I found plenty of others who had had issues of this nature. Here's someone who had the same issue and someone else who posted a script to deal with it:
raspberrypi.stackexchange.com/questions/...usb-stick-or-sd-card


From that I slightly rewrote it and came up with the following (it adds a repair for a second vfat partition as I have a second one on the disk). I've tested it and it seems to work so feel free to grab it and add it to the Astroberry images.

Warning: Spoiler!



I don't know if all those 'sudo' calls are actually necessary for a boot script though... probably not?
The following user(s) said Thank You: Eric
Last edit: 3 years 11 months ago by David James.
3 years 11 months ago #51558

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Boot partition

Thanks for directions. If you cannot avoid hard shutdown due to random power losses it is the way to go
Similar approach is already enabled for root file system of Astroberry Server (see /boot/cmdline.txt), but it might be good idea to enable it for /boot partition too.
3 years 11 months ago #51560

Please Log in or Create an account to join the conversation.

  • Posts: 85
  • Thank you received: 19

Replied by David James on topic Boot partition

So I'm not sure this actually is working... least of all because the device names on my Pi are of the mmc variety.

Further testing and tweaking is required.
3 years 11 months ago #51563

Please Log in or Create an account to join the conversation.

  • Posts: 983
  • Thank you received: 375

Replied by Radek Kaczorek on topic Boot partition

Just change sda1 to mmcblk0p1 (and sda2 to mmcblk0p2 respectively) and you will be fine
3 years 11 months ago #51565

Please Log in or Create an account to join the conversation.

  • Posts: 85
  • Thank you received: 19

Replied by David James on topic Boot partition

It's weird, it's now rebooting fine without the script even when the power is turned of. Of course it never does that at night!

I hate when I can't replicate problems!

The main difference is that I don't have the mount plugged it, but I do have one of the cameras plugged in.

I thought maybe it was because I was just switching the power off with the power supply cable's switch rather than pulling the power supply out, but it worked after just pulling the cable as well.

Still more testing required...
3 years 11 months ago #51567

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 0.250 seconds