DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-06-27 22:26:57

smerk
New member
Registered: 2007-06-27
Posts: 2

du -ks returns wrong directory sizes

Hi everyone, i've noticed that du -ks from either cygwin or opensuse on DNS-323
directories returns incorrect sizes.  Individual file sizes are correctly given.
Directories on local drives are ok and i never noticed this behavour with other
samba network shares. Right-click>properties from windows gives correct
directory sizes, but i'd like to be able to use du.
Any tips, insights appreciated. m

Offline

 

#2 2007-06-27 23:04:10

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: du -ks returns wrong directory sizes

a difference of a few percent could be normal if windows reports "sum of file sizes". du reports "disk usage" which is always greater or equal to the sum of file sizes.

Offline

 

#3 2007-07-06 11:49:23

smerk
New member
Registered: 2007-06-27
Posts: 2

Re: du -ks returns wrong directory sizes

Thought I'd follow up on this. Thanks for the reply.

I was aware of this already, but the differences are far more
than a couple of percent, more like 24GB for a 6GB directory.
I'm also aware of the block/byte output differences for dd et al.
A 'native' port of dd from UnxUtils does give correct sizes though,
within a few percent of course.

Just to continue with the mysteries... emacs hangs when editing
a file on the DNS. It seems to be creating a .lnk file which I've
never seen ceated by emacs on any other unix I've used.
Kind of bs to have to create/edit scripts locally for a balky NAS.

Offline

 

#4 2007-07-06 12:13:19

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: du -ks returns wrong directory sizes

Funny, but you're right - for SMB mounts:

SMB mount:

Code:

tp@kiwi:/mnt$ du -cks bob/vol1/fun_plug*
2       bob/vol1/fun_plug
2       bob/vol1/fun_plug-0.2
190913  bob/vol1/fun_plug.d
186537  bob/vol1/fun_plug.d-0.2
183785  bob/vol1/fun_plug.d.1
561238  total

NFS mount:

Code:

tp@kiwi:/mnt$ du -cks bob1/fun_plug*
4       bob1/fun_plug
4       bob1/fun_plug-0.2
10496   bob1/fun_plug.d
6520    bob1/fun_plug.d-0.2
3660    bob1/fun_plug.d.1
20684   total

Via telnet:

Code:

/mnt/HD_a2 # du -cks fun_plug*
4       fun_plug
4       fun_plug-0.2
10496   fun_plug.d
6520    fun_plug.d-0.2
3660    fun_plug.d.1
20684   total

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB