Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!nic.the.net!don From: D.Nash@utexas.edu (Donald L. Nash) Newsgroups: comp.unix.wizards Subject: Re: Help! There's a slash '/' in my filename. Message-ID: <43579@ut-emx.uucp> Date: 2 Feb 91 00:31:59 GMT References: <821@nddsun1.sps.mot.com> <11714@helios.TAMU.EDU> Sender: news@ut-emx.uucp Reply-To: D.Nash@utexas.edu Distribution: comp Organization: University of Texas System Office of Telecommunication Services Lines: 34 In article <11714@helios.TAMU.EDU> you write: > shouldn't something like: rm "slash/file" > work OK? This won't work. The / is not interpreted by the shell, but by the kernel routine namei(), which translates file names into inode numbers. The interpretation of the / character is wired into namei()'s brain. Any solution which involves using the unlink() system call to remove the file will fail because namei() will gag on that /. I've never had to deal with this problem before, but I seem to remember hearing a solution. Please wizards, don't flame me if I'm wrong, I'm only a wizard in training. Just politely point out my mistake and we'll all be happy. Anyway, if you "ls -i" in the directory containing this bogon file, you'll get the inode number for it. You can then use the clri command to zap this inode. This will leave all the links which pointed to this inode hanging loose, including the bogon link. It will also leave all the blocks associated with the file "missing," i.e. they won't be on the free list and the won't be allocated to files. After you run clri, unmount the filesystem and run fsck on it to repair the damage. This should get rid of all the hanging links and place the lost blocks on the free list. BTW, you'd better do this in single-user mode so no one will have open files on the filesystem when you try to dismount it, otherwise you won't be able to dismount it. Be sure to read the man pages for clri and fsck before you do any of this. Donald L. Nash The University of Texas System Office of Telecommunication Services Internet: D.Nash@utexas.edu THEnet: THENIC::DON BITNET: DON@THENIC PSI Mail: 311051200131::DON