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/12/28 00:11] – lbrpdx | dual_boot_ubuntu_batocera.linux [2024/09/21 20:15] (current) – [Ventoy] maximumentropy | ||
|---|---|---|---|
| Line 208: | Line 208: | ||
| Technically, | Technically, | ||
| - | By default, Batocera' | + | By default, Batocera' |
| < | < | ||
| Line 224: | 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.1703722314.txt.gz
- Last modified: 2 years ago
- by lbrpdx