Cannot recreate an Ubuntu ISO that is bootable
0
votes
1
answer
45
views
I am trying to create a bootable ISO for a customised Ubuntu.
The ISO I create is not bootable (it won't boot in VirtualBox). To debug I am not modifying Ubuntu, just trying to recreate a bootable ISO from the the original bootable Ubuntu ISO I downloaded from the web (it boots in VirtualBox). The steps are:
1. Mount original ISO
2. Make a read-write copy
3. Use
---
Steps 1 and 2. Mount original ISO and make a read/write copy:
genisoimage
to create a new ISO
The details are shown below. The new ISO won't boot. The file
command indicates it is bootable, but does not contain a "DOS/MBR boot sector" (whereas the original ISO does).
I have also shown some of the contents of the mounted disk (in case I am specifying the wrong boot catalog or image).
Can anyone tell me what I am doing wrong?
---
Steps 1 and 2. Mount original ISO and make a read/write copy:
> sudo mount -t iso9660 -o loop ubuntu-24.04.iso mntpoint
> mkdir mntpoint_rw
> rsync -a mntpoint/ mntpoint_rw
Step 3. Recreate the ISO:
> sudo genisoimage \,
-o /tmp/custom.iso \
-R -J -b EFI/boot/grubx64.efi -c boot.catalog -no-emul-boot -boot-load-size 4 -boot-info-table \
$(pwd)/mntpoint_rw
I have tried various combinations of -b, -c options with files boot.catalog
, EFI/boot/grubx64.efi
and boot/grub/grub.cfg
.
Info about the original ISO (downloaded from web):
> file ubuntu-24.04.iso
ubuntu-24.04.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Ubuntu 24.04.2 LTS amd64' (bootable)
> ls -lh ubuntu-24.04.iso
-rw-r--r-- 1 6.0G Aug 1 13:37 ubuntu-24.04.iso
Info about the new ISO:
> file /tmp/custom.iso
/tmp/custom.iso: ISO 9660 CD-ROM filesystem data 'Custom Ubuntu-24.04' (bootable)
> ls -lh /tmp/custom.iso
-rw-r--r-- 1 root root 6.0G Aug 1 13:56 /tmp/custom.iso
Selected content of the mounted disk:
> ls -l --block-size=K mntpoint_rw
total 84K
dr-xr-xr-x 3 4K Jan 27 2025 EFI
dr-xr-xr-x 3 4K Jan 27 2025 boot
-r--r--r-- 1 2K Feb 15 19:15 boot.catalog
dr-xr-xr-x 2 12K Feb 15 19:15 casper
dr-xr-xr-x 3 4K Feb 15 19:09 dists
dr-xr-xr-x 2 4K Feb 15 19:09 install
-r--r--r-- 1 44K Feb 15 19:15 md5sum.txt
dr-xr-xr-x 4 4K Feb 15 19:09 pool
dr-xr-xr-x 2 4K Feb 15 19:09 preseed
lrwxrwxrwx 1 1K Feb 15 19:09 ubuntu -> .
> find mntpoint_rw/EFI -type f | xargs ls -lh
-r--r--r-- 1 945K Jan 27 2025 mntpoint_rw/EFI/boot/bootx64.efi
-r--r--r-- 1 2.3M Aug 1 13:56 mntpoint_rw/EFI/boot/grubx64.efi
-r--r--r-- 1 837K Jan 27 2025 mntpoint_rw/EFI/boot/mmx64.efi
> find mntpoint_rw/boot ! \( -name '*.mod' -o -name '*.lst' \) -type f | xargs ls -lh
-r--r--r-- 1 2.4M Jan 27 2025 mntpoint_rw/boot/grub/fonts/unicode.pf2
-r--r--r-- 1 583 Feb 15 19:13 mntpoint_rw/boot/grub/grub.cfg
-r--r--r-- 1 7.5K Jan 27 2025 mntpoint_rw/boot/grub/i386-pc/efiemu32.o
-r--r--r-- 1 11K Jan 27 2025 mntpoint_rw/boot/grub/i386-pc/efiemu64.o
-r--r--r-- 1 31K Jan 27 2025 mntpoint_rw/boot/grub/i386-pc/eltorito.img
-r--r--r-- 1 318 Feb 15 19:13 mntpoint_rw/boot/grub/loopback.cfg
-r--r--r-- 1 145K Apr 9 2024 mntpoint_rw/boot/memtest86+x64.bin
Asked by John
(125 rep)
Aug 1, 2025, 04:39 AM
Last activity: Aug 1, 2025, 11:24 AM
Last activity: Aug 1, 2025, 11:24 AM