System Administration Guide, Volume 1

Creating a Swap File

The following general steps are involved in creating a swap file:

The mkfile Command

The mkfile command creates a file that is suitable for use either as an NFS-mounted or local swap area. The sticky bit is set, and the file is filled with zeros. You can specify the size of the swap file in bytes (the default) or in kilobytes, blocks, or megabytes using the k, b, or m suffixes, respectively.

The table below shows the options to the mkfile command.

Table 38-3 Options to the mkfile Command




Creates an empty file. The size is noted, but the disk blocks are not allocated until data is written to them. 


Verbose. Reports the names and sizes of created files. 

Caution - Caution -

Use the -n option only when creating an NFS swap file.