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

Quinton Pike
  • 101
  • 4

1 Answers1

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.

Signal15
  • 952
  • 7
  • 29