Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get block size info on AIX

897 views
Skip to first unread message

Marco Claro Pineda

unread,
Nov 29, 1993, 12:45:20 PM11/29/93
to
I am hoping that someone can help me with this problem. I need to
find out the disk block size on a particular machine. My problem may
or may not be familiar to readers on this group. When transferring
files between two machines the block count reported by 'du' doubles.
The only difference between the machines (both rs/6000s, identical
models) is that one runs a 3.1 version and the other is up to 3.2.3.

The doubling occurs when trasfering from 3.1 to 3.2. Its symmetrical
so transferring in the other direction halves the block count.

thanks in advance.


*************************************************************************
* Columbia hasn't got an opinion worth expressing. | mc...@columbia.edu *
* "Carpe Cibum" | Marco Pineda *
*************************************************************************

Michael G. Phillips

unread,
Nov 29, 1993, 6:22:50 PM11/29/93
to
Marco Claro Pineda (mc...@konichiwa.cc.columbia.edu) wrote:
> or may not be familiar to readers on this group. When transferring
> files between two machines the block count reported by 'du' doubles.
> The only difference between the machines (both rs/6000s, identical
> models) is that one runs a 3.1 version and the other is up to 3.2.3.

> The doubling occurs when trasfering from 3.1 to 3.2. Its symmetrical
> so transferring in the other direction halves the block count.

Sounds more like one machine has an alias with the "-k"
option set... That reports Kbytes vs 512-byte blocks.
(Or maybe the 3.1 version used -k as default???)

Note: the actual disk allocations are in 4k blocks though!
--
--------------------------------------------------------------------
Michael G. Phillips mg...@crl.com mg...@dbsoftware.com
(404)239-2766 "Just because it worked doesn't mean it works." -- me

Marco Claro Pineda

unread,
Nov 30, 1993, 2:57:08 PM11/30/93
to

First of all thank you to the people who responded to my original
post. It seems that there exists different versions of 'du' from 3.1
to 3.2. 3.1 du reports with a block size of 1024 and 3.2 with a block
size of 512. Using the '-k' option with 3.2 'du' reports with the sam
block count as 3.1.

My problem appears more complex, though, and du still seems to be the
culprit. Our product at work writes data files that du reports with
erroneous block counts. Copying the files and doing a block count on
the copied files yields the correct count.

My reading of the man page tells me that 'du' reports on block size
strictly on the basis of file size, and without regard to disk
blocking factors. How could it make a mistake in that case. All
other utilities tell me that the original file and the copy are the
same, and I have tried copying with other utilities, as well, all with
the same results. (For those who care I used cmp, dircmp and ls to
compare the files, and cp, cpio, tar and rcp to copy the files)

If there is anyone who has come across this problem, please post or
e-mail. thanks

Marc Auslander

unread,
Nov 30, 1993, 4:33:39 PM11/30/93
to
The AIX "man page" for du tells me that it counts the actual disk
space used, including indirect blocks. It says nothing about the file
size field.

Your application is writing a "sparse" file, either by using memory
mapped access or lseek. The unwritten blocks are not represented in
the original. When you copy the file, they are written as blocks of
zero, which is why the file grows. If you use backup/restore to copy
the original file, its "sparseness" is preserved.
--


Marc Auslander <ma...@watson.ibm.com> 914 784-6699 (Tieline 863 Fax x6306)

John Raven

unread,
Dec 6, 1993, 4:37:35 AM12/6/93
to

From 3.1 to 3.2 the format of the du output changed, it is now
in 512k blocks where it was in k's. Must have something to do
with (POSIX, OPEN, COMMON and all that standardization stuff.

use:

du -k

on 3.2 to get the block size in k's.
I am used to working in k's and just alias it so that is what
I always get.

0 new messages