This chapter describes the Logical Storage Manager support for mirroring the root and swap partitions.
You can find additional information in the
volencap(8),
volintro(8),
volrootmir(8),
and
volunroot(8)
reference pages.
Refer to Chapter 14 for information about recovering after a failure of the boot disk and on issues with system reinstallation.
LSM provides the ability to encapsulate the partitions used for the root file system and swap partition to LSM volumes. The root and swap devices then appear to applications as volumes and provide the same mirroring characteristics as other LSM volumes.
Using LSM to mirror the root and swap volumes provides complete redundancy and recovery capability in the event of boot disk failure. By mirroring disk drives that are critical to booting, you ensure that no single disk failure will leave your system unusable.
Digital suggests you mirror the original boot disk using the
volrootmir
command, which causes LSM to mirror volumes created on the original
boot disk onto another available disk.
The volume that contains the root file system is referred to as the root
volume (
rootvol).
The volume that contains the primary swap area is referred to as the
swap volume
(swapvol).
Other volumes that you use for swap (secondary swap volumes) are treated as ordinary LSM volumes.
For information about creating secondary swap volumes, refer to Section 7.9. For more information on mirroring the boot disk, see Section 5.3.
The following special usage types exist for root and swap volumes:
root
usage type
This type is intended for volumes used as root devices. Because the
root volume contains a file system, the
root
usage type resembles the
fsgen
usage type. The
root
usage type restricts the configuration of the volume such that all
plexes of the volume are accessible as a root device through normal disk
drivers.
swap
usage type
This type is intended for volumes used as the primary swap device.
Unlike the
root
device, a swap device does not contain a file system; therefore, it
generally resembles the
gen
usage type.
LSM root and swap disk mirroring help you provide system availability by ensuring that you can boot the system despite certain errors. For example, booting can proceed even if errors occur when you start the swap volume. To do this, configure swap volumes so that all plexes of the volume are accessible as a swap device through normal disk drivers.
To boot the system despite the failure of the primary boot disk, you can boot the system using a disk containing the root and swap volume mirrors. See Section 5.3 for more information.
You set up to mirror root and swap by first encapsulating the existing boot disk. Digital recommends that the root and swap partitions be encapsulated together. The steps for encapsulating the root file system are the same whether you are using UFS or AdvFS.
Refer to Section 14.6 if you have problems with this procedure. Refer to Section C.14 and Section C.15 for detailed examples.
Follow these steps to encapsulate the root and primary swap partitions:
rootdg
disk group has been initialized. (Note that if you are encapsulating
the entire boot disk,
rootdg
does not have to be initialized. In this case, the encapsulation procedure will
initialize it.)
The LSM encapsulation process requires two free partition-table entries to store LSM disk label tags. Note that the encapsulation requires only the partition-table entry; it does not need the disk space associated with the partition.
LSM uses space from the swap area to create an LSM private region for the root disk. After the encapsulation process has finished, the swap area is smaller by the size of the private region (by default 1024 sectors).
volencap
utility on the root disk. Do not specify particular partitions; supply
the name of the physical boot device,
as follows:
#
/usr/sbin/volencap rz0
This command creates the necessary LSM command scripts to convert all the
partitions contained on
rz0
to LSM volumes. Note that you use the
volencap
command whether the root file system is a UFS or an AdvFS file system.
This converts all in-use partitions on
rz0
to LSM volumes.
shutdown
command with the reboot switch to execute the command scripts created
by the
volencap
utility:
#
shutdown -r +2
During the first reboot, the following messages are displayed on the system console.
vm_swap_init: warning /sbin/swapdefault swap device not found
vm_swap_init: in swap over commitment node
You can safely ignore these messages.
The names
rootvol
and
swapvol
are automatically assigned to the root volume and swap volume. Do not
change these names. The root and swap volumes have the following
specific minor device numbers:
rootvol
is minor device 0
swapvol
is minor device 1
As part of the encapsulation, LSM creates configuration files and changes the following system files and directories:
/etc/fstab
/sbin/swapdefault
(if it exists)
/etc/sysconfigtab
/etc/fdmns/*
(if using AdvFS)
To maintain system availability, you must mirror the data important to running and booting your system. However, traditional LSM mirroring (described in Section 2.4), cannot be used to mirror the root disk. This is because mirroring, which is typically used to mirror data disks, cannot access some of the data required for a system reboot (such as the boot track). In addition, root disk mirroring is restricted such that the plexes on the mirrored disk must be accessible as root and swap partitions. Therefore, you must create a secondary root disk to make LSM continue to function if the boot disk fails.
The following list describes how to ensure that the secondary root disk has a boot track in the proper location and the root and swap partitions are accessible as partitions:
You can use a disk that is the same as the original, for example you can use an rz26 to mirror another rz26, or you can use a disk whose physical geometry is different from that of the original disk. For example, an rz28 can mirror an rz26, because the rz28 is larger than the rz26.
fstype
of
unused.
If any partition is incorrectly
marked as being in use, reinitialize the disk label (refer to the
disklabel(8)
reference page).
To mirror the
rootvol
and
swapvol
volumes, you can use any of the following methods. Refer to
Appendix C
for detailed examples.
volrootmir
utility
For example, the following command creates a mirror of all the
volumes on
rz0
on disk
rz1:
#
volrootmir -a rz1
This creates mirrors for
rootvol,
and
swapvol,
and for volumes associated with the
/usr
and
/var
file systems if they exist on the boot disk.
mirror volumes
option from the
voldiskadm
utility Support Menu.
The utility prompts you to enter the root disk physical device name
(such as
rz0,
which is the boot disk), and then prompts you to enter the
disk device on which to mirror the root and swap volume (such as
rz1).
The disk,
rz1
in the previous example, must not have any partitions in use, and
must not be already added to LSM.
dxlsm)
and choose:
rootvol -> Basic Ops -> Volume Ops -> Add Mirror -> Simple Mirror
The option for a root volume causes a form to pop up.
Enter the physical device name of the disk on which you want to mirror
the
rootvol
and
swapvol
volumes.
Example 5-1
shows how to add the the boot disk to LSM, on a system that
has disks already under LSM control.
In this example, you encapsulate
rz0,
which is the boot disk, and you use
rz1
to mirror
rz0.
Note that this example also sets the default boot path so that the
system first tries to boot from
rz0
and, if that fails, from
rz1.
#
volencap nconfig=0 rz0 [1]
#
shutdown -h +2 [2]
>>>
set bootdef_dev dka0 dka100 [3]
>>>
boot [4]
#
volrootmir -a rz1 [5]
dka0
as the primary boot device and
dka100
as the alternate boot device.
[Return to example]
rz1.
[Return to example]
If you used the
volrootmir
command without the
-a
option, you mirrored only the root and swap partitions
of the boot disk. In this case, the
layout of the mirrored root disk partition is similar to the
layout of the original root disk. For example, if the
g
and
h
partitions on the original root disk were in use for
/usr
and
/usr/staff
file systems, you can add the
g
and
h
partitions on the mirrored root disk to LSM. Then, you can add partitions
g
and
h
to LSM as nopriv disks, and mirror these partitions to obtain
higher data availability for the
/usr
and
/usr/staff
file systems.
See
Section 12.3.5
(mirroring using the graphical user interface) or
Section 7.3.2
(mirroring using the command line interface),
and the
volassist(8)
reference page for information about creating mirrors for existing volumes.
Because the data on the book disk in
rootvol
and
swapvol
must be accessed as partitions, you cannot use traditional methods to
evacuate a disk or move a subdisk. Hence, you should not use
volevac,
volassist move,
or
volsd mv.
Instead, perform one of the methods described in
Section 5.3.1
to create a new mirror. Later, remove the plex on the disk to be
evacuated, as described in
Section 5.5.
To remove mirrors associated with the root and swap volumes, enter the
volplex disassociate
command. For example:
#
volplex dis rootvol-01
#
volplex dis swapvol-01
..LP
When you disassociate a plex from
rootvol,
you should also disassociate the corresponding plex from
swapvol.
You can remove the last plex of the root and swap volumes only by using the
volunroot
utility, as described in
Section 5.6.
Refer to
voledit(8)
for information about removing
rootvol-01
and
swapvol-01
from the
rootdg
disk group.
If you want the system to revert back to using UNIX partitions instead
of LSM volumes for the root file system and primary swap partition, use
the
volunroot
utility.
When
volunroot
is executed, the LSM configuration for
rootvol
and
swapvol
is removed, and the system is set up to use disk partitions for the
root file system and the swap partition.
When
volunroot
is executed with the
-a
option, it unencapsulates all volumes on the boot disk that map directly
to a physical disk partition.
After executing
volunroot,
you must reboot the
system, using the disk that was last used for
rootvol
and
swapvol.
Note
Rebooting from the disk that was used for
rootvolandswapvolmay require that you first change the default boot device in the console.
The following considerations apply to using the
volunroot
utility:
rootvol
and
swapvol.
rootvol
and
swapvol
should be on the same physical disk.
Follow the steps shown here to execute the
volunroot
utility:
#
volunroot
or
#
volunroot -a
rootvol
and
swapvol.
The
volunroot
utility performs the following actions:
rootvol
and
swapvol
support for the root disk.
If you use the
-a
option, removes support for all LSM volumes on the root disk.
If you use the
-a
option, restores the use of partitions on the root disk for
all LSM volumes.
/etc/fstab
This file is changed to use disk partitions instead of LSM volumes.
/etc/sysconfigtab
This file is changed to remove LSM root and swap mirroring capabilities.
/sbin/swapdefault
If this file exists, it is changed to be a link to the swap partition.
/etc/fdmns/*
If you are using AdvFS, any domain directories that have disk partitions associated with the root disk are updated.
The
volunroot
utility changes the
/etc/fstab
and
/sbin/swapdefault
files to use the physical disk associated with the remaining mirror in
rootvol.