Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
The command you want is 'dd'. Assuming the drives are the same size (or the destination is larger):
dd if=/dev/hde of=/dev/hdf
The above will copy every block from the source (/dev/hde in this example) to the destination (/dev/hdf in the example). You can increase the buffering which may speed the copy if you have the memory, by specifying the 'bs' option:
does the second drive have to be formatted first? if so... how do i do that. cfdisk let's me tell it to be "linux" format, but i had to go through the slack installer to actually make it ext3. how do i format it in ext3 then?
You don't need to format it before the copy - any existing format will be overwritten. All blocks, including the filesystem overhead, partition tables, master boot record, etc. are being copied.
To format a partition as ext3, the command is (where /dev/hdx1 is the partion you want to format):
mke2fs -j /dev/hdx1
An ext3 partition is an ext2 partition with a journal (the -j option).
Will that also work for partitions?
If i just say dd if=/dev/hda1 of=/dev/hdb2
... will it just copy those partitions or will it try to copy the entire hard drives (therefore wiping files i need.)?
Last edited by lunarcloud_88; 07-29-2005 at 09:53 AM.
ok... now that i've moved it and realized it thinks its the same sized partition... how to i do that?
Can I be using the partition to be enlarged while running resize2fs?
Do I have to specify -j for ext3?
Last edited by lunarcloud_88; 07-30-2005 at 09:50 AM.
No, you don't want to use it while it's being resized. It should not be a mounted partition. To resize it (assuming it's called /dev/hdb2) to fill the new partition:
I have a 80Gig WD drive that's about to die. I purchased another 80Gig WD drive and partitioned the drive the same as the first drive. I did "dd if=/dev/hda of=/dev/hdb" and the hard drive light started flickering. This has been going on for about 6 hours.
How long should it take to completely copy an 80 Gig drive.?
I have a 80Gig WD drive that's about to die. I purchased another 80Gig WD drive and partitioned the drive the same as the first drive. I did "dd if=/dev/hda of=/dev/hdb" and the hard drive light started flickering. This has been going on for about 6 hours.
How long should it take to completely copy an 80 Gig drive.?
Thanks...
Normally better to start a new thread--but you question is pretty close to the original....
To use dd, there is no need to partition anything--it is doing low-level copy---bit by bit.
An easy way to answer your question **for your machine**:
dd if=/dev/hda of=/dev/hdb bs=1M count=10
See how long that takes...the same command without "count=10" will take 8,000 times longer (80GB/10MB)'
Also, I think dd goes faster when you specify a larger block size--I've never played with it though
Normally better to start a new thread--but you question is pretty close to the original....
To use dd, there is no need to partition anything--it is doing low-level copy---bit by bit.
An easy way to answer your question **for your machine**:
dd if=/dev/hda of=/dev/hdb bs=1M count=10
See how long that takes...the same command without "count=10" will take 8,000 times longer (80GB/10MB)'
Also, I think dd goes faster when you specify a larger block size--I've never played with it though
Like I said, I'm new to this.
It's been going for 8 hours, should I stop it and start again.?
What should I use for the best results (the "EXACT" command line) and how long should it take to copy the drive.?
Since I partitioned the drive is there anything I need to do or does it just rewrite over everything.?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.