Tim Peeler on Tue, 5 Jun 2001 20:10:05 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: file system shenanigans (was: Re: [PLUG] ELF Init section)


On Tue, Jun 05, 2001 at 04:00:39AM -0400, gabriel rosenkoetter wrote:
> You'd really think I'd have learned not to presume I knew things
> by now tonight, but I clearly haven't. ffs and lfs both default to
> whatever you set bsize to in the disk's disklabel which, in a
> default install of NetBSD at least, is 8192 bytes. I'm going to go

8k sectors??? And I thought 4k was wasteful.

> ahead and presume that ufs has some similar kind of way of deciding,
> though I haven't a clue what it is. Though I've created a ufs disk
> on a Solaris machine, it's all a bit hazy.
> 
> The problem here is that we're talking about two different things.
> du doesn't report blocks in the sizes the file system likes, but
> in the sizes it was compiled to show them. On BSD- and System

As I understand it, right.

> V-derived systems, this defaults to 512b blocks. On all the Linux
> systems I've used, it seems to default to 1K blocks. On every system
> trying to be POSIX compliant, du -k reports in 1K blocks.
> 
> Does this imply that the ext2 file systems on all the Linux systems
> I've used are using 1K blocks on disk? I doubt it. It's just what
> whoever wrote GNU's du decided was appropriate (because it's easier

That seems reasonable, but I don't know.  I know that du does default
to report usage in certain block sizes, but as to why I don't know.
I know RedHat had used 4096 byte block sizes to create the filesystem
and I remember seeing du report in 4k blocks, perhaps it's as simple
as what the person likes.

> for a human to understand? I guess, but only because we've become
> power-of-(about)-ten-byte centric in the 90s).
> 
> I'm still distantly curious about why the default block sizes for
> ext2 are what they are (does this make ext2 deal with a wider
> variety of disks better with less user intervention? seems like a
> program-that's-trying-to-be-too-smart problem would come up awfully
> quickly that way), but I guess I'm more curious about what workloads
> call for what block sizes (and fragment sizes, and cylinders per
> group, and so forth). Any conventional or experimental wisdom on
> that?
> 
>        ~ g r @ eclipsed.net

I believe the default block sizes are for filesystem and disk size.
The larger the blocks, the larger the filesystem you can have.  That's
the first most simple reason.  If there's others (and I believe there
are, otherwise I would still be able to choose 512), I don't know them.

Tim


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug