How to determince CD is bootable or not

Hi,

How can i determine the /dev/scd0 is bootable or not from command-line with single-line command according to ElTorito specification or something else?

Regards,

The isoinfo command can be used to extract that kind of data from iso images, if you don't have it, it comes with the cdrecord suite.

You can also use dd to determine if the CD/DVD is bootable i.e.

#!/bin/bash

DEVICE="/dev/sr0"
VERBOSE=1

bchex=`dd if=${DEVICE} skip=34887 bs=1 count=2 conv=swab 2>/dev/null | xxd | cut -d" " -f2`

bcdec=`printf "%d" 0x${bchex}`

bootable=`dd if=${DEVICE}  bs=1 skip=$(( bcdec * 2048 + 32))  count=1  2>/dev/null | xxd | cut -d" " -f2`

if [[ $bootable = 88 ]]; then
   [ $VERBOSE ] && printf "Bootable CDROM\n"
   exit 0
else
   [ $VERBOSE ] && printf "Not a bootable CDROM\n"
   exit 1
fi