Technical article 105920

In OpenServer 5.0.x, I don't have enough swap space to complete a panic dump.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

The swap area on my system is smaller than the amount of physical
RAM.  When my system panics, I am unable to obtain a valid dump
for analysis.

Cause

The function that dumps memory to disk during a panic can only
dump to a single device with enough contiguous space to contain
the entire contents of physical RAM.  If there is not enough space,
the dump will not be readable.

Solution

There are several possible solutions.  One is to increase the size
of the swap device so it is large enough to contain the contents
of physical RAM.  Another is to make the default dump device a
tape drive.  Finally, you can create a raw division on another
disk and make this the dump device.
To increase the size of the swap device, follow the steps in
TA104767 "Recover OpenServer 5 root filesystem after crash
if backups, boot/root exist."  When you create the new divisions,
make the swap space the size you need it to be.  Be sure that
there is enough room in the other divisions on the disk to contain
the filesystems that will be restored on them.
NOTE: The following steps should be taken in single-user mode, if
possible.  If you must be in multiuser mode, you need to unmount
any filesystems that are being modified.

Moving the dump device to a different drive or partition requires two steps:

I. Create the new division.

II. Configure the operating system so the new division is the dump device.

To have the dump go directly to a tape, you can skip step I and go directly to step II.

Following are details on the steps.
I.  Create the new division.
A. Find a filesystem with enough unused space to contain the new
dump device.  This must be big enough, _by itself_, to contain all
of your physical memory.  You may want to give it some extra space
in case you add more RAM in the future.
B. Be sure to make and test at least two backups of the filesystem
before proceeding.  The following steps will completely remove
the data from the filesystem.
C. Use divvy to view the partition the filesystem is on.  For
example, if it is on the 1st partition of the second drive, use:
divvy /dev/hd11
The first digit after "hd" is the drive number; the second is the
partition number.  Note that counting for the drive number starts
with zero and that counting for the partition number starts at
one.

Here, "partition" refers to the fdisk or physical partition, not the division.

Note: the reason that the first partition is number "1" and
not "0" is because "0" in this case represents the whole disk
device; thus /dev/hd10 is the device which represents the whole
secondary physical disk.  However, since the first partition on
any drive is at the beginning of that drive, "divvy /dev/hd10"
should also succeed in bringing up the first partition on the
second drive.

The divvy table will look something like this for a 4GB drive:

+-------------------+------------+--------+---+-------------+------------+
| Name              | Type       | New FS | # | First Block | Last Block |
+-------------------+------------+--------+---+-------------+------------+
| usr2              | HTFS       |  no    | 0 |            0|     4291104|
|                   | NOT USED   |  no    | 1 |            -|           -|
|                   | NOT USED   |  no    | 2 |            -|           -|
|                   | NOT USED   |  no    | 3 |            -|           -|
|                   | NOT USED   |  no    | 4 |            -|           -|
| scratch           | NON FS     |  no    | 5 |      4291105|     4291151|
| recover           | NON FS     |  no    | 6 |      4291152|     4291161|
| hd1a              | WHOLE DISK |  no    | 7 |            0|     4299162|
+-------------------+------------+--------+---+-------------+------------+
4291162 1K blocks for divisions, 8001 1K blocks reserved for the system
n[ame]       Name or rename a division.
c[reate]     Create a new file system on this division.
t[ype]       Select or change filesystem type on new filesystems.
p[revent]    Prevent a new file system from being created on this division.
s[tart]      Start a division on a different block.
e[nd]        End a division on a different block.
r[estore]    Restore the original division table.

Enter your choice or q to quit:

D.  In this case, you would need to steal some space from the
usr2 filesystem to make room for the dump device.  To create a
300MB dump device, make the following changes:
(1) Change the end block for usr2 (division 0) from
4291105 to 3991105.  Leave the Type as HTFS and make
sure "New FS" is set to 'yes'.
(2) Name division 1 to dump.  Set the start block to
3991106 and the end block to 4291105.  The FS Type should
be "NON FS" and "New FS" should be set to 'yes'.
NOTE: THIS STEP WILL COMPLETELY REMOVE _ALL_ DATA FROM THIS
FILESYSTEM!!  Be sure you have at least two _verified_ backups
before you do this.  If you don't, choose Exit, rather than
install, then go back to step B.
E. You should now quit divvy and choose to 'install' the new
division table.  This will set up the space for the new dump
device.

II. To configure the Operating System to use the new dump device, take the following steps:

A.  You first must determine the major and minor number of the
new device.  See another article in this database, TA103327,
"Minor numbers for first 4 hard disks, fdisk partitions, divvy
divisions".  In our example, in the second division on the first
partition of the second disk, the minor number is 104.  The
major number for the first four hard disks is "1" and is
represented by "hd" in the files we are going to edit.

For SCSI tapes, the device number is usually 46 and will be represented by "Stp."

Another way to check this is to list the device node:

# ls -l /dev/dump
br--r-----   1 root     mem        1,104 Jun  1  1996 /dev/dump
                                   ^^^^^
                                   The first number is
                                   the major number,
                                   the second is the
                                   minor number.
or, for a tape device:
# ls -l /dev/rStp0
crw-rw-rw-   5 root     root      46,  0 Nov  4 21:44 /dev/rStp0

B. The two files to edit are:

/etc/conf./cf.d/sassign
/etc/default/boot

C. The /etc/conf/cf.d/sassign file will have these three lines at the end:

swap    hd      41
dump    hd      41
root    hd      42

Using the device nodes above for the "dump" division, the sassign file should now have these entries

swap    hd      41
dump    hd     104
root    hd      42

If you intend to use the new swap area as your default swap area too (recommended) then change it to:

swap    hd     104
dump    hd     104
root    hd      42

If you intend to dump to tape, again using the above device nodes, the sassign file should have these entries

swap    hd      41
dump   Stp       0
root    hd      42

D. The /etc/default/boot file will have a line similar to the following:

DEFBOOTSTR=hd(40)unix swap=hd(41) dump=hd(41) root=hd(42)

In the case of the "dump" division on the secondary hard drive, this should now read

DEFBOOTSTR=hd(40)unix swap=hd(104) dump=hd(104) root=hd(42)

In the case of the dump device being the above tape drive, this should now read

DEFBOOTSTR=hd(40)unix swap=hd(41) dump=Stp(0) root=hd(42)

NOTE: If there is ever a problem with the second hard drive, this boot string can be overridden at the boot: prompt.

E.  The change to the sassign file requires a new kernel to be
built in order to take effect.  This can be accomplished with:
/etc/conf/cf.d/link_unix -y
F.  Once the link is finished, the system should be rebooted.
If a panic dump occurs, the kernel will now attempt to dump to
the new device.

NOTE: Although the kernel will now dump to the new dump device, the behavior will be slightly different than when dumping to the swap device.

First, when a panic happens there will be a prompt asking if
you want to save the dump to the default device.  You need to
answer 'y' to this question.  Then press <Enter> when it asks
if media is present.

On the subsequent reboot, you will not be asked if you want to save the dump. At this point the dump is already written to the specified dump device (secondary hard drive or tape). Note that if the system panics again, it will overwrite this dump. If you want to extract the dump from the dump device, you can use the following commands:

Note: prior to doing this, you should make sure that you have space on the filesystem to accommodate a file that will be approximately the size of RAM on the system.

If the dump is on the "dump" division, use

dd if=/dev/dump of=file bs=1024 count=`expr \`memsize /dev/dump\` / 1024 + 1`

If the dump is on the tape device, use

dd if=/dev/rStp0 of=file bs=1024

To still access your original swap area use:

# /etc/swap -l
to list
and:
# /etc/swap -a /dev/swap
to add.  This can also be stored in a file /etc/rc2.d/S09AddSwap
so it's available each time the server reboots.
Notes:    For greater flexibility in dealing with system memory images, the
          sysdump(ADM) command is available. See the Technical Article listed
          below and the manual page for more details.

See Also: TA105935, "How do I create customized system dump images on demand?"

Manual pages: sassign(F), sysdump(ADM), boot(F)

From the Xinuos technical article database, record 105920. Reproduced with permission. The original is at www.sco.com/ta/105920, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.