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.
Theo
On 12/12/2011 12:45 PM, Theo Band wrote:
Any ideas on what else I can do to get rid of this file?
Does
man lsattr man chattr
help you?
Mogens
On 12/12/2011 01:04 PM, Mogens Kjaer wrote:
On 12/12/2011 12:45 PM, Theo Band wrote:
Any ideas on what else I can do to get rid of this file?
Does
man lsattr man chattr
help you?
Mogens
Thanks this is indeed the the answer:
# lsattr aquota.user ----i--A----- aquota.user
A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the supe- ruser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
# chattr -i aquota.user # rm aquota.user rm: remove regular file `aquota.user'? y
Learned something today :-)
Theo
Hi :)
On Mon, Dec 12, 2011 at 12:45 PM, Theo Band theo.band@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
On 12/12/2011 01:04 PM, Rafa Griman wrote:
Have you checked attributes (lsattr)? Maybe it's got the immutable flag on.
Yes that was indeed the case.
In any case, the file is for quota definitions though it seems you don't have quotas activated:
The quota is enabled on the filesystem what was backed up. But when restored it was just a file in a subdirectory of the anotother temporary filesystem. I'm building a rsync hard link archive of all my previous dumps. This saves me much disk data and gives faster access when needed.
# mount|grep temp /dev/mapper/vgraid-temprestore on /mnt/temprestore type ext3 (rw)
Check if quotas are really on or off and the attributes.
Theo