LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Accidently deleted my harddisk multiple times and some more mistakes (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/accidently-deleted-my-harddisk-multiple-times-and-some-more-mistakes-4175628476/)

manishzez 04-26-2018 03:33 PM

Accidently deleted my harddisk multiple times and some more mistakes
 
I'm screwing my partitions for last three days and can't restore my computer as it was. 3 days back I accidently swap my Windows partition by mistake running Arch Linux Live USB. I then opened Ubuntu (dual-boot system) and tried to recover it by testdisk. But then by mistake I ended up in deleting every partition. I've have first screen showing GRUB rescue now. I live booted Tails and then recover every partition by testdisk.
https://i.stack.imgur.com/kJQ47.png
https://i.stack.imgur.com/i2VcO.png
https://i.stack.imgur.com/k1ypw.png
I tried to solve the problem with GRUb but when I write command 'insmod normal' for the 'set' output partition it shows 'unknown filesystem'. I live in small city so the Computer shops here don't know how it can be solved too. I recovered sdb2 data through foremost. A Quick Search in testdisk now shows
https://i.stack.imgur.com/sXs6d.png
I don't know if the partitions I recovered are in same order and that I've given them right type (primary and logical). How can I boot my ubuntu partition now? It'll be great if it is possible to recover the windows partition too. PLEASE HELP IF YOU CAN.

syg00 04-26-2018 06:19 PM

The more screwing you do, the screwed up it is likely to become. No way for us to know what you did, and in what order.

What is that first (gparted) png ?. Was that before you started recovery ?. If so you can use that as a template to assign the partition types using the last png above. Testdisk will assign the extended automatically. Note that the last (SAMSUNG_REC) is a primary - after all the logicals.

Quote:

I accidently swap my Windows partition by mistake running Arch Linux
By this I assume you mean you allowed it to me formatted as a Linux swap partition (i.e. Arch ran mkswap on it). Fortunately that only over-write a few sectors at the start, but it screws the filesystem as those sectors are meta-data - there are free NTFS recovery tools on the web that should be able to recover that from the backup blocks at the end of the NTFS filesystem. I've not tried any. Maybe even ntfsfix on Linux.

After all that you likely will still have to recover the boot-loader. Easiest done from a chroot into the on-disk Linux, although grub super disk might do it ok from a boot USB image.

manishzez 04-27-2018 10:55 PM

@syg00 Thanks a lot. I've recovered my bootloader and my Ubuntu got back. No, the gparted image is also the current one. But now I think it's in the same order as before. I've recovered data from scalpel from sda2. Now I've to only reinstall Windows. My laptop have a Windows Recovery Environment partition. Will doing 'complete restore' in it install it in sda2 (previous location) or my all partitions can get screwed up again?

syg00 04-28-2018 02:31 AM

Dunno - but I'd bet on M$oft screwing you all over again. Have a look at this - might help. Or not.
I've had poor experience when I've had to use the Windoze automatic fix tools - sometimes they work after a few attempts, sometimes I have to re-install. I always create a system restore image from my Windoze systems, and use that in need. Then restore my Linux systems, or if lucky just fix grub.

But to give yourself any chance, that /dev/sda2 has to be reformatted as NTFS - which is likely to do more damage. Make sure you do a quick format else it will zero the whole lot, and you'll lose everything. After that, it's just a matter of hoping. Before you start, run these and post the output.
Code:

sudo fdisk -l
sudo file -s /dev/sda2


manishzez 04-28-2018 02:19 PM

Thanks again. I already did recovery this afternoon. It worked fine, had bootloader problem after restart but then I reinstalled GRUB again. I used ddrescue for backup and now I have the .dd image of damaged sda2 (swap filesystem). https://imgur.com/a/s8FlzVo It's backup.dd. Do you about any better tool than foremost or scalpel for data recovery from it? The only files which are important in it are .doc word documents.

syg00 04-28-2018 08:39 PM

That second command should have been "file" as per my post. Doesn't matter now apparently.
Have a look at photorec for your docs - they basically all work the same way.

beachboy2 04-29-2018 04:49 AM

manishzez,

As syg00 suggests, try photorec (or qphotorec).

See post #2:
https://www.linuxquestions.org/quest...lp-4175626805/

manishzez 05-05-2018 10:54 AM

Thanks, everything worked fine. Same as past.

dave@burn-it.co.uk 05-06-2018 09:15 AM

Quote:

Dunno - but I'd bet on M$oft screwing you all over again.
Good joke!!!


All times are GMT -5. The time now is 01:35 AM.