Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Recovering files from XFS lost+found
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Narr
n00b
n00b


Joined: 05 Jun 2003
Posts: 22
Location: New Zealand

PostPosted: Sun Mar 21, 2004 12:33 am    Post subject: Recovering files from XFS lost+found Reply with quote

I couldn't find anything in the forums related to XFS
Does anyone know how to recover files from XFS lost+found.

I had trouble deleting a file from an xfs filesystem and also whenIi renamed a file in the same dir it just disapaired. All other dir and files at the same level seemed to be fine

I ran xfs_check and then xfs_repair after that a dir (one that is parent to the dir that had the file in) has disapaired and there is a lot of stuff in lost+found

Is there anyway to recover the files.

Chears Narr
_________________
I guess you could call the belief in sharing of knowledge a philosophy, but I just think it's a fact, It's what differentiates science from alchemy or witchcraft. Anybody who doesn't believe in it is just wearing some serious blinders.
Linus Torvalds
Back to top
View user's profile Send private message
dvc5
Guru
Guru


Joined: 06 Dec 2003
Posts: 433
Location: Sunnyvale, California

PostPosted: Sun Mar 21, 2004 1:07 am    Post subject: Reply with quote

I had a serious reiserfs crash about 6 months ago and every folder in my root partition was dumped in /lost+found/ by reiserfsck. I believe xfs does the same when you try to recover, and it will organize it by journal tag #. Really all you can do is look in each numbered folder and try to recognize which folder from "/" that it represents.
Your home and root folders should be easy, /etc will have a bunch of .conf files, etc... It took me the better part of a day to finally get everything copied back over, but afterwards the system was fully functional. I did do a "emerge -e world" just to be sure that no important files were left out.
_________________
#define NULL rand() /*heh heh heh */

Green Is Good
Back to top
View user's profile Send private message
Narr
n00b
n00b


Joined: 05 Jun 2003
Posts: 22
Location: New Zealand

PostPosted: Sun Mar 21, 2004 1:26 am    Post subject: Reply with quote

Thanks for the reply lozdvc5.

This will work, although longwinded. If there is an easer way I would love to know.

Cheers Narr
_________________
I guess you could call the belief in sharing of knowledge a philosophy, but I just think it's a fact, It's what differentiates science from alchemy or witchcraft. Anybody who doesn't believe in it is just wearing some serious blinders.
Linus Torvalds
Back to top
View user's profile Send private message
dvc5
Guru
Guru


Joined: 06 Dec 2003
Posts: 433
Location: Sunnyvale, California

PostPosted: Sun Mar 21, 2004 1:40 am    Post subject: Reply with quote

I'm sure you could write a script or search for one on the net that might automate this process, but it basically just amounts to copying files. And, since each hard drive is "unique" the folder names in /lost+found/ will never be the same on two machines. Maybe the naming scheme that the xfs recovery uses has some specific algorithm that you could utilize, however we're only talking about 10-20 folders to copy anyway.

Update: Just a side note, make sure you use the "cp -a source dest" format for copying. The "-a" (equivilent to -dpPR) flag will handle all permission-preservation, recursive copying, and other attributes so that your root partition will be useful after copying.
_________________
#define NULL rand() /*heh heh heh */

Green Is Good
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum