Find the answer to your Linux question:
Results 1 to 8 of 8
Like Tree1Likes
  • 1 Post By ktech11
Hello Friends, I am trying to clone my internal hdd to a usb hdd using dd and I cannot figure out how to do it. I have looked at the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    11

    Trying to clone a hdd using the dd command and I need some assistance


    Hello Friends,

    I am trying to clone my internal hdd to a usb hdd using dd and I cannot figure out how to do it. I have looked at the man pages, but they seem somewhat cryptic to me. Any help would be highly appreciated.

    Here are the details of my hdds:

    The hdd to be cloned: [/dev/sda]
    500.1 GB 500107862016 bytes
    255 heads
    63 sectors/track
    60801 cylinders
    total 976773168 sectors

    The hdd I'm cloning to: [/dev/sdb]
    80.0 GB 80026361856
    255 heads
    63 sectors/track
    9729 cylinders
    total 156301488 sectors

    I understand that I cannot copy the entire 500 GB to the 80 GB drive, but the data contained on the 500 GB drive is well under the 80 GB available on the drive to be cloned to. I have zeroed out the free space on the 500 GB drive so that it will not copy the free space. This should allow only the data to be copied to the 80 GB drive.

    The command used to zero out the free space is this:
    Code:
    dd if=/dev/zero of=0bits bs=20M; rm 0bits
    Now I simply need to know the exact syntax for use of the dd command as related to these hdds and any additional information you may have. I also need to know if I will need to resize my partitions on the destination drive once the cloning is complete. All information will be appreciated, thanks in advance.

  2. #2
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    Why not just use clonezilla? It is a bootable live CD to clone the drive from one to the other. It will do it for you and has a beginner mode to do it that is easy to follow.
    Clonezilla - About

    If you do want to use DD, here is a good set of instructions Using DD for disk cloning - Server Fault , but if you are cloning a file system that is mounted, you can have corrupted files in the clone. You can also use rsync to do the clone.
    completelinuxnube likes this.

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    11
    Thanks, ktech11. I am aware of Clonezilla, I wanted to try and do it another way if possible. I did not want to have to take the system down to do a clone, but if there is not a 100% viable way of doing it with a live system, then I have no choice. I see there is too much that can go wrong using DD. Thanks again.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    Rsync may be a way for you to do it if you need to keep the system up. Check out the man page rsync Man Page

  6. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    11
    Thanks again, ktech11 and please do not think of me as stupid, but I cannot make heads or tails out the man pages. It all seems so cryptic me. I have racked my brain hundreds of times trying to figure them out before turning to the forums, but I simply do not understand most of it. I need a guide to the guide, if you know what I mean.

  7. #6
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    No big deal. Give me a couple of minutes and I will give you a command that should work.

  8. #7
    Linux Newbie
    Join Date
    Jan 2012
    Location
    Ohio
    Posts
    175
    So I read a bit more on rsync, and it will not do what you want. I assume you want to clone a bootable drive. RSync does just files and directories. You will need to take the system offline to get the best result and keep the file system intact.

  9. #8
    Just Joined!
    Join Date
    Jul 2012
    Posts
    11
    Thanks for all the info Ktech11. It was worth a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •