RAID5 Recovery
Hi,
I had a run-in with the Ubuntu Server installer, and in trying to get the new system to recognize the clean 5-disk raid5 array left behind by the previous Ubuntu system, I think I inadvertently instructed it to create a new raid array using those same partitions.
What I know for sure is that now, I get this:
user@host:~$ sudo mdadm --examine /dev/hda1 mdadm: No super block found on /dev/hda1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdc1 mdadm: No super block found on /dev/hdc1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hde1 mdadm: No super block found on /dev/hde1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdg1 mdadm: No super block found on /dev/hdg1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdi1 mdadm: No super block found on /dev/hdi1 (Expected magic a92b4efc, got 00000000)
I didn't format the partitions or write any data to the disk, so I think the array's data should be intact. Is there a way to recreate the superblocks, or am I hosed?
Thanks,
Neil
Quoted 25 lines · On Saturday October 21, [email protected] wrote:
Hi,
I had a run-in with the Ubuntu Server installer, and in trying to get the new system to recognize the clean 5-disk raid5 array left behind by the previous Ubuntu system, I think I inadvertently instructed it to create a new raid array using those same partitions.
What I know for sure is that now, I get this:
user@host:~$ sudo mdadm --examine /dev/hda1 mdadm: No super block found on /dev/hda1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdc1 mdadm: No super block found on /dev/hdc1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hde1 mdadm: No super block found on /dev/hde1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdg1 mdadm: No super block found on /dev/hdg1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdi1 mdadm: No super block found on /dev/hdi1 (Expected magic a92b4efc, got 00000000)
Quoted 3 lines
I didn't format the partitions or write any data to the disk, so I think the array's data should be intact. Is there a way to recreate the superblocks, or am I hosed?
Weirds.... Could the drives have been repartitioned in the process, with the partitions being slightly different sizes or at slightly different offsets? That might explain the disappearing superblocks, and remaking the partitions might fix it.
Or you can just re-create the array. Doing so won't destroy any data that happens to be there.
To be on the safe side, create it with --assume-clean. This will avoid a resync so you can be sure that no data blocks will be written at all.
Then 'fsck -n' or mount readonly and see if you data is safe. Once you are happy that you have the data safe you can trigger the resync with
mdadm --assemble --update=resync .....
or
echo resync > /sys/block/md0/md/sync_action
(assuming it is 'md0').
Good luck.
NeilBrown
The drives have not been repartitioned.
I think what happened is that I created a new raid5 array over the old one, but never synced or initialized it.
I'm leery of re-creating the array as you suggest, because I think re-creating an array "over top" of my existing array is what got me into trouble in the first place.
Also, from mdadm man page (using v 1.12.0):
--assume-clean
Tell mdadm that the array pre-existed and is known to be clean.
This is only really useful for Building RAID1 array. Only
use this if you really know what you are doing. This is currently only supported for --build.
This suggests to me that I can only use this to build a legacy array without superblocks - which I don't want - and that since my array was RAID5, that it's not "really useful", whatever that means. Oh, and also, I don't really know what I'm doing. ;)
If I do re-create the array to regenerate the superblocks, isn't it important that I know the exact parameters of the pre-existing array, to get the data to match up? chunk size, parity method, etc?
I just don't want to rush in and mess things up. Did that once already. ;)
Thanks,
Neil
Quoted 56 lines · Neil Brown
Quoted 25 lines · On Saturday October 21, [email protected] wrote:
Hi,
I had a run-in with the Ubuntu Server installer, and in trying to get the new system to recognize the clean 5-disk raid5 array left behind by the previous Ubuntu system, I think I inadvertently instructed it to create a new raid array using those same partitions.
What I know for sure is that now, I get this:
user@host:~$ sudo mdadm --examine /dev/hda1 mdadm: No super block found on /dev/hda1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdc1 mdadm: No super block found on /dev/hdc1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hde1 mdadm: No super block found on /dev/hde1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdg1 mdadm: No super block found on /dev/hdg1 (Expected magic a92b4efc, got 00000000) user@host:~$ sudo mdadm --examine /dev/hdi1 mdadm: No super block found on /dev/hdi1 (Expected magic a92b4efc, got 00000000)Quoted 3 lines
I didn't format the partitions or write any data to the disk, so I think the array's data should be intact. Is there a way to recreate the superblocks, or am I hosed?
Weirds.... Could the drives have been repartitioned in the process, with the partitions being slightly different sizes or at slightly different offsets? That might explain the disappearing superblocks, and remaking the partitions might fix it.
Or you can just re-create the array. Doing so won't destroy any data that happens to be there.
To be on the safe side, create it with --assume-clean. This will avoid a resync so you can be sure that no data blocks will be written at all.
Then 'fsck -n' or mount readonly and see if you data is safe. Once you are happy that you have the data safe you can trigger the resync with
mdadm --assemble --update=resync .....
or
echo resync >/sys/block/md0/md/sync_action(assuming it is 'md0').
Good luck.
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · On Sunday October 22, [email protected] wrote:
The drives have not been repartitioned.
I think what happened is that I created a new raid5 array over the old one, but never synced or initialized it.
If you created an array - whether it synced or not - the superblock would be written and --examine would have found them. So there must be something else that happened. Hard to know what.
Quoted 13 lines
I'm leery of re-creating the array as you suggest, because I think re-creating an array "over top" of my existing array is what got me into trouble in the first place.
Also, from mdadm man page (using v 1.12.0):
--assume-clean
Tell mdadm that the array pre-existed and is known to be clean.
This is only really useful for Building RAID1 array. Only
use this if you really know what you are doing. This is currently only supported for --build.
Quoted 4 lines
This suggests to me that I can only use this to build a legacy array without superblocks - which I don't want - and that since my array was RAID5, that it's not "really useful", whatever that means. Oh, and also, I don't really know what I'm doing. ;)
--assume-clean was extended to --create in mdadm-2.2.
Quoted 4 lines
If I do re-create the array to regenerate the superblocks, isn't it important that I know the exact parameters of the pre-existing array, to get the data to match up? chunk size, parity method, etc?
Yes, but I would assume you just used the defaults. If not, you presumably know why you changed the defaults and can do it again???
In any case, creating the array with --assume-clean does not modify any data. It only overwrites the superblocks. As you currently don't have any superblock, you have nothing to lose.
After you create the array you can try 'fsck' or other tools to see if the data is intact. If it is - good. If not, stop the array and try creating it with different parameters.
Quoted 3 lines
I just don't want to rush in and mess things up. Did that once already. ;)
Very sensible.
Assuming the partitions really are the same as they were before (can't hurt to triple-check) then I really thing '--create --assume-clean' is your best bet. Maybe download and compile the latest mdadm
http://www.kernel.org/pub/linux/utils/raid/mdadm/
to make sure you have a working --assume-clean.
NeilBrown