Announcement

Collapse
No announcement yet.

Partition recovery after formatting and changing partition table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Pre-Install] Partition recovery after formatting and changing partition table

    Partition recovery after formatting and changing partition table.

    Hello everyone, I would like to ask some help regarding partition restoring.

    This is about my mothers laptop which I prepared for upgrade to 26.04 (from 24.04) but somehow I did the epic mistake not to copy the folder with all the files I had collected for the transfer

    I realized my mistake shortly after starting the 26.04 installation which means that first:
    1. I changed the partition table to increase the EFI folder´s size (sda1) from 100MB to 300 MB (I think) because 26.04 required me to do so.
    2. Kubuntu 24.04 was on sda5, so I shrinked it a bit and moved it to the right. I did that so I could also move the sda2,3,4 partitions (windows etc) to the right. This means that I understand/handle/describe the partitions in a linear way, just like kparted shows on its gui.
    3. I chose regional settings etc, started the installation and after 10-15 minutes I realized my blunder and canceled the installation.

    I am now booting the laptop live from the 2604 usb.

    I have tried Testdisk with ¨deeper search¨ but it takes forever and does not find anything. I left it overnight. One thing here, the laptop went to sleep too, so I cannot be sure it worked 100%. I also tried RLinux but no good. It saw the old partition, tried to make an image but I do not find contents. Another utility I tried is Hetman Partition Recovery software but no luck.

    Any ideas?
    ​

    #2
    At this point, what is your goal?
    Are you trying to recover that folder you forgot to copy?
    The problem sounds like the partitions and/or partition table are damaged, so lots of programs (or a chroot) can't really read the data off the "partitions."

    Have you tried the interactive capability of gdisk? See what it sees and/or can do? (Ref.: Rod Smith's website).

    Testdisk is usually the go-to for this, but you tried it and it seems to hang.

    (Thing is, too, in your Step 1., you really didn't have to increase that ESP -- the installer would push past that suggestion to do so ...)
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #3
      My current goal is to recover the folder and its contents if possible. After that, format and clean install.

      I am unhappy that the installer mentions the minimum size as a requirement, if I hadn´t done that, maybe I could have saved the data. Or maybe the installation would have completed faster, therefore overwriting the disk...

      Regarding gdisk, is it a command line tool? I seem to remember reading about it, but probably haven´t ever used it. Definitely not in this incident. Is it for partition recovery, data recovery etc?

      This page (https://www.rodsbooks.com/gdisk/download.html) mentions is it available in the ubuntu live environment. Is this the one you meant?

      Comment


        #4
        Yes that's the gdisk (GPT fdisk) written by Rod Smith.
        And the Tutorial material:
        https://www.rodsbooks.com/gdisk/index.html
        It's been awhile since I had to use it, frankly.
        I'm pretty sure it runs from a live USB to fix/repair partitions.

        So, there might be some front-end learning time for you on this.
        TestDisk and PhotoRec (if I recall right) are two other tools,
        but you tried TestDisk.

        No matter how you do this kind of work, it's not relaxing or fun.
        (In my how-to's around here, I spent a lot of time messing with this stuff.
        It can and often does work. But it can also hang on you, too.
        It's usually worth the effort though, as I'm sure you're feeling right now!)
        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          ok it seems that I have some reading and waiting to do!

          thanks for your input, I do think it is worth the effort. That's why I spent a big part of last weekend on this... Hopefully I will be able to do it tomorrow.

          Comment


            #6
            First of all, stop using the affected drive for now. Don't run any more recovery or filesystem repair tools on the original disk, and don't attempt to reinstall Kubuntu.

            Since you moved and resized several partitions, some of the original data may have been overwritten, but it doesn't necessarily mean everything is lost.

            I'd suggest the following:
            -If the files are important, consider making a full disk image to another drive and doing further recovery attempts on that image. GNU ddrescue is worth considering, particularly if there are any signs of disk errors.
            -TestDisk is worth another attempt, but I'd run it against a copy rather than the original disk.
            -If the partition cannot be recovered, PhotoRec may recover individual files, although original filenames and directory structures may be lost.

            Make sure any recovered files are saved to a different physical drive, never back onto the affected disk.

            One important question: when you say you cancelled the installation, had the installer actually started formatting or installing to any of the partitions, or had you only changed the partition layout before cancelling? That could make a significant difference to the recovery chances.
            ​
            ▁ ▂ ▄ ▅ ▆ ▇ █ ᄂIПЦX FӨЯ ᄂIFΣ █ ▇ ▆ ▅ ▄ ▂ ▁

            Comment

            Users Viewing This Topic

            Collapse

            There are 0 users viewing this topic.

            Working...
            X