lost+found


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users lost+found
# 1  
Old 03-28-2002
lost+found

Hi all

I am using SOLARIS 8 on Sun enterpris3000 server. Last night i got a file system corrupted adn some inconsistancy in the file system were shown when i run fsck -o p option.
Then i tried to fix it with fsck -F ufs -y /dev/md/rdsk/d1 option as i have given all yes response i cd not able to see the questions asked during fsck. after this phase is complete when i run fsck -o p again it shows the error inj super block or magic number so i assigned a new superblock and fix the bug.
but after that when i fount the file system it was previouly 63% full and now it is only 16% and everything is written to lost+found directory. with the inodes number of the files assigned to every files .Still aome previous files and directory mapping are not their in the lost+found directory.
I think the reson may be during fsck when it ask to clear the inodes i have given yes option to around thousands of inodes.

I am telling the exact error i was getting when i first notice the corrupted file systems.

1) i can able to creat files and directories in that file system.Once i come out of the directory and put ls or ls -al it shows nothing.
2) when i tried to delete those file and directories it will say files exists can't delete.even rm -r won't work


Now i have restored all data from last night backup. but still i want to know HOW TO RESTORE DATA FROM LOST+FOUND DIRECTORIES?

Plese SUGGEST.
Thanks and regards
Prafulla
# 2  
Old 03-28-2002
If you are repairing a filesystem, you must run fsck on the unmounted filesystem. If you are repairing the root filesystem, run fsck while the system is in single-user mode and no other user processes are running. After repairing root, you must bring the system down immediately, without running sync, and reboot it.

Although it is technically feasible to repair files that are damaged and that fsck says you should remove, it is usually not practical.The best insurance against significant loss of data is frequent backups. If you do not have write permission to the filesystem fsck is checking, fsck will report problems but not give you an opportunity to fix them.

When fsck encounters a file that has lost its link to its filename, fsck asks you whether you want to reconnect it. If you choose to reconnect it and fix the problem, the file is put in a directory called lost+found, and it is given its inode number as a name.

try ufsrestore command to restore you data back from lost+found. I havent done with that command before. Maybe other have some idea of the syntax..
# 3  
Old 03-28-2002
First, ufsrestore recovers files from a tape prviously written by ufsdump. It's a cool program, but it won't move stuff out of lost+found.

You can manually move things from lost+found by doing stuff like "mv /lost+found/143226 /etc/passwd" or whatever. But moving a file from one point to another point in the same filesystem never increases its size. If your disk is 16% full now, after the moves it will still be 16% full. If your disk was previously 63% full, then you are missing lots of stuff.

I never try to fix a filesystem that is this badly damaged. I would newfs it and completely reload from backup. Unless it is root, it which case I would reinstall the OS. Sorry for the bad news.

You would think that the superblock at least would be ok after a "fsck -y"; but I believe you, because the same thing happened to me a few weeks ago only on a SunOS 2.5.1 box. It may be that Sun's fsck is less than robust.
# 4  
Old 03-31-2002
Lightbulb Restoring the files from lost+found.....

As the Size of your filesystem has reduced to an incredible low value,
Lot of Data (files & directories) might be lost.

For restoring the Files & Directories that have got stored in the lost+found
directory read the below mentioned lines.

--------------------------------------------------------------------------------------

When FSCK is performed on a FILE System,

example : fsck -o f /dev/rdsk/c0t0d0s4
where /dev/dsk/c0t0d0s4 is mounted on /export

And if FSCK encounters any problem with the FileSystem SuperBlock Entries,
It prompts for a confirmation to rectify the problem, When Confirmation is provided,
FSCK tries to rectify the problem either correcting the Entries in the SuperBlock
or by moving the files[having the problem] into the /FileSystem/lost+found Directory.

example : ** Phase 3 - Check Connectivity
UNREF FILE I=788 OWNER=root MODE=100644
SIZE=19994 MTIME=Jan 18 10:49 2001
RECONNECT? y

In this case the file with INODE Number 788 is moved into the /export/lost+found
directory as

# ls /export/lost+found
#788


For Restoring the file in /export/lost+found into /export perform the below mentioned
tasks :

# ls /var/tmp/c0t0d0s4*
/var/tmp/c0t0d0s4_log

View this file to know the Correct File Name & Path for the corresponding file stored in the
/export/lost+found Directory with the INODE_Number as the FileName.
And then MOVE or COPY the file from /export/lost+found Directory into the Correct Path
mentioned in the LOG File.

--------------------------------------------------------------------------------------

Try this it will work fine. Good Luck.
# 5  
Old 03-31-2002
fsck does not fix or protect your data as a first priority, it's main purpose is to keep the file system in a consistanmt state. It is possible for a box to go down hard with a bunch of open files, and to lose data completely.

Good luck, and remember, good backups are your friend.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

lost+found

Hi, What is lost+found in linux ? Cheers, snj (2 Replies)
Discussion started by: snjksh
2 Replies

2. Red Hat

How to recover data from lost+found

Hi All, I am facing a problem of filesystem corruption,where i am trying to recover data with fsck -f <device name> ,now it restore the corrupted data in lost+found directory.Please let me know how to recover the data from lost+found directory. Thanks, Shailesh (1 Reply)
Discussion started by: sbapotikar
1 Replies

3. Shell Programming and Scripting

Lost+found

I need to try and sort 125gb of lost+found files and directories that look like from testing the files are good in some areas. Does anyone know of a script using strings, file, find, etc. to help sort something like this........can't find it on google. thks:confused: (1 Reply)
Discussion started by: morrish
1 Replies

4. UNIX for Advanced & Expert Users

lost+found

Does anyone have or know of a script to help sort and display a large lost+found directory? i've googled this but not much help solaris 9 thanks (3 Replies)
Discussion started by: morrish
3 Replies

5. UNIX for Dummies Questions & Answers

Files in Lost+Found

Hi, upon reboot of our test solaris 9 box, I was prompted to run fsck on one of the filesystems (/var). This resulted in placing all the files in the lost+found directory. I have no backup. What are my options to place the files back to /var (from lost+found, is it possible?). Appreciate any... (1 Reply)
Discussion started by: spricks
1 Replies

6. Solaris

Deleted Lost+Found directory

If you delete your lost & found directory, how do you get it back, just do a mkdir? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

7. AIX

Lost+Found is not available

Hi, I have a AIX 4.3.3 running on IBM pseries server. I have some jfs filesystems running on it. I dont see Lost+Found directory in them. Can anybody guide me why it is not available. Cheers, Vinod.. (4 Replies)
Discussion started by: vinod2all
4 Replies

8. UNIX for Advanced & Expert Users

what is lost+found dir?

hi all, just wanted to know what is lost+found dir for? tnx (1 Reply)
Discussion started by: bok
1 Replies

9. UNIX for Dummies Questions & Answers

lost+found directory

what is the directory "lost+found" and how is it used? (2 Replies)
Discussion started by: Ben070371
2 Replies

10. UNIX for Dummies Questions & Answers

Lost+found

Hi all, after a crash of our SUN Server 220R on file system was corrupt and I had run fsck getting a lost of files/dir's in the lost+found of the file system loking like drwxrwxr-x 2 lmxadmin DOS---- 512 Oct 31 21:04 #0007680 drwxrwxr-x 2 lammer DOS---- 512 Jan 29 09:29... (6 Replies)
Discussion started by: DPAI
6 Replies
Login or Register to Ask a Question

Featured Tech Videos