How to make a byte for byte copy of a drive?

8,221

Solution 1

If the device is there at /mnt/md0 or wherever then dd will work, to backup to a file use:

dd if=/dev/md0 of=/tmp/raid1.img

the output can be another device:

dd if=/dev/md0 of=/dev/sdb

Solution 2

There are a variety of tools that you can use. dd is probably as good as many. Clonezilla is a good tool, there are more on this wikipedia page too.

Solution 3

Bearing in mind it won't mount to Linux or Windows at this point, what are the options?

As advised use DD or Clonezilla. They do not need the drive to be mounted - just present and visible by the OS (i guess at one of these points: /dev/sd[0-9] ). If you want to do it to more than one drive from a raid configuration - image/backup them one by one writing their position (sequence in raid) so you know which one after which was in the raid configuration and to witch raid controller port connected

Share:
8,221
Matt Peddlesden
Author by

Matt Peddlesden

Updated on September 18, 2022

Comments

  • Matt Peddlesden
    Matt Peddlesden over 1 year

    Possible Duplicate:
    Using DD for disk cloning

    What's the easiest and most reliable, risk free, way of making an exact copy of a hard drive?

    We have a drive that's been messed up by someone re-initialising RAID on it and before we start playing with solutions for fixing it i'd like to get an exact copy of it.

    Bearing in mind it won't mount to Linux or Windows at this point, what are the options?

    The only one that springs to my mind is DD in Linux. Recommendations appreciated.

    • Ben Pilbrow
      Ben Pilbrow about 13 years
      This is a duplicate, but I don't think it deserves a downvote...
    • Matt Peddlesden
      Matt Peddlesden about 13 years
      Thanks, the main reason for posting this question was to find out if using DD was going to be the right way - it's a fair while since I used it for this kind of thing and wanted to ensure that my approach wasn't going to be an old outdated approach that had since been superceded by modern tools. Thanks to all for confirming!
    • Ben Pilbrow
      Ben Pilbrow about 13 years
      I used the examples in the question I linked to only a few weeks ago - definitely still relevant and still very good :-)