0

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?

lucaferrario
  • 111
  • 2
  • 7

2 Answers2

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.

  • 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 '14 at 23:12
0

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! ;-)

lucaferrario
  • 111
  • 2
  • 7