LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   cannot delete or modify the file (https://www.linuxquestions.org/questions/linux-general-1/cannot-delete-or-modify-the-file-562902/)

k0nsole.c 06-19-2007 05:44 AM

cannot delete or modify the file
 
HI

I have a problem dealing with the file, 11GB in size. I login as root and tried to delete, it said permission denied.
I tried to rename, permission denied.
I tried to cp /dev/null > filename, permission denied.
I tried to touch, permission denied.

The file is under a folder and I tried to remove the folder, permission denied.
I tried to chmod the file, permission denied.
I am already root.

Pls advise.
I am having headache because of the problem. The script to clean up the old file performed failed because of that file.

atulsvasu 06-19-2007 05:56 AM

Get ls -l on that file, may be ls -i also.

Centinul 06-19-2007 05:57 AM

can you give us the 'ls -l' of the file in question? That way we can at least see what permissions are assigned to it.

HTH,

Centinul

k0nsole.c 06-21-2007 06:25 AM

I tried ls -i also, the file was not chattr before and no i flag was set.

Anyway, I will tell the story. I have some scripts running to remove old backup files in local harddisk. The files are about 10GB in size. I have alert from scripts for failure to remove the backup files and failure to tar the new backup. So I login as root and remove manually. The files are not able to removed and its folder attribute is also cannot be changed. I suspected harddisk had some problem, probably bad sector due to everyday write/erase 10GB files.

I booted up to single user mode and deleted the files, still unsuccessful. I ran fsck and encountered alot of error messages, while trying to fix the errors, system just hang. I hard rebooted the system, the system startedup but hang at "red hat nash version 2.6.1.4 starting.."
I tried to reboot into single user mode again, but hang at same stage.
I thought os corrupted or file system corrupted.
I replaced the harddisk and reinstalled the os.

But I still want to know the possible cause of this.
is that harddisk corrupts and making errors to file modification in first place?
is that fsck corrupted the file system?
how to recover the system hang at "red hat nash version 2.6.1.4 starting "
I want to know for my knowledge and sharing to other users who might have encountered same problem.

My os is centos 4.3
Hardware is HP prolient server.
HDDs are running raid 5.

thanks.

atulsvasu 06-22-2007 03:28 AM

You are not posting ls -l of that file!!!

It may be due to permission of parent directory if you can't
even put ls.

Post ls -l for every directory in parent chain.

SciYro 06-22-2007 10:08 AM

Assuming the problem disappeared, its probably a random freak occurrence, no need to spend time wondering. Still, fsck can corrupt file systems, if they are in active use (it should warn you to umount the file systems prior to running fsck). As for the original problem, perhaps a Selinux policy was misplaced or file system corruption got it? Who knows.

k0nsole.c 06-25-2007 09:03 PM

Quote:

Originally Posted by atulsvasu
You are not posting ls -l of that file!!!

It may be due to permission of parent directory if you can't
even put ls.

Post ls -l for every directory in parent chain.


I told ya. not possible to post the ls output, we replaced the harddisk, cannot afford to give downtime. The permission of the parent directory is drwxr-xr-x, But I could not chmod 777 to the folder also. Anyway, we had done with the problem already. Thanks for your concern.

k0nsole.c 06-25-2007 09:07 PM

Quote:

Originally Posted by SciYro
Assuming the problem disappeared, its probably a random freak occurrence, no need to spend time wondering. Still, fsck can corrupt file systems, if they are in active use (it should warn you to umount the file systems prior to running fsck). As for the original problem, perhaps a Selinux policy was misplaced or file system corruption got it? Who knows.

Thanks SciYro. I just wondered what could be the problem. Yes it did warn fsck would corrupt the file system, but my stubborn mind went ahead. We suspected the harddisk corrupted initially and fsck made the file system corruption. Thanks again


All times are GMT -5. The time now is 12:51 AM.