So you have downloaded an iso which could be a linux installation or live iso or a windows iso or something other operating system. Now if you are planning to burn it to an actual disk like a cd or dvd, it would be a nice idea to first check if the iso if properly bootable or not.
This will confirm that the iso is bootable and is going to work the same way when used from an external media like dvd.
1. isoinfo command
To check if the iso is bootable, check the headers using the isoinfo command. In this example we shall use the ubuntu live server iso which is bootable and used to installed ubuntu server.
$ isoinfo -d -i ubuntu-23.04-live-server-amd64.iso CD-ROM is in ISO 9660 format System id: Volume id: Ubuntu-Server 23.04 amd64 Volume set id: Publisher id: Data preparer id: XORRISO-1.5.2 2019.10.26.180001, LIBISOBURN-1.5.2, LIBISOFS-1.5.2, LIBBURN-1.5.2 Application id: Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1289680 El Torito VD version 1 found, boot catalog is in sector 790 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 317 791 [email protected]:/media/enlightened/a935afc9-17fd-4de1-8012-137e82662ff0/downloads$
Check the section titled: Eltorito validation header. It indicates that the iso is bootable. To learn more about El Torito check the wikipedia section here:https://en.wikipedia.org/wiki/ISO_9660#El_Torito
Lets run the same common on Windows 10 Installer iso that can be downloaded from microsoft.com for free.
$ isoinfo -d -i Win10_22H2_English_x64.iso CD-ROM is in ISO 9660 format System id: Volume id: CCCOMA_X64FRE_EN-US_DV9 Volume set id: CCCOMA_X64FRE_EN-US_DV9 Publisher id: MICROSOFT CORPORATION Data preparer id: MICROSOFT CORPORATION, ONE MICROSOFT WAY, REDMOND WA 98052, (425) 882-8080 Application id: CDIMAGE 2.56 (01/01/2005 TM) Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 2985931 El Torito VD version 1 found, boot catalog is in sector 22 NO Joliet present NO Rock Ridge present Eltorito validation header: Hid 1 Arch 0 (x86) ID 'Microsoft Corporation' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 8 Bootoff 202 514 $
In the windows 10 iso also, we can see the Eltorito header, confirming that its a bootable disk image.
2. "file" command
The file command will indicate if the file is bootable. Here is the output for the same ubuntu server live iso file.
$ file ubuntu-23.04-live-server-amd64.iso ubuntu-23.04-live-server-amd64.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Ubuntu-Server 23.04 amd64' (bootable) $
Note the "(bootable)" string towards the end of the line.
Doing the same for the windows 10 installer iso
$ file Win10_22H2_English_x64.iso Win10_22H2_English_x64.iso: ISO 9660 CD-ROM filesystem data 'CCCOMA_X64FRE_EN-US_DV9' (bootable) $
We can see that it reports the windows 10 iso as bootable as well.
3. Boot with Qemu
This is a more advanced way of checking whether the iso is bootable or not. It will actually boot it up in a virtualised environment using Qemu emulator.
The command is actually quite simple
$ qemu-system-x86_64 --enable-kvm -cpu host -boot d -m 2048 -cdrom ubuntu-23.04-live-server-amd64.iso
This will popup a Qemu virtual machine gui window and try booting the device. Note that this will indicate whether the iso is bootable or not, but it is not guaranteed to successfully boot the iso in anyway depending on what os is in the iso.