Partition Write Error; confused about geometry

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
Posts: 1
Joined: 03 Oct 2016, 23:35

Partition Write Error; confused about geometry

#1 Post by crwx »

Howdy. I am not deeply experienced at the magic of partitioning and may need some ELI5-level explanations.

Somehow, I am not sure how, the partition on one of my volumes became corrupted. I believe this happened from my misuse of a FreeDOS bootable USB drive. In any case, I have been attempting to restore the partition with testdisk and have not been able to do so. The volume should be an LVM volume, residing on top of a Linux RAID array consisting of four hard disks. The RAID array appears to be solidly recognized, no issue there. The issue is when I try to restore the partition, I am utterly confused about what I should input for geometry. testdisk sees an "MS Data" partition and can see there is an XFS filesystem on the disk; however it never restores it to the correct size (4.5TB). Instead it attempts to restore the disk to 524G. It also never seems to get the partition to start on a physical sector boundary, or use the correct sector size.

Code: Select all

crw@bilby:~$ sudo fdisk -l /dev/md0
GPT PMBR size mismatch (1098853631 != 200894463) will be corrected by w(rite).
Disk /dev/md0: 4.1 TiB, 4500904476672 bytes, 8790829056 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 1048576 bytes / 3145728 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors  Size Id Type
/dev/md0p1          1 1098853631 1098853631  524G ee GPT

Partition 1 does not start on physical sector boundary.
One question I have is, should I be using traditional partitioning tools at all, given that it was a Logical Volume to begin with? Given that it is a logical volume, what the heck is its geometry? Am I even asking the right questions? I've been beating my head against this thing for two days and decided I needed the experts.

Sad fact: there is no backup, as the whole point of this was that the RAID array would be the point of redundancy. This array has survived a looong time, every disk has been replaced at least once if not twice over the past ten (twelve? or more?) years. This is a home setup. Any help would be greatly appreciated.

Sponsored links

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

Re: Partition Write Error; confused about geometry

#2 Post by cgrenier »

fdisk is limited to 2TB disks (to be correct, 2TB for disk using 512-bytes sector).
Use gparted or parted for EFI GPT partionned disk.