Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
As system configurations change and new software packages are installed, you might need to add more swap space. The easiest way to add more swap space is to use the mkfile and swap commands to designate a part of an existing UFS or NFS file system as a supplementary swap area. These commands, described below, enable you to add more swap space without repartitioning a disk. Alternative ways to add more swap space are to repartition an existing disk or add another disk. See Chapter 28, Disk Management (Overview) for information on how to repartition a disk.
Creating a swap file using 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 it's activated automatically when the system is booted.
Description 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.
-v
Caution Use the -n option only when creating an NFS swap file.
3. The swap file of the size nnn (in Kbytes, bytes, or Mbytes) and name you specify is created. 4. Activate the swap file.
# /usr/sbin/swap -a /path/filename
5. You must use the absolute path name to specify the swap file. The swap file is added and available until the file system is unmounted, the system is rebooted, or the swap file is removed. Keep in mind that you can't unmount a file system while some process or program is swapping to the swap file. 6. Add an entry for the swap file to the /etc/vfstab file that specifies the full path name of the file, and designates swap as the file system type, like this:
/path/filename
swap
no
$ /usr/sbin/swap -l
# mkdir /files # mkfile 24m /files/swapfile # swap -a /files/swapfile # vi /etc/vfstab (An entry is added for the swap file):
/files/swapfile swap # swap -l swapfile dev swaplo blocks free /dev/dsk/c0t2d0s1 32,17 8 205624 192704 /files/swapfile 8 40952 40952
no