File Systems

 

RAM-based file systems

 

RAM based file systems organize files in the Random Access Memory and the swap partition.  They cease to exist when the operating system is shut down.  RAM based file systems increase performance by providing access to data in RAM, so that it is not necessary to go to the disk every time data is called by a process.  Data in RAM based file systems may be actual data from disk read into RAM, program instructions, or information about the process.

 

swapfs - this is the file system that stores swapped out pages from RAM.  Partitions which use swapfs are swap partitions.  Swap space is only allocated as it is actually needed.  Otherwise swapfs assigns addresses to running processes, which do not actually exist, but which the swapfs can convert to actual addresses when swapping out begins. This greatly reduces the need for swap space. Thus it is only necessary for a system to have enough swap space to hold a core dump, which is equal to the amount of RAM.  The largest possible swap slice is 2 to the 63 bytes.

 

swap

The swap command controls the allocation of swap space. 

swap -l lists available swap space; swap -s shows what is happening in swap space at the time. Swap space may be increased with swap –a, and swap files or partitions removed with swap –d. 

 

Swap space may also be increased after the disk is partitioned by adding a swap file.  A large, empty file is created in any partition where there is space, then added to swap.  This may speed up system processes. Swap files can be temporarily added to the swap space at the command line.  Such an addition lasts only until the next reboot.

 

swap –s  (shows RAM + swap)

swap –l (swap only: also, swaplo is the number of sectors skipped at the beginning of the swap partition.  This is to prevent clobbering the VTOC if partition 0 is the swap partition).

mkfile 30m /export/swapfile

swap -a /export/swapfile

swap -l

swap -s

 

A swapfile may be removed with swap -d

swap -d /export/swapfile

the swapfile may then be removed (it will not vanish from df –k until it is).

rm /export/swapfile

 

A swap file or partition may be added to the file /etc/vfstab so that it becomes permanent, with a line like this:

 

/dev/dsk/c0t1d0s1                   -           -           swap    -           no        -

(partition)

/export/swapfile          -           -           swap    -           no        -

 

Note that swap does not hold a ufs file system, so columns in the vfstab related to fsck have a dash.

Hosted by www.Geocities.ws

1