Go to main content

Managing File Systems in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020

UFS Direct I/O Mode

File systems usually perform a lot of caching to avoid redundant I/O access to a device. This boosts performance when a block of data is needed multiple times over a short period of time. However, for some loads, the file system caching might not be effective or can even be disruptive. This usually involves applications (mostly databases) which perform caching on their own, and decide what needs to be cached in the memory for faster access. For such loads, UFS provides direct I/O mode, which disables caching on the file system level, enabling all read and write operations to be performed directly on the device. UFS then remains in control of the file system organization but data flow is managed by the application.

Direct I/O mode can be enabled for a whole file system or for each file. To enable direct I/O mode for a file system, you can use the directio option while mounting the file system. Direct I/O access is then used to access all the files on the mounted file system.

# mount -F UFS -o directio /dev/dsk/device-name/directory-name

Enabling direct I/O mode on separate files is useful on file systems with mixed load. To enable direct I/O access for a specific file, you must update the source code of the application when the file is opened. For more information, see the directio(3C) and mount_ufs(8) man pages.