LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Is my partition Rescuable? (https://www.linuxquestions.org/questions/linux-software-2/is-my-partition-rescuable-813674/)

William (Dthdealer) 06-12-2010 12:00 AM

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.

Simon Bridge 06-12-2010 01:36 AM

You have no partition in that space - have you seen:
http://sysblogd.wordpress.com/2008/0...-roms-or-dvds/

William (Dthdealer) 06-12-2010 02:16 AM

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.

Glenn D. 06-12-2010 02:55 AM

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.

William (Dthdealer) 06-12-2010 04:08 AM

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.

William (Dthdealer) 06-12-2010 05:34 AM

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.

William (Dthdealer) 06-12-2010 05:39 AM

*Looking at utility "foremost"*

William (Dthdealer) 06-12-2010 05:48 AM

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

syg00 06-12-2010 05:58 AM

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.

William (Dthdealer) 06-12-2010 06:17 AM

*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.

JZL240I-U 06-14-2010 04:44 AM

http://web.archive.org/web/200410240...node.php?id=85
http://project.terminus.sk/dare/
http://www.thefreecountry.com/utilit...recovery.shtml
http://diskeeper.com/downloads/menu.aspx
http://developer.berlios.de/projects/dvdisaster
http://freshmeat.net/projects/dvdisa...ease_id=171598
http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html
http://packages.debian.org/lenny/ext3grep
http://packages.debian.org/lenny/myrescue
http://www.nilfs.org/en/
http://recover.sourceforge.net/
http://freshmeat.net/projects/recoveryispossible/
http://www.cgsecurity.org/wiki/PhotoRec
http://www.tux.org/pub/people/kent-r...looplinux/rip/
http://www.digitalforensicssolutions.com/Scalpel/
http://www.grc.com/cs/prepurch.htm
http://www.cgsecurity.org/wiki/TestDisk_Download
http://e2undel.sourceforge.net/

Perhaps one of those can help...
Good luck.


All times are GMT -5. The time now is 12:31 AM.