LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-31-2013, 10:04 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 51
repair damaged Partition Table


Hi

Howto repair damaged Partition Table with Ext4 on Wheezy?
 
Old 05-31-2013, 10:06 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
what have you tried? probably testdisk will help you,
 
Old 05-31-2013, 01:53 PM   #3
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by pan64 View Post
what have you tried? probably testdisk will help you,
By mistake, a very important Ext4 70 GB partition was overwritten with a FAT32 1GB partition with some files from Debian Live USB.
Do you think, I still can recover files from a damaged Ext4 partition?

BTW I've already tried testdisk, but cannot find files from damaged Ext4 partition.
 
Old 05-31-2013, 03:57 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
photorec doesn't rely on the partition table, so it can sometimes find some files.

parted, in the "advanced" menu, has an option to rebuild a damaged partition table, but - from your description - it sounds like the table was overwritten, not just damaged, so that's not likely to help.

BEFORE YOU TRY ANY RECOVERY, I'D STRONGLY SUGGEST IMAGING THE ENTIRE DISK AND WORKING WITH THE IMAGE.

That way you won't make things worse and, if you really need to recover files, you can send the drive to a commercial recovery shop. (Note that this is a VERY expensive option, since you'll be employing well trained technicians to, basically, do a byte-by-byte examination of the drive, sometimes by hand. I.e., weeks or months at $100-$200/hr.)
 
Old 05-31-2013, 04:14 PM   #5
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by PTrenholme View Post
photorec
BEFORE YOU TRY ANY RECOVERY, I'D STRONGLY SUGGEST IMAGING THE ENTIRE DISK AND WORKING WITH THE IMAGE.

That way you won't make things worse and, if you really need to recover files, you can send the drive to a commercial recovery shop. (Note that this is a VERY expensive option, since you'll be employing well trained technicians to, basically, do a byte-by-byte examination of the drive, sometimes by hand. I.e., weeks or months at $100-$200/hr.)
BTW I have an Acronis Image of the whole disk, but it's 2 weeks old and I have quite important new data. It will be lot of work to create again.
 
Old 06-03-2013, 01:05 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
So old data and probably part of the structure can be recovered by that image, I do not know Acronis, but probably filesystem can also be restored. Data saved after the last backup can be restored by testdisk I would suggest you to save the content of the disk (with dd) and try to recover from that backup.
 
Old 06-03-2013, 11:38 AM   #7
Hangaber
Member
 
Registered: Sep 2004
Location: USA
Distribution: Slackware
Posts: 163

Rep: Reputation: 51
A few months back, I was able to recover a few extra files (that testdisk did not) using "extundelete".

However, if any of these files are over 4GB (not the image/partition, but the files you wish to recover), you will have to modify the source code and rebuild.
Per: http://sourceforge.net/mailarchive/f...undelete-users
Code:
...the source code and changed line 2534 in extundelete.c from
 if (truncate( (outputdir + fname2).c_str(), EXT2_I_SIZE(inode)) == 0) {
to
 if (1 || truncate( (outputdir + fname2).c_str(), EXT2_I_SIZE(inode)) == 0) {
I didn't perform the recompile on Debian though ... although your issue is not Wheezy specific, it just happens to be the OS you're using.
(You can attempt recover those files using any compatible OS, including a bootable-CD/thumbdrive based live OS.)

Last edited by Hangaber; 06-03-2013 at 11:41 AM. Reason: Adjusted "2GB" to "4GB"
 
  


Reply

Tags
damaged, partition table, recover, repair



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
Using terminal to repair a damaged partition? anutherguy Linux - Software 1 05-07-2013 02:39 PM
Repair Partition Table? Geminias Linux - Newbie 3 02-04-2008 09:18 PM
Root partition damaged, system will not boot- How to repair? applewax Linux - General 1 05-27-2005 11:53 AM
How to repair partition table? houshuang Linux - Hardware 1 03-18-2004 03:10 AM
Redhat with damaged MBR/Partition Table pawlub Linux - General 13 12-11-2003 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:24 PM.

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