dkmap(8) dkmap(8)
NAME
dkmap - print disk space usage map
SYNOPSIS
dkmap [-F vfstab] [-V dktab] [-bdiq] [-t afsruv]
[physical-block-device ...]
dkmap [-F vfstab] [-V dktab] [-bdiq] [-a]
dkmap [-F vfstab] [-V dktab] [-bdiq] [-a] [physical-block-device]
dkmap [-F vfstab] [-V dktab] [-bdiq] [-a] [physical-block-device length]
dkmap [-F vfstab] [-V dktab] [-bdiq] [-a]
[physical-block-device length offset]
DESCRIPTION
The dkmap command generates a disk space usage table for all connected
disk drives (autoconf(8)). The type of usage is taken from the
/etc/vfstab file. This tool provides administrators with a complete
summary of disk space use, reporting collectively on all physical disk
space and how that space is used, whether by virtual disks, as file
systems, swap space, or for an application-defined use. dkmap also
checks for overlap of used disk space and prints warning indicators
upon finding these errors.
dkmap is useful in determining the location of unused disk space, in
addition to being helpful as a prevention tool; dkmap can be run prior
to the mount(1M), newfs(1M), mkfs(1M), or swap(1M) commands to check
that disk space already in use is not going to be overwritten by the
proposed changes.
If a partition or virtual disk is not used for file systems, but via
the raw device interface, an entry must be made in vfstab. The charac-
ter string raw is entered in the fstype field. If the entry is not
made, the partition or virtual disk is displayed as being available
(Available). You can also enter the character string avail in the
fstype field of a vfstab entry, which implies that the partition is
available.
Also note that any string within the fstype and the mountpoint fields
of a vfstab entry need not be an existing file system or one of the
above special strings. A system administrator may wish to use these
fields to describe the use of that disk space in more specific terms
than the generic string raw. For instance, if a partition is used by a
data base for employee records, then the system administrator may wish
to set fstype and mountpoint to be databasename and employee, respec-
tively.
Page 1 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
OPTIONS
The dkmap options are:
-F Instead of using the system vfstab file (/etc/vfstab), use the
specified file.
-V Instead of using the system virtual disk specification file
(/etc/dktab), use the specified file.
-d Always show the disk offsets of the block range of each parti-
tion. Normally, the block range of the partition use is shown
only when there appears to be a problem with the usage, or when
the partition is available.
-b Always show the block ranges, but show them as relative offsets
to the specified partition. Note that if there are overlapped
usages of disk space, then this option may be ignored (this is
because the disk offsets are shown for the offending block
ranges).
-i Ignore size information from kernel and other sources. This
option is particularly useful when reorganizing a disk, as it
will suppress any error messages about inconsistencies in file
system size between the old and new disk usage.
-q Quiet mode - suppress diagnostic messages.
-t Allows selective display of use types.
a Show available block ranges.
f Show block ranges that are used by file systems.
r Show block ranges that are used as a raw disk.
s Show block ranges that are used for swapping.
u Show block ranges that are inaccessible (see below).
v Show block ranges that are used as parts of a virtual disk.
-a This option is designed for use by a parsing program, hence the
output is minimal and unformatted.
If zero, one or two arguments are given, produce the following
output:
blkspecial=NNN
offset=NNN
length=NNN
where blkspecial is the partition name containing the largest
available disk block range for that disk device, offset is the
offset of the beginning of the available blocks, and length is
the number of available blocks in that range.
Page 2 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
If no arguments are given, then the above description is given
for each disk device with available space. If only the physical
block device is given, then it is given for that device only. If
the physical block device and the length are given, then it is
given for the first available block range which will fit that
many blocks. Note that this may be different from that shown by
the other forms of this option.
If all three arguments, physical block device, length and offset
are given, then dkmap will determine whether the use of that
block range would cause any overlapped use of disk space. dkmap
will not show the above format, rather it will use the output
format described below. If no output is desired (just the exit
code is required), then the -q option should be used.
If the -a option is not present and there are disk path name
arguments present, then the display is limited only to those
disks specified. Note, however, that dkmap still scans all disk
partitions and all virtual disks encountered and determines the
usage for each. This may produce warning messages for disks other
than those specified.
The -D option is used for debugging purposes only.
DIAGNOSTICS
If the -a option is specified, then the exit value will be either 0
(zero) or 1 (one), based on 1) whether the specified use can be added
to the system without any overlap or inconsistency or 2) whether a
range of available space was found, depending on the number of argu-
ments. If the -a option is not specified, then dkmap will exit with a
value which is the bit-wise OR of the following:
1 = Some disk space is available (unused).
2 = An overlap in disk space usage.
4 = There was at least one partition that had a questionable use, or
at least one virtual disk that had a questionable configuration.
8 = There was some fatal error.
If the -a option is specified, then the exit value corresponds only to
the disks specified. Otherwise, it corresponds to all disks known to
the system.
OUTPUT
The output of dkmap is organized in groups by physical disk. Each disk
is output with a description of its use. Virtual disks follow with
their usage. Each physical disk description has the following format:
diskdkname (sizeofdiskin Mb):
flags partitionpathname blockrange usage
...
Page 3 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
Each virtual disk description has the following format:
flags vdiskdkname blockrange usage
flags have the following meaning and always appear in this order:
? the partition size or use is uncertain
! the partition use is overlapping with another use
* the partition is marked in /etc/vfstab as available but
dkmap found a use for it
@ the partition size is zero
~ the block range represents only a portion of the parti-
tion
blockrange starting and ending block offset of block range, can be
either a disk offset, or be relative to the partition (it
may not always appear)
usage has one of the following formats:
AVAILABLE (numberofblocks blks)
INACCESSIBLE (numberofblocks blks)
FSType:mountpoint
vdiskname: piece vdiskpiecenumber
<usage> e.g. <raw> or <swap>
INACCESSIBLE block ranges are those that cannot be accessed via a disk
partition. This is generally caused by either specifying an incorrect
user-defined partition layout to dkpart(8), or by a disk configuration
error. Although the blocks are inaccessible to the system, they do not
pose a problem and the error may be ignored (resulting in reduced disk
capacity).
NOTES
dkmap is designed to detect any overlap or misconfiguration of parti-
tions based on /etc/vfstab. It is a preventive, advisory measure to
aid the administrator. A better solution would be a kernel-based
implementation where partition usage would be rigorously enforced and
overlapping uses prohibited.
The /etc/vfstab file represents the official source of disk usage
information. /etc/vfstab file must be complete at all times. This is
especially important if disk space is accessed only by the raw device
interface.
Page 4 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
A virtual disk referenced in /etc/vfstab must be described in
/etc/dktab before dkmap can be used.
When using virtual disks, the /etc/dktab file represents the official
source of virtual disk configuration information. The integrity of the
/etc/dktab file must be assured at all times.
MESSAGES
NOTE: partition partitionname, used as usedescription has
0 length. The specified partition has no length, hence this par-
tition cannot be used and will be ignored.
NOTE: vdiskname is not configured in the kernel.
-- Using configuration from /etc/dktab
The virtual disk has no kernel configuration. The related physi-
cal partitions will be marked with the flag ?.
NOTE: configuration for vdiskname differs in kernel and in
/etc/dktab
-- Using configuration from /etc/dktab
The currently configured virtual disk does not match what is
described in /etc/dktab. The related physical partitions will be
marked with the flag ?.
NOTE: Don't know about FSType name.
Assuming FS uses entire length of partitionname
dkmap does not know how to ascertain the size of the specified
file system and thus assumes that it will use the entire disk
partition. The related physical partitions will be marked with
the flag ?.
NOTE: name can't find size of FS.
Assuming FS uses entire length of partitionname
dkmap tried to ascertain the size of the specified file system
but failed. It thus assumes that the file system will use the
entire disk partition. The related physical partitions will be
marked with the flag ?.
NOTE: currently swapping into partition partitionname
The kernel swap table indicates that this partition is being
used, but there was no entry in /etc/vfstab.
NOTE: swap partition 'partition name' not known to kernel
The partition is marked for swapping, but the swap(1M) command
has not been used to add that partition to the kernel swap table.
Page 5 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
NOTE: use of partition exceeds length
-- partitionname: len = N, use = N
The size of the used area of a partition is larger than the phy-
sical partition length. The related physical partitions will be
marked with the flag ?.
NOTE: partition partitionname is marked as available
-- in /etc/vfstab but it is being used
The related physical partitions will have its usage field changed
to <?avail?>.
NOTE: can't find a partition for an unused block range
-- block range <N,M> on diskname
While determining unused areas on the disk, dkmap could not find
a partition that included the given block range.
FATAL ERROR MESSAGES
Can't parse vdisk name (vdiskname)
The path name of the virtual disk is not in the standard format
(/dev/vd/vdiskNN).
Cannot continue without virtual disk information
The library routine for parsing /etc/dktab returned an error.
Check the consistency of /etc/dktab by running dkconfig.
Cannot find physical disk (partitionname) for vdisk vdiskname
Errors were encountered while trying to associate physical parti-
tions with a virtual disk. Check the consistency of /etc/dktab by
running dkconfig.
Could not find a root file system entry
partitionname is not the root filesystem currently mounted
The root and swap partitions are determined automatically by the
kernel, however, they should be defined in /etc/vfstab. dkmap (as
with other file system and I/O utilities) ensures that these
entries exist in /etc/vfstab. This is a particularly helpful
diagnostic when booting from an alternative partition or when the
kernel is configured to override the default root and swap parti-
tions.
Offset + length for exceeds partition size
The offset and length determined for the use of the partition
exceeds the partition size.
No disk found for partition being considered (partitionname)
The specified disk partition name does not correspond to any
known disk on the system.
Page 6 Reliant UNIX 5.44 Printed 11/98
dkmap(8) dkmap(8)
The remainder of the messages printed by dkmap are self-explanatory.
FILES
/dev/CCCN/[r]Xdisk[0-9]*s[0-15] physical disk device path names
/dev/vd/[r]vdisk[0-9]* virtual disk device path names
/etc/dktab virtual disk configuration file
/etc/vfstab file system configuration file
SEE ALSO
swap(1M), dktab(4), vfstab(4), vdisk(7), dkconfig(8), dkpart(8).
Page 7 Reliant UNIX 5.44 Printed 11/98