LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 06-18-2005, 06:47 AM   #1
fechin
LQ Newbie
 
Registered: Jun 2005
Posts: 4

Rep: Reputation: 0
dd if=/dev/hda of=dev/hdb taking forever to complete


I've got a P42.6 with two 160 GB hard drives. I'm trying to make a copy of the hard drive by running the command: dd if=/dev/hda of=dev/hdb. I first booted the PC from a knoppix live cd. The command has been running now for 21 hours. Any ideal how long this should take? Is there any way to find out the current progress?

Thanks,
Paul
 
Old 06-18-2005, 06:50 AM   #2
n0xvb
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; openSUSE 11.2
Posts: 255

Rep: Reputation: 32
Re: dd if=/dev/hda of=dev/hdb taking forever to complete

Quote:
Originally posted by fechin
I've got a P42.6 with two 160 GB hard drives. I'm trying to make a copy of the hard drive by running the command: dd if=/dev/hda of=dev/hdb. I first booted the PC from a knoppix live cd. The command has been running now for 21 hours. Any ideal how long this should take? Is there any way to find out the current progress?

Thanks,
Paul
I don't know of a way to check progress, however I can say that I'm not surprised at the length of time. If the drives were on different intefaces, it would run much faster. Unfortunately that's the nature of the IDE beast.
 
Old 06-18-2005, 08:47 AM   #3
LinuxVB
Member
 
Registered: May 2005
Distribution: SuSE
Posts: 58

Rep: Reputation: 15
Increase the blocksize to the size of the cache on the drive.
Default blocksize is 512 bytes and it takes forever to clone a harddrive that way.

If you can do it, move the target drive to Secondary Master (hdc) and clone from Primary Master (hda). Transfers on the same ATA controller take longer.

Cloning a 160GB drive 2MB or 8MB at a time will take a long time regardless.
As I recall it was 45 minutes to clone a 9GB drive on the same SCSI bus as the target.
Here's a reference:
http://www.mail-archive.com/linux-ne.../msg03712.html

Last edited by LinuxVB; 06-18-2005 at 01:30 PM.
 
Old 06-18-2005, 10:57 AM   #4
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
Knoppix doesn't enable DMA unless you tell it to. So you will get an average speed of ~4MB/sec. Give the "DMA" option at boot or enable it by hand once booted with hdparm.
 
Old 06-18-2005, 12:02 PM   #5
fechin
LQ Newbie
 
Registered: Jun 2005
Posts: 4

Original Poster
Rep: Reputation: 0
The 160GB has been copying for 26 hours and counting. That would mean its transfering at most 1.75 meg per second. Can it really be that slow? Any slower and I should start using floppy disks!

Paul
 
Old 06-18-2005, 08:06 PM   #6
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 332

Rep: Reputation: 32
While this will complete, eventually, I'm not sure what it is that you want to accomplish. This procedure indeed copies the whole 160G, including empty space and all, from one disk to the next.

If the intent is to preserve the bootability of the cloned hard drive, this is iffy at best. Your hdb will be bootable (in another machine when it becomes hda) if, and only if, the disk geometry is exactly the same in both drives.

You are *much* faster just tar'ing the contents of each partition on your hda to the corresponding partition on hdb. I find that tar works better than cp -a.

So, first make the partitions on hdb the same as on hda and make the file systems on hdb. Say you have only hda1 that fills the whole disk.

mkdir /to /from
mount /dev/hda1 /from
mount /dev/hdb1 /to
cd /from
tar c . | tar xC /to

If you have more partitions, do this for each one.

This will run way faster because you don't copy empty space. hdb1 will, as a fringe benefit, also be defragmented.

You can make the new disk bootable in its new home easily.

I use a variant of this procedure to clone systems (instead of tar'ing from a live HD, I start from the tar'ed contents of each partition, else it's the same thing).

Hope it helps,
mlp
 
Old 06-18-2005, 10:32 PM   #7
fechin
LQ Newbie
 
Registered: Jun 2005
Posts: 4

Original Poster
Rep: Reputation: 0
The copy finally finished after 36 hours and the copied disk worked as expected. Thanks for the advice. I'll use the tar method in the future.
 
Old 06-19-2005, 01:04 AM   #8
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
Half_Elf is right about recent versions of Knoppix. Start it this way:

boot: knoppix dma

I use knoppix to copy partitions and noticed that it was dead slow after version 3.7. In version 3.7, dma acceleration was activated by default and you had to specify “no dma” to turn it off. Since version 3.7, you have to activate dma acceleration either at boot time or through the knoppix launcher.

Also, increasing the block size used by dd helps a lot. I usually use 128MB, but that's on systems with more than 256MB installed. Next time, try something like:

dd if=/dev/hda of=/dev/hdb bs=64M

With dma acceleration enabled, you should be able to transfer between ATA100 drives at about 1GB/min.
 
  


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
/dev/hda under lilo.conf even thoug my HD is under /dev/hdb Basel Slackware 8 10-27-2005 07:00 PM
Clone with dd if=/dev/hda of=/dev/hdb question wrc1944 Linux - Hardware 2 11-28-2004 10:10 AM
can't boot anymore /dev/hdb -> /dev/hde broxtor Linux - Hardware 4 11-13-2004 11:55 AM
mounting CD, CDRW... /dev/cdrom -> /dev/hda kersten78 Slackware 9 09-24-2004 12:53 AM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 06:11 AM


All times are GMT -5. The time now is 11:32 PM.

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