Super User is a question and answer site for computer enthusiasts and power users. 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 am taking over control of a server and I have found a directory in two different locations:

/var/www
/home/user.name (i.e., ~/)

that have the exact same inode number:

ls -i
11895253 directory.name

I had thought that hard links on directories were entirely impossible. What is this then? How does a folder exist in two places at once with the exact same contents?

share|improve this question
1  
Post here output of mount. – Eddy_Em Apr 30 '13 at 6:57
    
They are probably under different mount points, so they are not hard links, although they may end up referencing the same directory. – mark4o Apr 30 '13 at 7:00
    
@Eddy_Em mount gave me: /var/www/directory.name on /home/user.name/directory.name type none (rw,bind) – Cameron Grover Apr 30 '13 at 7:02
1  
And that's an answer to your question! – Eddy_Em Apr 30 '13 at 7:16
up vote 5 down vote accepted

It's a "bind mount". From the mount man page:

The bind mounts. Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else. The call is

 mount --bind olddir newdir

See also http://backdrift.org/how-to-use-bind-mounts-in-linux and http://backdrift.org/how-to-use-bind-mounts-in-linux.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .