Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2000 15:45:35 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        "Scott M. Lewandowski" <sml_freebsd_questions@hotmail.com>
Cc:        questions@freebsd.org
Subject:   Re: Minimum filesystem block size
Message-ID:  <14913.10367.600015.346520@guru.mired.org>
In-Reply-To: <OE75MzfoV1qdiixjnzi000020a6@hotmail.com>
References:  <14912.12013.88339.583561@guru.mired.org> <OE75MzfoV1qdiixjnzi000020a6@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Scott M. Lewandowski <sml_freebsd_questions@hotmail.com> types:
> Mike,
> 
> Thanks very much for this response. I did not understand the "fragment"
> concept, but I think I do now.

Please leave the mail on -questions so it goes into the archives (and
so others can answer if I'm wrong).

> So for my configuration, where I want to store lots of relatively small
> email files (~80,000 files, 90% of which are < 1K), do you have
> recommendations for block size/fragment size/inode density settings? It
> looks like I could benefit from 512 byte blocks, but maybe I should just use
> the default of 1K. If I use that default, is there harm in sticking with the
> default block size of 8K? I don't see anything in the man page that
> discusses the ramifications of block and fragment size (other than the
> obvious, such as wasted space). Also, I assume that decreasing inode density
> doesn't cause any ill side effects, other than taking up more space for the
> inodes themselves, right?

If your files really are mostly less than 1K - and most of them are >
512 bytes, which I expect is true for mail, then 512 vs. 1K fragments
won't make a lot of difference. If you stay with 1K frags, you might
as well stay with 8K blocks. If you go with 512 byte frags, you have
to lower the block size to 4K.

I'd raise the inode density for this case, otherwise you risk running
out of inodes (one required per file) before you run out of disk
space. The man page for newfs notes for the -i flag that "this value
effectively specifies the average file size on the file system." The
default is four times the frag size, which is going to be much to
large for what you have in mind.

	<mike

> Thanks for your original replies, and any further info you can offer!
> 
> Scott
> 
> ----- Original Message -----
> From: Mike Meyer <mwm@mired.org>
> To: <questions@freebsd.org>; <sml_freebsd_questions@hotmail.com>
> Sent: Tuesday, December 19, 2000 11:00 PM
> Subject: Re: Minimum filesystem block size
> 
> 
> > Mike Meyer <mwm@mired.org> types:
> > > Scott M. Lewandowski <sml_freebsd_questions@hotmail.com> types:
> > > > I am thinking of deploying qmail to take advantage of the Maildir
> format
> > > > that it offers. However, it seems like this will be very wasteful of
> space.
> > > > According to the newfs man page, the minimum disk block size is 4096
> bytes.
> > > > Since Maildir stores each new mail message, as well as all archived
> mail
> > > > messages, as separate files, this means that each email will take up
> 4K of
> > > > disk space, even though my average mail message is only ~1K. Is this
> > > > correct, or am I missing something? Is there any way to use a smaller
> block
> > > > size on a new filesystem?
> > > You're missing fragments in the file system. Any partial blocks in a
> > > file are stored in fragments, not blocks, and fragments are shared
> > > amongst files. I always use the default (1k), but it can be as low as
> > > 512 bytes (with 4K blocks). Reread the newfs man page for details.
> >
> > Just to clarify the "fragments are shared amongst files", I meant that
> > blocks that hold fragments can hold fragments from more than one
> > file. So with three files of sizes 24K + 828 bytes, 576 bytes, and
> > 1812 bytes on a 4K/1K file system, you get a file with 6 blocks and a
> > fragment (828 bytes of 1K) and two files that are pure fragment; one
> > being one fragment (576 bytes of 1K) and one of two (1812 bytes of
> > 2K). The fragments could all fit in one block, meaning your total disk
> > usage is 7 blocks (6 blocks for the first file, and one block for the
> > fragments of all the rest), not counting inodes, directory blocks,
> > etc.
> >
> > <mike
> > --
> > Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/
> > Independent WWW/Unix/FreeBSD consultant, email for more information.
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
> 
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Unix/FreeBSD consultant,	email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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