0

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 ).

6
  • What are the actual files you're trying to work with? May 27, 2013 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 ). May 27, 2013 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. May 27, 2013 at 15:44
  • Run the commands through strace and check lsattr for the file and for /somedir. May 27, 2013 at 16:50
  • Here is the strace response to the command "strace rm -f root.hdd" - pastebin.com/wyZ24ehM May 28, 2013 at 2:18

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .