Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using CentOS 6.3 and am logged in a root.

When I create a hard link by doing this:

ln /root.hdd /somedir/root.hdd

That works fine, the inode shows the same between the two files and everything functions as normal. But when I try to delete the link, It will not allow me to.

rm /somedir/root.hdd
unlink /somedir/root.hdd
umount /somedir/root.hdd

None of these work. I get "Operation not permitted" even though im root, and even using sudo doesn't help.

root.hdd is a openvz file that contains a vm's filesystem in a single file. Which is later mounted using ploop ( lookback device ).

share|improve this question
    
What are the actual files you're trying to work with? –  Michael Hampton May 27 '13 at 15:41
    
root.hdd which is a openvz file that contains a vm's filesystem in a single file. Which is later mounted using ploop ( lookback device ). –  Quinton Pike May 27 '13 at 15:43
2  
OK, now edit your question to make it clear what you are trying to do. Many people do not see these comments. –  Michael Hampton May 27 '13 at 15:44
    
Run the commands through strace and check lsattr for the file and for /somedir. –  Hauke Laging May 27 '13 at 16:50
    
Here is the strace response to the command "strace rm -f root.hdd" - pastebin.com/wyZ24ehM –  Quinton Pike May 28 '13 at 2:18

1 Answer 1

Your strace contains the following;

...
unlinkat(AT_FDCWD, "root.hdd", 0)       = -1 EPERM (Operation not permitted)
...
write(2, "cannot remove `root.hdd'", 24cannot remove `root.hdd') = 24
...

Since the unlinking failed, it's safe to assume something still has the file open (using the 'root.hdd' name). Since the file contains an OpenVZ filesystem, make sure any process or service that is related to OpenVZ is off, then try again.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.