Managing filesystem types

ufs inodes

The inode information is kept in the cylinder information block. An inode contains all the information about a file except its name, which is kept in a directory. An inode is 128 bytes long. One inode is created for every 2K of storage available in the filesystem. This parameter can be changed when mkfs(1M) is used to create the filesystem.

What does a ufs inode contain?

A ufs inode contains the following:

The ufs inode's disk block addresses

The heart of the inode is two arrays that, together, comprise 15 disk-block addresses.

The following figure illustrates this chaining of address blocks stemming from the inode.

The address chain in a ufs filesystem

The following table shows the number of bytes addressable by the different levels of indirection in the inode address array for ufs filesystems. These numbers are calculated using the logical block size of the filesystem and the number of bytes used to hold an address.

  Maximum number of bytes addressable by

Logical Block Size

Direct Blocks

Single Indirect Blocks Double Indirect Blocks
2048 bytes 24KB 1MB 512MB
4096 bytes 48KB 4MB 4GB
8192 bytes 96KB 16MB 32GB
The table shows the number of bytes addressable using the level of indirection in the column header plus all lower levels of addressing. For example, the table values for single indirect blocks also include bytes addressable by direct blocks; and the table values for indirect blocks include bytes addressable by direct blocks and single indirect blocks. In a filesystem with a 2048-byte block size, files larger than 512MB use triple indirect blocks.

The theoretical maximum size of a ufs filesystem is the same as the size of a file addressable with triple indirection. In practice, however, file size is limited by the size field in the inode. This is a signed 32-bit field, so file sizes are limited to 2GB. Because of the large size of ufs logical blocks, double indirect blocks rarely appear in ufs filesystems. The result is that data retrieval in large files is much quicker than it would otherwise be.

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