bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

du does not account space allocated by long softlinks


From: Ville Herva
Subject: du does not account space allocated by long softlinks
Date: Fri, 6 Dec 2002 20:49:03 +0200
User-agent: Mutt/1.4i

Long (non-embedded) softlinks allocate disk blocks to hold the referred path
on linux/ext[23] (possibly on other fs's as well). This space is not
reported by du(1) at all:

mkdir empty; cd empty
ln -fs $(perl -e "print ('a' x 100)") a
du -k a
0       a
perl -e 
'($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)=lstat
 "a"; print $blocks*512,"\n"'
4096

(4096 is the size of one disk block on this fs.)

With shorter soft links (the limit is 60 chars on my case), no disk block is
allocated because the referred path is embedded in the softlink:

ln -fs $(perl -e "print ('a' x 10)") a
du -k a
0       a
perl -e 
'($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)=lstat
 "a"; print $blocks*512,"\n"'
0

du --version
du (fileutils) 4.1
Written by Torbjorn Granlund, David MacKenzie, Larry McVoy, and Paul Eggert.

Copyright (C) 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 
-- v --

address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]