"Just switch off" using Overlayroot

55 views
Skip to first unread message

Ralf G.

unread,
Jun 8, 2026, 2:43:41 PMJun 8
to MPF Users

Dear pinheads,

I am currently at the stage of placing playfield elements (trial and error), with cardboard, wooden pieces, wire etc, on a whiteboard with a working Italian lower half (slingshots, inlanes, outlanes, trough and shooter lane). Although it seems to be an issue only for the final touch-up of a complete machine, I found it very useful not having to worry about shutting down my game PC at this stage, as I have no monitors, mouse or keyboard attached to the whiteboard. So I wanted to share how I set up my Linux PC such that you can simply switch it off. I am looking forward to feedback, concerns, no-go hints etc from the more experiences Linux experts here (I am not). When this procedure is hardened, I am happy to move it over to the Tutorial. So here goes…

Assumption: you start a fresh installation of Ubuntu (or derivates), or: you are running it already and have a little space left on your hard drive for an additional partition.

Here’s the (only?) caveat: the “Overlayroot” package is key to this feature; unfortunately it got deprecated with Ubuntu 26.04 LTS (although still available from the repo). I therefore use a 24.04 LTS install, which at this time (2026) is still fully maintained (until 2029).

What we need to accomplish is the following: we’ll create a separate partition for the mountpoint of “<mpf machine folder>/data” . That folder will remain as is, i.e. full read/write access. However, the entire rest of the system (root: “/” ) will be loaded into the RAM, and used there. All data written to/from the system to “/” will be gone after shutdown, with the exception of the mpf data folder. You can switch off your PC anytime (well: perhaps not exactly when you save your highscores…) – the next time it boots up, it comes up as the original, unchanged version.

We need to do 3 things now:

  1. Create that extra partition for “<mpf machine folder>/data”
  2. Create a GRUB boot manager entry for a read-only root system, and make it the default
  3. Install and configure the Overlayroot package.

Overlayroot.jpg


Creating that separate partition is easiest when starting with a fresh Ubuntu install. If you have a running system, you may want to use gparted.

Create the partition (in my example the device is called “nvme0n1p3”) and format it as ext4 . The size does not have to be huge, honestly. A few MB will be plenty. Do not define a mountpoint just yet.

After Ubuntu and mpf have been fully installed, run

sudo blkid

Note down the UUID of the partition containing your mpf data folder (e.g. 80fdd43d-5b7f-4105-b243-aa59583b6095). Then open

sudo nano /etc/fstab

and append the following line:

/dev/disk/by-uuid/<pasted from blkid>  <mpf machine folder>/data  ext4  rw,sync,noauto,x-systemd.automount,x-systemd.idle-timeout=5  0  0

e.g.:

/dev/disk/by-uuid/80fdd43d-5b7f-4105-b243-aa59583b6095  /home/janedoe/mypinballheaven/data  ext4  rw,sync,noauto,x-systemd.automount,x-systemd.idle-timeout=5  0  0

Save the file and exit (^o, ^x).

This mounts the data folder with the following options: (rw) read-/write-able, (sync) write buffer will be written to disk right away, (noauto) no default mounting, (x-systemd.automount) enable a mountpoint where a file system may later be mounted, (x-systemd.idle-timeout=5) partition is automatically unmounted after not being used for 5 seconds.

Now we open

sudo nano /etc/default/grub

Change or add these lines:

GRUB_DEFAULT=“Ubuntu RO“

GRUB_TIMEOUT_STYLE=menu

GRUB_TIMEOUT=5

GRUB_RECORDFAIL_TIMEOUT=5

Save the file and exit (^o, ^x).

That creates another entry “Ubuntu RO” in the GRUB boot loader. The entry still needs to be define though. Open

/boot/grub/grub.cfg

And copy all lines between (but not including) ### BEGIN /etc/grub.d/10_linux ### and ### END /etc/grub.d/10_linux ### and paste them into

/etc/grub.d/40_custom

Rename “menuentry 'Ubuntu' ” to “menuentry 'Ubuntu RO' “ .

Append to line : linux /boot/vmlinuz-[…]-generic root=UUID=[…] ro  quiet splash $vt_handoff overlayroot=”tmpfs:recurse=0”

Save /etc/grub.d/40_custom and update the system with

sudo update-grub

Finally, install overlayroot:

sudo apt-get install overlayroot

Reboot. Now you’re done. Remember: ANY changes you are making to the system (other than in the data folder) will be gone after the next reboot. If you want to make changes to the system, to mpf files etc. you need to select “Ubuntu” in GRUB, not “Ubuntu RO”.

 


chud...@gmail.com

unread,
Jun 9, 2026, 7:37:03 AMJun 9
to mpf-...@googlegroups.com

Great.

 

Thanks for your initiative Ralf.

 

 

De : mpf-...@googlegroups.com <mpf-...@googlegroups.com> De la part de Ralf G.
Envoyé : lundi 8 juin 2026 20:44
À : MPF Users <mpf-...@googlegroups.com>
Objet : [mpf-users] "Just switch off" using Overlayroot

--
You received this message because you are subscribed to the Google Groups "MPF Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpf-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mpf-users/cf06335e-63f5-4c60-8c55-22312711e13dn%40googlegroups.com.

image001.jpg

Marc Rechté

unread,
Jun 10, 2026, 9:55:28 AM (13 days ago) Jun 10
to MPF Users
Regarding my raspberrypi setup (one for mpf, one for mpf-mc), I disabled as much as possible services I don't use. I configured systemd to not log to file (just to the console). Also disabled log in MPF. So far I never got an issue with corrupted FS. I just hold a spare SD-card in the cabinet, should such situation happen...

Kalle Heinz

unread,
Jun 10, 2026, 10:33:28 AM (13 days ago) Jun 10
to MPF Users
more or less same here. Use Raspi and in general I have seen so many Raspis in the past years which just got switched off since they run headless I believe I never saw a corruption. As mentioned earlier, have a spare SD at hand and I believe it should be all good to just switch it off. Of course the initial described way is the cleaner approach.

Anthony van Winkle

unread,
Jun 16, 2026, 8:03:15 PM (7 days ago) Jun 16
to MPF Users
I too have never had an issue losing data with a hard poweroff, across nearly a dozen games, platforms, and computer types (including Raspberry Pi 4/5, UP Core and Duo, and other randos). I had one of my machines in an arcade for ~6 months as well, and it was totally fine with poweroff.

Not saying there's anything wrong with protecting your system, but for new builders try not to fret about it. There are plenty of other things to fret about first :)

Reply all
Reply to author
Forward
0 new messages