Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Please advise what is the best way to create linux software raid image with dd?

/dev/md0 consists of /dev/sda & /dev/sdb.

  1. I ran dd if=/dev/sda of=sda.img same for sdb
  2. Restored on the remote system
  3. Restored MBR
  4. Now I'm getting some error that could be fixed with FSCK.

I wonder if there is a better way of doing it? on the running system though...

Thanks in advance

share|improve this question

migrated from stackoverflow.com Mar 8 '12 at 5:48

This question came from our site for professional and enthusiast programmers.

    
Post this to superuser.com. And make sure the partitions are flagged for MD. mdadm should show them even if the fs is not online. –  EdH Mar 8 '12 at 4:29
1  
The best way is to back up /dev/md0, not the devices in the raid array. If the array is assembled then the drives could go into an inconsistent state if one is updated after you backed it up, but before you backed up the other. –  Patrick Mar 8 '12 at 6:11

1 Answer 1

Why would you ever use dd in this situation? You should create the (I assume) RAID1 volume with the disk whose contents you want to keep and a missing component for the other drive, and then add the second drive in and let MD take care of the data copy. Note, though, that whether you use dd or not, you're going to have to leave some empty space at the end of the block device for MD to put it's metadata.

share|improve this answer
    
I'd imagine any situation in which you want an image of a raid device. RAID 1 isn't going to cut it if you're taking an image for a court case. –  Sirex Mar 8 '12 at 8:12
    
@Sirex: The question doesn't talk about creating an image of a RAID device, it asks "the best way to create linux software raid image with dd". –  womble Mar 8 '12 at 13:09
    
so what's the best way? to create a live software raid image then ?Thanks –  RomanG Mar 9 '12 at 2:16
    
I guess I don't understand. I read your "the best way to create linux software raid image with dd" as exactly what you say this question isn't about. odd. –  Sirex Mar 9 '12 at 15:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.