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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-18-2005, 05:47 AM
|
#1
|
LQ Newbie
Registered: Jun 2005
Posts: 4
Rep:
|
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
|
|
|
06-18-2005, 05:50 AM
|
#2
|
Member
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; Ubuntu Raspberry Pi OS
Posts: 255
Rep:
|
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.
|
|
|
06-18-2005, 07:47 AM
|
#3
|
Member
Registered: May 2005
Distribution: SuSE
Posts: 58
Rep:
|
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 12:30 PM.
|
|
|
06-18-2005, 09:57 AM
|
#4
|
LQ Guru
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163
Rep:
|
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.
|
|
|
06-18-2005, 11:02 AM
|
#5
|
LQ Newbie
Registered: Jun 2005
Posts: 4
Original Poster
Rep:
|
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
|
|
|
06-18-2005, 07:06 PM
|
#6
|
Member
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333
Rep:
|
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
|
|
|
06-18-2005, 09:32 PM
|
#7
|
LQ Newbie
Registered: Jun 2005
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
06-19-2005, 12:04 AM
|
#8
|
Senior Member
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|