I have a Linux raid (those md device), it only contains one drive, and it has a btrfs patition on it.
I accidently do the following thing:
fdisk /dev/md126
I didn't see the warning
The old btrfs signature will be removed by a write command.
Device does not contain a recognized partition table. Created a new
DOS disklabel with disk identifier 0x3cf67d6f
and type w to exit.
Now the partition table is gone.
I try to use testdisk /dev/md126 , and it pick up my partition, but
Disk /dev/md126 - 1993 GB / 1856 GiB - CHS 486640640 2 4
The harddisk (1993 GB / 1856 GiB) seems too small! (< 1993 GB / 1856 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...
The following partition can't be recovered:
Partition Start End Size in sectors
> Linux 16368 0 1 486657007 1 4 3893125120 [2018.10.18-11:37:13 v15254]
[ Continue ]
btrfs blocksize=4096, 1993 GB / 1856 GiB
It doesn't seem to let me keep the partition.
And parted rescue doesn't show the partition at all
What should I do next?
This is the fdisk -l output before I break the partition table:
Disk /dev/sdb: 1.8 TiB, 2000365380096 bytes, 3906963633 sectors
Disk model: EARX-00PASB0
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: 0xcca96a8e
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 4982527 4980480 2.4G fd Linux raid autodetect
/dev/sdb2 4982528 9176831 4194304 2G fd Linux raid autodetect
/dev/sdb3 9437184 3902564351 3893127168 1.8T fd Linux raid autodetect
Disk /dev/md126: 1.8 TiB, 19933000280061440 bytes, 3893125120 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
After:
Disk /dev/sdb: 1.8 TiB, 2000365380096 bytes, 3906963633 sectors
Disk model: EARX-00PASB0
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: 0xcca96a8e
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 4982527 4980480 2.4G fd Linux raid autodetect
/dev/sdb2 4982528 9176831 4194304 2G fd Linux raid autodetect
/dev/sdb3 9437184 3902564351 3893127168 1.8T fd Linux raid autodetect
Disk /dev/md126: 1.8 TiB, 1993280061440 bytes, 3893125120 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: 0x3cf67d6f
Here is the parted print output of current situation:
Model: Linux Software RAID Array (md)
Disk /dev/md126: 1993GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
This is the output of another drive with the similar config:
Model: Linux Software RAID Array (md)
Disk /dev/md123: 1995GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0.00B 1995GB 1995GB btrfs
/dev/md126. Usingfdiskandpartedis not relevant here. (Unfortunately I know nothing about BTFS so I can't guide you further.)