Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-13-2005, 11:29 AM   #1
LQ Newbie
Registered: May 2005
Posts: 9

Rep: Reputation: 0
ReiserFS data recovery

I have two reiserfs partitions - /, and another one that contains /home, /usr/local, and /tmp. The / partition is a 5.5G primary partition at the beginning of my HD. The rest of the space is an extended parititon chain composed of ~23G for the second reiserfs partition (which is mounted at /mnt/prsnldata, and bound mounted for /home, and symllinked for /usr/local and /tmp), and ~130M swap.

Yesterday night I wanted to shrink /mnt/prsnldata to create a 3G ext2 partition to install Debian GNU/Hurd. I rebooted using the Ultimate Boot CD and ran the live distro on that cd. I then made sure none of my partitions were mounted, and ran 'resize_reiserfs' to shrink /mnt/prsnldata by 4.5G. I then used QTParted to resize the actual partition (/dev/hda5) but I did it in a complicated way. I first shrunk /dev/hda5 by 100M, planning to delete the swap partition and create a bigger swap. After committing changes, QTParted wasn't allowing me to change any of the partitions' data, so I had to reboot back into the live distro. Anyway, after rebooting, I deleted the swap, created a bigger swap, and then shrunk /dev/hda5 by 3.2G, which I then used to create an ext2 partition. After committing the changes, I tried to run 'resize_reiserfs /dev/hda5' to expand /dev/hda5 back to its current physical size. For some reason resize_reiserfs reported that nothing needed to be done.

I then rebooted, and this time booted into Debian Linux, but into the recovery mode (single ro). About part way through the regular boot up for the recovery mode it reported that fsck failed, and gave me the login screen, but showed none as the user. Anyway, I logged in as root (but none was still showing as the user even though I used the root passwd and the login directory was /root). I then tried to run 'resize_reiserfs /dev/hda5' and was told to run 'reiserfsck', so I ran 'reiserfsck --check /dev/hda5'. It reported that I had corruptions that could be fixed with the --rebuild-tree option. I then ran reiserfsck with that option (and the -S option). After it was done I mounted /dev/hda5, and found that the correct total size was being reported but the used space was only at 5G (and before all this it had been 11G) and the only folder on there was lost+found. So I umnounted /dev/hda5, and ran 'resize_reiserfs /dev/hda5' and then 'reiserfsck --rebuild-tree -S /dev/hda5' again. After mounting /mnt/prsnldata, the correct total size and used space was showed, but the only folder was lost+found, and that folder was the 11G of used space (actually it was reported as 12G, but I'm not sure why).

I decided to then reboot back into the live distro, and using QTParted delete the ext2 and swap partitions, and resize /dev/hda5 to include that space. I then rebooted back into Debian recovery mode, and ran 'resize_reiserfs /dev/hda5' which apparently seemed to work fine, and then 'reiserfsck --rebuild-tree -S /dev/hda5' for a third time. The results were the same: the correct used space and total size are reported, but the used space all comes from one folder - lost+found. I also tried 'reiserfsck --rebuild-sb /dev/hda5' twice and 'reiserfsck --clean-attributes /dev/hda5' once and both essentially reported that nothing needed to be done (this was after had already rebuilt the tree once at least).

I apologize that this post is so long, and I hope all of that made sense, but I was just trying to detail my steps. Anyway, right now I'm running on Ubuntu's live cd, and I have two partitions - /dev/hda1 (/) and /dev/hda5 (/mnt/prsnldata). My /dev/hda1 partition is intact, but my /dev/hda5 partition still only shows a lost+found folder that is being reported as 12G (both by 'df' and 'du').

My main question is what do I do now? I just ran 'ls -l | wc -l' in the lost+found folder and there's 2,144 files/directories. Do I have to go through all of them? If so, how? I tried to 'view' some of them, and I realized that while some of them show up as blank data, even the ones that do show up with ASCII data (ie, the scripts, etc) just show the file contents. I have no idea of what the filename should be, nor where the file should go. How am I supposed to use all these lost+found chunks and rebuild my partition?

The other alternative is to reinstall Debian (since I also lost /usr/local). I've only been running Debian since April, and before I did that I burned all my personal data to backup cds, so in terms of my personal data, I would only lose any changes/additions in the last few months. If I have to do a fresh install, I don't mind since I can slowly go through and figure out what apps I had installed, and set them back up.

What do you think? Is it possible to go through the lost+found folder and try and rebuild /dev/hda5? If so, would it be more of a hassle than installing from scratch?

Thank you so much for all your help.
Old 07-13-2005, 12:26 PM   #2
Registered: Nov 2003
Location: Farmington Michigan
Distribution: UBUNTU - Slackware - SuSE 9.1 - Knoppix - Fedora
Posts: 828

Rep: Reputation: 30
you learned a valuable lesson...

how important is the data? you could just try to recover it using something like the sleuth kit or similar....

good luck.


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
DISCUSSION: ReiserFS Data Recovery Tips thegeekster LinuxAnswers Discussion 13 01-02-2010 08:32 AM
Partitions + recovery + FAT + ReiserFS + a complete idiot wini_g Linux - General 2 10-12-2007 06:02 PM
ReiserFS - Bad Blocks - Recovery - HELP! leprechaun Linux - Hardware 1 04-10-2004 07:13 PM
Reiserfs recovery NSKL Linux - Software 2 04-09-2003 02:01 PM
Manual recovery of data from trashed reiserfs Gantrep Linux - Hardware 7 02-28-2003 10:36 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:54 AM.

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