Linux Raid 5 - lost partition tables - 4096 sector size issue?

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
bafu
Posts: 2
Joined: 26 Dec 2016, 06:33

Linux Raid 5 - lost partition tables - 4096 sector size issue?

#1 Post by bafu »

Hello,
I have lost the partition table of 4 members of my linux raid 5 that consists of 5 devices (WDC WD40EFRX-68WT0N0).

Only the following partition table was left:

Code: Select all

$ sudo sfdisk -l /dev/sdg
Disk /dev/sdg: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: FA6B09CD-30E5-479A-A401-199491BAF0A7

Device     Start        End    Sectors  Size Type
/dev/sdg1   2048 7814028976 7814026929  3.7T Linux RAID
The other 4 members were overriden:

Code: Select all

$ sudo sfdisk -l /dev/sda
Disk /dev/sda: 3.7 TiB, 3999677808640 bytes, 7811870720 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: 0x00000000

Device     Boot Start        End    Sectors Size Id Type
/dev/sda1           1 4294967295 4294967295   2T ee GPT
I could restore 2 additional partition tables by using TestDisk.

Code: Select all

Disk /dev/sdc - 4000 GB / 3726 GiB - CHS 486401 255 63
     Partition               Start        End    Size in sectors
>P Linux Raid                  2048 7813766151 7813764104
But I have a problem with the 2 missing devices, because they have an other logical sector size:

Code: Select all

Disk /dev/sdf: 3.7 TiB, 4000787021824 bytes, 976754644 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors Size Id Type
/dev/sdf1           1 4294967295 4294967295  16T ee GPT

I tried to change the blocksize to 512 and the cylinders to 486401 in TestDisk according to the other devices.
The partition was found but fdisk does not recognize the disklabel and type. There must be some issue because of the 4096 sector size.

I hope, someone can help me!

Thanks!

All partitions were created by the following commands:

Code: Select all

$ sudo parted /dev/sdd mklabel gpt 
$ sudo parted -a optimal -- /dev/sdd mkpart primary 2048s -8192s
$ sudo parted /dev/sdd set 1 raid on
Last edited by bafu on 07 Jan 2017, 11:39, edited 2 times in total.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Linux Raid 5 - lost partition tables - 4096 sector size issue?

#2 Post by cgrenier »

fdisk uses dos partition tables, they are limited to 2 TB.
Please post the testdisk.log file for /dev/sdf from TestDisk 7.1-WIP using EFI GPT for the partition table without changing the disk geometry.

bafu
Posts: 2
Joined: 26 Dec 2016, 06:33

Re: Linux Raid 5 - lost partition tables - 4096 sector size issue?

#3 Post by bafu »

Thank you so much for the fast response!

Now the scan seems to work. (with 7.1-WIP)

I have written the partition table, but the disk identifier becomes zero? Can I ignore this?

Code: Select all

Disk /dev/sdf: 3.7 TiB, 4000787021824 bytes, 976754644 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 00000000-0000-0000-0000-000000000000

Device     Start       End   Sectors  Size Type
/dev/sdf1    256 976720768 976720513  3.7T Linux RAID

Locked