Ubuntu/Linux Mint Installer wipe out on a SSD disk

How to use TestDisk to recover lost partition
Post Reply
Message
Author
edouardlopez
Posts: 2
Joined: 20 May 2014, 13:30

Ubuntu/Linux Mint Installer wipe out on a SSD disk

#1 Post by edouardlopez » 20 May 2014, 15:57

I'm trying to restore my data after hitting issue #1265192: Reinstallation wipes out all/other partitions, also described in Why “remove Ubuntu 12.04 and replace it with Ubuntu 13.10” means to use all of the disk and lose all data? [closed].

Partition tables
My disk is a ~100Gb Corsair disk. Previously to the events, the parition table was :

Code: Select all

/dev/sda1    ext4          7.5Go      /
/dev/sda2    extended
/dev/sda5    ext4          2Go        /home
/dev/sda6    ext4          100Go      /mnt/data
/dev/sda7    swap          2Go
Image

After realizing there was no confirmation pop-up I close the installer to prevent further operation. However, I got a new partition's table :

Code: Select all

/dev/sda1    ext4          108Go      /
/dev/sda2    extended
/dev/sda5    swap          4Go
Gpart

I went to the Ubuntu Data Recovery page and tried to use gpart, which detect 4 partition but doesn't give much information :

Code: Select all

sudo gpart /dev/sda

Code: Select all

Begin scan...
End scan.

Checking partitions...
Ok.

Guessed primary partition table:
Primary partition(1)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(2)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(3)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(4)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
Using the -v flag give a little more but still not much :

Code: Select all

sudo gpart -v /dev/sda

dev(/dev/sda) mss(512) chs(14593/255/63)(LBA) #s(234436545) size(114470mb)

* Warning: strange partition table magic 0x0000.
Primary partition(1)
   type: 131(0x83)(Linux ext2 filesystem)
   size: -1061158912mb #s(-2173253452288) s(972733539046918144-972731365793465855)
   chs:  (0/32/33)-(1023/254/63)d (60549862374535/212/14)-(60549727095765/17/60)r
   hex:  00 20 21 00 83 FE FF FF 00 08 00 00 00 D8 7F 0D 00 FE FF FF 05 FE FF FF

Primary partition(2)
   type: 002(0x02)(XENIX / filesystem)
   size: 0mb #s(0) s(0-0)
   chs:  (269/231/63)-(256/96/57)d (0/0/0)-(0/0/0)r
   hex:  FE E7 7F 0D 02 60 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Primary partition(3)
   type: 000(0x00)(unused)
   size: 21mb #s(43605) s(0-43604)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(2/182/9)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA 00 00 00 00 00 00

Primary partition(4)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
   hex:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Testdik

When running testdisk Analyse tool here is what I got :

Code: Select all

Disk /dev/sda - 120 GB / 111 GiB - CHS 14593 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Linux                    0  32 33 14097 252 43  226482176
 2 E extended             14098  30 11 14593  66  1    7954434
No partition is bootable
 5 L Linux Swap           14098  30 13 14593  66  1    7954432
Quick search

Code: Select all

Disk /dev/sda - 120 GB / 111 GiB - CHS 14593 255 63

     Partition                  Start        End    Size in sectors

 1 * Linux                    0  32 33 14097 252 43  226482176
 2 P Linux Swap           14098  30 13 14593  66  1    7954432
Deeper Search
Running a deeper search doesn't seems to give more, here a screenshot during :
Image

And at the end I got back to this, that look like initial Analyse screen :

Code: Select all

Disk /dev/sda - 120 GB / 111 GiB - CHS 14593 255 63
     Partition               Start        End    Size in sectors
>  Linux                    0  32 33 14097 252 43  226482176
   Linux                 1215 203 13 14338  75  9  210812928
   Linux Swap           14098  30 13 14593  66  1    7954432
Clone
I'm creating a disk image using dd as a friend suggest the disk could try to reorganize sector even if not currenlty used (something related to TRIM flag on the disk) :

Code: Select all

outf="/media/mint/51ee8de5-b1a9-4d57-9a94-24b9b1d0d10b/sdd-disk.img"; 
sudo dd if=/dev/sda of="$outf" & ddpid=$!
Questions
  • At the bottom of the Analyse tool I got a A: add partition entry. Should I rebuild manually my partition table ?
  • Does the fact that my disk is an SSD could explain why I got few information
  • What can I try next ?

Sponsored links

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

Re: Ubuntu/Linux Mint Installer wipe out on a SSD disk

#2 Post by cgrenier » 20 May 2014, 19:25

Try to list the content of each partition: select a partition and press 'p'.
This way you may be able to recover your partition.

edouardlopez
Posts: 2
Joined: 20 May 2014, 13:30

Re: Ubuntu/Linux Mint Installer wipe out on a SSD disk

#3 Post by edouardlopez » 21 May 2014, 09:43

cgrenier wrote:Try to list the content of each partition: select a partition and press 'p'.
This way you may be able to recover your partition.
Here is what I do, output below :
  1. run testdisk
  2. create a new log file
  3. select & proceed > Disk /dev/sda - 120 GB / 111 GiB - Corsair Force GT
  4. select Intel/PC partition
  5. Analyse current partition structure and search for lost partitions
  6. Run Quick Search
  7. Select biggest partition (from current partition table, not older one!)
  8. List files
Analyse

Code: Select all

Disk /dev/sda - 120 GB / 111 GiB - CHS 14593 255 63
Current partition structure:
     Partition                  Start        End    Size in sectors

 1 P Linux                    0  32 33 14097 252 43  226482176
 2 E extended             14098  30 11 14593  66  1    7954434
No partition is bootable
 5 L Linux Swap           14098  30 13 14593  66  1    7954432
Quick Search

Code: Select all

Disk /dev/sda - 120 GB / 111 GiB - CHS 14593 255 63
     Partition               Start        End    Size in sectors
>* Linux                    0  32 33 14097 252 43  226482176
 P Linux Swap           14098  30 13 14593  66  1    7954432

[...]
ext4 blocksize=4096 Large file Sparse superblock, 115 GB / 107 GiB
List file
Got only two files, not even a file system.

Code: Select all

   * Linux                    0  32 33 14097 252 43  226482176
Directory /

>drwxr-xr-x     0     0      4096 19-May-2014 16:08 .
 drwxr-xr-x     0     0      4096 19-May-2014 16:08 ..
 drwx------     0     0     16384 19-May-2014 14:43 lost+found
 -rw-r--r--     0     0     21763 19-May-2014 16:52 testdisk.log
Previous Partition table
The one I'm trying to get data from.
Image

Current Partition table
The one created by the Ubuntu installer.
Image

appalbarry
Posts: 4
Joined: 03 Jun 2014, 23:47

Re: Ubuntu/Linux Mint Installer wipe out on a SSD disk

#4 Post by appalbarry » 04 Jun 2014, 00:00

By way of followup, I had the same thing happen with the Installer for Mint 17 - instead of just upgrading the OS it wiped out every partition on the drive.

Testdisk wasn't able to find the old partitions, so I now have what looks like an very long PhotoRec session pulling files off.

Anyhow - please add your name to the bug over at Mint's Bugtracker:
https://bugs.launchpad.net/linuxmint/+bug/1325786

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests