From Electron Cloud
Jump to: navigation, search

readiso:

#!/bin/sh
device=/dev/cdrom

blocksize=`isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5`
if test "$blocksize" = ""; then
        echo catdevice FATAL ERROR: Blank blocksize >&2
        exit
fi

blockcount=`isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4`
if test "$blockcount" = ""; then
        echo catdevice FATAL ERROR: Blank blockcount >&2
        exit
fi

command="dd if=$device of=/tmp/cd.iso bs=$blocksize count=$blockcount conv=notrunc,noerror"
echo "$command" >&2
$command

copycd:

#!/bin/sh
~/bin/readiso
cdrecord -v -pad padsize=63s dev=/dev/hdc /tmp/cd.iso