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 have an OpenVZ container containing some hard links pointing to the host file system.

For example, I have run on the host ln /root/file /var/lib/vz/private/101/root/link

Now I'm asking myself: if I backup the VM 101 with vzdump, how will it treat the hard link? Will it copy it as a hard link or will it try to follow the link and include in the dump also the /root/file (which would make my backup really HUGE).
And does the vzdump mode (stop, suspend, snapshot) change this behaviour?

share|improve this question
    
Seems easy enough to test. –  EEAA Jan 15 at 22:58
    
Just test it that shouldn't make the server explode –  Bartłomiej Zarzecki Jan 15 at 23:36

2 Answers 2

A hard link does not 'point at' another file, that's a soft / symlink. If it is in-fact a hard link (which requires it to be on the same filesystem), then it would be treated just like any other file.

Basically, a soft link points at a filename, whereas the penultimate filename points at an inode on disk.

A hard link is a new filename that points directly at the inode.

If you create a hard link and remove the original file, the hard link still fuctions the same. If you create a soft link and remove the original file, the soft link now points at something that no longer exists.

So if it's a hard link, it's literally another pointer to the exact same data. I would expect vzdump to treat it just like any other file.

share|improve this answer
    
I tested and you're perfectly right: the hard link is treated exactly as a file and so the file is included in the dump even though it is outside the VM virtual file system...so, BE CAREFUL! ;-) –  lucaferrario Jan 15 at 23:12
up vote 0 down vote accepted

I tested and it is exactly as yoonix said: the hard link is treated exactly as a file and so the file is included in the dump even though it is outside the VM virtual file system...so, BE CAREFUL! ;-)

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.