Re: hard links and symbolic links

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/06/05

  • Next message: Neil Woods: "Re: Question regarding searching for files which are not of specific type ??"
    Date: Wed, 06 Apr 2005 16:27:12 -0400
    
    

    In article <d30svd$bp5$3@reader1.panix.com>,
     Jeremiah DeWitt Weiner <jdw@panix.com> wrote:

    > Francesco M. <fmarchioni@libero.it> wrote:
    > > This raised 2 questions to me. Is anybody able to explain it ?
    > > 1) Why symbolic links take more disk space then hard links ?
    >
    > This statement seems pretty odd to me: symlinks use an extra inode,
    > but basically no disk space, where as hard links point to the same inode
    > as the original file, so they don't take up another inode, but this is
    > such a minor consideration, disk-space-wise, as to be of no consequence
    > at all, unless maybe you had millions of links.

    In many implementations, a symlink is stored like a normal file, with
    the target information in the file contents. As a result, the symlink
    uses up a whole disk block, which will mostly be wasted. It also uses
    up an inode.

    But you're right that this is not of much consequence these days, where
    disks are measured in 10's or 100's of gigabytes. I expect the text the
    OP quoted was written back when disk space was not nearly as plentiful.

    -- 
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    

  • Next message: Neil Woods: "Re: Question regarding searching for files which are not of specific type ??"

    Relevant Pages

    • Mysterious directory / IRIX 6.5.14
      ... /rings is a 195 GB filesystem. ... In looking to free up disk space, ... in the /rings//1996 directory do not correspond to inode numbers in ... Thanks in advance for any advice. ...
      (comp.sys.sgi.admin)
    • Help
      ... It says no buffer space ... on device.So I checked for inode numbers but that are only 60%used. ... deleted some of the heavy directories. ... my disk space is 11%. ...
      (SunManagers)
    • Re: rm doesnt free up space
      ... Earl wrote: ... > Rebooting and forcing a fsck doesn't seem to have solved the problem. ... but what is your inode count? ... even if there is still plenty of free disk space available. ...
      (Fedora)
    • Re: Empty files
      ... Mikhail Teterin wrote: ... other than for the directory entry itself? ... if it exists on the drive then it's assigned an inode number. ... that can get quite costly on disk space when you have a lot of ...
      (comp.unix.bsd.freebsd.misc)
    • Re: Undoing a symbolic link
      ... A hardlink is different to a symlink, instead of just linking to a filename, ... it links to the actual inode and increases the inode's "ref count". ... between hard links and symbolic links is that, for a symlink, the file ...
      (comp.os.linux.misc)