Solved

Recover Data from FreeBSD lost+found

Posted on 2008-11-02
4
1,601 Views
Last Modified: 2013-12-06
Over the weekend, I had an email server RAID5 array fail. After bringing the array back online and running fsck, the entire /usr now how has 1 directory, lost+found. Inside the lost+found are hundreds of directories, of which very few contain anything. df - h still reveals /usr as having 24GB used. However most of this data does not appear to be visible. I would really like to recover these emails for my customers, but I do not know where to go from here, assuming it is even possible. I would appreciate any direction or advice.

Sample directory listing of /usr/lost+found

#05274997       #05648578       #05956413       #06287585       #06929083
#05274998       #05648580       #05956416       #06287586       #06929084

All of the directories look like this except for these 3:

Makefile
patch-ad
pkg-plist
0
Comment
Question by:FusionNetworks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 22865273
file * */*

If /usr did not contain mail spool you can reinstall -

csup all sources to RELENG_6_3
buildworld + installworld base system

record output of pkg_info

do pkg_delete -a and pkg_add -r packages one by one

That should more or less recover content of /usr

0
 
LVL 62

Expert Comment

by:gheist
ID: 22865280
You can try installing a system aside on some working but soon-to-recommision workstation while reinstalling server with 7.0
0
 

Accepted Solution

by:
FusionNetworks earned 0 total points
ID: 22866589
Sorry gheist, I may not have been perfectly clear on what I needed help with. But I greatly appreciate your responses. I was trying to recover 24GB of email directories and message in /usr/local/virtual when the entire /usr slice was corrupted.

I was able to resolve this. Here is what I did.
1. Installed FreeBSD on a second drive array in the server. Which could then access the old drive array.
2. Copied the corrupted slice from the original drive array to a file on the new drive array using DD. (dd if=/dev/SOURCE of=/dev/DEST bs-8192)
3. Mounted the image file.
       mdconfig -a -t vnode -f /IMAGEFILE -u 0
       mount /dev/md0 /mnt
4. Moved the lost+found directory from the newly out of the newly mounted image file
5. Umounted the image file (umount /mnt)
6. ran fsck on the unmounted image file (fsck -t ufs -fy /IMAGEFILE)

This created a new lost+found directory. Inside of which, among other folders was a 23GB folder (#04945920) which appears to be my old /usr/local with all of the subdirectories listed. Specifically the virtual folder that contains all of my customers maildirs and emails. Upon closer inspection all maildirs and messages are intact. Woohoo!

0
 
LVL 62

Expert Comment

by:gheist
ID: 22867170
I clearly did not get the essence of your request.
Glad you fixed it.

dd conv=noerr,notrunc does go over bad blocks if you ever run into problem again

Now you noticed softupdates in action - ./local was unlinked because of excess activity below it. Let me recommend using separate system for fast changing data... (like /var)

0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unix process listing into CSV format 3 87
bash while loop reading input from data section in script 7 72
Linux hostname change 2 96
Martian Packets Unix 5 83
Backing up data is essential for any office small or large. Most think that a simple USB drive will suffice. Even the USB drives themselves display words like backup.   Most novices will ask themselves the question “Will this work for my business…
From Coral's  "So You Want To Play With Computers" Series Preface: What follows is a tweaked reprint from 2005/06. This is a True Story. The names have been changed to protect the guilty. While this deals with a fairly simple, text file recovery…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question