LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices


By Kenny_Strawn at 2011-02-20 14:52
I know many people who post here on LQ may think that the GUI is the only way to clone a CD or DVD, but it isn't. If you happen to be running a dumb terminal, you can clone with dd.

This command not just allows you to clone CDs or DVDs, but also hard disks and USB flash drives, creating exact 1:1 copies of these disks. But be warned: When you clone one hard drive onto another, you erase the contents of one drive with the contents of another. You can also use dd to create an image file with the contents of a hard drive, CD, DVD, or USB flash drive for later cloning. Let's get started!

Create an image of a hard drive for later use:

Code:
dd if=/dev/sda of=/mnt/hdd.img #be warned: the image created may be too large for your hard drive
Clone the image back onto another drive:

Code:
dd if=/mnt/hdd.img of=/dev/sda
Clone the contents of one partition onto another:

Code:
dd if=/dev/sda1 of=/dev/sda2
Clone the contents of a whole hard drive onto another completely different drive:

Code:
dd if=/dev/sda of=/dev/sdb
Clone one CD or DVD onto another in a separate drive:

Code:
dd if=/dev/sr0 of=/dev/sr1 #or 'dd if=/dev/cdrom of=/dev/cdrom0'
Create an image of a CD or DVD to later clone onto another:

Code:
dd if=/dev/cdrom of=/mnt/cdbackup.iso
Clone the image back onto another CD or DVD:

Code:
dd if=/mnt/cdbackup.iso of=/dev/cdrom
Clone drives over a network:

Code:
dd if=/dev/sda | ssh username@host "dd of=/dev/sda"
Dump an image over a network:

Code:
dd if=/dev/sda | ssh username@host "dd of=/mnt/hdd.img"
Clone a networked drive onto yours:

Code:
ssh username@host "dd if=/dev/sda" | dd of=/dev/sda
Clone a networked image onto yours:

Code:
ssh username@host "dd if=/mnt/hdd.img" | dd of=/dev/sda
BE WARNED!! Most of these commands will ERASE the contents of disks with new content! USE THESE COMMANDS WITH CAUTION! If you can heed the warnings, you can use this command very usefully, for example to create backups of drives onto external ones.

NOTE: For more information on dd, see this LQ thread.


by Kenny_Strawn on Mon, 2011-02-21 22:44
Sorry for the inconvenience regarding the duplicates; apparently my Chrome notebook froze and I ended up pressing "Post article" four times.

by corp769 on Mon, 2011-02-21 22:47
Nice. Hate when that happens.... well it doesn't happen to me, cause I don't use a laptop from google. LOL.... Speaking of which, how is that thing anyway? I am thinking about trying to get one.

by Kenny_Strawn on Mon, 2011-02-21 22:55
So far, I have experienced very few bugs, but it's not like I have none together. In particular, there's one bug where the screen resolution seems to constantly rise to a level so high that some themes fail to render...

However, no worries. I was able to create my own theme, and I was able to (via the Chrome Theme Creator) set the New Tab Page background to be repetitive so I don't have that problem.

Take a look:

https://lh5.googleusercontent.com/_7...221-190507.png

I also reported the bug.

by corp769 on Tue, 2011-02-22 00:00
Ooo I like that. Is it worth getting?

by Kenny_Strawn on Tue, 2011-02-22 18:48
Here is the theme's Chrome Web Store page:

https://chrome.google.com/webstore/d...eneei?hl=en-US

by unSpawn on Tue, 2011-02-22 19:15
Apart from this discussion thread straying from it's intended purpose, in your text you listed "dd if=/mnt/cdbackup.iso of=/dev/cdrom" as a way to burn an ISO to CDROM. Did you actually test that command writing a valid CDFS to an empty CDROM? Didn't you get any errors? Could you read slash verify the result for real?

by Kenny_Strawn on Tue, 2011-02-22 22:59
Quote:
Originally Posted by unSpawn View Post
Apart from this discussion thread straying from it's intended purpose, in your text you listed "dd if=/mnt/cdbackup.iso of=/dev/cdrom" as a way to burn an ISO to CDROM. Did you actually test that command writing a valid CDFS to an empty CDROM? Didn't you get any errors? Could you read slash verify the result for real?
The command is provided that a CD is in the drive...

by TobiSGD on Wed, 2011-02-23 07:37
Have you tested that? I doubt that this will work.

by Kenny_Strawn on Wed, 2011-02-23 20:24
Quote:
Originally Posted by TobiSGD View Post
Have you tested that? I doubt that this will work.
I have tried it with a CD in the drive, and it does work. First, with the CD mounted, you run 'fdisk -l' and then, when the device file for the CD or DVD drive is determined, you dd the image to it. It works for me, at least from an external CD ROM drive.

by Kenny_Strawn on Wed, 2011-02-23 22:44
And I didn't mention trying to dd "back" onto the CD it came from, I was referring to cloning one CD onto another via the use of an image so that you can copy the CD or DVD multiple times with just one CD or DVD drive.


  



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

Main Menu
Advertisement
Advertisement
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
Open Source Consulting | Domain Registration