21 September 2024
Most guides to create a bootable live CD for Ubuntu will wipe the entire drive, creating a single partition in the process.
The ISO for Ubuntu 22.04 is about 4.5GB, and these days most USB sticks are way bigger than that. Its a shame to waste the rest of the space.
After some googling I came across this post which describes how to do this. However the top answer seemed overly complex and this simpler answer save me an error running the isohybrid --partok
command.
Following a link to this post, it seems things are even simpler.
Partition the drive with the first partition being the one to use for storage - I formatted as FAT32 as I wanted to use it with Windows and my TV. Apparently, if the storage partition is second, Windows will not see it.
Create a partition with the remaining space, format as EXT4.
Make the second partition bootable.
Copy the ISO over using dd:
sudo dd if=/home/sodonnell/Downloads/ubuntu-22.04.5-desktop-amd64.iso of=/dev/sda2 bs=1M
sda
not the partition. The install-mbr command can be installed with apt install mbr
.sudo install-mbr /dev/sda
After that, I rebooted my system and was able to run "Try Ubuntu" successfully.