1

Topic: Wiped my RAID1 Array partition table using gparted

Hello,
I have wiped by mistake my RAID 1 Array partition table by clicking on "Create Partition Table" instead of selecting my sd card.
Both raid discs are still active and assembled, but I not able to mount the RAID anymore.

Do you have any idea how to solve the problem and/or re-create the partition ?

Thanks for your help !

https://i.ibb.co/FxwTrTk/Screenshot.png

2

Re: Wiped my RAID1 Array partition table using gparted

If these assumptions are true:
1. The old partition table was overwritten with the same partition type, either MSDOS before and after, or GPT before and after.
2. There was a single partition spanning the array.
3. The partition was previously aligned to the default of 1 MiB.

Then take this action:
Create a new partition, SELECTING FILE SYSTEM "unformatted".  Take the other defaults.


Using file system "unformatted" is critical.  It tells GParted to only create entries in the partition table to define it's boundary and NOT write a file system.  (Writing a file system would overwrite you data on your array).

If the above assumptions are not correct, please describe what you can about the partitions that use to exist on the array.  Some idea of the number of partitions, their size and file system types.

3

Re: Wiped my RAID1 Array partition table using gparted

Unfortunately, the RAID partition table was overwritten with MSDOS whereas each individual disc is GPT.

There is a single partition spanning the array with first sector: 34 and Last sector: 3907029134
- Start : 17.4kB
- End: 2000GB

Thanks for your advices.

4

Re: Wiped my RAID1 Array partition table using gparted

What type of file system was on your RAID1 Array before the partition table got overwritten?

Please provide the output from running the following commands:

sudo parted /dev/sdc unit s print
sudo parted /dev/sde unit s print
sudo parted /dev/md127 unit s print
sudo fdisk -l /dev/sdc
sudo fdisk -l /dev/sde
sudo fdisk -l /dev/md127
sudo lsblk -o name,maj:min,rm,size,ro,type,fstype,label,mountpoint /dev/sdc /dev/sde
sudo blkid | egrep 'sdc|sde|md127'
sudo blkid /dev/sdc /dev/sde /dev/md127

5

Re: Wiped my RAID1 Array partition table using gparted

I think the file system type was ext4 on your RAID1 Array before the partition table got overwritten.

Here are the output:

~$ sudo parted /dev/sdc unit s print
Model: ATA WDC WD20EARS-00M (scsi)
Disk /dev/sdc: 3907029168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start  End          Size         File system  Name              Flags
 1      34s    3907029134s  3907029101s               RAID: RAID-Rever  raid


~$ sudo parted /dev/sde unit s print
Model: ATA WDC WD20EARS-00M (scsi)
Disk /dev/sde: 3907029168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start  End          Size         File system  Name              Flags
 1      34s    3907029134s  3907029101s               RAID: RAID-Rever  raid


~$ sudo parted /dev/md127 unit s print
Model: Linux Software RAID Array (md)
Disk /dev/md127: 3907026780s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags


~$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8BBD21C2-B551-4A36-AD8F-785648A1134A

Device     Start        End    Sectors  Size Type
/dev/sdc1     34 3907029134 3907029101  1.8T Linux RAID

~$ sudo fdisk -l /dev/sde
Disk /dev/sde: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DCDF2061-D919-4FD6-9DCA-81CCF8DA8231

Device     Start        End    Sectors  Size Type
/dev/sde1     34 3907029134 3907029101  1.8T Linux RAID

~$ sudo fdisk -l /dev/md127
Disk /dev/md127: 1.8 TiB, 2000397711360 bytes, 3907026780 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xec610992

~$ sudo lsblk -o name,maj:min,rm,size,ro,type,fstype,label,mountpoint /dev/sdc /dev/sde
NAME      MAJ:MIN RM  SIZE RO TYPE  FSTYPE            LABEL       MOUNTPOINT
sdc         8:32   0  1.8T  0 disk                                
└─sdc1      8:33   0  1.8T  0 part  linux_raid_member :RAID-Rever 
  └─md127   9:127  0  1.8T  0 raid1                               
sde         8:64   0  1.8T  0 disk                                
└─sde1      8:65   0  1.8T  0 part  linux_raid_member :RAID-Rever 
  └─md127   9:127  0  1.8T  0 raid1                               

~$ sudo blkid | egrep 'sdc|sde|md127'
/dev/sdc1: UUID="4921684d-700a-050b-b66b-27ef184a826e" UUID_SUB="580ba5c4-467a-416d-9ac4-056e6406bd6a" LABEL=":RAID-Rever" TYPE="linux_raid_member" PARTLABEL="RAID: RAID-Rever" PARTUUID="bbf1e878-b655-4288-9f07-163a1d67d1ba"
/dev/sde1: UUID="4921684d-700a-050b-b66b-27ef184a826e" UUID_SUB="8d44f19f-3ad9-015c-e124-c4c57ccc10c3" LABEL=":RAID-Rever" TYPE="linux_raid_member" PARTLABEL="RAID: RAID-Rever" PARTUUID="6b785160-0394-4b08-ae00-e8bf2b299e2d"
/dev/md127: PTUUID="ec610992" PTTYPE="dos"

~$ sudo blkid /dev/sdc /dev/sde /dev/md127
/dev/sdc: PTUUID="8bbd21c2-b551-4a36-ad8f-785648a1134a" PTTYPE="gpt"
/dev/sde: PTUUID="dcdf2061-d919-4fd6-9dca-81ccf8da8231" PTTYPE="gpt"
/dev/md127: PTUUID="ec610992" PTTYPE="dos"

6

Re: Wiped my RAID1 Array partition table using gparted

Looking in /etc/fstab will identify what the file system type.

Assuming it's ext4 run this command and report the output to search the first 2 MiB of the drive looking for the signature of an ext4 file system so we can work out where the partition use to be.

sudo dd if=/dev/md2 bs=1M count=2 2> /dev/null | hexdump -C | grep '30  .* 53 ef '

7

Re: Wiped my RAID1 Array partition table using gparted

There is no mention of the partition in fstab (but this partition was manually mounted on demand).

This command is not returning anything : should I use "if=/dev/md127" instead of "if=/dev/md2" ?

8

Re: Wiped my RAID1 Array partition table using gparted

Yes, that should be /dev/md127.

9

Re: Wiped my RAID1 Array partition table using gparted

The command is not returning anything for /dev/md127

But here is the result for the sde1 and sdc1 :

~$ sudo dd if=/dev/sdc1 bs=1M count=2 2> /dev/null | hexdump -C | grep '30  .* 53 ef '
000fc030  42 fb da 4d 02 00 23 00  53 ef 01 00 01 00 00 00  |B..M..#.S.......|
~$ sudo dd if=/dev/sde1 bs=1M count=2 2> /dev/null | hexdump -C | grep '30  .* 53 ef '
000fc030  44 fb da 4d 02 00 16 00  53 ef 01 00 01 00 00 00  |D..M....S.......|