<?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; dd</title>
	<atom:link href="http://www.ghacks.net/tag/dd/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>Mon, 23 Nov 2009 22:22:46 +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>
		<item>
		<title>dd: the ultimate disk cloning tool</title>
		<link>http://www.ghacks.net/2009/01/17/dd-the-ultimate-disk-cloning-tool/</link>
		<comments>http://www.ghacks.net/2009/01/17/dd-the-ultimate-disk-cloning-tool/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 00:16:16 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[acronis true image]]></category>
		<category><![CDATA[clone disk]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[copy data]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[disk cloning]]></category>
		<category><![CDATA[disk image]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=9947</guid>
		<description><![CDATA[I recently had to clone a hard disk so I naturally turned to solutions such as Acronis True Image, but I discovered these did not work (the start-up disk claimed the clong was &#8216;complete&#8217; when it blatantly wasn&#8217;t) and I also tried copying the partition using gParted in Ubuntu but this froze at about 3%, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to clone a hard disk so I naturally turned to solutions such as Acronis True Image, but I discovered these did not work (the start-up disk claimed the clong was &#8216;complete&#8217; when it blatantly wasn&#8217;t) and I also tried copying the partition using gParted in Ubuntu but this froze at about 3%, due to corrupt data, which seemed not to be caught in a chkdsk.</p>
<p>I was about to give up hope and copy the files manually when I came across an extremely powerful, yet simple, Unix command: dd.</p>
<p>Using a Linux live disc, dd can be used to copy files, disks and partitions. It can output directly onto another disc or as an image (like an iso).</p>
<p>dd copies data byte-exactly, meaning it won&#8217;t get stuck should it encounter corrupted or fragmented data.</p>
<p><span id="more-9947"></span>dd is nicknamed &#8216;destroy disk&#8217; as mistyping one letter can wipe your hard disk, so caution must be used.</p>
<p>To copy a hard disk, one would use the following command (whilst root):</p>
<p><code>dd if=/dev/hdx of=/dev/hdy</code></p>
<p>hdx is the input hard disk (to be copied) and hdy is the output hard disk (where it is to be copied to).</p>
<p>if = input<br />
of = output</p>
<p>This is extremely important to remember and their names must be altered according to how they are on your computer (use a tool like gParted to find out your drive&#8217;s paths). For example, your &#8216;if&#8217; may be /dev/sdb whilst your &#8216;of&#8217; may be /dev/sda, but this obviously varies according to how you want to use it and computer-by-computer so you MUST check. An extremely intelligent friend of mine accidentally wiped a hard drive using this command!</p>
<p>Another use would be to use it to produce a CD image:</p>
<p><code>dd if=/dev/cdrom of=image.iso bs=2k</code>.</p>
<p><a href="http://www.debianhelp.co.uk/ddcommand.htm"><br />
Debian Help has a more complete guide.</a></p>

	Tags: <a href="http://www.ghacks.net/tag/acronis-true-image/" title="acronis true image" rel="tag">acronis true image</a>, <a href="http://www.ghacks.net/tag/clone-disk/" title="clone disk" rel="tag">clone disk</a>, <a href="http://www.ghacks.net/tag/command/" title="command" rel="tag">command</a>, <a href="http://www.ghacks.net/tag/copy-data/" title="copy data" rel="tag">copy data</a>, <a href="http://www.ghacks.net/tag/dd/" title="dd" rel="tag">dd</a>, <a href="http://www.ghacks.net/tag/disk-cloning/" title="disk cloning" rel="tag">disk cloning</a>, <a href="http://www.ghacks.net/tag/disk-image/" title="disk image" rel="tag">disk image</a>, <a href="http://www.ghacks.net/tag/iso/" title="iso" rel="tag">iso</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/unix/" title="unix" rel="tag">unix</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/03/29/remote-ssh-run-processes-anywhere-on-different-platforms/" title="Remote SSH: Run processes anywhere on different platforms (March 29, 2009)">Remote SSH: Run processes anywhere on different platforms</a> (1)</li>
	<li><a href="http://www.ghacks.net/2008/11/08/iso-creator/" title="ISO Creator (November 8, 2008)">ISO Creator</a> (4)</li>
	<li><a href="http://www.ghacks.net/2006/12/03/how-to-easily-dump-ps3-movies-and-games/" title="How to easily dump PS3 movies and games (December 3, 2006)">How to easily dump PS3 movies and games</a> (7)</li>
	<li><a href="http://www.ghacks.net/2009/01/27/burn-cds-from-command-line/" title="Burn CDs From Command Line (January 27, 2009)">Burn CDs From Command Line</a> (4)</li>
	<li><a href="http://www.ghacks.net/2009/01/11/burn-cd-and-dvd-iso-images-with-k3b/" title="Burn CD and DVD ISO Images with K3B (January 11, 2009)">Burn CD and DVD ISO Images with K3B</a> (9)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/01/17/dd-the-ultimate-disk-cloning-tool/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
