On Fri, 16 Mar 2001, Holp, John Mr. wrote:

> >     ls -li vmlinuz                  while at        /       (root)
> > I get the following
> > 
> > 12  lrwxrwxrwx      1       root    root    19 Jan 18       08:05
> > vmlinuz -> boot/vmlinuz-2.2.17
> > 
> > To me this means that vmlinuz is a soft link pointing to
> > boot/vmlinuz-2.2.17

That is correct.  If the file shows that sort of link information, it is a
soft link.  Hard links do not have such information, they directly
reference the original file.  So you would see the actual file information
there, not the link information.

You should think of a hard link as another name for the original file.  A
soft link is a file which contains the file name of whatever it points to.

> >     But when I do a ls -li /boot/vmlinuz-2.2.17     I get the following
> > 
> > 12  -rwxrwxrwx      1       root    root    1042807  Jan 18  08:05
> > /boot/vmlinuz-2.2.17
> > 
> > Here is my confusion, I thought only hard links used the same inode
> > number?  Note that both are using inode 12.

It is possible for files on different filesystems to use the same inode
number.  So if /boot is on another filesystem from / then it looks like
they have the same inode number by coincidence.  If /boot and / are on
different filesystems this proves it is a soft link as hard links cannot
point across filesystems (and they cannot point to directories).

Reply via email to