[CentOS] hard link a directory

Fri Jan 12 02:27:08 UTC 2007
Ross S. W. Walker <rwalker at medallion.com>

That's a symbolic link and it is perfectly fine to symlink directories.

Symbolic links contain the path to the inode, hard links contain the
inode reference itself. Think of hard links like copying the file, but
having the copy point to the same data, if you delete any one of the
hard links the data remains, but if you symlink it and delete the
destination file then you loose the data and the symlink points to
nothing unless you put another file there with the same name. Hard links
cannot be made between files in different file systems, as the inode
referenced in file system 1 will not be the same on file system 2, but
since a symlink is a path to an inode that path can point to a
file/directory on a different filesystem.

-Ross


> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Peter Serwe
> Sent: Thursday, January 11, 2007 9:13 PM
> To: CentOS mailing list
> Subject: Re: [CentOS] hard link a directory
> 
> I just usually add the '-s' flag to my ln's, and it seems to work. 
> 
> Sometimes I add '-snf' just because it's more fun to type.
> 
> Peter
> Andreas Rogge wrote:
> > You can't.
> > Ken Thompson decided that this complicates things too much 
> so this was
> > disabled back in the 70ies.
> > You can however do a
> > mount --bind /var/spool /home/recordings
> > this has a quite similar effect.
> >
> > Regards,
> > Andreas Rogge
> >
> > Am Freitag, den 12.01.2007, 05:50 +0800 schrieb Mark Quitoriano:
> >   
> >> Hi im trying to hard link a folder and i get this
> >>
> >> # ln /var/spool /home/recordings
> >> ln: `/var/spool': hard link not allowed for directory
> >>
> >> how do i hard link a directory?
> >> _______________________________________________
> >> CentOS mailing list
> >> CentOS at centos.org
> >> http://lists.centos.org/mailman/listinfo/centos
> >>
> >>     
> >
> > _______________________________________________
> > CentOS mailing list
> > CentOS at centos.org
> > http://lists.centos.org/mailman/listinfo/centos
> >   
> 
> 
> -- 
> Peter Serwe <peter at infostreet dot com>
> http://www.infostreet.com
> 
> "The only true sports are bullfighting, mountain climbing and 
> auto racing." -Earnest Hemingway
> 
> "Because everything else requires only one ball." -Unknown
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.