Page 1 of 1

btrfs+ext4 partitions recovery from accidental MBR wipe

Posted: 25 Sep 2016, 19:33
by ks92
Hello.

Trying to install OpenBSD (as dual-boot) on my computer yesterday resulted in wiping the MBR, although I quited the installation (tried with pressing 'q', then pressed my laptop power button when 'q' didn't work) before choosing to proceed with any partitioning operation, the installer asked for choosing one of the following options "erase ^?, werase ^W, kill ^U, intr ^C, status ^T".

When I've rebooted my computer, I get "No O/S found on partition 3" from boot.

Now after I reboot with Ubuntu live dvd and try to list partitions using GNU Parted; I get:
(parted) print
Model: ATA TOSHIBA MK3263GS (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
4 32.8kB 320GB 320GB primary sun-ufs boot
I find also a '320 GB Volume' within the file manager - when I open it I get only 1 GB empty drive.

Meanwhile, I gave testdisk a try - when the deeper search finished, many partitions were listed most of them don't much the size of the lost ones, except of just one: an ext4 partition with the same size as the ext4 lost partition, but when I hit enter on top of it I got "No partition found or selected for recovery". and then I was unable to get back to the buffer.

I have two partitions on the disk and they were completely lost: the first has an ext4 filesystem and contains data, the other has btrfs and contains archlinux OS. I really need to recover my partitions. Does anyone have an idea? Any help will be much appreciated.

Thank you very much.

Re: btrfs+ext4 partitions recovery from accidental MBR wipe

Posted: 26 Sep 2016, 06:08
by cgrenier
When there is a list of all the partitions, try to list the ext4 filesystem content ('P' to list files). If the partition is ok, switch it to P(rimary).
TestDisk is not able to list files from btrfs filesystem but if you find a btrfs partition, switch it to P(rimary).
On next screen, choose Write, confirm, Quit and restart your computer.

Re: btrfs+ext4 partitions recovery from accidental MBR wipe

Posted: 26 Sep 2016, 12:24
by ks92
cgrenier wrote:When there is a list of all the partitions, try to list the ext4 filesystem content ('P' to list files). If the partition is ok, switch it to P(rimary).
TestDisk is not able to list files from btrfs filesystem but if you find a btrfs partition, switch it to P(rimary).
On next screen, choose Write, confirm, Quit and restart your computer.
Okay.