LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices

Reply
 
Search this Thread
Old 05-21-2008, 12:23 PM   #1
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
Howto burn iso image on CD using the command line tool cdrecord


INTRODUCTION
==========
{EDIT: for burning an iso image on DVD see post #4 this thread}

this is a short description on how to burn an iso image on CD using cdrecord. i have found two good resources on the web but neither worked for me as they suggested. so i had to alter them a bit and this is what i did. let's assume you have an iso image located somewhere on your hd. i'll use the variable $MYISO to denote this file. here is a generic command template:
Code:
# cdrecord -v -eject speed=48 dev=0,0,0 $MYISO
-v turns on verbose mode
-eject ejects cd after burning
speed= gives the speed with wich to burn
dev= gives the device to use (i'm not sure if you can use /dev/xxx as notation. i think this should be no problem. however, if you have /dev/hdx won't work. see below)

now, most likely this will fail . if you have an IDE/ATAPI cd-drive then you will get an error message saying something like "couldn't open scsi driver", even if you did this as root. it will suggest to
Code:
# cdrecord -scanbus
which will also return an error if scsi emulation is not enabled for the cd drive with which you are trying to burn. so first we have to...

ENABLE SCSI EMULATION
================

{EDIT: check your kernel version first. if you have a 2.4 kernel you can follow the steps as provided. if you have a 2.6 kernel you don't need to enable scsi emulation just use the prefix ATAPI in the cdrecord command:
Code:
cdrecord -v -eject speed=48 dev=ATAPI:0,0,0 $MYISO
}

this is quite easy. do:
Code:
$ dmesg | grep ATAPI
you'll get a list of your IDE/ATAPI devices. your cd drive should be one of those. example output (from [2]):
Code:
hdc: PHILIPS CDRW1610A, ATAPI CDROM drive
hdc: ATAPI 40X CD-ROM CD-R/RW drive, 8192kB Cache
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
N.B.: you need to have scsi emulation compiled into your kernel or as module. if you don't you need to compile one . but this is beyond the scope of this howto.

[1] claims that you need to configure /etc/modules.conf and /etc/lilo.conf to make scsi emulation available. yet, when i altered /etc/modules.conf i got a bunch of error messages and in the end not even my mouse worked. so i left it out and followed mainly [2]. if you have grub instead of lilo you still might want to take a look in [1]. what you basically need to do is to claim the cd drive for the scsi emulation. put the line:
Code:
append="hdx=ide-scsi"
at the end of your lilo.conf. where hdx denotes you cd drive. that's why we did "dmesg | grep ATAPI". when i tried this step according to [1], lilo complained about two append lines (?!). if you are trying to claim two drives for the scsi emulation, you should try it like this:
Code:
append="hdx=ide-scsi hdy=ide-scsi"
after you did this, do:
Code:
# lilo
# shutdown -r now
after rebooting do:
Code:
$ dmesg | grep scsi
you should have an output like this:
Code:
Detected scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
N.B.: after scsi emulation claimed your cd drive the associated /dev file has changed. you can't mount a cd using the old /dev/hdx. instead, the output of the above command tells you that the /dev file associated with your cd drive is sr0. so a mount command should look like this: "mount -t iso9660 /dev/sr0 /mnt".

another important thind is the dev name is displayed in "scsi notation" meaning as integer triplet of channel,id,lun. in the example 0,0,0. you should use this when specifying the dev with cdrecord. you can also do:
Code:
# cdrecord -scanbus
this should work now and give you something like this:
Code:
Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
Linux sg driver version: 3.1.25
Using libscg version 'schily-0.8'.
scsibus0:
        0,0,0     0) 'TEAC    ' 'CD-W552D        ' '1.00' Removable CD-ROM
        0,1,0     1) *
        0,2,0     2) *
        0,3,0     3) *
        0,4,0     4) *
        0,5,0     5) *
        0,6,0     6) *
        0,7,0     7) *
you see the scsi bus is 0,0,0.

the last step is to burn with the above mentioned command. be sure to know which speed your burner is capable of:
Code:
# cdrecord -v -eject speed=48 dev=0,0,0 $MYISO
and ready. EOP

good luck, vadkutya

RESOURCES
========

[1] http://www.ibm.com/developerworks/li.../l-cdburn.html
[2] http://newbiedoc.sourceforge.net/tut...p-scsi.html.en

Last edited by vadkutya; 05-24-2008 at 09:39 AM.
 
Old 05-21-2008, 01:22 PM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Is the scsi emulation of IDE drives still really needed?

EDIT: here's what I thought about, quoted from the documentation of Linux kernel (this piece from 2.6.25.4 kernel from kernel.org):
Quote:
CONFIG_BLK_DEV_IDESCSI:

WARNING: ide-scsi is no longer needed for cd writing applications!
The 2.6 kernel supports direct writing to ide-cd, which eliminates
the need for ide-scsi + the entire scsi stack just for writing a
cd. The new method is more efficient in every way.

This will provide SCSI host adapter emulation for IDE ATAPI devices,
and will allow you to use a SCSI device driver instead of a native
ATAPI driver.

This is useful if you have an ATAPI device for which no native
driver has been written (for example, an ATAPI PD-CD drive);
you can then use this emulation together with an appropriate SCSI
device driver. ---

Last edited by b0uncer; 05-21-2008 at 01:34 PM.
 
Old 05-21-2008, 04:38 PM   #3
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Original Poster
Rep: Reputation: 16
sry, should have posted that i'm still using a 2.4 kernel. thanx for the direction

vadkutya
 
Old 05-24-2008, 09:37 AM   #4
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Original Poster
Rep: Reputation: 16
Howto burn iso image on DVD using command line tool growisofs

this is a little add on to the previous howto. if you'd like to burn an iso image to dvd you can use "growisofs" which is part of the dvd+rw tool set, i think.

1. CREATING AN ISO IMAGE
=================
Code:
$ mkisofs -oBAK001.iso -J -rock -v -V BAK001 /some-dir
-o specifies the output file
-J MS Joliet naming conversion. needed for compatibility with DOS 8.3 file naming convention.
-rock Rock Ridge extensions for longer filenames
-v verbose
-V label which shows up e.g. in Explorer under MS Windows
/some-dir the directory you want to create an iso image of

2. BURNING
=======
this is quite simple as well:
Code:
# growisofs -dvd-compat -Z /dev/hdc=BAK001.iso -speed=2
-dvd-compat from the manpage:" Provide maximum media compatibility with DVD-ROM/-Video. In write-once context (DVD+R and DVD-R) this results in unappendable recording (closed disk). In DVD+RW context it instructs the logical unit to explicitly burn [otherwise optional] lead-out."
-Z write-once and close track. you can simply pass the device and append the iso filename
-speed give the speed with which to burn. 2x is safe burn

EOP

i just burned a backup on dvd. it worked flawlessly. there is one point to mention though. growisofs doesn't do shell expansions. so, "growisofs ... -Z /dev/hdc=~/BAK001.iso ..." will not work.

good luck, vadkutya

3. REFERENCE
==========
[3] http://www.yolinux.com/TUTORIALS/Lin...ialCDBurn.html

Last edited by vadkutya; 05-24-2008 at 09:42 AM.
 
Old 05-24-2008, 09:55 AM   #5
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
It's all right, just caught my eye..probably people would first try burning and succeed and forget about ide-scsi emulation before actually modifying their kernel, but better safe than sorry.

I'm not sure how it is with the "new" blu-ray discs (well they aren't actually new anymore..), there seem to be some blu-ray drives for computers at shops, but I don't recall seeing anything writable..well maybe writable blu-ray discs come later, but when they do, remember to add here instructions for them as well.
 
Old 05-24-2008, 10:17 AM   #6
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by b0uncer View Post
It's all right, just caught my eye..probably people would first try burning and succeed and forget about ide-scsi emulation before actually modifying their kernel, but better safe than sorry.
i edited the first post, so if someone is using linux 2.6 they can use the alternative command. i don't know anything about blu-ray disk unfortunately...

vadkutya
 
Old 10-01-2008, 05:36 AM   #7
fhleung
Member
 
Registered: Aug 2004
Distribution: Fedora, Debian
Posts: 333

Rep: Reputation: 30
2 commands mkisofs and cdrecord need to write iso file to disc.

To mkisofs make iso image, need other files like .bin, .catalog, root image etc.
Code:
mkisofs -o filename.iso -b isolinux.bin -c boot.catalog -no-emul-boot -boot-load-size 4 -boot-info-table -r <directory>
<directory> is where the root image, initial ram disk etc files are.


To cdrecord the iso file to disc, I simply
Code:
cdrecord -v dev=/dev/cdwriter isofile.iso
check your CD/DVD writer name at /dev




How to burn .iso file to CD as data? NOT un-pack the files inside the iso image.

Last edited by fhleung; 10-01-2008 at 05:39 AM.
 
Old 03-21-2010, 07:54 AM   #8
gauchao
Member
 
Registered: Dec 2009
Distribution: SLACKWARE 14.1 64bit
Posts: 158

Rep: Reputation: 24
Quote:
# cdrecord -v -eject speed=48 dev=0,0,0 $MYISO
Just don't forget not to type the $ before the ISO name.
 
  


Reply

Tags
burning, cd, cdrecord, commandline, dvd, image, iso


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to burn DVD iso using cdrecord slacknewbie2 Slackware 5 05-21-2009 04:12 PM
CDRecord - Misc. Issues # Would like to burn an ISO BlueSpirit Slackware 16 03-25-2007 07:09 PM
Trying to burn BeOS ISO Using CDRecord in Linux linux-rulz Linux - General 4 09-10-2005 04:02 PM
how do you force cdrecord to burn a non-iso9660 image? hedpe Linux - Software 3 08-01-2005 01:36 PM
Command line question - creating ISO image satimis Linux - General 8 09-25-2004 03:18 AM


All times are GMT -5. The time now is 03:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration