Jump to content
guitarlp

lost+found? A folder one one of my drives...

5 posts in this topic Last Reply

Recommended Posts

I cleared my drives today and when I ran reiserfsck I found disk1 had some errors and I had to run --rebuild-tree to fix it.

 

All that's done... but when I run reiserfsck on my disks all the disks show 1 directory except for disk one... it shows 2.

 

So I used the cd command to enter /mnt/disk1 and ran an ls command. It shows there's a folder called lost+found in there.  What in the heck is it?

 

It may also be worth noting that this drive was parity at one point. But, when I bought the exact same drive and added it to my unRAID array unRAID told me the new drive was too big to be added as a data drive. I had to put the new drive in as parity and my old parity became a data drive. I've read of that on here before... about shrinking hard drives but it doesn't sound like there was ever a fix for it.

 

My disk1 that this lost+found folder is on has a size of 732,573,496. The parity disk (same exact hard drive) has a file size of 732,574,552.

 

Anyways... I'm just curious what this lost+found folder is on my disk1. I wiped all the hard drives clean and ran reiserfsck --fiix-fixable and --rebuild-tree on disk 1.

 

Here's my rebuild tree output:

 

root@NAS:~# umount /dev/md1
root@NAS:~# reiserfsck --rebuild-tree /dev/md1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
** Do not  run  the  program  with  --rebuild-tree  unless **
** something is broken and MAKE A BACKUP  before using it. **
** If you have bad sectors on a drive  it is usually a bad **
** idea to continue using it. Then you probably should get **
** a working hard drive, copy the file system from the bad **
** drive  to the good one -- dd_rescue is  a good tool for **
** that -- and only then run this program.                 **
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will rebuild the filesystem (/dev/md1) tree
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal..
Reiserfs journal '/dev/md1' in blocks [18..8211]: 0 transactions replayed
###########
reiserfsck --rebuild-tree started at Sat May 17 04:23:31 2008
###########

Pass 0:
####### Pass 0 #######
Loading on-disk bitmap .. ok, 13801 blocks marked used
Skipping 13800 blocks (super block, journal, bitmaps) 1 blocks will be read
0%....20%....40%....60%....80%....100%                           left 0, 0 /sec
Could not find a hash in use. Using "r5"
        "r5" hash is selected
Flushing..finished
        Read blocks (but not data blocks) 1
                Leaves among those 1
                Objectids found 2

Pass 1 (will try to insert 1 leaves):
####### Pass 1 #######
Looking for allocable blocks .. finished
0%....20%....40%....60%....80%....100%                           left 0, 0 /sec
Flushing..finished
        1 leaves read
                1 inserted
####### Pass 2 #######
Flushing..finished
Pass 3 (semantic):
####### Pass 3 #########
Flushing..finished
        Files found: 0
        Directories found: 2
Pass 3a (looking for lost dir/files):
####### Pass 3a (lost+found pass) #########
Looking for lost directories:
Flushing..finishede 0, 0 /sec
Pass 4 - finished       done 0, 0 /sec
Flushing..finished
Syncing..finished
###########
reiserfsck finished at Sat May 17 04:24:57 2008
###########

 

Here's my reiserfsck output:

 

root@NAS:~# reiserfsck /dev/md1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will read-only check consistency of the filesystem on /dev/md1
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Sat May 17 04:25:17 2008
###########
Replaying journal..
Reiserfs journal '/dev/md1' in blocks [18..8211]: 0 transactions replayed
Checking internal tree..finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
        Leaves 1
        Internal nodes 0
        Directories 2
        Other files 0
        Data block pointers 0 (0 of them are zero)
        Safe links 0
###########
reiserfsck finished at Sat May 17 04:26:22 2008
###########

 

Here's the folder on the drive... looks like there's no folders or files in it that I can see:

 

root@NAS:~# cd /mnt/disk1
root@NAS:/mnt/disk1# ls
lost+found/
root@NAS:/mnt/disk1# cd lost+found
root@NAS:/mnt/disk1/lost+found# ls
root@NAS:/mnt/disk1/lost+found#

 

Edit: I just started samba and tried to open the network location and it prompted me for a username/password (I don't use user level security). I went into Shares and only share I had in there "Movies" was gone... nothing else was shown. I added Movies back as a user share and on that page I now have 2 user shares. I'm sharing Movies and lost+found. But I never created this lost+found share.

 

Not sure how it got there and why this is happening... so any help would be appreciated.

Share this post


Link to post

in simple terms its stuff thats been lost and then found again :P

 

Essentially its data that is on the drive but has been lost due to filesystem errors of some sort. When you checked your partition the tool found this data and stuck it in this directory rather than ignoring or deleting it.

 

Thats the good news... the bad news is that ive never seen anything recovered that is any use.

 

I believe (but wait for confirmation) that it is safe to delete.

 

[im sure someone will post a far more detailed explanation]

Share this post


Link to post

Thanks for the reply. The really good news is I have nothing on this drive so there's nothing I need to save. :)

 

So if there is ever a filesystem error and I run the rebuild tree command it will find any "lost" data due to the file system corruption and place it in a lost+found folder? Anything that's not "lost" will remain on the drive and work fine? Why would it create a lost+found folder if there's no data even in there?

Share this post


Link to post

google says it better than i ever could

 

/lost+found - Linux should always go through a proper shutdown. Sometimes your system might crash or a power failure might take the machine down.

Either way, at the next boot, a lengthy filesystem check using fsck will be done. Fsck will go through the system and try to recover any corrupt files that it finds. The result of this recovery operation will be placed in this directory. The files recovered are not likely to be complete or make much sense but there always is a chance that something worthwhile is recovered.

Share this post


Link to post

I've been having some issues with one of my data drives. I've had to do xfs-rebuilds two or three times. The second time, I had about a hundred files. They were about the size of JPG pictures. I renamed then suffix, sure enough, they were pictures. There were maybe a hundred of them. I don't think they were copies of pictures that were supposed to be in the file tree: I think they were LOST then FOUND and jammed into this lost+found folder.

 

Recently, I had another hiccup with the xfs stuff and this same damn drive, MD5. There was 4GB and 18k files in there. All different sizes. I'm positive there is real stuff in there that is now found it's way into this lost and found folder.

 

Kinda infuriating here - as unRaid and disk arrays are supposed to protect from this sort of thing. Sure the data is there, but I'm not going to dig though 18k files to see what's what. It's gone.

 

Can this be possible? Am I reading it wrong? I hope!?

 

other thread I started on this

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.