Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

  1. Are those hardlinks supposed to be there at all?
  2. How were they created in the first place?
  3. 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.

share|improve this question
can you put here cat /etc/mtab output? – MealstroM May 20 '11 at 6:28
up vote 2 down vote accepted

You shoudn do. this shoud be like that. check why this was done

/run is now a tmpfs, and /var/run is bind mounted to it. /var/lock is bind mounted to /run/lock. Applications can use /run the same way as /var/run. Since the latter is FHS/LSB most apps should just use the latter, only early boot stuff should use /run, for now. The folks who have packages where this applies already have been informed

you could try to use mount --bind /dir1 /dir2 for yours purposes if yours problem is not described in article by link

share|improve this answer
This still doesn't explain why there are hardlinks there or how are they supposed to be re-created (ln refuses to hardlink directories). – bdew May 19 '11 at 14:13
Err, wait... there aren't hardlinks, it's just cp being stupid and seeing mount --bind as hardlinks (same inode number i guess) and complaining about it. – bdew May 19 '11 at 14:15
You can use rsync with --hard-links to copy what you need. that would be better i suppose. – MealstroM May 19 '11 at 14:31

Your Answer


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.