RE: Need help restoring imsm raid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
IMSM metadata is written at the end of drive. I suspect that before writing GPT metadata, installer cleared exiting one.
Unfortunately, Your RAID0 is gone and cannot be reassembled. RAID1 is still and operation your personal data is safe but please backup it firstly.
 
The only idea I have is to recreate the RAID0 array on drives with the same size as old raid. 
It can be done from system via mdadm.
#stop r1 if running
# mdadm -S /dev/md/<name>
# remove r0 array from metadata
# mdadm --kill-subarray 0 /dev/md/<container>
# start r1
# mdadm -I /dev/md/<container>
# add disk to recover r1
# mdadm --add /dev/md/<container> /dev/sda
# wait for recovery to end
# cat /proc/mdstat
# now recreate r0 volume (it is important to put member drives in correct order)
# mdadm -CR <name> -l 0  -n2 /dev/sda /dev/sdb
 
It will take the biggest block of free space from each drive which should be same as old r0.  The rest of drive is already in r1. 
Then you can compare new metadata with old one. Per dev size and array size  for each drive in r0 should be the same as previous.
Please also verify slots for r0 in metadata: sda should be 0, sdb 1.
 
The worse problem is your partition table on r0, it was overwritten because the first sectors of it are also the first sectors of the drive.
With this problem I cannot help you. I recommend to use dd-rescue or other tool. GPT has a backup which should be written at the end
of r0 volume or somewhere else and should not be cleared by Ubuntu installer. I believe that windows uses GPT also.

Good luck.
Mariusz

-----Original Message-----
From: linux-raid-owner@xxxxxxxxxxxxxxx <linux-raid-owner@xxxxxxxxxxxxxxx> On Behalf Of Adriaan Callaerts
Sent: Tuesday, April 7, 2020 11:39 PM
To: linux-raid@xxxxxxxxxxxxxxx
Subject: Need help restoring imsm raid

I have the following situation:



I’ve set up my Windows PC a long time ago to have the following raid setup:

- Two 1TB disks in this machine
- Intel Matrix Storage Mgmt
- The disks have one IMSM raid container with two volumes inside
  + The first 200GB of both disks is allocated to a RAID0 volume
  + The remaining 800GB of both disks form a RAID1 volume
- Both volumes then contain multiple partitions with various data,
  + mostly the RAID0 one contains partitions for OS files (Windows System Partition, C-drive and the like)
  + and then the RAID1 contains actual personal data (documents, photos, music etc)

A few months back, I decided to try and install a dual-boot Ubuntu
18.04 on the machine.
What ended up happening (I think) is I let the installer write the partition table to the wrong part of the disk (/dev/sda instead of a devmapper/dmraid block device, I don't remember exactly), which corrupted the raid setup. I haven't touched the device since then, but now want to start using the machine again and hence want to recover my data as much as possible before (if necessary) reinstalling any OSes.

The current situation is that I can no longer boot the PC from disk (nor windows or linux) and I can no longer read any of my data on either disk/volume/partition by default when using a linux-from-USB.

When inspecting the partitions on the drives, it detects invalid partitions which make no sense (incorrect filesystem types, partition sizes, etc).

However, some fiddling with mdadm –scan can mount the RAID1 volume in degraded mode which allows me to read my files in that volume.

This leads me to believe that IMSM stores some metadata at the beginning of both disks (I’ve found no proof or documentation anywhere that confirms this), and that my writing of a new partition table has overwritten or at least corrupted that metadata on the first disk.
I’ve gotten this far in investigating, but am no closer to fixing the issue. I have been hesitant to run any operations which might be destructive to my data (if it’s not lost already?). Any help in further diagnosing - and especially in fixing - my screwup would be greatly appreciated!


Kind regards,
Adriaan Callaerts




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux