I'm trying to copy the root file system of a Debian unstable system. I get the following warnings when i do this:
gw:/# cp -xar / /mnt/1.tmp/ cp: will not create hard link `/mnt/1.tmp/var/run' to directory `/mnt/1.tmp/run' cp: will not create hard link `/mnt/1.tmp/var/lock' to directory `/mnt/1.tmp/run/lock'
Now from my memory of how things work in unix, hardlinking directories is disallowed, and indeed it won't let me do it:
ln: `run': hard link not allowed for directory
So, my questions:
- Are those hardlinks supposed to be there at all?
- How were they created in the first place?
- How do i recreate them on the new filesystem?
Looks like those hardlinks reported by cp don't actually exist, those 2 directories are mounted with --bind and cp sees the same inode number and thinks it's a hardlink.
I still don't fully understand how all this /run thing is supposed to work, for example there is no tmpfs mounted there on this system.
Anyway I'll go ahead with the move and unless something interesting happens or someone gives a better explanation will accept MealstroM's answer as it was somewhat helpful to understanding what is going on.