LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-12-2010, 12:00 AM   #1
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99
Blog Entries: 39

Rep: Reputation: 19
Is my partition Rescuable?


Hello guys. I've really stuffed up with this one.

I decided to install Fedora today ( from Debian ) so I downloaded the 64 bit variation and then burnt it and booted from it.

My partition table before looked like this ( the XXXs of values I do not know ) :
Code:
Number  Start   End     Size    Type      File system     Flags
 1      1049kB  10.5GB  10.5GB  primary   fat32           diag
 2      10.5GB  110GB   100GB   primary   ntfs
 3      110GB   111GB   98.7MB  primary   ext2            boot
 4      111GB   320GB   209GB   extended
 5      111GB   315GB   XXXXXX  logical   ext3            XXXX
 6      315GB   320GB   5124MB  logical   linux-swap(v1)
I wanted to seperate my /home and / (root) partitions in my new system so that in the future, distro-hopping would be easier. I deleted everything in my fifth partition except for my home folder, from which I moved my home folder ( /home/whales ) to the top layer of the partition ( now /whales ).

I then did a yum install gparted so I could shrink partition 5 (now going to be /home) and add another 20gb one for / (root). Unfortunately Gparted spat out an error about the kernel not reading the partition table until reboot ( but first it succeeded in shrinking the FS to 286GB ). I panicked and tried to format p5 to ext3 ( it was ext3 ) but then realised this was dumb before it could 'create the ext3 filesystem' and I cancelled the operation.

I then rebooted, realising I should have done what the error said to in the first place.

Nope. The partition was 'empty' apart from lost+found ( which is empty ).

Nuts I thought to myself. The filesystem must have been overwritten . I tried a 'rescue' on parted on the command line, but that did not work. So I then removed the parition reference and then tried a rescue, but nothing happened. No output other than progress, and now I am stuck with this layout:
Code:
Number  Start   End     Size    Type      File system     Flags
 1      1049kB  10.5GB  10.5GB  primary   fat32           diag
 2      10.5GB  110GB   100GB   primary   ntfs
 3      110GB   111GB   98.7MB  primary   ext2            boot
 4      111GB   320GB   209GB   extended
 5      315GB   320GB   5124MB  logical   linux-swap(v1)
All of my files AFAIK should still be there between 111GB and 268GB. Is it possible to rummage through them looking for the files and creating a new FS?

BTW I'm on a livecd right now. Sorry if there are spelling mistakes - no dictionary in Firefox.

I did backup most, but some are photos off a camera I wiped a few days ago and school work started a few days ago etc. I was impatient to change OS so I didn't backup everything to start with. Lesson learned.

Imaginary gold pieces ( and seas full of gratitude ) to anyone who can tell me how to get out of my mess with all/most of my files.
 
Old 06-12-2010, 01:36 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You have no partition in that space - have you seen:
http://sysblogd.wordpress.com/2008/0...-roms-or-dvds/
 
1 members found this post helpful.
Old 06-12-2010, 02:16 AM   #3
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
Thankyou.

Recovering now. With the options in the article it seems to copy everything to the 'recovered blocks' file, but luckily it is going to a portable HD bigger than my internal HD.
 
Old 06-12-2010, 02:55 AM   #4
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 132

Rep: Reputation: 26
Info
====
Url: http://www.cgsecurity.org/wiki/TestDisk
Download: http://www.cgsecurity.org/wiki/TestDisk_Download


From the website
================
TestDisk is OpenSource software and is licensed under the terms of the GNU General Public License (GPL).

TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

TestDisk can

* Fix partition table, recover deleted partition
* Recover FAT32 boot sector from its backup
* Rebuild FAT12/FAT16/FAT32 boot sector
* Fix FAT tables
* Rebuild NTFS boot sector
* Recover NTFS boot sector from its backup
* Fix MFT using MFT mirror
* Locate ext2/ext3 Backup SuperBlock
* Undelete files from FAT, NTFS and ext2 filesystem
* Copy files from deleted FAT, NTFS and ext2/ext3 partitions.

TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery.
 
1 members found this post helpful.
Old 06-12-2010, 04:08 AM   #5
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
I've stopped the ddrescue ( with log files still available so I can continue in the future ) and used TeskDisk.

It managed to bring back the empty version of the partition at first ( and here I restarted when requested ). I'm now doing a 'deeper search' which will take longer but will hopefully work.

I love the userbase on LinuxQuestions.org. Posts are always helpful and I'm sure Godwin's law does not apply here.
 
Old 06-12-2010, 05:34 AM   #6
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
Nope - all TestDisk does is find the empty version.

For a better chronological description of what I did wrong:
  1. I resized my partition I was going to use as home
  2. I was instructed to reboot my computer, but I did not ( lesson learned )
  3. The partition now looked like corrupt data, so I 'format to' ed it to ext3
  4. I stopped that before it could 'create filesystem'
I'll just continue with the ddrescue while reading TestDisk docs.
 
Old 06-12-2010, 05:39 AM   #7
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
*Looking at utility "foremost"*
 
Old 06-12-2010, 05:48 AM   #8
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
Hold crud my problem is solved!
Code:
foremost -i /dev/sda5 -o /media/oneofmyexterbaldrivers
Of course no filenames nor folders are restored, so there will be alot of sifting! But I don't care! Everything is back!

EDIT: A few things are corrupt ( from putting the partition 'ontop' ) but the majority is fine.

EDIT2: Only a handful of files are saved, of which .txt and .odf are not included! I'll try photorec next

Last edited by William (Dthdealer); 06-12-2010 at 05:59 AM.
 
Old 06-12-2010, 05:58 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,820

Rep: Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830Reputation: 2830
Some observations:
- don't fuck with partitions without a (current) backup.
- don't plan on sharing /home between distros (can be done, but needs plenty of pre-planning).
- don't think you can interrupt things. That looks to me like the mkfs was done.
- testdisk is for recovering partitions, not (generally) data.
- have a look at photorec, then foremost for data mining - you will need plenty of spare space, and time.
... and patience.

The mkfs (if done) will have overlaid the beginning of the partition - hopefully no data loss there as it had also been done when the partition was originally formatted.

Edit: just saw your updates. well done.
Lucky lad.

Last edited by syg00; 06-12-2010 at 06:00 AM.
 
1 members found this post helpful.
Old 06-12-2010, 06:17 AM   #10
William (Dthdealer)
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 39

Rep: Reputation: 19
*removed 'solved' thread option*

I cheered too early.

Is there anything else I can do? Only a fraction of my files are coming out.

EDIT: Nope. I have over a thousand text files ( of which only useful are a dozen ) and two jpegs ( of which I should have hundreds).

Seems like I lost the second I didn't do what I wastold to. I've printed out the latest document I needed to access ( a text file! ) and I have _most_ of my photos backed up.

Thanks guys for helping. Hopefully there is an answer, but I think I'm pretty much screwed.

Last edited by William (Dthdealer); 06-12-2010 at 06:24 AM.
 
  


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
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 02:35 PM
Hard Drive Partition Management - Mandriva Double Partition with Swap File partition moshebagelfresser Linux - Hardware 2 05-23-2008 10:46 AM
Copy files from partition to partition too slow, SATA hard disk.What should I do£¿ Ryanlee SUSE / openSUSE 20 10-31-2005 07:30 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM
Newbie Installing Debian3 on m68k w/250M Partition Needs help creating swap partition AppleMac Linux - Newbie 2 11-01-2002 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration