small du(1) question
Chuck Swiger
cswiger at mac.com
Wed Oct 19 22:02:58 UTC 2011
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?
> isn't there a way to automatically query the blocksize of the underlying device,
> instead of always asuming the blocksize is 512 byte?
There is a way to query the blocksize of a physical device-- ie, ATA's IDENTIFY DEVICE, or SCSI's MODE SENSE-- but various drives lie about their actual physical blocksize to work around bugs in BIOS and drivers.
Also, while one does prefer to have all of the three blocksizes mentioned above correspond for performance reasons, they aren't always the same.
Regards,
--
-Chuck
More information about the freebsd-questions
mailing list