LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2010, 04:46 PM   #1
SuperDude123
Member
 
Registered: Nov 2008
Posts: 158

Rep: Reputation: 30
dd command


I'm in the process of cloning one hard drive to an other. The one being cloned is a Segate and the one being written to is a Western Digital. They are both 500GB, and with fdisk -l, I see all the partitions of the segate [/dev/sda/1...7] and none for the WD [/dev/sdb] (fresh out of the box hard drive). I can see that they both have the same number of heads, sectors, cylinders, and bytes.

If I do dd if=/dev/sda of=/dev/sdb, will it conserve all the data on the Segate (sda) and clone it to the WD (sdb)? How much time should this take?
 
Old 01-03-2010, 05:04 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
That should work fine....

To see how long it will take, try some experiments with various block sizes, and a limited number of counts. Look at the data rate and use that to see how long 500GB will take. (I expect that it will be a good task to run overnight.)
 
Old 01-03-2010, 06:09 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,342
Blog Entries: 6

Rep: Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929Reputation: 1929
http://www.linuxquestions.org/questi...ommand-362506/

A long DD thread
 
Old 01-04-2010, 04:02 AM   #4
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
I personally use dcfldd, available in Debian repositories.

DD defaults to cloning sector per sector when a BS count is not included in the command, dcfldd defaults to cloning block per block which is faster if you don't need the rootkits and other forms of malware that could be installed in slack space. You can also give a BS count of 512 to dcfldd and it will clone sector for sector like dd does by default. Only thing different with dcfldd is that you get to observe the progress and you'll know more or less when it will be done, dd gives you a blank prompt giving one the impression it's frozen, and you may get nervous and shut it down prematurely.

A better dd command would be:
Code:
dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror
Most file systems use blocks or clusters to write data to, which can be 8 or more sectors per block. If a file is only 510 bytes in size, it will be written to one sector of the entire 8 sector block, the rest of the unallocated space/sectors is "slack space" containing nothing usable. DD will default to cloning all 8 sectors where dcfldd will only clone the data in the one sector and not the slack space.
 
  


Reply


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
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 03:14 AM
Automatically append another piped command to issued command in bash amateen Programming 1 05-07-2009 07:36 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 07:30 PM
Translating windows pscp command to linux scp command help robward Linux - General 2 01-17-2008 07:02 AM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 03:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:19 PM.

Main Menu
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