APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds RSS Feeds











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
->
-> Removing an invisible or 'lost' file


Deleting a "lost" file name





I think I have serious disk corruption caused by my backup script. In a certain directory there is a lost file that looks like this:

rw-rw-rw- 1 root sys      593213440 Apr 27 10:21

I've tried to look at this file with FTP explorer but it doesn't show up. I've tried running fsck -s in single user mode as suggested from a support page on the Internet and it should've placed the file in the lost and found folder but did not.

First, you were misled by someone - this isn't a lost file and fsck can't fix it. There's nothing to fix as far as your disk goes - it isn't corrupt or damaged.

This is simply a large file with a name that "ls" can't show you. It HAS a file name- it probably has control characters in it that are confusing the display. Try this:

ls -b
 

That displays "unprintable" characters.

If that doesn't work, do "ls -l > /tmp/t" and then look at /tmp/t with a text editor - can you see the name now?

No? OK, "vi /tmp/t" and move to the line that it is on and type:

:l
 

That is, with your cursor on that line, type a ":" (which drops you to the bottom of the screen) and then type a lowercase "l" (ell) and press ENTER. If all else has failed, THAT will show you precisely what this file name is.

As I said, it probably contains control characters. Here's a similar file I just created on my system:

total 33352
-rw-r--r--    1 apl  apl        0 Jul 22 14:33  
-rw-r--r--    1 apl  apl      251 Jan  6  2010 2words
 

Using "ls -b" shows it's true name:

 \b\b\b
2words
 

It's a space followed by 3 backspace characters. I know the space is there because it doesn't line up with the next name.

Here's what it looks like in /tmp/t:

total 33464
-rw-r--r--    1 apl  apl        0 Jul 22 14:33  ^H^H^H
-rw-r--r--    1 apl  apl      251 Jan  6  2010 2words
 

And when using ":l" in vi

~                                                                               
~                                                                               
-rw-r--r--    1 apl  apl        0 Jul 22 14:33  ^H^H^H$
 

I assume you'd like to get rid of it? Now that you know its name and how long it is (in my example, 4 characters), that's easier.

$ rm -i " ^H^H^H"
remov?  
 

I got those backspaces in there by hitting CTRL-V and then CTRL-H. Notice that the normal "remove xxx?" got partially overwritten by the backspaces in the name.

I could have left out the "-i", of course.

Because I know the length, I could also have done:

rm -i ????
 

That might be easier.

If you can't do that, do "ls -i" to find out the inode number,reboot go to single user mode (or unmount the filesystem if possible), use clri to remove the inode, and then do a fsck.

Finally- fix whatever the heck is wrong with whatever moronic script is doing this- it's completely stupid- if you don't understand the script, post it here and we'll dissect it..



If this page was useful to you, please help others find it:  





Comments?




More Articles by - Find me on Google+



Click here to add your comments
- no registration needed!


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar

Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

I am a Kerio reseller. Articles here related to Kerio products reflect my honest opinion, but I do have an obvious interest in selling those products also.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

pavatar.jpg

This post tagged:

       - Linux
       - MacOSX
       - Shell
       - Troubleshooting















My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide



Buy Kerio from a dealer
who knows tech:
I sell and support

Kerio Connect Mail server, Control, Workspace and Operator licenses and subscription renewals



Click and enter your name and phone number to call me about Kerio® products right now (Flash required)