From owner-freebsd-questions@FreeBSD.ORG Wed Oct 19 20:47:54 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id A8A04106566B; Wed, 19 Oct 2011 20:47:54 +0000 (UTC) Date: Wed, 19 Oct 2011 20:47:54 +0000 From: Alexander Best To: Chuck Swiger Message-ID: <20111019204754.GA23081@freebsd.org> References: <20111019193413.GA9065@freebsd.org> <6620A8F5-523D-4A1E-9CC1-9C2D917BF0C2@mac.com> <20111019203713.GA19350@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111019203713.GA19350@freebsd.org> Cc: freebsd-questions@freebsd.org Subject: Re: small du(1) question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2011 20:47:54 -0000 On Wed Oct 19 11, Alexander Best wrote: > On Wed Oct 19 11, Chuck Swiger wrote: > > On Oct 19, 2011, at 12:34 PM, Alexander Best wrote: > > > the du(1) man page states the following: > > > > > > " > > > -B blocksize > > > Calculate block counts in blocksize byte blocks. This is differ- > > > ent from the -k, -m options or setting BLOCKSIZE and gives an > > > estimate of how much space the examined file hierarchy would > > > require on a filesystem with the given blocksize. Unless in -A > > > mode, blocksize is rounded up to the next multiple of 512. > > > " > > > > > > is this a doc bug, or does du(1) really always assume that every filesystem's > > > blocksize == 512? > > > > 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? isn't > there a way to automatically query the blocksize of the underlying device, > instead of always asuming the blocksize is 512 byte? ...also: since -A is supposed to take the actual file size into account and not the blocksize of the underlying filesystem, shouldn't the output of 'du -A -B4096' and 'du -A' be the same? just tested this on freebsd 7 and freebsd 10 and the outputs differ. cheers. alex > > cheers. > alex > > > > > Regards, > > -- > > -Chuck > >