[comp.unix.xenix] CORRUPTED FILES

glenn@stsim.ocs.com (glenn ford) (12/13/89)

I am running SCO386 2.3.1, and have a problem.  There are several (15-20)
corrupted files in my root directory that I can't seem to delete.  I have
tried 'rm -i *', but when I come across the corrupted file it just says
non-existent, and goes onto the next file.  Is there a way to delete these
files?? In prvious problems such as this I would do rm -r, but I can do
it this time since the bad files are in the ROOT directory.  Any help
would be greatly appreciated, thank you.

..uunet!ocsmd!stsim!glenn

scotto@crash.cts.com (Scott O'Connell) (12/15/89)

In article <840@stsim.ocs.com> glenn@stsim (glenn ford) writes:
>I am running SCO386 2.3.1, and have a problem.  There are several (15-20)
>corrupted files in my root directory that I can't seem to delete.  I have
>tried 'rm -i *', but when I come across the corrupted file it just says
>non-existent, and goes onto the next file.  Is there a way to delete these
>files?? In prvious problems such as this I would do rm -r, but I can do
>it this time since the bad files are in the ROOT directory.  Any help
>would be greatly appreciated, thank you.
>

I use find . -print -ok rm {} \;	-OR-

      ls -i	<find the inode number>
      find -inum <#> -exec rm {} \;

Both of these work for me.
-- 
Scott O'Connell		UUCP: {nosc, ucsd, hplabs!hp-sdd}!crash!ipars!scotto
			ARPA: crash!ipars!scotto@nosc.mil
			INET: scotto@ipars.cts.com

daveh@marob.masa.com (Dave Hammond) (12/16/89)

In article <840@stsim.ocs.com> glenn@stsim (glenn ford) writes:
>I am running SCO386 2.3.1, and have a problem.  There are several (15-20)
>corrupted files in my root directory that I can't seem to delete.  I have
>tried 'rm -i *', but when I come across the corrupted file it just says
>non-existent, and goes onto the next file.  Is there a way to delete these
>files?? In prvious problems such as this I would do rm -r, but I can do
>it this time since the bad files are in the ROOT directory.  Any help
>would be greatly appreciated, thank you.

I believe the problem is not damaged files, but a damaged directory.
The reason `rm -i' says non-existant is likely because the directory
damage resulted in a non-zero inode entry, which now points to a
non-existant file.  In this case, I believe that things like ncheck and
clri will be ineffectual, since the inode really does not exist.  The
easiest (like you say) is to `rm -r' the directory, but since its in the
root directory, you may have to reinstall the system.

--
Dave Hammond
daveh@marob.masa.com
uunet!masa.com!marob!daveh

simon@ms.uky.edu (G. Simon Gales) (12/16/89)

Did you try fsck'ing the filesystem?

-- 
Simon Gales@The University of Kentucky
   simon@ms.uky.edu             | 'Fate... protects fools, little children,
   simon@UKMA.BITNET            |  and ships named Enterprise.' 
   {rutgers, uunet}!ukma!simon  |                           - Riker, ST:TNG

alex@xicom.uucp (Alex Laney) (12/22/89)

In article <840@stsim.ocs.com> glenn@stsim (glenn ford) writes:
>I am running SCO386 2.3.1, and have a problem.  There are several (15-20)
>corrupted files in my root directory that I can't seem to delete.  I have
>tried 'rm -i *', but when I come across the corrupted file it just says
>non-existent, and goes onto the next file.  Is there a way to delete these
>files?? In prvious problems such as this I would do rm -r, but I can do
>it this time since the bad files are in the ROOT directory.  Any help
>would be greatly appreciated, thank you.

(I hope you have an up-to-date backup before you try anything)

This sounds like your '/' directory file is corrupt, not that you have
corrupted files. I first off would say that you should go into
maintenance mode and run 'fsck.' If that doesn't find any problems, then
I think you should check that the inodes that those
files show are in actual use. They shouldn't be. You could create
enough null files in /tmp through a shell script so that those inodes
are in use, and then 'rm' the ones in / and then the ones in /tmp.

-- 
Alex Laney, Xicom Group, National Semiconductor, Ottawa, Canada (613) 728-9099
uunet!mitel!sce!xicom!alex (alex@xicom.uucp)     Fax: (613) 728-1134
"You save time, increase the amount of work done and it is easy."

steve.jackson@canremote.uucp (STEVE JACKSON) (12/26/89)

Your file names may have hidden characters at the end of them.
Try ls -l|od -c|more, and look for \b or whatever at the end of
the file names.  If the file 'seems' to be called foo, but is actually
foo^H, try rm -f foo*.
sjackson[A[A[A[B[B[B
---
 * Via ProDoor 3.1R 

rogerk@sco.COM (Roger Knopf 5502) (12/29/89)

In article <840@stsim.ocs.com> glenn@stsim (glenn ford) writes:
>I am running SCO386 2.3.1, and have a problem.  There are several (15-20)
>corrupted files in my root directory that I can't seem to delete.  I have
>tried 'rm -i *', but when I come across the corrupted file it just says
>non-existent, and goes onto the next file.  Is there a way to delete these
>files?? In prvious problems such as this I would do rm -r, but I can do
>it this time since the bad files are in the ROOT directory.  Any help
>would be greatly appreciated, thank you.

What this really is are files with non-printing characters in their
file names. Getting rid of them is easy using wild cards and od (to
find them).

To make an example, I created one using "touch <F1>". Since my
terminal is a Wyse 60, it created a file named CTRL-A@ but since
CTRL-A isn't a printable character, it shows up in my directory
as simply "@".

To find it, I used "od -c ." to produce this output:

    <several lines deleted>
    0002520 370 032   3   .   2   d   i   s   c   u   s   s  \0  \0  \0  \0
    0002540 367 030   d   e   a   d   .   a   r   t   i   c   l   e  \0  \0
    0002560   b 020   d   e   a   d   .   l   e   t   t   e   r  \0  \0  \0
    0002600   ; 032 001   @  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
    0002620

The first column is the octal address within the file, the second two are
the inode number.  Everything else on each line is the file name. When
searching for these kinds of files, I look for file names with octal
values or escaped characters in them. The last line is the one we want
to delete.

Remove it using "rm ?@", the "?" being the wild card for one character.
Usually these little monsters have a lot of stuff, I usually use just
enough to actually match and follow it with "*".

Roger Knopf
SCO Consulting Services

michaelb@wshb.UUCP ( WSHB employee) (01/04/90)

The brute force methoed I've taught users here involves using vi.

redirect the output of ls -l to a file; ls -l > bad.files
use vi to get the names and write them down ;  vi bad.files

The files names will show up in vi with representations of the non-printing
characters, ie. escape=^[. (Escape seems to be the worst culprit because
it does crazy things to the terminal if the next character makes a valid
terminal control sequence.) After WRITING DOWN the wierd names, exit vi.
Then rm 'wierd sequences' for each file name. (Many people get confused
here if the names cause up-down or clear screen actions. Tell them to
do it anyway.) The hardest part is getting people to remember to use
the "\" before special characters.

Hope this helps. It isn't the most esoteric solution, but it is easy for
laymen to remember and use.

-- 
Michael Batchelor -- Systems/Operations Engineer
WSHB - An International Broadcast Station of
          The Christian Science Monitor Syndicate, Inc.
uunet!wshb!michaelb                 803/625-4880