Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| dual_boot_ubuntu_batocera.linux [2021/12/30 07:09] – [Ubuntu Linux] atari | dual_boot_ubuntu_batocera.linux [2024/09/21 20:15] (current) – [Ventoy] maximumentropy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Dual boot Batocera ====== | ====== Dual boot Batocera ====== | ||
| - | It is recommended to boot Batocera off of a USB drive and to use your BIOS boot selection menu to switch between Batocera and other operating systems that may already be on other drives. You can still [[: | + | It is recommended to boot Batocera off of a USB/other external |
| + | |||
| + | <WRAP center round alert> | ||
| + | Before attempting //any// of this, **make a backup of your data**. There is a chance that the following actions (shrinking partitions, replacing boot loaders, etc.) can render the storage devices inoperable. | ||
| + | |||
| + | If this sounds too spooky to you, just [[: | ||
| + | </ | ||
| Ordinarily, Batocera utilizes [[https:// | Ordinarily, Batocera utilizes [[https:// | ||
| Line 11: | Line 17: | ||
| ===== Dual boot Batocera and Windows ===== | ===== Dual boot Batocera and Windows ===== | ||
| - | You will likely have to wipe your hard drive' | + | ==== Automatically ==== |
| - | - Partition your intended drive to begin with a large physical NTFS partition for Windows. It is recommended to use a GPT partition table. The rest of the free space will be used for Batocera. | + | For those that prefer video guides (there |
| - | - Install Windows via your preferred method. It will re-partition the existing NTFS partition into smaller logical partitions, but should retain its total size. | + | |
| - | - In the empty space, add a new physical FAT32 partition around 8GB in size (can be larger if you want, but not smaller) labelled " | + | |
| - | - Immediately after the BATOCERA partition, create another partition to fill up the rest of the drive. This will be used as the " | + | |
| - | - Rename the folders in Windows' | + | |
| - | - Download | + | |
| - | - Copy the contents of '' | + | |
| - | - Boot into Batocera from a USB drive, run '' | + | |
| - | * FIXME (confirmation needed) To do this on Windows itself, open an administrator command prompt and run '' | + | |
| - | - Open '' | + | |
| - | The final '' | + | This guide is assuming Windows is being booted from an EFI partition. If it isn't, or you don't know, **proceed at your own risk**. |
| - | set timeout=5 | + | |
| - | menuentry ' | + | === Preparing the drive === |
| - | search --fs-uuid --no-floppy --set=root 2AD8-4A0C | + | |
| - | chainloader (${root})/ | + | |
| - | } | + | |
| - | menuentry | + | Partition the drive, having a 8 GB FAT32 partition after the Windows drive immediately followed by the "userdata" |
| - | | + | |
| - | | + | Extract and copy the latest [[https:// |
| - | initrd / | + | |
| + | < | ||
| + | D:\ | ||
| + | ├─ boot\ | ||
| + | ├─ EFI\ | ||
| + | ├─ tools\ | ||
| + | └─ batocera-boot.conf | ||
| + | </ | ||
| + | |||
| + | === Installing GRUB over Windows' | ||
| + | |||
| + | Download and install [[https:// | ||
| + | - Extract the grub2win ZIP, and run '' | ||
| + | - Allow grub2win to download the latest EFI package for your operating system. | ||
| + | - Ensure the target drive is the one the system boots into by default (usually C:\). Click **Setup**. | ||
| + | - Once it's done, click **Return To The Setup Menu**. | ||
| + | - Check "Delete setup files" if desired, and then **Close The Setup Program**. | ||
| + | - Grub2win will automatically scan for available operating systems. It will not find Batocera, unfortunately. Click **Manage Boot Menu** in the middle bottom of the window. | ||
| + | | ||
| + | - Under " | ||
| + | - Name the " | ||
| + | - Click **Edit Custom Code**. A text document will be opened with the default text editor. Paste in the following and save the file, for Batocera **v39** and higher: < | ||
| + | set efibootmgr=/ | ||
| + | | ||
| + | if [ ! -z $reviewpause ] ; then | ||
| + | echo GNU Grub will load the Batocera EFI Boot Manager at disk address $root | ||
| + | | ||
| + | fi | ||
| + | echo GNU Grub is now loading the Batocera EFI Boot Manager | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | set efibootmgr=/ | ||
| + | | ||
| + | if [ ! -z $reviewpause ] ; then | ||
| + | echo GNU Grub will load the Batocera EFI Boot Manager at disk address $root | ||
| + | | ||
| + | fi | ||
| + | echo GNU Grub is now loading the Batocera EFI Boot Manager | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | Pleillear keeps an updated copy of the file at [[https:// | ||
| + | </ | ||
| + | - Close the text editor. | ||
| + | - Grub2win will then scan the code for mistakes. If all goes well, click **OK**, followed by **OK**. | ||
| + | - Check that the Batocera listing is correct and in the menu slot desired. Then click **Apply**. | ||
| + | - Set any further cosmetic settings desired. Lower the "Grub timeout" | ||
| + | - Grub2win will then install the desired boot menu onto the drive. Green means it's good. Click **Close**. | ||
| + | - Reboot and pray to whatever entity that you want that it worked. | ||
| + | |||
| + | ===== Dual boot Batocera and MacOS or other UEFI-based x86_64 systems using rEFInd ===== | ||
| + | |||
| + | <WRAP center round important> | ||
| + | Although Windows can be hostile towards other operating systems (erasing their bootloaders on an update, clearing the master boot record without warning, etc.), Macs can be even more hostile. Keep this in mind and definitely have a secure method of restoring a backup when playing with the Mac's bootloader. | ||
| + | |||
| + | For " | ||
| + | </ | ||
| + | |||
| + | <WRAP center round important> | ||
| + | Before installing rEFInd, be sure to read and understand the entire contents of its documentation first. Being negligent in this regard can result in an unbootable system if no flashing method is prepared earlier. To quote the author of rEFInd: "Note: I consider rEFInd to be beta-quality software! That said, rEFInd is a usable program in its current form on many systems." | ||
| + | </ | ||
| + | |||
| + | Install [[https:// | ||
| + | |||
| + | < | ||
| + | menuentry " | ||
| + | icon EFI/ | ||
| + | loader | ||
| + | initrd / | ||
| + | options "label=BATOCERA console=tty3 quiet loglevel=0 vt.global_cursor_default=0" | ||
| } | } | ||
| - | </file> | + | </code> |
| ===== Dual boot Batocera and other Linux distributions ===== | ===== Dual boot Batocera and other Linux distributions ===== | ||
| Line 69: | Line 132: | ||
| EOF | EOF | ||
| </ | </ | ||
| + | - Make it executable by running '' | ||
| - Run '' | - Run '' | ||
| - Reboot | - Reboot | ||
| Line 80: | Line 144: | ||
| </ | </ | ||
| - | ==== Linux Mint ==== | + | ==== Linux Mint/MX Linux ==== |
| - | For other distributions like Linux Mint 19.03, you can use the following method. | + | For other distributions like Linux Mint 19.03, you can use the following method. It also works for MX Linux, all mentions of Linux Mint also refer to MX Linux in this section. |
| === Install Linux Mint === | === Install Linux Mint === | ||
| Line 94: | Line 158: | ||
| * Partition 2: type = ext4. It must be created and placed right after the '' | * Partition 2: type = ext4. It must be created and placed right after the '' | ||
| - | Then download [[http:// | + | Then download [[https:// |
| + | |||
| + | <WRAP center round tip> | ||
| + | Since it's been set up manually, you can remove the '' | ||
| + | </ | ||
| === Configure the GRUB boot loader === | === Configure the GRUB boot loader === | ||
| Line 120: | Line 188: | ||
| </ | </ | ||
| * The file can also be automatically downloaded with the following command: < | * The file can also be automatically downloaded with the following command: < | ||
| - | sudo wget https:// | + | sudo wget 'https://wiki.batocera.org/ |
| </ | </ | ||
| - Then run the following commands: < | - Then run the following commands: < | ||
| Line 133: | Line 201: | ||
| You will now be presented with the GRUB menu upon booting, allowing you to select either Batocera or Linux Mint to boot into. | You will now be presented with the GRUB menu upon booting, allowing you to select either Batocera or Linux Mint to boot into. | ||
| + | |||
| + | ===== Ventoy ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Technically, | ||
| + | |||
| + | By default, Batocera' | ||
| + | |||
| + | < | ||
| + | qemu-img resize batocera.img +#G | ||
| + | sudo losetup --find --show batocera.img | ||
| + | </ | ||
| + | |||
| + | and expanding the userdata partition with Gparted or something similar. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | If you want to keep using [[https:// | ||
| + | |||
| + | < | ||
| + | gparted /dev/loop * | ||
| + | </ | ||
| + | |||
| + | If you prefer using a script instead of manual procedures, this will add a specified amount of space to a Batocera image file, | ||
| + | and will expand the /userdata SHARE partition to fill the added space: | ||
| + | |||
| + | <code bash| batocera-ventoy-resize.sh> | ||
| + | #!/bin/bash | ||
| + | # batocera-ventoy-resize.sh 20240921 n2qz/ | ||
| + | # Expand a Batocera installation image file to make storage space | ||
| + | # available in SHARE when booting the image from Ventoy. | ||
| + | # | ||
| + | # Tested on Ubuntu 24.04.1 LTS with e2fsprogs 1.47.0. May not work on | ||
| + | # older versions of linux, as current Batocera images (v41+) use newer | ||
| + | # ext4 features not available with older ext4 utilities | ||
| + | err () { | ||
| + | exitcode=$? | ||
| + | echo "... Exit code $exitcode on line ${BASH_LINENO[0]} while executing command: $BASH_COMMAND" | ||
| + | exit $exitcode | ||
| + | } | ||
| + | trap err ERR | ||
| + | growsize=" | ||
| + | inputimage=" | ||
| + | outputimage=" | ||
| + | if [ -z " | ||
| + | then | ||
| + | echo " | ||
| + | echo " | ||
| + | exit 2 | ||
| + | fi | ||
| + | image=$(basename " | ||
| + | if [ -z " | ||
| + | then | ||
| + | outputimage=" | ||
| + | fi | ||
| + | if [ " | ||
| + | then | ||
| + | echo "... Copy ${inputimage} to ${outputimage}" | ||
| + | cp " | ||
| + | else | ||
| + | echo "... Decompress ${inputimage} to ${outputimage}" | ||
| + | gzip -vkcd " | ||
| + | fi | ||
| + | echo "... Grow image ${outputimage}" | ||
| + | truncate -s " | ||
| + | echo "... Set up loopback device" | ||
| + | lodev=$(sudo losetup --find --show --partscan " | ||
| + | echo "... Loopback device is: ${lodev}" | ||
| + | sharepart=2 | ||
| + | sharepartdev=" | ||
| + | echo "... Adjust GPT on ${lodev}" | ||
| + | sudo sgdisk -e " | ||
| + | echo "... Show free space on ${sharepartdev}" | ||
| + | sudo dumpe2fs " | ||
| + | echo "... Resize SHARE partition ${sharepartdev}" | ||
| + | sudo parted -s " | ||
| + | echo "... Check ${sharepartdev}" | ||
| + | sudo fsck -f " | ||
| + | echo "... Grow ${sharepartdev}" | ||
| + | sudo resize2fs " | ||
| + | echo "... Show free space on ${sharepartdev}" | ||
| + | sudo dumpe2fs " | ||
| + | echo "... Detach loopback device ${lodev}" | ||
| + | sudo losetup -d " | ||
| + | echo "... Successfully completed" | ||
| + | </ | ||
| + | |||
| + | |||
- dual_boot_ubuntu_batocera.linux.1640848191.txt.gz
- Last modified: 4 years ago
- by atari