A P P E N D I X  A

Safeguarding the Solaris VTOC

This appendix provides information on how to protect the Solaris Volume Table of Contents (VTOC).

The following topics are included:


Overview

A Solaris raw disk or LUN, when initialized by the utility format(1M), contains one or more partitions (slices) with information on the physical layout of the volume. This information is stored in cylinder 0 in the VTOC. The VTOC is located on each formatted disk and, in most cases, mapped in partition 2 (the backup partition), which often includes every block on the raw device. A physical backup of partition 2 to an identical disk's partition 2 copies the data in every single block, including the volume's VTOC.

It is recommended that the ONLY time any partition containing a VTOC be used is when identical disks are configured and one is attempting to do a physical backup of one disk's partition 2 to partition 2 of another disk of the same size. Other scenarios of using a partition containing a VTOC are often problematic.


Volume Details

For optimal use of almost every block on a raw disk or LUN, Solaris' supported volume managers, file systems, and databases (and many other applications that can use individual partitions on a disk for storage) have knowledge of a volume's VTOC and have incorporated software to exclude writing any data to, or on top of, the volume's VTOC.

By using the Solaris prtvtoc(1M), format(1M), or metastat(1M) utilities, a system administrator can determine if any source or destination device has partitions or metadevices containing cylinder 0. If the partitions or volumes are used for backup, mirroring, replication, or snapshots, it must be understood that the VTOC of the source device will be copied to the destination device, possibly changing the destination device's VTOC.

If the volumes contained in raw device partitions or volumes do not contain
cylinder 0, there would be no change in the disk format, since the VTOC will not be overwritten. If source and destination raw devices or metadevices are identically formatted, and include cylinder 0, the VTOCs will be identical, and there will be no perceived change in the raw device's layout when the volume slice containing the VTOC is overwritten.


Solaris Volume Manager

When using the Solaris Volume Manager, during metainit processing, if a raw disk partition contains cylinder 0, the associated metadevice may contain cylinder 0. When a Solaris Volume Manager volume is created out of that metadevice, it too may contain cylinder 0, meaning that it contains the raw device's VTOC. In some cases (for example, raw image backup of a disk or metadevice) it is normal for applications to use disk partitions containing cylinder 0.

Under the Solaris Volume Manager, writing to cylinder 0 is seen as a write I/O error and reported to the system console and /var/adm/messages as follows:

md:[kern.notice] NOTICE: md: d1: write to label.

When using a volume manager like Veritas Volume Manager (VxVM), copying between individual volumes created under this volume manager is safe, as VxVM avoids the VTOC issue by always excluding these blocks from any volumes created by the volume manager. This is not true for Solaris Volume Manager.


Solaris VTOC Errors

Depending on how the overwriting of the VTOC occurs, the destination volume will appear to have a corrupted VTOC or be incorrectly formatted, which may manifest as Solaris I/O errors, fsck(1M) errors, missing volumes (/dev/dsk/c?t?d?s?), or console or /var/adm/messages with the error: Corrupt label; wrong magic number.


Availability Suite

Both the Remote Mirror and Point-in-Time Copy software are volume-based data services, not file system data services. The software has no knowledge of VTOCs, file systems, or metadata. This is a good thing, since it allows both the Remote Mirror and Point-In-Time Copy software to work with all Solaris supported volume managers, file systems, and databases and to be independent of the various RAID levels, multi-pathing software, or Sun Cluster devices.

Therefore, it is the responsibility of the system administrator to know if a replicated or snapped volume contains a VTOC or not, and if, in the movement of the VTOC from the source to the destination volume, it will incorrectly overwrite a VTOC.

As you can see, this is a somewhat "hidden" problem, which can be best avoided by always excluding cylinder 0 (the VTOC) when using raw devices for either partitions or components of Solaris Volume Manager volumes.