Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2011 20:01:39 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        Alexander Best <arundel@freebsd.org>, freebsd-questions@freebsd.org
Subject:   Re: small du(1) question
Message-ID:  <441uu85y58.fsf@lowell-desk.lan>
In-Reply-To: <D5BC40B0-159F-4F97-AB3F-B7D1EDCB459C@mac.com> (Chuck Swiger's message of "Wed, 19 Oct 2011 15:02:41 -0700")
References:  <20111019193413.GA9065@freebsd.org> <6620A8F5-523D-4A1E-9CC1-9C2D917BF0C2@mac.com> <20111019203713.GA19350@freebsd.org> <D5BC40B0-159F-4F97-AB3F-B7D1EDCB459C@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Swiger <cswiger@mac.com> writes:

> On Oct 19, 2011, at 1:37 PM, Alexander Best wrote:
>>> The default blocksize is 512 bytes.
>>> 
>>> The -B option flag lets you tell du to assume a different filesystem blocksize.
>> 
>> so when running freebsd on a hdd with a blocksize of 4k, a simple 'du -h' will
>> always display incorrect results, unless '-B 4096' was also specified?
>
> Which blocksize?
>
> The filesystem's DEV_BSIZE kept in the superblock info, the logical sector size provided by the device to the BIOS/UEFI/firmware, or the actual physical device blocksize?

du(1) uses DEV_BSIZE, but it looks like that's the version from
sys/param.h, which is always 512.  I would suggest fixing that to
look at the filesystem's definition, but then I'd have to figure
out what the correct behaviour would be when recursing into
through multiple filesystems with different blocksizes.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?441uu85y58.fsf>