How do I recreate a bootable ISO after making changes to its extracted files?
https://askubuntu.com/questions/1562407/how-do-i-recreate-a-bootable-iso-after-making-changes-to-its-extracted-files
I've downloaded the stock Ubuntu 24.04.3 LTS ISO image. I'd like to use this to create a USB installation drive, but first I want to make a small edit to GRUB configuration. GRUB is not the point of this question, so please don't get hung up on that.
To extract the stock ISO I followed this suggestion to use 7z. This appeared to work:
7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (806C1),ASM,AES-NI)
Scanning the drive for archives:
1 file, 6345887744 bytes (6052 MiB)
Extracting archive: ../ubuntu-24.04.3-desktop-amd64.iso
WARNINGS:
There are data after the end of archive
--
Path = ../ubuntu-24.04.3-desktop-amd64.iso
Type = Iso
WARNINGS:
There are data after the end of archive
Physical Size = 6345547776
Tail Size = 339968
Created = 2025-08-05 13:20:26
Modified = 2025-08-05 13:20:26
67% 835 - pool/main/f/firmware-sof/firmwar . ned_2023.12.1-1ubuntu1.7_all.de
{Junk omitted. Ask if you'd like to see it}
95% 1214 - pool/restricted/n/nvidia-graphi . 63.01-0ubuntu0.24.04.1_amd64.de
Everything is Ok
Archives with Warnings: 1
Warnings: 1
Folders: 199
Files: 1035
Size: 6342415880
Compressed: 6345887744
According to posts like this, the warning about data after the end of the archive is benign. In any event, usable files were extracted:
Unzipped_ISO$ ls
total 92K
drwx------ 3 user user 4.0K Jul 25 13:19 boot
drwx------ 2 user user 4.0K Jan 1 15:10 '[BOOT]'
-rw-rw-r-- 1 user user 2.0K Aug 5 14:20 boot.catalog
drwx------ 2 user user 12K Aug 5 14:20 casper
drwx------ 2 user user 4.0K Aug 5 14:17 .disk
drwx------ 3 user user 4.0K Aug 5 14:11 dists
drwx------ 3 user user 4.0K Jul 25 13:19 EFI
drwx------ 2 user user 4.0K Aug 5 14:11 install
-rw-rw-r-- 1 user user 44K Aug 5 14:20 md5sum.txt
drwx------ 4 user user 4.0K Aug 5 14:11 pool
drwx------ 2 user user 4.0K Aug 5 14:11 preseed
I then made an edit to one line of boot/grub/grub.cfg. No problems there.
The problem is that, having made that change, I can't reverse the extraction and recover a new bootable ISO file.
Based on advice this WikiHow article, I first tried the xorriso utility. It failed.
$ xorriso -as mkisofs -o ubuntu-24.04.3-2026.01.01-desktop-amd64_grubfix.iso -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -J -R /home/user/Unzipped_ISO/
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev 'stdio:ubuntu-24.04.3-2026.01.01-desktop-amd64_grubfix.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 112g free
Added to ISO image: directory '/'='/home/user/Unzipped_ISO'
xorriso : UPDATE : 1236 files added in 1 seconds
xorriso : FAILURE : Cannot find in ISO image: -boot_image ... bin_path='/boot/isolinux/isolinux.bin'
xorriso : UPDATE : 1236 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
I did a web search for the error "xorriso : FAILURE : Cannot find in ISO image: -boot_image". It returned very few results, much of which was in Chinese. I have to assume I don't have enough lifetime left to ever learn the resolution to this failure.
I then tried Brasero, following the instructions in the WikiHow article above. At no point was there any UI element that differentiated between a bootable ISO and a non-bootable ISO. Brasero produced an .iso output file, which I then attempted to burn to a USB drive using BalenaEtcher. BalenaEtcher raised a warning that the ISO was not bootable:
Missing partition table
It looks like this is not a bootable image. The image does not appear to contain a partition table, and might not be recognized or bootable by your device.
I tried it anyway, and sure enough, the USB was not recognized as bootable. I don't understand the nature of this error; since all I did was change one line of one file, any partition table in the original should have carried through to the output. It appears that Brasero won't create a bootable ISO.
I found this AskUbuntu post that appears on-topic, but the question is vague and the answers are poorly written and lack meaningful context. In particular, they don't appear to be concerned with whether or not the resulting ISO is bootable. I have no confidence that lurching randomly through the suggestions there will be a good use of my limited time.
So, I'm looking for expertise. How do I re-package a bunch of files that I just extracted from a perfectly good, bootable ISO back into a bootable ISO? The computer I'm working on is Ubuntu 22.04.