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 [2023/09/17 05:27] – [Linux Mint/MX Linux] Use HTTPS link maximumentropy | dual_boot_ubuntu_batocera.linux [2024/09/21 20:15] (current) – [Ventoy] maximumentropy | ||
|---|---|---|---|
| Line 49: | Line 49: | ||
| - Under " | - Under " | ||
| - Name the " | - 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: < | + | - 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=/ | set efibootmgr=/ | ||
| | | ||
| Line 60: | Line 70: | ||
| | | ||
| </ | </ | ||
| - | Pleillear keeps an updated copy of the file at [[https:// | + | Pleillear keeps an updated copy of the file at [[https:// |
| </ | </ | ||
| - Close the text editor. | - Close the text editor. | ||
| Line 122: | Line 132: | ||
| EOF | EOF | ||
| </ | </ | ||
| + | - Make it executable by running '' | ||
| - Run '' | - Run '' | ||
| - Reboot | - Reboot | ||
| Line 197: | Line 208: | ||
| Technically, | Technically, | ||
| - | By default, Batocera' | + | By default, Batocera' |
| < | < | ||
| Line 213: | Line 224: | ||
| gparted /dev/loop * | 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.1694928448.txt.gz
- Last modified: 3 years ago
- by maximumentropy