Just a little help before I kill anything with dd...
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Distribution: Fedora mainly, but I am open to others.
Posts: 273
Rep:
Just a little help before I kill anything with dd...
Hey,
Situation: I have an older, slower computer that I am replacing with a new one that I'm building. So, computer A (old) is being replaced with computer B (new).
I want to copy hard drive A, which is an old IDE drive, to hard drive B which is a faster SATA drive. I will be using my laptop to copy A to be B via external USB enclosures. So, in the end, I'd like the new drive to be bootable in the new computer. Which, if I'm not mistaken, the dd command will accomplish.
Distribution: Fedora mainly, but I am open to others.
Posts: 273
Original Poster
Rep:
Good catch, Jan... I don't think I need to identify a partition. I think the hard drive is just one big partition.
The hard drives will be equal size, too.
I'm only a little concerned about the drive needing to be formatted first. Anyone else care to elaborate on that?
Also, any idea on how long this will take? The source is an 80GB drive with 25GB used. It will be going over USB 2.0. I'm anticipating anywhere between an 1 1/2 - 2 1/2 hours.
Last edited by BallsOfSteel; 05-19-2009 at 02:55 PM.
Good catch, Jan... I don't think I need to identify a partition. I think the hard drive is just one big partition.
It all depends on what do you want to do, really. dd just read and write bytes, it is not concerned about file systems, formats or any other higher level thing. It just copy bytes from point A to point B and that's about everything it understands. For dd, file system structures and the proper data which forms our files are both the same thing. So it also copies the "formatting".
So, if you use if=/dev/sdc you will be making a 1:1 image of the whole contents of the device. Boot sector, partitions and filesystems included. Also including the free space, since for dd it's not really free. It will still copy whatever it can read.
A thing you should be concerned about when using dd is that if the destination disk is not exactly of the same size (or bigger) then the end of your file system will not be ok, and that can cause some serious problem if not fixed.
Quote:
I'm only a little concerned about the drive needing to be formatted first. Anyone else care to elaborate on that?
If you are copying a whole filesystem you don't need to format previously. The whole device you use will be overwritten with whatever you throw into it. So, if you plan to dd sdc to sda you can just do "dd if=/dev/sdc of=/dev/sda". If you plan to do it at partition level instead you first must make sure that sda1 is of the same size of sdc1, and proceed the same. You don't need to format sda1.
Quote:
Also, any idea on how long this will take? The source is an 80GB drive with 25GB used. It will be going over USB 2.0. I'm anticipating anywhere between an 1 1/2 - 2 1/2 hours.
Expect a longer time at least to read the IDE drive. Which takes me to the next point: why at all do you want to use dd when you could just use tar -cfzpf instead? The image would be much smaller, and more importantly, you wouldn't be copying 55 GBs of empty space. Yes, you need to create the partitions by hand and format them, but that's the only extra step. Even with dd, you still need to adjust the bootloader config and fstab.
Distribution: Fedora mainly, but I am open to others.
Posts: 273
Original Poster
Rep:
Quote:
Originally Posted by i92guboj
Expect a longer time at least to read the IDE drive. Which takes me to the next point: why at all do you want to use dd when you could just use tar -cfzpf instead? The image would be much smaller, and more importantly, you wouldn't be copying 55 GBs of empty space. Yes, you need to create the partitions by hand and format them, but that's the only extra step. Even with dd, you still need to adjust the bootloader config and fstab.
I'm not familiar with that tar command. This is my first venture into copying one drive on to another. Mind you, this is a Windows box. Normally I'd reinstall everything... however, this is a box that we use to run a program that runs steel buildings for us. I just don't feel like going through all of the leg work of reinstall everything. I thought that dd would be faster and easier.
I'm not familiar with that tar command. This is my first venture into copying one drive on to another. Mind you, this is a Windows box. Normally I'd reinstall everything... however, this is a box that we use to run a program that runs steel buildings for us. I just don't feel like going through all of the leg work of reinstall everything. I thought that dd would be faster and easier.
If you have a more efficient way, please tell.
Oh, I didn't know that the drive you want to backup was a windows install. Then by all means use dd. Windows is dumb like a donkey and will break if you copy the files or compress them with tar. A disk image is probably better if it's windows which you want to backup.
Mmmm - I don't like dd for this sort of thing. And when you say the disks will be the same size, be very careful. Even same models from the same manufacturer can differ in total cylinder count. As stated above, ensure the target is larger (or at least not smaller).
Copying 80 Gig one sector at a time will take ages - better hope that's a USB 2.0 spec.
Personally I don't screw around like that with NTFS too much, but if I did I'd be looking at ntfsclone. Filesystem aware copying is always better IMHO - but note the warnings on copying NTFS boot partitions. Seeing as it's a separate disk, you can always retry if it does fail.
However, now that I remember you are going to have problem if the names are named differently. Windows hardcode things, and that means that if you dd from disk A to disk B a windows install when disk A is IDE and disk B is SATA, then the installation will break. I've seen how windows is unable to boot when you just change a SATA disk to IDE emulation mode on the BIOS. So I guess that you are going to have problems no matter what you do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.