LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-25-2009, 09:06 PM   #1
IMNOboist
Member
 
Registered: Nov 2003
Location: Northern Utah
Distribution: OpenBSD, Ubuntu, Linux Mint, Knoppix
Posts: 56

Rep: Reputation: 16
Recover data on ext3 partition on Ubuntu


Here's the deal: I wanted to upgrade from Intrepid to Jaunty. I opted for a format/reinstall as I figured upgrading usually sucks. To save my important data, I resized my partition (partition A), formatted the empty space with ext3 (now partition B), and moved the necessary files from partition A to partition B. Then I went through the install process and installed Jaunty on partition A, telling the installer to NOT format partition B. It gave a warning about the installer deleting system folders (var, usr, etc) but I figured it didn't apply. I was wrong.

So now partition B is "empty." I know it didn't format it, but I need to get those files off of there. I have created an image of partition B using ddrescue, but I don't know where to go from there. I tried using foremost, but it won't recover things like my virtual machines and completely nukes the original file structure I had. And I've tried mounting it (using sudo mount -t ext3 -o loop /home/user/recovery.img /mnt), but that doesn't seem to work. The mount command completes successfully, but nothing shows up in the folder I mounted it to.

Any ideas? I really appreciate everyone's help!
 
Old 04-26-2009, 08:48 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,452
Blog Entries: 54

Rep: Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895Reputation: 2895
I sometimes wonder what it exactly is that makes people think they can ignore warnings without consequences?... Anyway, not much use right now, but at least now you know why making backups to removable media is better.

Quote:
Originally Posted by IMNOboist View Post
So now partition B is "empty." I know it didn't format it, but I need to get those files off of there.
Short: if after a disk formatting op you don't see any directory structures then yes, reformatting might be the cause.
Longer: a filesystem structure consists amongst others of things like superblocks, reserved inodes, and inodes for initially created directories like /lost+found. "Formatting" means overlaying a partition with a (new) filesystem structure. However formatting does not necessarily mean wiping the paritition area, it just overlays the structure. Therefore a group of blocks (aka a file) may still exist (where not overwritten) but they're no longer hooked into the filesystem structure, they are effectively unlinked and therefore invisible on mount. The problem with recovering files here is that not all blocks a file may occupy are directly linked. That's why OSS header/footer carvers like scalpel, foremost and photorec use file "magic" to recover "files" instead. BTW, this is unfortunately not an uncommon topic. Searching LQ for "recover files" or equivalent will yield threads you might want to read.


Quote:
Originally Posted by IMNOboist View Post
I have created an image of partition B using ddrescue, but I don't know where to go from there.
Tools like 'photorec' will accept dd images as input.


Quote:
Originally Posted by IMNOboist View Post
I tried using foremost, but it won't recover things like my virtual machines and completely nukes the original file structure I had.
Best forget your precious directory structure and be content if you can recover *any* files.


Quote:
Originally Posted by IMNOboist View Post
And I've tried mounting it (using sudo mount -t ext3 -o loop /home/user/recovery.img /mnt), but that doesn't seem to work. The mount command completes successfully, but nothing shows up in the folder I mounted it to.
There's more than one thing wrong with doing that (mount point, write mode, journalling)...
 
  


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
How to Recover Data from an ext3 partition harikrishnan81 Linux - Hardware 1 06-27-2008 05:54 AM
How to recover Data from LVM+ext3 partition ? neel.gurjar Linux - Server 3 06-20-2008 04:54 PM
need help to recover data from ext3 hard disk parv Linux - Software 2 04-06-2007 11:35 PM
recover ext3 partition nama Fedora 2 12-16-2006 04:30 PM
recover ext3 data holdrio Linux - Software 2 06-21-2006 10:10 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration