In my case, I had used the USB stick for other stuff and was previously imaged with dd, so despite the stick being physically 8Gb, my Linux was only seeing it as a much smaller disk (2Gb). This caused issues later on when rsyncing the Packages folder onto the stick as it was running out of space!.
The solution for me was to do this to my stick before running the mkosxinstallusb script:
Maybe mkosxinstallusb could incorporate this step before running sgdisk -o $stick_dev to make the process more robust for some corner cases. Something like this:
[...]
echo "\n# partitioning USB drive"
if [ -b "$stick_dev" ]
then
for device in $(lsblk -lnp -o NAME "$stick_dev" | tac)
do
umount -l "$device" 2>/dev/null || true
done
fi
dd if=/dev/zero of=$stick_dev bs=1M status=progress
sync
sgdisk -o $stick_dev
sgdisk -n 1:0:0 -t 1:AF00 -c 1:"disk image" -A 1:set:2 $stick_dev
sync
[...]
This is just a suggestion.
In my case, I had used the USB stick for other stuff and was previously imaged with
dd
, so despite the stick being physically 8Gb, my Linux was only seeing it as a much smaller disk (2Gb). This caused issues later on when rsyncing the Packages folder onto the stick as it was running out of space!.The solution for me was to do this to my stick before running the
mkosxinstallusb
script:That made it be an 8Gb disk again.
Maybe
mkosxinstallusb
could incorporate this step before runningsgdisk -o $stick_dev
to make the process more robust for some corner cases. Something like this: