Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: adrian on June 05, 2012, 02:41:04 PM

Title: du not taking files with same inodes into account (tcl 4.5.3)
Post by: adrian on June 05, 2012, 02:41:04 PM
Hi all,

I'd first like to say TCL is is AWESOME!!! But now, I'd like to report a failing.  :-[

The du utility isn't reporting space correctly.  A hard linked file should show up as not taking up so much space (only the size of the pointer to the inode).  Here is an example.

Code: [Select]
$ printf "% *s" $((1024*12)) '' > file1
$ cp -l file1 file2
$ ls -li file*
  14700 -rw-r--r--    2 backup   backup       12288 Jun  5 21:18 file1
  14700 -rw-r--r--    2 backup   backup       12288 Jun  5 21:18 file2
$ du -a file*
12.0K   file1
12.0K   file2

As you can see they are the same inode so I was expecting file1 to show up as 12.0K and file2 to be much less (around 1-4K) when using du.  Is there a quick fix for this? I need this to display overhead for a backup server that I'm making.

Thanks all,


A

P.S. Could someone fix the settings on this forum?  If I use the code tag, it says I am not allowed to post external links and keeps me from posting. :(

P.P.S. Looks like it is not enforced after the first post.
Title: Re: du not taking files with same inodes into account (tcl 4.5.3)
Post by: adrian on June 05, 2012, 03:19:18 PM
Oh, FYI, I tried it on TCL 4.5.4 with the same bug.


A
Title: Re: du not taking files with same inodes into account (tcl 4.5.3)
Post by: adrian on June 05, 2012, 11:50:04 PM
For now, I dled the gcc and support files and built the coreutils.  They all didn't compile, but they did compile up to compiling du so I'm happy about that.  I just need the du util anyway. :)


A
Title: Re: du not taking files with same inodes into account (tcl 4.5.3)
Post by: curaga on June 06, 2012, 02:12:38 AM
Please report busybox bugs to busybox. Also there would have been coreutils.tcz ;)
Title: Re: du not taking files with same inodes into account (tcl 4.5.3)
Post by: adrian on June 06, 2012, 12:34:23 PM
Duh!  Done!  ;D


A