Editing the boot partition

This is the platform-specific boot partition, usually FAT32 but can depend on the device. This partition can be read and edited by most other operating systems should you plug the drive into another machine. The most common file that might need to be edited is the batocera-boot.conf file, but others too might be required to be changed depending on what you're doing.

Be careful; changing these files can affect Batocera's ability to boot, so always make backups of these files before changing them.

When you plug your Batocera drive into another machine, the small boot partition should appear as a standard FAT32 drive. The contents of this will change depending on what platform you're using. This is what the x86_64 one looks like:

There he is!

This is the equivalent of looking into the /boot folder in Batocera while Batocera is running.

If you edit any text file under Windows, make sure you have an editor that respects Unix line terminators. Don't use Notepad, use a text editor like Notepad++, that doesn't replace the Unix line terminations (LF) with DOS/Windows line terminations (CR/LF). Wordpad has also been reported to corrupt Unix text files.

The batocera-boot.conf file uses the same syntax as the batocera.conf file, however different keys are available.

The default batocera-boot.conf can be found here on the Github. Right click and “Save Link As…”, making sure the name is batocera-boot.conf.

If your drive doesn't appear in your file explorer on Windows, you may need to assign it a drive letter using Disk Management.

  1. Open the Start menu with Win, type in “disk management” (not to be confused with “Device Management”) and open “Disk Management”. This looks pretty technical! But don't worry, we're only doing one thing.
  2. Right-click the Batocera drive and click on “Assign Drive Letter and Paths…” (notice how the Batocera drive has no drive letter, while the other drives do). You can usually tell which drive this is based on its size.
  3. Click “Add…”. Make sure “Assign the following drive letter:” is checked and press “OK”, then press “OK” again. This should automatically select an available letter.
  4. Check “This Computer”. Your drive is now present!

Inside of tools/btrfs_on_windows you'll find the experimental BTRFS driver needed to read BTRFS file system partitions on Windows (useful if you have chosen BTRFS as the file system for your userdata partition, by default it is ext4). This driver can bluescreen your computer, and is not recommended for regular use. You can choose to use this file system as your userdata partition for its benefits as explained here.

Read its readme file first!

In contrast to how Windows mounts drives as letters like C:\, Linux 'mounts' partitions to folders when connected, allowing you to access partitions by looking in the assigned folder. In other Linux-based distributions that aren't Batocera, this will typically be in /mnt/sda# where # is a number. Batocera has set up the FAT32 boot partition to appear as the /boot folder in the root directory when booted up, and can be accessed through this folder in its file manager (F1). You'll find if you attempt to do so, however, you'll be met with a “no write permissions error” or something similar. Batocera boots with /boot as read-only, so you'll need to remount it with the read-write permissions instead:

Run the following command (in either Xterm (F1 > Applications) or SSH):

mount -o remount,rw /boot

If all goes well, nothing will display like so:

Success!

and you're ready to start editing the boot partition!

If an error message comes up, you've either misspelled the command, your installation has been corrupted or you're not in the Batocera terminal.

This will make the /boot partition writable until next boot. No need to do anything to change it back, as Batocera will default to mounting it as read-only on next boot.

This is not required if you are intending to edit files in the Batocera virtual filesystem. Refer to the overlays page for info on that. Note that almost all configuration can be done within Batocera or batocera.conf and editing overlays should not be required in most cases.

  • edit_boot_partition.txt
  • Last modified: 22 months ago
  • by atari