Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After a power failure, my machine comes up but doesn't mount the raid disk because it isn't found (correctly). Using mdadm --examine on the partitions making up the raid device, I found that they are there, but with a different UUID and a new name after the power fail. The new name is clearly a bogus string from some other memory/disk location before the crash. I don't think it had a name before because it would previously auto-assemble on /dev/md0.

Linux actually auto-assembled the raid device, but I didn't notice at first because it was on a new device name (/dev/md/NEW_NAME), and had a new UUID. I was able to manually e2fsck check it, mount it and all of the data is there and good. Now I want to restore it to the old device, and old UUID. I know how I can do this by destroying it and recreating it, but that requires backing up and restoring the data. Actually I already have a day-old backup, so I could skip that part, but this is a really big drive and even the restore will be many hours.

How to fix this the quick way: fixing the raid superblock(s) without touching the data?

share|improve this question
Are you certain the UUID changed? I'm guessing the /dev/md/NEW_NAME is actually something like hostname:0, which would indicate it is the md0 array on that host. – dobey Oct 31 '12 at 15:54
Please provide more details, including the output of mdadm -D and references to the old UUID, such as /etc/fstab. – psusi Oct 31 '12 at 19:10
the NEW_NAME is actually an old hostname:0, not the current hostname. In the past, the device name was always literally "/dev/md0", now it is "/dev/md/old_host_name:0". The old UUID from /etc/mdadm.conf was "ARRAY /dev/md0 uuid=5aeb1f36-14de-497e-b28c-4b2d7792ed5f level=0 num-devices=2" – harry Oct 31 '12 at 21:21
the old UUID also matches that in /etc/fstab. Output from mdadm -D /dev/md/old_host_name\:0 is as expected, but too long to allow in a comment. Tail end is: Spare Devices : 0 Chunk Size : 64K Name : old_host_name:0 UUID : df23f4fc:e8d9394b:f5dfa552:852ba930 Events : 0 Number Major Minor RaidDevice State 0 8 19 0 active sync /dev/sdb3 1 8 35 1 active sync /dev/sdc3 – harry Oct 31 '12 at 21:32
"fixing the raid superblock(s) without touching the data?" using the backup. – Braiam Jul 28 '14 at 15:38

Your Answer


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

Browse other questions tagged or ask your own question.