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

disk blocksize in solaris

36 views
Skip to first unread message

Jeff Zheng

unread,
Mar 29, 1996, 3:00:00 AM3/29/96
to

Can anyone tell me in solaris, the disk block size has to be 512 bytes?

what happen if I use a disk with block size other than 512 bytes in
solaris?

thanks a lot!

Jeff
jzh...@integrix.com


Lee Duncan

unread,
Apr 1, 1996, 3:00:00 AM4/1/96
to
>>>>> "JZ" == Jeff Zheng <jzh...@ix.netcom.com> writes:

JZ> Can anyone tell me in solaris, the disk block size has to be 512
JZ> bytes?

JZ> what happen if I use a disk with block size other than 512 bytes
JZ> in solaris?

JZ> thanks a lot!

JZ> Jeff jzh...@integrix.com

UFS under Solaris uses a filesystem which has evolved from the
McKusick fast file system. What this means is that you have a default
block size of 8k, and a default frag size (frags make up blocks) of 2k
(I'm *really* rusty at this, so please correct me if I'm wrong).
There sizes *are* tunable at filesystem creation time (within limits,
of course).
--
Lee Duncan Lee.D...@Central.Sun.COM

He who wonders discovers that this in itself is wonder. -- M. C. Escher

Tom Sorensen

unread,
Apr 1, 1996, 3:00:00 AM4/1/96
to

In article <gn57mvz...@churchlady.Central.Sun.COM>, ldu...@churchlady.Central.Sun.COM (Lee Duncan) writes:
>>>>>> "JZ" == Jeff Zheng <jzh...@ix.netcom.com> writes:
>
>JZ> Can anyone tell me in solaris, the disk block size has to be 512
>JZ> bytes?
>
>McKusick fast file system. What this means is that you have a default
>block size of 8k, and a default frag size (frags make up blocks) of 2k
>(I'm *really* rusty at this, so please correct me if I'm wrong).

Ok, you're partially wrong.

The block size in UFS, as in most modern FS's, is 512 bytes. The i-node
size is 8k by default (I think), although it's tunable as you say.

Proof? Just look at df. By default it reports in blocks. df -k reports in
a more reasonable format for most humans, and the available listing is
exactly 1/2 the number of blocks shown, thus each block is 1/2K = 512 bytes.

--
Tom Sorensen t...@dogbert.de.sc.ti.com | Fight the CDA |blue|
If I managed to represent TI in this post, then I'm | Responsibility | () |
probably far more surprised than TI is. | Starts at Home | /\ |

Bruce Adler [Contractor]

unread,
Apr 2, 1996, 3:00:00 AM4/2/96
to
By default:

The ufs file system block size is 8k.
The ufs file system fragment size is 1k.
The disk driver block size (aka sector size) is 512 bytes.

The "df" and "du" commands report (due purely to historical reasons)
allocations based on the 512 byte sector size. The "df -k" and "du -k"
commands report allocations based on 1k blocks.

The block size values are configurable (modify at your own risk) and
are stored in the ufs file system superblock.

BA

Anthony Duarte

unread,
Apr 3, 1996, 3:00:00 AM4/3/96
to
I know that Solaris reads the partition table to look up the ufs block
size on read()/write(). (default 8k) I also know that the driver
will check the alignment/size of the I/O to make it aligned with the
disk block size.

But how does this relate to the Solaris Buffer Cache? Will the 8k ufs
block be stored as 2 consecutive 4k buffers for cache purposes? And will
a 1k write force an 8k read? (Or will the cache handle it with a 4k operation?)

If anyone knows the answers, please let us know. This will definitely effect
the layout of my data structures for efficient database operation.

Tony

Guy Harris

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
Anthony Duarte <adu...@oracle.com> wrote:
>But how does this relate to the Solaris Buffer Cache? Will the 8k ufs
>block be stored as 2 consecutive 4k buffers for cache purposes?

The "Solaris Buffer Cache", except for file system metadata (other than
directory blocks), is known as "the page pool", and, as such, a buffer
is one page in size.

Given that, on most Suns, yes, an 8K UFS block will be stored as 2 4K
pages, although there is no guarantee that they'll be contiguous in
physical memory, and they'll only be contiguous in virtual memory if
they're mapped contiguously. On some Suns (older Sun-4 kernel
architecture machines, and the Sun-4e kernel architecture machines -
which aren't supported by Solaris 2.5, I think - and, I seem to
remember, the newer Ultras) you have 8K pages, so an 8K UFS block will
be stored as one 8K page.

>And will
>a 1k write force an 8k read? (Or will the cache handle it with a 4k
>operation?)

I no longer remember the details of the VM system, so I don't remember
whether it'll just read in one page or two.

David B. Schmidt

unread,
Apr 4, 1996, 3:00:00 AM4/4/96
to
Spoke upon these pages, Lee Duncan <ldu...@churchlady.Central.Sun.COM>
raised the offer of...

>
>>>>>> "JZ" == Jeff Zheng <jzh...@ix.netcom.com> writes:
>
>JZ> Can anyone tell me in solaris, the disk block size has to be 512
>JZ> bytes?

Nope, You can set the blocksize to (just about) anything you want... 512
or 1024 are prob. the best sizes though - then again that all depends on
what you are using the disk for...

This is in Sol 2.4 x86 - BTW

-David <dsch...@shadow.net>


0 new messages