Help! There's a slash '/' in my filename.

Donn Terry donn at hpfcdc.HP.COM
Wed Feb 20 15:44:46 AEST 1991


Having once had the joy ( :-} ) of dealing with a version of fsck(!) that 
would create filenames with imbedded nulls in them (even worse than
imbedded slashes because they don't print right!), the discussion about
how to remove such filenames is correct: you can't do it easily.

I know of several ways (without going back to the offending software
if it is even capable of undoing the damage).:

Use fsdb to patch the filename field of the directory entry.  Be
sure you don't make things worse (like imbed a null).  (In theory
this doesn't require a fsck, but in theory all unused guns are always
unloaded, too.)

Use fsdb to zero the i-number field of the diretory entry, and fsck
to get the link count back to the right value.

(Only experienced fsdb users should use fsdb; there's a catch-22 here
that should be taken with a grain of salt: fsdb is hard to use and 
error-prone.)

The clri trick mentioned here earlier.

The trick of linking all good files and nuking the directory.  However
this may leave it in lost+found, instead.

Write a C program that does one of the above actions to the open raw
file system.  (Probably worse than using fsdb because finding the right
place is hard.)

Have a version of fsck that looks for such junk and fixes it.  Some
exist, and if you have source it's probably easier to fix it in fsck
than learning fsdb  (which is not to say that fixing it in fsck is
trivial, but not's not too hard).

I guess you could back up everything (else) and reinitialize the media,
but I'd rather not.

Donn Terry
HP, Ft. Collins



More information about the Comp.unix.internals mailing list