DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Managing filesystem types

Choosing a logical block size

Logical block size is the size of the blocks that the system kernel uses to read or write files. The logical block size is usually different from the physical block size, which is the size of the smallest block that the disk controller can read or write, usually 512 bytes.

The s5 filesystem supports logical block sizes of 512, 1024 (1K), and 2048 (2K) bytes, (the default is 1024 bytes or 1K) while the sfs and ufs filesystems support logical block sizes of 2048 (2K), 4096 (4K), and 8192 (8K) bytes. An administrator can choose a logical block size during installation or with the mkfs(1M) command when making a new filesystem after the system is installed. The installation program provides a 1024-byte vxfs filesystem as a default. mkfs(1M) uses a default logical block size of 1024 bytes for the vxfs filesystem. The sfs and ufs filesystems support three logical block sizes: 2048 bytes (2K), 4096 bytes (4K), and 8192 bytes (8K).

There are no fragments with vxfs because storage is allocated in extents that are collections of one or more blocks. For the most efficient space utilization, use the smallest block size available on the system. The smallest block size available is 1K (a 1024-byte block). mkfs(1M) uses a default logical block size of 1024 bytes for most vxfs filesystems. (A larger default block size may be selected for multi-gigabyte filesystems.) vxfs uses logical block sizes of 2048 bytes (2K), 4096 bytes (4K), and 8192 bytes (8K) in addition to the default size. Unless there are special concerns, you need never specify a block size when creating a vxfs filesystem. Because vxfs does allocation and I/O in multiple-block extents, keeping the logical block size as small as possible increases performance and reduces wasted space for most workloads.

What to consider when choosing a logical block size

To choose a reasonable logical block size for your system, you must consider both the performance desired and the available space. For information on disk performance, see ``Managing and improving system performance''. For most sfs,, ufs, and s5 systems on an Intel processor, a 4K filesystem provides the optimal performance. This size offer a good balance between disk performance and use of space in primary memory and on disk. See ``Managing system performance'' for more information.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004