3. The Pregame Show

This is the fuzzy part of the course. I don't have alot of examples so I'll leave some of this to imagination, but I want to talk about how you get disks ready to be used by Veritas. First of all, you'll need to have the disks you want to use attached to the system. When using disks in Veritas they DO NOT have to be on the same controller, or anything like that, any disk attached to the system will work. Once the disks are attached you'll need to make the OS aware of them, which on Solaris would be:

	# drvconfig;devlinks;disks

After this, the "format" command should display your new disks in its output. If it is, the disk is now usable by the OS, and by extension, Veritas.

A quick note on partitioning. DO NOT PARTITION DISKS FOR USE WITH VERITAS!!! Why do I scream about it? Veritas does all that for you. Veritas wants a very simple partition layout, which is default on most disks. If the partition layout is wrong, Veritas will tell you when you try to bring it under Veritas control. If you need to repartition disks for Veritas you can do it with the format command, and simply restore one of the "default" layouts.

Now we need to bring the disk under the control of Veritas. Once Veritas gets a disk NO PART of that disk is usable outside of Veritas. This is why you can't partition disks before using Veritas, it doesn't want you trying to mess with ITS disks! (Veritas and the disk form a bit pact of something)

There are two ways to bring a disk under Veritas control, "encapsulation" and "initialization". They ARE different. Both methods get your disk ready for use in Veritas volumes. The difference is that "encapsulation" will preserver your data on the disks. Veritas just kind of gels around the data and assimilates the disk. Whereas with "initialization" the data is wiped free and brought into Veritas control. When initializing all data on the disk being initialized will me lost. Some times Veritas and it's manuals tend to blur the difference between the two, so be careful.

To add a disk to Veritas control you can use "vxdiskadm". This is a ascii-menu driven tool, which allows for some help assisted, interactive operations. VxDiskAdm is invoked with the command "/usr/sbin/vxdiskadm". It's output looks like this:

Volume Manager Support Operations
Menu: VolumeManager/Disk

 1      Add or initialize one or more disks
 2      Encapsulate one or more disks
 3      Remove a disk
 4      Remove a disk for replacement
 5      Replace a failed or removed disk
 6      Mirror volumes on a disk
 7      Move volumes from a disk
 8      Enable access to (import) a disk group
 9      Remove access to (deport) a disk group
 10     Enable (online) a disk device
 11     Disable (offline) a disk device
 12     Mark a disk as a spare for a disk group
 13     Turn off the spare flag on a disk
 list   List disk information


 ?      Display help about menu
 ??     Display help about the menuing system
 q      Exit from menus

Select an operation to perform:

To add a disk you'll need to choose with is more appropriate, option "1" (initialize), or "2" (encapsulate). For the disks I'm going to use, I'll just initialize.

Before initializing my new disks, it's a good idea to using the "list" operation in vxdiskadm, just to make sure that Veritas sees the disks too. Just type "list", and here is my output:

----------------------------------------------------------------
List disk information
Menu: VolumeManager/Disk/ListDisk

  Use this menu operation to display a list of disks.  You can
  also choose to list detailed information about the disk at
  a specific disk device address.

Enter disk device or "all" [<address>,all,q,?] (default: all) all

DEVICE       DISK         GROUP        STATUS
c0t0d0       -            -            error
c0t1d0       -            -            error
c2t0d0       disk01       rootdg       online
c2t1d0       disk02       rootdg       online
c2t2d0       disk03       rootdg       online
c2t6d0       -		  -            online

Device to list in detail [<address>,none,q,?] (default: none)

Notice in the output that disks at t0, t1, and t2 have already been initialized, so they have a disk name. However, I haven't initialize c2t6d0. (Again, notice that Veritas isn't interested in partitions. Where's not specifying sX in the device name). The following is the full output of an initialization process of a new disk into Veritas using "vxdiskadm", option 1. This is kinda long, but notice how easy and helpful it is!

Add or initialize disks
Menu: VolumeManager/Disk/AddDisks

  Use this operation to add one or more disks to a disk group.  You can
  add the selected disks to an existing disk group or to a new disk group
  that will be created as a part of the operation. The selected disks may
  also be added to a disk group as spares. The selected disks may also
  be initialized without adding them to a disk group leaving the disks
  available for use as replacement disks.

  More than one disk or pattern may be entered at the prompt.  Here are
  some disk selection examples:

  all:          all disks
  c3 c4t2:      all disks on both controller 3 and controller 4, target 2
  c3t4d2:       a single disk

Select disk devices to add:
[<pattern-list>,all,list,q,?] list

DEVICE       DISK         GROUP        STATUS
c0t0d0       -            -            error
c0t1d0       -            -            error
c2t0d0       disk01       rootdg       online
c2t1d0       disk02       rootdg       online
c2t2d0       disk03       rootdg       online
c2t6d0       disk04       rootdg       online

Select disk devices to add:

Add or initialize disks
Menu: VolumeManager/Disk/AddDisks

  Use this operation to add one or more disks to a disk group.  You can
  add the selected disks to an existing disk group or to a new disk group
  that will be created as a part of the operation. The selected disks may
  also be added to a disk group as spares. The selected disks may also
  be initialized without adding them to a disk group leaving the disks
  available for use as replacement disks.

  More than one disk or pattern may be entered at the prompt.  Here are
  some disk selection examples:

  all:          all disks

Add or initialize disks
Menu: VolumeManager/Disk/AddDisks

  Use this operation to add one or more disks to a disk group.  You can
  add the selected disks to an existing disk group or to a new disk group
  that will be created as a part of the operation. The selected disks may
  also be added to a disk group as spares. The selected disks may also
  be initialized without adding them to a disk group leaving the disks
  available for use as replacement disks.

  More than one disk or pattern may be entered at the prompt.  Here are
  some disk selection examples:

  all:          all disks
  c3 c4t2:      all disks on both controller 3 and controller 4, target 2
  c3t4d2:       a single disk

Select disk devices to add:
[<pattern-list>,all,list,q,?] list

DEVICE       DISK         GROUP        STATUS
c0t0d0       -            -            error
c0t1d0       -            -            error
c2t0d0       disk01       rootdg       online
c2t1d0       disk02       rootdg       online
c2t2d0       disk03       rootdg       online
c2t6d0       -            -            online

Select disk devices to add:
[<pattern-list>,all,list,q,?] c2t6d0

  Here is the disk selected.  Output format: [Device_Name]

  c2t6d0

Continue operation? [y,n,q,?] (default: y)

  You can choose to add this disk to an existing disk group, a
  new disk group, or leave the disk available for use by future
  add or replacement operations.  To create a new disk group,
  select a disk group name that does not yet exist.  To leave
  the disk available for future use, specify a disk group name
  of "none".

Which disk group [<group>,none,list,q,?] (default: rootdg)

Use a default disk name for the disk? [y,n,q,?] (default: y)

Add disk as a spare disk for rootdg? [y,n,q,?] (default: n)

  The selected disks will be added to the disk group rootdg with
  default disk names.

  c2t6d0

Continue with operation? [y,n,q,?] (default: y)

  The following disk device appears to have been initialized already.
  The disk is currently available as a replacement disk.
  Output format: [Device_Name]

  c2t6d0

Use this device? [y,n,q,?] (default: y)

  The following disk you selected for use appears to already have
  been initialized for the Volume Manager.  If you are certain the
  disk has already been initialized for the Volume Manager, then you
  do not need to reinitialize the disk device.
  Output format: [Device_Name]

  c2t6d0

Reinitialize this device? [y,n,q,?] (default: y)

  Initializing device c2t6d0.

  Adding disk device c2t6d0 to disk group rootdg with disk
  name disk04.

Add or initialize other disks? [y,n,q,?] (default: n)

Easy right? Totally! Now that our disk is added to Veritas control, we can start using the disk. Since I'm using 4 disks, after all of them were added to Veritas control "vxprint" output looks like this:

# vxprint
Disk group: rootdg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdg       rootdg       -        -        -        -        -       -

dm disk01       c2t0d0s2     -        17678493 -        -        -       -
dm disk02       c2t1d0s2     -        17678493 -        -        -       -
dm disk03       c2t2d0s2     -        17678493 -        -        -       -
dm disk04       c2t6d0s2     -        17678493 -        -        -       -
#

Understand the output? Vxprint is our window into the world of Veritas. You'll use it extensively. Every time we do something we'll want to check it with vxprint. Right now, notice that we have 4 disks, named "disk01", "disk02", "disk03", and "disk04". They are labeled with "dm", which represents a VM disk. The VM Disks are a member of the "rootdg" which is the default disk group. The length displayed in the fifth column is the VM disk length (aka size) in SECTORS! [Sectors can be converted to kilobytes by dividing by 2. On this system anyway.]

We've now created the foundation for our volumes to come. We've built VM disks, which are members of a diskgroup (the default in this case... nothing happens without a disk group). We can now build "subdisks" which will form our plex!