21 September 2024

Create a bootable Ubuntu installer on a partitioned USB drive

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.

  1. 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.

  2. Create a partition with the remaining space, format as EXT4.

  3. Make the second partition bootable.

  4. Copy the ISO over using dd:

sudo dd if=/home/sodonnell/Downloads/ubuntu-22.04.5-desktop-amd64.iso of=/dev/sda2 bs=1M
  1. Install a MBR onto the disk - note this command runs on the disk 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.

blog comments powered by Disqus