[CentOS] Cannot remove a file

Rafa Griman rafagriman at gmail.com
Mon Dec 12 12:04:36 UTC 2011


Hi :)

On Mon, Dec 12, 2011 at 12:45 PM, Theo Band <theo.band at greenpeak.com> wrote:
> I have used restore to restore a snapshot of home data. From the root of
> this restore a file called aquota.user exists but cannot be removed:
>
> # mount|grep temp
> /dev/mapper/vgraid-temprestore on /mnt/temprestore type ext3 (rw)
> # cd /mnt/temprestore/home
> # ll -d .
> drwxr-xr-x 2 root root 4096 Dec 12 11:12 .
> # ll
> total 12
> -rw------- 1 root root 8192 Sep 30 10:21 aquota.user
> # rm aquota.user
> rm: remove write-protected regular file `aquota.user'? y
> rm: cannot remove `aquota.user': Operation not permitted
> # mv aquota.user somethingelse
> mv: cannot move `aquota.user' to `somethingelse': Operation not permitted
> # chown root.root aquota.user
> chown: changing ownership of `aquota.user': Operation not permitted
> # setfacl -b aquota.user
> # rm aquota.user
> rm: remove write-protected regular file `aquota.user'? y
> rm: cannot remove `aquota.user': Operation not permitted
> # getfacl aquota.user
> # file: aquota.user
> # owner: root
> # group: root
> user::rw-
> group::---
> other::---
>
> And yes, I did a fsck -f on the filesystem. I even re-created the
> filesystem (it needs to be empty anyhow) but after I restore the file
> (using restore) the same problem pops up.
> Any ideas on what else I can do to get rid of this file?
>
> CentOS 5.7
> Selinux permissive.


Have you checked attributes (lsattr)? Maybe it's got the immutable flag on.

In any case, the file is for quota definitions though it seems you
don't have quotas activated:

# mount|grep temp
/dev/mapper/vgraid-temprestore on /mnt/temprestore type ext3 (rw)

Check if quotas are really on or off and the attributes.

HTH

   Rafa



More information about the CentOS mailing list