Announcement

Collapse
No announcement yet.

How to recover partitions deleted by mistake?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to recover partitions deleted by mistake?

    Hi all,

    I have delete a whole disk that contained a linux installation using "clean" command on Windows using diskpart. After doing that I realized I had delete the wrong disk.

    How could I recover it? I have write nothing nor create any partition on the disk after doing this.

    The disk is a SSD.

    Many thanks in advance

    #2
    I assume you did not run a "wipe out" (or zero-out on the drive, but simply deleted partitions. If so, a standard tool is
    TestDisk
    http://www.cgsecurity.org/wiki/TestDisk

    You'll have to read the guidelines to see how to run it. It should be run from a live CD (there are many options for doing so--see the site; or run a live Kubuntu/Linux CD, install TestDisk in your live session, and run it from there). There ARE a few details, but many people report great success with it. (I've used it and tested it, but that was some years ago.)
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      Many thanks for your help, Qqmite,

      I've install testdisk in another kubuntu installation and run it, but when I select Analyse it found nothing, then if i select "Quicksearch" it finds an unrecoverable NTFS partition that can't be the one i'm looking for

      I made the "clean" (not clean all) and then didn't do anything else to the disk, I can't believe it's impossible.

      Any help?

      Thanks

      Comment


        #4
        Did you run the "Deeper Search" function with testdisk? I've had good success with it. There are other utilities out there, but not usually free.

        Also, how complex was your table?

        If you have files on it you want to recover, you might be stuck using a file recovery utility like UFS Explorer. If it's just an install with no real data, I wouldn't bother to recover it.

        Too late now I realize, but backing up a partition table is cheap insurance and very simple to do - in the future, obviously.

        Please Read Me

        Comment


          #5
          I want to thank the help.

          I finally recovered the disk, the procedure were:

          -Use testdisk to recover main partition (the other one and boot was unrecoverable, or at least I couldn`t)
          -Installing fresh kubuntu 14.2 onto a new SSD
          -Resize recovered partition to exactly match in size with new one on the new installation (using gparted)
          -Clone partition to partition with clonezilla
          -Restore grub using "boot repair disk"
          -Boot on recovered disk
          -Modify grub to avoid 10 secons wait screen on every boot.

          Regards

          Comment


            #6
            FYI:

            Backup MBR and partition table: sudo dd if=/dev/sda of=/boot/mbr.img bs=512 count=1
            Restore just partition table: sudo dd if=/boot/mbr.img of=/dev/sda bs=1 count=64 skip=446
            Restore MBR and partition table: sudo dd if=/boot/mbr.img of=/dev/sda bs=512 count=1

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              FYI:

              Backup MBR and partition table: sudo dd if=/dev/sda of=/boot/mbr.img bs=512 count=1
              Restore just partition table: sudo dd if=/boot/mbr.img of=/dev/sda bs=1 count=64 skip=446
              Restore MBR and partition table: sudo dd if=/boot/mbr.img of=/dev/sda bs=512 count=1
              Many thanks!! I really appreciate your info

              Comment


                #8
                Using dd to back up and restore the MBR is certainly a useful thing, if the machine's disks have MBR style partitions. If they're GPT, though -- common in UEFI machines -- this technique no longer works, as there is no MBR. The partition table area of a GPT is usually -- but does not have to be -- in the first 16,384 bytes of the disk. GPT is essentially a series of pointers. While more complex, the elimination of arbitrary fixed values and places for things like table locations and partition boundaries makes GPT much more flexible. The Wikipedia article is good.

                Comment


                  #9
                  To backup/restore GPT disks partition tables, use sgdisk

                  To backup:
                  sgdisk -b gpt_table.img /dev/sda

                  To restore:
                  sgdisk -l gpt_table.img /dev/sda

                  Obviously (maybe?) in either case; Keep your partition table backup on a different drive!

                  Please Read Me

                  Comment


                    #10
                    And in new systems, UEFI/GPT, how the provided recovery image (at the end of the disk) comes into play. I'm guessing the UEFI software-firmware knows how to handle some of this (backup and restore) according to its setup and design.
                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #11
                      GPT disks make a backup of the GPT header and partition table at the end of the disk. If you're thinking about recovery images for operating systems, that's not related to UEFI/GPT.

                      Comment

                      Working...
                      X