1830045 Members
13869 Online
109998 Solutions
New Discussion

Re: cannot remove a file

 
SOLVED
Go to solution
Tonatiuh
Super Advisor

cannot remove a file

Red Hat Enterprise Linux 4.0

I tray to remove a file and get the following error:

rm: cannot remove `1_1b_redo.log': Read-only file system

Any idea?
10 REPLIES 10
HGN
Honored Contributor
Solution

Re: cannot remove a file

Hi

Is this is a NFS mount or which id are you using to remove this file,also need to make sure that this file is not open.

Rgds

HGN
Ivan Ferreira
Honored Contributor

Re: cannot remove a file

Please post the full path to the file and the results of:

cat /proc/mounts

lsattr 1_1b_redo.log
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Tonatiuh
Super Advisor

Re: cannot remove a file

HGN:
This is a local FS not a NFS. The file is not open.

Ivan:
[dev.lc.org*root /root]$ cat /proc/mounts
...
/dev/sda10 /orafiles ext3 rw 0 0
...

[dev.lc.org*root /orafiles/data/dev/orafiles/02/lcprod01]$ lsattr 1_1b_redo.log
------------- 1_1b_redo.log
Ivan Ferreira
Honored Contributor

Re: cannot remove a file

Can you create new files in this file system?

Do:
touch testfile
rm testfile

If does not works, it seems that there is a problem and the kernel think that the file system is read only.

Try running this command:

mount -o rw,remount /mount_point
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Tonatiuh
Super Advisor

Re: cannot remove a file

Ivan:

I can succesfully create, edit, update and remove a file in the same filesystem.

More Info:
This files was packed into a TAR file from an OCFS (Oracle Cluster FileSystem) of another server, and unpacked in this filesystem.

After unpacked I tried to remove them with the error mentioned.
Ivan Ferreira
Honored Contributor

Re: cannot remove a file

I had the same problem with another file system type. The way that I resolved was umounting and remounting the file system.

Also, sometimes when I cannot remove a file using rm, I use midnight commander (mc) and the mc can remove the files.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Tonatiuh
Super Advisor

Re: cannot remove a file

what is midnight comander (mc)? must I download it from someplace?
Tonatiuh
Super Advisor

Re: cannot remove a file

Bingo Ivan!, I umount and mount the filesystem and problem solved. Thanks!
dirk dierickx
Honored Contributor

Re: cannot remove a file

strange behaviour, can you try to reproduce this problem untarring this file in another directory? if this problem also occurs there you should log this incident with redhat.
Ivan Ferreira
Honored Contributor

Re: cannot remove a file

Why am I getting "read only filesystem" error messages when the filesystem is mounted rw?

by Demosthenes Mateo

If the kernel finds fatal corruption on the disk or if certain key IOs like journal writes start failing, the kernel may remount the filesystem as read-only. This is because the filesystem can no longer maintain write integrity under these conditions. Any such behavior will be thoroughly logged in /var/log/messages.

Should this happen, backup your recent data as this may be a symptom of an impending disk failure. Perform filesystem checks on the disk using e2fsck as soon as possible and use the -c option to enable badblock checking. The normal fsck may not detect all the errors and return clean. For example:

e2fsck -c /dev/sda3
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?