<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gHacks technology news &#187; burn cds</title>
	<atom:link href="http://www.ghacks.net/tag/burn-cds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 23:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Burn CDs From Command Line</title>
		<link>http://www.ghacks.net/2009/01/27/burn-cds-from-command-line/</link>
		<comments>http://www.ghacks.net/2009/01/27/burn-cds-from-command-line/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 18:16:07 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Music and Video]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Advanced]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[burn cds]]></category>
		<category><![CDATA[cdrecord]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[mkisofs]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=10173</guid>
		<description><![CDATA[Recently I wrote a simple how-to for burning CDs in GNOME (Easy CD Burning in GNOME.) From that article a request came in to illustrate how to burn from the command line. This ability illustrates the flexibility of the Linux operating system. Not only can you burn CDs from an outstanding, and simple, GUI, you [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wrote a simple how-to for burning CDs in GNOME (<a title="Easy CD Burning in GNOME" href="http://www.ghacks.net/2009/01/26/easy-cd-burning-in-gnome/" target="_blank">Easy CD Burning in GNOME.</a>) From that article a request came in to illustrate how to burn from the command line. This ability illustrates the flexibility of the Linux operating system. Not only can you burn CDs from an outstanding, and simple, GUI, you can burn them from commands.</p>
<p>In this article we will cover the <em>cdrecord</em> and <em>dd </em>commands where we will burn ISO images, data backups, and audio CDs.</p>
<p><span id="more-10173"></span><strong>Installing cdrecord and dd<br />
</strong></p>
<p>By default, <em>cdrecord</em> and <em>dd</em>, should be installed. If not you can find it in your Add/Remove Software utility by searching for &#8220;cdrecord&#8221; and &#8220;dd&#8221;. Once you have installed the applications open up a terminal window and get ready.</p>
<p>The first thing you need to do is to determine where your device is located. To locate your device issue the command <em>cdrecord -scanbus</em>. When the command runs you should see output similar to:</p>
<p><em> 1000,0,0 100000) *<br />
1000,1,0 100001) *<br />
1000,2,0 100002) &#8216;HL-DT-ST&#8217; &#8216;RW/DVD GCC-T10N &#8216; &#8216;1.00&#8242; Removable CD-ROM<br />
1000,3,0 100003) *<br />
1000,4,0 100004) *<br />
1000,5,0 100005) *<br />
1000,6,0 100006) *<br />
1000,7,0 100007) *</em><br />
As you can see above, my device is listed. The listing information I take out of this is 0,2,0. If your scanbus reports the number before the first &#8220;,&#8221; as a 1000 you will only want the last digit &#8211; in my case a 0. If scanbus reports only a 0 before the first &#8220;,&#8221; that will be your first number in your device location. So my device is 0,2,0.</p>
<p>This device address will be plugged into the command for burning in conjunction with the <em>dev=</em> argument.</p>
<p><strong>Burning ISO image</strong></p>
<p>You have data on a CD that you want turned into an ISO image. This could be a Linux distribution or anything. To do this you would issue the command:</p>
<p><em>dd if=/dev/cdrom of=</em><em>ISO_file.iso</em></p>
<p>Where <em>/dev/cdrom </em>is the location of your CD device and <em>ISO_file.iso </em>name of the ISO image you want to create. NOTE: If you are wanting to put the ISO image file in a location other than where you are issuing the command, use the full path to the file name.</p>
<p>You can also make use of the <em>mkisofs</em> command to create ISO images of directories on your hard drive. The command for this would look like:</p>
<p><em>mkisofs -o Directory.iso Directory</em></p>
<p>Now let&#8217;s burn that ISO image to a CD. To do this issue a command similar to:</p>
<p><em>cdrecord dev=0,0,0 -data speed=48 </em><em>ISO_file.iso</em></p>
<p>The above command would put the ISO_file.iso file onto a burnable CD. If you know the actual burning speed of your device you can make adjustments to the command above.</p>
<p><strong>Burn Audio CDs</strong></p>
<p>What everyone has been waiting for. How to burn audio CDs. You could easily burn a directory full of .wav files with the command:</p>
<p>cdrecord dev=0,0,0 -eject speed=48 -pad -audio *.wav</p>
<p>But let&#8217;s take this one step further and create a handy bash script that will do the following:</p>
<p>Convert spaces in file names to underscores.</p>
<p>Convert .mp3 files to .wav files.</p>
<p>Burn all .wav files to cd.</p>
<p>Here is the script:</p>
<p><em>#!/bin/sh</em></p>
<p><em># Convert spaces to underscores<br />
for i in *.mp3; do mv &#8220;$i&#8221; `echo $i | tr &#8216; &#8216; &#8216;_&#8217;`; done</em></p>
<p><em># Convert MP3 files to WAV files<br />
for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done</em></p>
<p><em># Burn the CD<br />
cdrecord dev=0,0,0 -eject speed=48 -pad -audio *.wav</em></p>
<p>Once you have created the script, make sure you chmod the file so it is executable like this:</p>
<p>chmod u+x burn_script</p>
<p>To run the script first move it into the directory that contains your mp3 files and issue the command .<em>/burn_script</em>. Or you can copy the <em>burn_script</em> to <strong>/usr/bin<em> </em></strong>so it is a global command.</p>
<p><strong>Final Thoughts</strong></p>
<p>Linux is an incredibly flexible operating system. The ability to burn CDs from the command line proves just how flexible it is. Do you have other tricks you like to use along these lines? If so, share them.</p>

	Tags: <a href="http://www.ghacks.net/tag/burn-cds/" title="burn cds" rel="tag">burn cds</a>, <a href="http://www.ghacks.net/tag/cdrecord/" title="cdrecord" rel="tag">cdrecord</a>, <a href="http://www.ghacks.net/tag/command-line/" title="command-line" rel="tag">command-line</a>, <a href="http://www.ghacks.net/tag/dd/" title="dd" rel="tag">dd</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/mkisofs/" title="mkisofs" rel="tag">mkisofs</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/02/13/searching-for-files-in-linux-via-command-line/" title="Searching for Files in Linux via Command Line (February 13, 2009)">Searching for Files in Linux via Command Line</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/02/18/linux-command-line-fu/" title="Linux Command Line Fu (February 18, 2009)">Linux Command Line Fu</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/02/06/get-to-know-linux-gnome-terminal/" title="Get To Know Linux: gnome-terminal (February 6, 2009)">Get To Know Linux: gnome-terminal</a> (5)</li>
	<li><a href="http://www.ghacks.net/2009/01/17/dd-the-ultimate-disk-cloning-tool/" title="dd: the ultimate disk cloning tool (January 17, 2009)">dd: the ultimate disk cloning tool</a> (11)</li>
	<li><a href="http://www.ghacks.net/2009/03/20/create-dvds-in-linux-with-devede-mkisofs-and-k3b/" title="Create DVDs in Linux with DeVeDe, mkisofs, and K3B (March 20, 2009)">Create DVDs in Linux with DeVeDe, mkisofs, and K3B</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/27/burn-cds-from-command-line/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
