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!
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
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 | /\ |
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
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
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.
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>