Click to See Complete Forum and Search --> : deleting a device
Howlin Mad Murdock
06-15-2001, 05:59 PM
Ok,
Here is the problem, my filesystem got all screwed up and a file in it was converted to a device. It has a c--xrw-r--. I can not delete it as root. it says i can not unlink it. Is there a way to get rid of this file?
Thanks,
Murdock
ps. I have tried renaming it, changing attributs, but it does not work.
Howlin Mad Murdock
06-15-2001, 08:35 PM
like i said, deleting does NOT work
Craig McPherson
06-15-2001, 11:14 PM
If rm -f doesn't work, then it means there's actually an error in the filesystem. Since fsck doesn't detect it, it probably won't be easy to fix.
One option would be to use a raw inode editor or low-level disk editor to rip out the inode the file is linked to, then run fsck to repair the hole in the filesystem you just made. I wouldn't really recommend that, though.
My most sound advice: ignore it. That's the safest thing you can do.
I'll let you know if you come up with anything brilliant, but it really sounds like you've just got a really screwed-up filesystem entry that's not going to be easy to fix.
I don't think you ever answered my question about your signature -- did that really happen??
Howlin Mad Murdock
06-16-2001, 02:03 AM
Craig,
Ohhh it happened......they just dont want you know about it!!
I would ignore it, but its blocking a service I would like to use. Do you have a howto or something that could explain to me how to rip the inode out?
Thanks,
Murdock
Craig McPherson
06-16-2001, 02:58 AM
Your telnet daemon doesn't HAVE to be called in.telnetd. You could call it in.telnetd.real, then point your superserver at that program instead.
Howlin Mad Murdock
06-16-2001, 03:07 AM
i guess you are right, i am just gonna have to mess with the stupid rpm so it doenst complain
Murdock
Howlin Mad Murdock
06-16-2001, 03:35 AM
hey Craig,
I think i am goona mess with the disk. I know its not the best idea, but what the hell, hopefully i learn something. Anyways could you suugest a inode editor or low-level disk editor?
Thanks a bunch,
Murdock
Craig McPherson
06-16-2001, 03:58 AM
Debugfs might do the job. It's really thick, though, so prepare to read some documentation. I personally don't use any program that has a "catastrophic mode".
Okay, I got brave and read the documentation and played with it. Here's how you can do it:
It's easy to start it: debugfs -w /dev/hdXX
You can then type "help" at the prompt to get a list of options.
It has an internal "rm" command that is all-powerful -- it'll even delete Immutable files, which not even Root can do with standard tools.
If for some reason its internal rm command doesn't work, "stat" the file to get its inode number, then do this to the inode:
clri number
freei number
kill_file number
I really bet the "rm" command in debugfs will do the job, but you can try those as a last resort.
[ 16 June 2001: Message edited by: Craig McPherson ]
Howlin Mad Murdock
06-16-2001, 02:43 PM
Craig,
I used debugfs, took me a little bit, had to initialize the debugfs in write mode, but once i did that, the rm command worked like a charm. Thanks for all of your help and suggestions. I am always amazed at your vast knowledge of linux.
Thanks again,
Murdock
Craig McPherson
06-16-2001, 03:18 PM
Bwah hah hah, inode-editing is awesome.
Hey, if you know what really happened with those commando guys, then why are they still in trouble with the government??