View Single Post
Old 13th August 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Gosha, you may eventually find it useful to conduct your own basic research, rather than asking here, or guessing and hoping. Self-sufficiency can be learned, and would be significantly faster than posting and waiting for a reply here.

For instance, FAQ section 14.4, called "How is swap handled?", would have given you a great deal of useful information. Here is a relevant excerpt:
Code:
 14.4.2 - Swapping to a partition

On OpenBSD, the 'b' partition of the boot drive is used by default and automatically for swap. 
No configuration is needed for this to take place. If you do not wish to use swap on the boot disk, 
do not define a "b" partition. If you wish to use swap on other partitions or on other disks, you 
need to define these partitions in /etc/fstab with lines something like:
/dev/sd3b none swap sw 0 0 /dev/sd3d none swap sw 0 0
And it further goes on to describe swapctl(8) and other ways to define and create swap areas.

Had you been interested enough to want to learn for yourself how the OS manages swap at boot up, you might have looked at the /etc/rc script started by init(8) on boot. It contains this command:
Code:
swapctl -A -t noblk
Examining the swapctl man page, you might have learned both confirming and clarifying info about the boot disk swap space, as well as what that swapctl command actually does:
Code:
     Note: The initial swap device (root disk, partition b) is handled auto-
     matically by the kernel and does not need to be added to /etc/fstab or
     added via swapctl.  It will show up as "swap_device" in the output dis-
     played with the -l flag.
.
.
.
     -A      This option causes swapctl to read the /etc/fstab file for de-
             vices and files with an ``sw'' type, and adds all these entries
             as swap devices.  If no swap devices are configured, swapctl will
             exit with an error code.
.
.
.
     -t blk|noblk
             This flag modifies the function of the -A option.  The -t option
             allows the type of device to add to be specified.  An argument of
             blk causes all block devices in /etc/fstab to be added.  An argu-
             ment of noblk causes all non-block devices in /etc/fstab to be
             added.  This option is useful in early system startup, where
             swapping may be needed before all file systems are available,
             such as during disk checks of large file systems.

Last edited by jggimi; 13th August 2009 at 11:55 AM.
Reply With Quote