i’m trying to burn an iso of opensuse dvd with cdrecord from command line.
I tried 2 dvd-rw already, the 1st one with os 12.1 on it, the 2d one still brand new.
Do i need to erase before burning ?
cdrecord -v -speed=2 dev=4,0,0 -blank=all
i can’t blank disk : fast and all are ko, even using -force flag, seems like the “drive or media” does not support the ‘blank media’ command.
I did not know that a -rw media would need to support being blanked.
i have errors only , what can i do to burn please ? (i already checked the md5 of the iso, which is ok)
only giving you a part of the text for my machine is ko right now :
....
starting new track at sector 0 track 01 0 of 4242 mb written Errno : 5 (input/output error) , write_g1 scsi sendcmd : no erro ....
....
CDB
status
sense bytes
sense key 0*( Illegal request, segment 0
sense code 0*30 Qual 0*06 (cannot format medium - incompatible medium) Fru 0*0
sense flags Blk 0 (not valid)
write track data : error after 0 bytes
wodim A write error occured
Where the $1 parameter is the image file. As to blanking the media, I
don’t remember, but it should work jut with overwriting the media with
the new image.
–
Cheers / Saludos,
Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))
it worked ok, but at reboot the install process is frozen when looking for linux partitions (60%).
i checked the install media : no error returned, installs begins again and frozen again at the same place.
… i let it go and , and ,and … Wow it finally achieved the process, surely a nightmare for a newcomer discovering the os.
Here’s a script I wrote many years ago* to burn CDs and DVDs under Linux and Unix. I’m still using it on all distros to burn iso images from the command line. I actually never used another method. As far as I can tell, it still works. If it complains about a non existing device, just create a symlink (or fix the script, so that it uses the rigtht device name - as I guess the CD/DVD device name has changed).
It might help. But, please dont’ ask me for support - it’s too old and I’m too busy. If it doesn’t work for you, either fix it or forget it.
It should determine the correct size and is able to burn both CDs and DVDs. All you need to do is to insert the right medium.
#!/bin/bash
prg=`basename $0`
srcdir_def=/data/mboot
srcdir=$srcdir_def
img_def=mboot.iso
OS=`uname -s`
bootable=0
burn=0
# ~~~~~~~~~~~ medium type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 0 = cd rewritable
# 1 = cd
# 2 = dvd
medium=0
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~ maximal size for iso images ~~~~~~~~~~~~~~~~~
# CD-rewritable : 657Mb (74:48:01)
# CD : 703Mb (79:57:72)
# DVD : 4483Mb
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cdrwmax=688914432
cdmax=737148928
dvdmax=4699717632
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cdwriter=/dev/cdrw
dvdwriter=/dev/dvdrw
cmd='genisoimage -v -r'
function error () {
exec cat << EOFERROR
;32;1m$prg 1.0 @ agnelo de la Crotche - 12092007
;31;1merror: ;37;0m $1
EOFERROR
}
function help () {
exec cat << EOFHELP
;37;1mNAME
$prg ;37;0m - create and write cd/dvd
;37;1mSYNOPSIS
$prg;37;0m ;36;1m-bw ;37;0m] ;36;1m srcdir ;37;0m] ;36;1mimage ;37;0m]
;37;1mDESCRIPTION
$prg ;37;0mcreates and burns a cd/dvd
;37;1m-h --help ;37;0mdisplay this help
;37;1m-b --boot ;37;0mcreate a bootable ;33;1m$OS ;37;0mcd/dvd
;37;1m-w --burn ;37;0mcreate and burn image
;37;1m-i --img ;37;0mburn image
;37;1m-B --blank ;37;0mblank cd
;37;1m-e --blankdvd ;37;0mblank dvd
;36;1msrcdir ;37;0msource directory of the image (default: ;37;1m$srcdir_def;37;0m)
;36;1mimage ;37;0mdestination file ( default ;37;1mmboot.iso;37;0m )
EOFHELP
}
function burnimg () {
img=$1
if -f $img ] ; then
imgsize=`stat -L -c "%s" $img`
if $imgsize -gt $dvdmax ] ; then
error "size of image ;31;1m$imgsize ;37;0mbytes exceeds maximal dvd size: ;33;1m$dvdmax ;37;0mbytes"
elif $imgsize -gt $cdmax ] ; then
medium=2
echo "image $img (;31;1m$imgsize ;37;0mbytes) requires a dvd"
elif $imgsize -gt $cdrwmax ] ; then
medium=1
echo "image $img (;31;1m$imgsize ;37;0mbytes) requires a non rewritable cd"
fi
case $medium in
0|1)
-w $cdwriter ] || error "no write acces to device $cdwriter"
echo " - burning cd..."
exec cdrecord -v dev=$cdwriter $img
;;
2)
-w $dvdwriter ] || error "no write acces to device $dvdwriter"
echo " - burning dvd..."
exec growisofs -dvd-compat -Z $dvdwriter=$img
;;
esac
else
error "$img not found"
fi
exit
}
if "$1" == "-h" -o "$1" == "--help" ] ; then
help
elif "$1" == "-b" -o "$1" == "--boot" ] ; then
bootable=1
shift
if "$1" == "-w" -o "$1" == "--burn" ] ; then
burn=1
shift
fi
elif "$1" == "-w" -o "$1" == "--burn" ] ; then
burn=1
shift
if "$1" == "-b" -o "$1" == "--boot" ] ; then
bootable=1
shift
fi
elif "$1" == "-i" -o "$1" == "--img" ] ; then
shift
img=$1
burnimg $img
elif "$1" == "-B" -o "$1" == "--blank" ] ; then
-w $cdwriter ] || error "no write acces to device $cdwriter"
echo " - blanking cd..."
exec cdrecord blank=fast dev=$cdwriter
elif "$1" == "-e" -o "$1" == "--blankdvd" ] ; then
-w $dvdwriter ] || error "no write acces to device $dvdwriter"
echo " - blanking dvd..."
exec dvd+rw-format -force $dvdwriter
fi
"$1" != "" ] && srcdir=$1 && shift
if $bootable -gt 0 ] ; then
rel=`uname -r`
mac=`uname -m`
ver=${rel/./}
title="$OS $rel"
bs=$OS/$rel/$mac/floppy$ver.fs
cmd="$cmd -b $bs -c boot.catalog"
img_def=$OS$ver-$mac.iso
fi
if ! -d $srcdir ] ; then
error "Source directory ;33;1m$srcdir ;37;0mdoesn't exist"
elif $(ls -1 $srcdir | wc -l) -eq 0 ] ; then
error "Source directory ;33;1m$srcdir ;37;0mis empty"
fi
img=`pwd`/${1:-$img_def}
cd $srcdir >& /dev/null
if "x$title" != "x" ] ; then
sudo $cmd -V "$title" -o $img $srcdir
else
sudo $cmd -o $img $srcdir
fi
cd - >& /dev/null
if $burn -eq 1 ] ; then
echo "burnimg $img "
else
imgsize=`stat -L -c "%s" $img`
echo "image $img ($imgsize bytes) successfully created"
fi
Actually the original purpose of this script was to burn custom openBSD and NetBSD (bootable) installation DVDs. That’s why the code probably looks overcomplicated for a simple task such as burning iso images. But I mainly use it now to just burn Linux iso images (live CDs or DVDs).