Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Removing files with illegal filenames
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
yaman666
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2002
Posts: 117
Location: Chicago, IL

PostPosted: Wed Aug 08, 2007 4:21 pm    Post subject: Removing files with illegal filenames Reply with quote

Somehow I got some corrupted filenames in one of the postfix mailboxes:
Code:
# ls
ls: cannot access î*: No such file or directory
ls: cannot access ─Hed╛Y
: No such file or directory
ls: cannot access ¬: No such file or directory
ls: cannot access %╬: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access : No such file or directory
ls: cannot access ┬: No such file or directory
ls: cannot access (: No such file or directory
ls: cannot access 0: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access : No such file or directory
ls: cannot access
Ò;F!: No such file or directory
ls: cannot access ┬: No such file or directory
ls: cannot access ┬: No such file or directory
ls: cannot access A: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access @: No such file or directory
ls: cannot access M112126P2172: No such file or directory
ls: cannot access 7700: No such file or directory
ls: cannot access Ì: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access X: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access : No such file or directory
ls: cannot access =: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access ÷Y
: No such file or directory
ls: cannot access =: No such file or directory
ls: cannot access ÊÊ,: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access =: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access: No such file or directory
ls: cannot access : No such file or directory
ls: cannot access 1150027081.V8288I3dd598.x.x: No such file or directory
         =?  =?  @    ?  ?*?  ???  ??  ?  ???  0                                          7700?  ??;F!    M112126P2172?  ?Y?  ?Y?  ?Y?
         =?  (   %??  ?  ??,  ??   ??  ?  ???  1150027081.V8288I3dd598.x.x?  ?A     ?Hed?Y?  X??            ?Y?  ?Y?  ?Y?


And removing them doesn't work well either:
Code:

# rm *
rm: cannot remove `': No such file or directory
rm: cannot remove `': No such file or directory
rm: cannot remove `': No such file or directory
rm: cannot remove `': No such file or directory
rm: cannot remove `': No such file or directory
rm: cannot remove `': No such file or directory
rm: cannot remove `=\002': No such file or directory
rm: cannot remove `=\002': No such file or directory
rm: cannot remove `=\002': No such file or directory
rm: cannot remove `(': No such file or directory
rm: cannot remove `@': No such file or directory
rm: cannot remove `%\276\032': No such file or directory
rm: cannot remove `\370': No such file or directory
rm: cannot remove `\001': No such file or directory
rm: cannot remove `\300*\031': No such file or directory
rm: cannot remove `\377\377,': No such file or directory
rm: cannot remove `\210\355\031': No such file or directory
rm: cannot remove `\210\023': No such file or directory
rm: cannot remove `\210\023': No such file or directory
rm: cannot remove `\210\023': No such file or directory
rm: cannot remove `\002': No such file or directory
rm: cannot remove `\b': No such file or directory
rm: cannot remove `\020\002\004': No such file or directory
rm: cannot remove `\020\002\004': No such file or directory
rm: cannot remove `0': No such file or directory
rm: cannot remove `1150027081.V8288I3dd598.x.x\001': No such file or directory
rm: cannot remove `7700\001': No such file or directory
rm: cannot remove `\030A': No such file or directory
rm: cannot remove `\f\327;F!': No such file or directory
rm: cannot remove `\200Hed\254Y\n': No such file or directory
rm: cannot remove `M112126P2172\001': No such file or directory
rm: cannot remove `X\001\004': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory
rm: cannot remove `\247Y\n': No such file or directory


This is reiserfs filesystem - any suggestions?

Thanks!
Back to top
View user's profile Send private message
IQgryn
l33t
l33t


Joined: 05 Sep 2005
Posts: 764
Location: WI, USA

PostPosted: Wed Aug 08, 2007 5:00 pm    Post subject: Reply with quote

Reiserfs occasionally (though rarely) creates files that can't be deleted, usually caused by a power outage or hard restart. You'll need to run a full fsck on the filesystem. You can try this first:
Code:
reiserfsck --fix-fixable <device>
but if that doesn't work, you'll have to run
Code:
reiserfsck --rebuild-tree <device>
which can lose EVERYTHING if the power goes out during the check (please back up anything you care about first)

See man reiserfsck for more information about the different options.
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Thu Aug 09, 2007 1:25 am    Post subject: Reply with quote

IQgryn wrote:
Code:
reiserfsck --rebuild-tree <device>
which can lose EVERYTHING if the power goes out during the check (please back up anything you care about first)


It doesn't even require a power outage to screw the filesystem. I lost power once when I still used reiserfs. It booted, but had serious issues with /usr, so I did the rebuild tree thing after the standard fix-fixable run. It rebuilt a tree, but it only partly resembled what should have been there. Since the system was now irretrievably toasted due to missing libs and bits and pieces of the toolchain, I experimented and ran rebuild-tree a few more times. Every time, even though nothing had changed between runs, it came up with a completely different tree. It ended up with some creatively generated file names and a totally bizarre directory structure. I imagine I could have kept doing that until finally, nothing was left. Instead I just backed up my /home, wiped everything and used ext3 instead. Not one serious problem on any partition, ever. The worst damage a power outage has caused was to not free a few inodes for stuff I'd deleted.
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
yaman666
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2002
Posts: 117
Location: Chicago, IL

PostPosted: Thu Aug 09, 2007 2:28 am    Post subject: Reply with quote

Unfortunately this is a production server, so taking it offline to do reisrefsck is not an option, and neither is losing everything. :-)

But thanks for the info! I thought there may have been a simpler way that didn't require deep file system meddling.
Back to top
View user's profile Send private message
Mantaar
Apprentice
Apprentice


Joined: 17 May 2007
Posts: 219

PostPosted: Thu Aug 09, 2007 2:52 am    Post subject: Reply with quote

You mean running a production server with an inconsistent fs is an option?...

I think you're playing with fire...
_________________
Error compiling committee.c: too many arguments to function.
Back to top
View user's profile Send private message
yaman666
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2002
Posts: 117
Location: Chicago, IL

PostPosted: Thu Aug 09, 2007 4:27 am    Post subject: Reply with quote

Mantaar wrote:
You mean running a production server with an inconsistent fs is an option?...

I think you're playing with fire...


Well, it is so far an isolated issue and it may have something to do with the fact that mail was migrated from another postfix installation on the old server to this one. As long as I don't see any more problems like this, I don't see a reason to panic.
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Thu Aug 09, 2007 5:14 am    Post subject: Reply with quote

Quote:
As long as I don't see any more problems like this, I don't see a reason to panic.


(emphasis mine)

I'd start those backups going. Just in case.

Better yet, set up a similarly-partitioned drive in another machine and start an rsync going. This should get most of the non-live data. Then shut down all the server's services and follow up with another rsync to catch any changes since the first one. Swap drives and restart the server. Now you can play with the funny filenames offline at your leisure.
Back to top
View user's profile Send private message
yaman666
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2002
Posts: 117
Location: Chicago, IL

PostPosted: Thu Aug 09, 2007 5:39 am    Post subject: Reply with quote

Akkara wrote:

I'd start those backups going. Just in case.

Better yet, set up a similarly-partitioned drive in another machine and start an rsync going. This should get most of the non-live data. Then shut down all the server's services and follow up with another rsync to catch any changes since the first one. Swap drives and restart the server. Now you can play with the funny filenames offline at your leisure.


Got daily backups in place, no worries. :-) The machine is a colo box though, so it's not getting a hard drive change until it is REALLY needed. This is not enough cause to warrant me going there. But thanks for the suggestions!
Back to top
View user's profile Send private message
manaka
Apprentice
Apprentice


Joined: 23 Jul 2007
Posts: 178
Location: Spain

PostPosted: Tue Aug 14, 2007 3:32 pm    Post subject: Reply with quote

I have also found ReiserFS metadata corruption in case of power outages. In theory, as it does metadata journaling, that shouldn't happen. The following link gives some enlightenment about these issues...

http://linuxmafia.com/faq/Filesystems/reiserfs.html
_________________
Javier Miqueleiz

"Listen to your heart. It knows all things, because it came from the Soul of the World, and it will one day return there."
Back to top
View user's profile Send private message
yaman666
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2002
Posts: 117
Location: Chicago, IL

PostPosted: Tue Aug 14, 2007 5:43 pm    Post subject: Reply with quote

Come to think of it, I think we may have had 1 or 2 power outages on that machine before it was moved to colo location. May be that was it!
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