2

dear Community,

I’m writing as I may have wrecked my system up. I launched disk manager in Windows; as one of my disks was not recognized, and as Windows kindly suggested me to initialize the-said disk, I clicked on « initialize with GPT » - as I thought it was a USB key which was not mounting.

Unfortunately, it was my RAID 5 volume created with mdadm

So if I understood well, Windows created a GPT partition to replace (?) the existing one mdadm created. Now I can see this RAID disk on Windows, which was not the case before.

Without having touched anything, do you think I can revert back the partition? Any guidance on how to do it?

Any help very very much appreciated!

EDIT 24/06/2023: Thanks for the first answers! I do have backups but not images of the full disks (only at file level, and not everything). I try to check if there is a way to rewrite partition table first (if possible! and how…) to make mdadm work again with existing data, then trying to recover data on the disks themselves (but as it is RAID 5 I predict a lovely mess, isn’t it?), and last resort to just wipe everything and use backed up data (but this is not a challenge nor would be a question here :) ).

(As a bonus, here are the results of some commands (my RAID is mounted under md126, with 3 disks: sda, sdc and sdd - sdb is the storage for OS:

——— PARTED ————

#parted -l

Error: Argument invalide during seek for read on /dev/sda
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel? o
Model: ATA TOSHIBA DTO1ACA3 (scsi)
Disk /dev/sda: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags: 

Error: /dev/sdc: unrecognised disk label
Model: ATA TOSHIBA HDWD130 (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:

Error: /dev/sdd: unrecognised disk label
Mode1: ATA TOSHIBA HDWD130 (scsi)
Disk /dev/sdd: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknoun
Disk Flags:

Model: Linux Software RAID Array (md)
Disk /dev/md126: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number    Start    End        Size     File system   Name                            Flags
1        17,4kB    16,8MB    16,8MB                  Microsoft reserved partition    msftres

——— GDISK ———

# gdisk /dev/md126

GPT fdisk (gdisk) version 1.0.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/md126: 11721056256 sectors, 5.5 TiB
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 84059E0C-5A54-40A5-A643-39FASFFA047E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 11721056222
Partitions will be aligned on 8-sector boundaries
Total free space is 11721023455 sectors (5.5 TiB)

Number     Start (sector)     End (sector)     Size        Code     Name
  1          34                 32767          16.0 MiB    0C01     Microsoft reserved...

——— MDSTAT ———

# cat /proc/mdstat

Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md126 : active (auto-read-only) raid5 sda[2] sdc[1] sdd[0]
      5860528128 blocks super external:/md127/0 level 5, 64k chunk, algorithm 0 [3/3] [UUU]

md127 : inactive sdc[2](S) sda[1](S) sdd[0](S)
      7560 blocks super external:imsm

unused devices: <none>
DaOurZ
  • 21
  • 3
  • Easiest way: diff the damaged drive with the last full image, and restore what was overwritten. Safest way: back up any data since last disk images, restore images, restore recent data. – DrMoishe Pippik Jun 23 '23 at 17:12
  • 1
    Does this answer your question? [How do I recover lost/inaccessible data from my storage device?](https://superuser.com/questions/241817/how-do-i-recover-lost-inaccessible-data-from-my-storage-device) – Joep van Steen Jun 23 '23 at 19:00
  • @DrMoishePippik Thanks for the answers! I edited my question - I don’t have full disk backup (only partial file-level backups), and I use RAID 5, where anyhow I need to rebuild the array then put the data to make everything work - without guidance this is outside of my knowledge :’( – DaOurZ Jun 23 '23 at 23:11
  • @JoepvanSteen Thanks for the answers! I edited my question - as I use RAID 5 I am unsure I can get anything else than scrambled data with this, but I will give a try if no other option and if you think it is the best way to proceed! – DaOurZ Jun 23 '23 at 23:12
  • TestDisk is powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software: certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy. https://www.cgsecurity.org/wiki/TestDisk – vssher Jun 24 '23 at 03:32
  • @vssher wow thanks, it may do the trick! I didn’t stumbled upon this - I will try it today and let you know :) – DaOurZ Jun 24 '23 at 09:52

0 Answers0