LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 04-26-2018, 03:33 PM   #1
manishzez
LQ Newbie
 
Registered: Apr 2018
Posts: 4

Rep: Reputation: Disabled
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.
 
Old 04-26-2018, 06:19 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
1 members found this post helpful.
Old 04-27-2018, 10:55 PM   #3
manishzez
LQ Newbie
 
Registered: Apr 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
@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?
 
Old 04-28-2018, 02:31 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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
 
Old 04-28-2018, 02:19 PM   #5
manishzez
LQ Newbie
 
Registered: Apr 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-28-2018, 08:39 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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.
 
Old 04-29-2018, 04:49 AM   #7
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,953
Blog Entries: 32

Rep: Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463Reputation: 1463
manishzez,

As syg00 suggests, try photorec (or qphotorec).

See post #2:
https://www.linuxquestions.org/quest...lp-4175626805/
 
Old 05-05-2018, 10:54 AM   #8
manishzez
LQ Newbie
 
Registered: Apr 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks, everything worked fine. Same as past.
 
Old 05-06-2018, 09:15 AM   #9
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accidently deleted partition PenguinWearsFedora Slackware 2 11-06-2011 07:26 AM
i accidently deleted 'ldconfig'!!! ethicalstar Linux - Software 3 05-31-2008 11:15 AM
Deleted /boot directory accidently!!! jim_cliff11 Linux - Software 3 10-21-2006 01:41 PM
accidently deleted my ~/.Xauthority behmjoe Linux - Software 4 12-14-2005 10:53 PM
Help: Accidently deleted file patske Linux - Newbie 5 02-17-2004 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration