Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Recover Data from FreeBSD lost+found

Posted on 2008-11-02
4
Medium Priority
?
1,637 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
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.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

688 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