Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cleaning lost+found on ext3
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
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Tue Aug 01, 2006 3:51 pm    Post subject: Cleaning lost+found on ext3 Reply with quote

Hi people.

Code:

lost+found # du -sh .
650M    .


What should i do?
My system is running well without these files..
How can i know what they were before being lost?
What should i do with them? i can't simply rm.

Thanks in advance :)
_________________
Foo.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54421
Location: 56N 3W

PostPosted: Tue Aug 01, 2006 5:58 pm    Post subject: Reply with quote

KaZeR,

You should look at the files and directories and decide what to do with them on a case by case basis.
lost+found is used by fsck to put recovered file and file fragments or even whole directories.

If your system is really worly well, its doing it with about 650Mb missing
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Wed Aug 02, 2006 7:13 am    Post subject: Reply with quote

I should have precised that this is the lost+found from my /home partition :)

I agree that i should review the files manually (and i'm willing to, just to check), but how do i do this?
And how do i delete the files once i've reviewed them?

Thanks :)
_________________
Foo.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54421
Location: 56N 3W

PostPosted: Wed Aug 02, 2006 2:26 pm    Post subject: Reply with quote

KaZeR,

First, you should look at the types of files you have there.
Code:
ls --color
is good for that, otherwise you need to use ls -l and look at the first letter in permissions.
The names in lost+found are the inode numbers where the files can be found but inside any directories, the actual filenames may still exist. That makes it easy.

You can also attempt to open any and every file in less. Thats not very interesting with binary files.
feeding the file names to the file command may help too.

You will need to be root to do much of this. All the usual file comands will work. lost+found is just a normal directory from that respect.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Wed Aug 02, 2006 2:42 pm    Post subject: Reply with quote

Well, that's what i tried to do.

But here's the result (hence this thread) :

Code:

drw-rw-r-x  2        344      16827         12288 sep 19  1970 #75992906
d--xr-xrwt  2        344      17013          4096 sep 19  1970 #75998858
Patate lost+found #
Patate lost+found # rmdir "#75992906"
rmdir: #75992906: Opération non permise
Patate lost+found # chmod +x "#75992906"
chmod: modification des permissions de `#75992906': Opération non permise
Patate lost+found # rmdir "#75992906"
rmdir: #75992906: Opération non permise
Patate lost+found # chown root:root "#75992906"
chown: changement de propriétaire pour `#75992906': Opération non permise
Patate lost+found #


Weird, isn't it?
_________________
Foo.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54421
Location: 56N 3W

PostPosted: Wed Aug 02, 2006 2:51 pm    Post subject: Reply with quote

KaZeR,

rmdir requires that the directory be empty but it doesn't give a permissions error.
The # symbol is reserved and should not be used in file/dir names. I know it was fsck, not you.

What does
Code:
rm -rf "#75992906"
do?
The owner and group IDs look strange
Code:
344      16827
The numbers are shown becase they cannot be resolved to names on your system
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Wed Aug 02, 2006 3:00 pm    Post subject: Reply with quote

NeddySeagoon wrote:
KaZeR,

rmdir requires that the directory be empty but it doesn't give a permissions error.

I agree, and if it was the case, the error message would be slightly different (directory not empty).

NeddySeagoon wrote:

The # symbol is reserved and should not be used in file/dir names. I know it was fsck, not you.

Yeah, bad bad baaaaaad fsck ;)
Hence the " around the filename.


NeddySeagoon wrote:

What does
Code:
rm -rf "#75992906"
do?
The owner and group IDs look strange
Code:
344      16827
The numbers are shown becase they cannot be resolved to names on your system


Code:

Patate lost+found # rm -rf "#75992906"
rm: ne peut détruire le répertoire `#75992906': Opération non permise

_________________
Foo.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54421
Location: 56N 3W

PostPosted: Wed Aug 02, 2006 4:18 pm    Post subject: Reply with quote

KaZeR,

Are you able to
Code:
rm -rf lost+found
if it works, do make a new one
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 7:17 am    Post subject: Reply with quote

Hi NeddySeagoon,

It didn't work.
I got a "Operation not permitted for each entry in lost+found.

It's a bit weird, isn't it?
_________________
Foo.
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Fri Aug 04, 2006 7:52 am    Post subject: Reply with quote

KaZeR wrote:
Hi NeddySeagoon,

It didn't work.
I got a "Operation not permitted for each entry in lost+found.

It's a bit weird, isn't it?


Just to make sure: did you do it as a root?
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 9:18 am    Post subject: Reply with quote

Yup :)

Quote:

Patate lost+found # whoami
root
Patate lost+found # rm -rf "#75325465"
rm: ne peut enlever `#75325465': Opération non permise

_________________
Foo.
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Fri Aug 04, 2006 9:48 am    Post subject: Reply with quote

KaZeR wrote:
Yup :)


Roger that! :D
Back to top
View user's profile Send private message
palatin
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2004
Posts: 113
Location: Paris

PostPosted: Fri Aug 04, 2006 12:12 pm    Post subject: Reply with quote

May it be related to attributes ? You should shake with chattr some_file.
_________________
fumo~
Back to top
View user's profile Send private message
Sedrik
l33t
l33t


Joined: 08 Apr 2005
Posts: 655
Location: Uppsala, Sweden

PostPosted: Fri Aug 04, 2006 12:19 pm    Post subject: Reply with quote

can the files be removed using a livecd and mounting the disk?
_________________
From Gentoo with love
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 12:23 pm    Post subject: Reply with quote

palatin wrote:
May it be related to attributes ? You should shake with chattr some_file.


Code:

 # chattr -s "#75325465"
Patate lost+found # rm "#75325465"
rm: détruire un fichier protégé en écriture fichier régulier `#75325465'? y
rm: ne peut enlever `#75325465': Opération non permise


Do you think of a specific attr flag? I checked the manpage but didn't find anything relevant...
_________________
Foo.
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 12:26 pm    Post subject: Reply with quote

Sedrik wrote:
can the files be removed using a livecd and mounting the disk?


I tried this too. no success, same error.

There's only one thing that i didn't say : my /home is LVM. But i didn't mention it earlier since it seems rather related to the FS.

Anyhow, thanks everyone for your time :)
_________________
Foo.
Back to top
View user's profile Send private message
palatin
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2004
Posts: 113
Location: Paris

PostPosted: Fri Aug 04, 2006 12:35 pm    Post subject: Reply with quote

the s flag attribute is not relevent. you should check for i or u flags. you can list the flags running 'chattr file'

Edit : can you chown/chmod the file ?
_________________
fumo~
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 12:52 pm    Post subject: Reply with quote

palatin wrote:
the s flag attribute is not relevent. you should check for i or u flags. you can list the flags running 'chattr file'

Edit : can you chown/chmod the file ?


I was unable to chown/chmod (idem, operation not permitted).

BUT

:)


After running chattr = somefile, i'm able to chown, chattr, or rm the file!

I've wiped two of them, but waiting for the others, so we can maybe understand what is bloking. (If you feel so ;)
_________________
Foo.
Back to top
View user's profile Send private message
palatin
Tux's lil' helper
Tux's lil' helper


Joined: 20 Oct 2004
Posts: 113
Location: Paris

PostPosted: Fri Aug 04, 2006 1:02 pm    Post subject: Reply with quote

I'm up to it 8)

Which attributes are set on other files ?

Edit : Maybe the metadata was corrupt, thus triggering wierd user/group ID and attributes.

Edit 2 : I was talking bullshit, use lsattr to see attributes...
_________________
fumo~
Back to top
View user's profile Send private message
KaZeR
Apprentice
Apprentice


Joined: 04 Feb 2004
Posts: 291
Location: Au fond, à droite.

PostPosted: Fri Aug 04, 2006 1:29 pm    Post subject: Reply with quote

Here's a sample :

Code:

# lsattr "#75972195"
s-S-ia-----tT #75972195


Your edit 1 : I totally agree
Your edit 2 : No pb, i shall have read the manpage ;)
_________________
Foo.
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