Results 1 to 7 of 7

Thread: DD and cloning external harddrives of different sizes

  1. #1
    Join Date
    Jun 2008
    Location
    Degerfors, Sweden
    Beans
    60
    Distro
    Ubuntu 13.04 Raring Ringtail

    DD and cloning external harddrives of different sizes

    I'm not sure if this is the right area for this question, but I'll give it a go.

    In the past, I have used dd to replace (as well as overwrite) hard drives.

    If you do a direct clone of a drive, you are supposed to make sure the target drive is the same size as the source drive.

    It is quite important that I am able to clone a failing drive (250GB), however, my only other drive available is a completely new 1TB external hard drive from a different manufacturer.

    Is it still possible for me to safely clone the failing drive? If yes, how would I go about doing this? Make a 250GB partition on the 1TB drive?


    If I use the TB drive as a "temporary backup", and once I have copied over with dd burn everything directly to DVDs, and then restore the TB drive to it's original state, will this be able to be done?

  2. #2
    Join Date
    Jun 2005
    Location
    /Italy/Bologna/home
    Beans
    640
    Distro
    Ubuntu Development Release

    Re: DD and cloning external harddrives of different sizes

    If you're going to make a bit-by-bit copy, you don't need to make any partition on the target drive, which will become an exact copy (also in "virtual" size) of the source.

    When you say "failing", what do you mean exactly? If you can still read it, I'd suggest a file-by-file copy using rsync.

    Also, take a look at Clonezilla.

  3. #3
    Join Date
    Aug 2006
    Location
    South Side of Hell
    Beans
    134
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: DD and cloning external harddrives of different sizes

    I agree, if its readable file copy with rsync or other utility would be the easiest bet.

    if you must do a bit by bit copy then you would need to grab the whole disk rather than just a partition.

    example instead of
    Code:
    dd if=/dev/sda1 of=/dev/sdb1
    use
    Code:
    dd if=/dev/sda of=/dev/sdb
    this would leave your 1TB disk with a partition the exact size as the old 250GB disk and 750GB of free space. Which if it is a resizable filesystem such as ext3 or ext4 you can then use gparted to change the size of the partiion to the full 1TB and extend the filesystem to utilize it.


    Also on another note, if the disk is failing and you have bad sectors you may want to use something like ddrescue which does not error out on unreadable sectors.

  4. #4
    Join Date
    Jun 2008
    Location
    Degerfors, Sweden
    Beans
    60
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: DD and cloning external harddrives of different sizes

    Hm... I was supposed to get email notifications of replies... I need to recheck my settings. [/thinkoutloud]


    Thanks for the input guys.

    Yes, the drive is completely failing. It makes horrible clicking noises, and before it died it had crashed once already, but I was able to restore much data with chkdisk. However, this last time it failed miserably, and is no longer readable or repairable via chkdisk.

    I'm still kicking myself for procrastinating to backup the data while I had the chance.

    Quote Originally Posted by Nostalos View Post
    Also on another note, if the disk is failing and you have bad sectors you may want to use something like ddrescue which does not error out on unreadable sectors.
    Perfect! I was planning on using regular dd and tell it to keep going and ignore all errors (I'm pretty sure there is a flag for that), but ddrescue is just what I need.

    Since I'm running in Ubuntu anyway, is there any GUI for ddrescue? I prefer having all options available and visible to me instead of digging through the docs and hoping to God that I didn't misspell anything.



    One final thing, sadly, I had to start using the harddrive already due to another system that needed a fresh reinstall and I needed somewhere to backup the existing contents.

    Sorry for being difficult, but is there any way to preserve what is already on the external drive when restoring bit by bit?



    When I'm on the ActionScript forums, I am in control and on top of it all. Here I feel so helpless...

  5. #5
    Join Date
    Aug 2006
    Location
    South Side of Hell
    Beans
    134
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: DD and cloning external harddrives of different sizes

    There is no GUI for ddrescue, but then again there is not many commandline arguements for it.

    http://www.forensicswiki.org/wiki/Ddrescue has some examples.


    One final thing, sadly, I had to start using the harddrive already due to another system that needed a fresh reinstall and I needed somewhere to backup the existing contents.

    Sorry for being difficult, but is there any way to preserve what is already on the external drive when restoring bit by bit?
    Nope.


    P.S. there are 2 packages in the repositories. ddrescue and gddrescue. you want gddrescue.

  6. #6
    Join Date
    Aug 2006
    Location
    South Side of Hell
    Beans
    134
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: DD and cloning external harddrives of different sizes

    Had another thought as well. can use ddrescue to output to a file instead of another physical disk. Not sure of the syntax off the top of my head but you can then mount the file as a virtual disk in Ubuntu and recover the contents that way. As long as you have enough free space on the destination drive you can copy the entire 250GB partition bit by bit to the existing file system.


    Code:
    ddrescue --no-split /dev/hda1 /path/imagefile /path/logfile
    then as root (note this is from memory so may not be 100% correct)

    Code:
     sudo mount -t ext4 -o loop /path/imagefile /mnt
    provided its ext4 filesystem.
    Last edited by Nostalos; February 24th, 2010 at 02:12 AM.

  7. #7
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: DD and cloning external harddrives of different sizes

    I do not think you want to use dd to copy from a small disk to a large one. There was a previous thread were someone did that and his new large drive was set to be the small drive size. Nothing worked to resize the drive until he downloaded a utility from the drive mfg. Another thread had the same issue but the brand of drive had no utility.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Tags for this Thread

Bookmarks

Posting Permissions

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