Click to See Complete Forum and Search --> : Can't delete a file
Howlin Mad Murdock
06-14-2001, 10:01 AM
Hello,
I installed the telnet server onto a machine on my private network. It is running Redhat 7.0. The disk became corrupt some how and I ran a fsck to fix the problems. It kinda repaired the error, but my /usr/sbin/in.telnetd file is no longer owned by any user.
ls -al /usr/sbin/in.telnetd gave me this:
c--xrw-r-T 1 8233 30240 101, 112 Oct 6 2029 /usr/sbin/in.telnetd
Now I believe that 8233 is the user number, which I dont have a user at the ID, and 30240 is the group number, which I dont have either. Now I tried to chown the file as root and it gave me a permission denied. I tried to delete it and got the same error. Basically I want to delete the old file and reinstall the package to make sure nothing else is messes up.
Thanks,
Murdock
Strike
06-14-2001, 10:14 AM
put this at the end of /etc/group:
foo:x:30240:root
You should then be able to chmod/chown/chgrp the file to whatever you want. (you can remove that line when you are done with this file too)
Craig McPherson
06-14-2001, 03:06 PM
Root can chown and chmod any file. There's no need to add that group.
It also looks like you've got a very screwed-up file there. Look at the permission bits. You see that "c" at the front? That's normally used for device files, not normal files. Most likely the permissions and ownership got completely scrambled some way or another.
Howlin Mad Murdock
06-14-2001, 05:37 PM
Craig,
I tried to chown and chmod, it wouldn't let me.
Strike,
I tried what you said, but it gave me the error:
Cannot unlink file.
Murdock
Craig McPherson
06-14-2001, 05:44 PM
It sounds like there actually a bad entry in the filesystem.
Fsck the drive, and I bet it'll tell you there's an error with that file, and probably offer to delete it for you.
Howlin Mad Murdock
06-14-2001, 09:27 PM
Ijust ran a fsck, but it still didnt change anything. It was just the boot up fsck, I dont know how to remount the / partition read-only.
Murdock
Craig McPherson
06-14-2001, 09:34 PM
mount -o remount,ro /
fsck -rv /dev/hdXX
Howlin Mad Murdock
06-14-2001, 09:46 PM
mount -o remount,ro /
gives me the error:
mount: / is busy
Murdock
Craig McPherson
06-14-2001, 11:29 PM
mount: / is busy
Okay, here's a fun new idea.
Shut down any programs that are running. Run the "sync" command a couple times. Then hit your computer's reset button.
That's one way to force it to fsck. :)
In 1972 a crack commando unit was sent to prison by a military court for a crime they didn't commit. These men promptly escaped from a maximum security stockade to the Los Angeles underground.
Did this really happen? If you know that they're innocent, why are they still in trouble with the government?
Howlin Mad Murdock
06-14-2001, 11:35 PM
Craig,
I'll give that a try. Thanks for helping me out.
Murdock
Howlin Mad Murdock
06-15-2001, 10:52 AM
Well,
I kill everythjing non essential to the machine being up. ran sync a few times and wqas able to remount read-only. Ran fsck, no errors. The system seems to actually think this is right. I still can not delete this stupid file. Arrrrrrggghh. I dont know what to do now.
Murdock