The following general steps are involved in creating a swap file:
Creating a swap file with the mkfile command
Activating the swap file with the swap command
Adding an entry for the swap file in the /etc/vfstab file so that the swap file is activated automatically when the system is booted.
The mkfile command creates a file that is suitable for use as either an NFS-mounted or a 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 Kbytes, blocks, or Mbytes by using the k, b, or m suffixes, respectively.
The following table shows the mkfile command options.
Table 42–2 Options to the mkfile Command
Option |
Description |
---|---|
-n |
Creates an empty file. The size is noted, but the disk blocks are not allocated until data is written to them. |
-v |
Reports the names and sizes of created files. |
Use the -n option only when you create an NFS swap file.