Chapter 4. XVM Administration Commands

This chapter summarizes the xvm command line interface (CLI) commands and provides examples of each command. A full description of the syntax of each individual command is available through the help command, as described in “Online Help for XVM CLI Commands” in Chapter 3.

This chapter includes sections on the following topics:

Physical Volume Commands

You can use the following commands to create, manage, and delete XVM physical volumes:

set  

Changes the default XVM domain

label 

Assigns disks to the XVM Volume Manager

show 

Displays XVM physical volumes

change 

Modifies XVM physical volumes

probe 

Probes an XVM physical volume

dump 

Regenerates XVM physical volumes

give  

Changes the domain of an XVM physical volume

steal 

Changes the domain of an XVM physical volume when the node or cluster that currently owns the physical volume is unable to execute the give command

unlabel 

Removes disks from the XVM Volume Manager

foswitch 

Changes the pat used to access a physical disk

These commands are summarized in the following sections.

Changing the Current Domain with the set Command

You use the set command to change the current XVM domain while executing XVM CLI commands. The current domain can be local or cluster. If the current domain is local, the XVM objects you are creating belong to the current node you are running from. If the current domain is cluster, the XVM objects you are creating belong to the cluster that the current node belongs to. The current domain is displayed as part of the xvm prompt, which appears as xvm:cluster> or xvm:local>. You can also see the current XVM domain by executing the set command without specifying the local or cluster parameter.

You cannot set the domain to cluster if cluster services are not started.

The following example changes the current domain from cluster to local:

xvm:cluster> set domain local

For information about XVM domains, see “XVM Domains” in Chapter 2.

Assigning Disks to the XVM Volume Manager with the label Command

You use the label command to assign a disk to the XVM Volume Manager. The label command writes out or modifies an XVM physical volume label on a disk. In a clustered environment, you can label only the disks that are attached to the system you are working from.

When you label a disk as an XVM physical volume, the first four bytes of logical block one, when represented as ASCII characters, yield xlab. This enables you to determine whether a disk is an XVM physical volume even if you are not running the XVM Volume Manager.

Use the -name option to assign a name to the XVM physical volume. If you do not specify a name, the default name will be the base name of the unlabeled disk path (for example, dks0d1). If you specify a name when assigning multiple disks to XVM, the supplied name acts as a prefix for each physical volume name, with a unique numeric suffix added. If you do not specify a name when assigning multiple disks, the unlabeled disk path is used as the prefix for each physical volume name.

When you assign a disk to the XVM Volume Manager, the disk is an XVM option disk by default. Under IRIX, you can label the disk as an XVM system disk with the -type option of the label command. You can also label the disk as a system disk that is a mirror of an existing XVM system disk. Labeling an XVM disk as a system disk or a mirror of a system disk is a special case of the label command, as it both assigns a disk to the XVM Volume Manager and creates logical volumes on that disk for the root and swap filesystems. For information on creating XVM system disks and mirroring XVM system disks, see “XVM System Disks”.


Note: XVM on Linux does not support XVM system disks.

You cannot label a disk as an XVM disk if the disk contains any partitions that are currently in use as mounted filesystems. On systems with many disks, these checks can be time-consuming. The label command provides a -nopartchk option to override this restriction. Use the  -nopartchk option with caution, as data corruption or system panics can result from labeling disks with partitions that are in use.

When you label an XVM disk, the -volhdrblks option allows you to specify how much space to assign to the volume header; the default value is the number of blocks currently in the volume header of the disk being labeled. The -xvmlabelblks option allows you to specify how much space to assign to the XVM label area; the default is 512 blocks for system disks and 1024 blocks for option disks.

The usual default values for the -volhdrblks and the -xvmlabelblks options support approximately 5000 XVM objects; this should be sufficient for most XVM logical volume configurations. If you will have more than that many objects on the XVM physvol that the label area needs to maintain, you may need to increase the XVM label area size. As a rule of thumb, one block is required for every seven objects. Note that a volume element and a name for a volume element count as two objects.

Although the default size for the XVM label area should be sufficient for most XVM logical volume configurations, you can increase the XVM label area size by shrinking the volume header from the default value and increasing the XVM label area correspondingly. For example, the default options will give you 1024 blocks for the XVM label area on an option disk and, usually, 4096 blocks for the volume header. The user data then starts at block 5120. If you set the number of volume header blocks to 3072, you can set the number of XVM label blocks to 2048. This will double the XVM label area, shrinking the volume header area from the default and leaving the user data starting at block 5120.

As of the IRIX 6.5.26 release, the data area of an XVM-labeled disk starts on a 32-sector boundary. Disks labeled as XVM disks under earlier releases will continue to work.

The following example labels dks0d3 as XVM physical volume fred:

xvm:cluster> label -name fred dks0d3

The following example labels dks0d3 as XVM physical volume fred, reserving enough space for 4096 blocks of XVM labels and increasing the default volume header to 8192 blocks.

xvm:cluster> label -volhdrblks 8192 -xvmlabelblks 4096 -name fred dks0d3

Displaying Physical Volumes with the show Command

You use the show command to display information about XVM objects.

The following example shows the results of a show command with the -extend option enabled to show all the existing physical volumes and their device paths:

xvm: cluster> show -extend phys
phys/coreyz    138737184 online,cluster (/dev/rdsk/2000006016fe1f95/lun0vol/c3p0)
phys/jansad    17779016 online,cluster (/dev/rdsk/dks2d19vol)

The following example shows the results of a show command executed on a specific physical volume, with the -extend option enabled:

xvm:cluster> show -v phys/disk2
XVM physvol phys/disk2
=========================
size: 17779016 blocks  sectorsize: 512 bytes  state: online,cluster
uuid: a9764967-439c-1023-8c3b-0800690565c0
system physvol:  no
physical drive:  /dev/rdsk/dks5d6vol on host hugh3
Disk has the following XVM label:
  Clusterid:  0
  Host Name:  hugh_cluster
  Disk Name:  disk2
  Magic:  0x786c6162 (xlab)     Version 2
  Uuid: a9764967-439c-1023-8c3b-0800690565c0
  last update:  Sun Dec 12 16:27:16 1999
  state: 0x21<online,cluster> flags: 0x0<idle>
  secbytes:  512
  label area:  1024 blocks starting at disk block 3072 (10 used)
  user area:   17779016 blocks starting at disk block 4096
Physvol Usage:
Start        Length       Name                    
---------------------------------------------------
0            17779016     slice/disk2s0           
Local stats for phys/disk2 since being enabled or reset:
-----------------------------------------------------------------------
stats collection is not enabled for this physvol

The show command also allows you to display information about unlabeled disks. The following example shows the results of a show command executed on an unlabeled disk:

xvm:cluster> show -v unlabeled/dks0d1
Unlabeled disk unlabeled/dks0d1vol
================================
volume alias:      /dev/rdsk/dks0d1vol
volume full path:  /hw/module/2/slot/io1/baseio/pci/0/scsi_ctlr/0/target/1/lun/0/disk/volume/char
Disk does not have an XVM label

The show command can display information about disks that the XVM Volume Manager sees as foreign disks. This can be useful if you find yourself in a situation where you need to use the steal command to take control of an XVM physvol from its current owner. In this situation, you may need to determine the owner of a disk that you cannot read as a physvol, since it appears as a foreign disk to you. The output of the show command will show the owner as the “Host Name” of the physvol.The following example shows all foreign disks, using the -extend option to display the name of the host or cluster that owns the disk and name of the physical volume on that host or cluster. In this example, sample output is shown.

xvm:cluster> show -extend foreign
foreign/2000006016fe058c/lun0vol/c3p0          * ??? (csc-eagan:csc-lun0)
foreign/2000006016fe058c/lun1vol/c3p0          * ??? (csc-eagan:csc-lun1)
foreign/2000006016fe0c97/lun7vol/c3p0          * ??? (cxfs0-2:matrix)

The following example executes the show command on dks5d46, which is a disk that is foreign to the current node, which is hugh2:

hugh2 1# xvm
xvm:cluster> show dks5d46
foreign/dks5d46vol                * private
xvm:cluster> show -v dks5d46
Foreign disk foreign/dks5d46vol
================================
volume alias:      /dev/rdsk/dks5d46vol
volume full path:  /hw/module/2/slot/io7/fibre_channel/pci/0/scsi_ctlr/0/target/46/lun/0/disk/volume/char
Disk has the following XVM label:
  Clusterid:  0
  Host Name:  hugh
  Disk Name:  disk5
  Magic:  0x786c6162 (xlab)     Version 2
  Uuid: 530138fd-0096-1023-8a7a-0800690592c9
  last update:  Thu Sep 16 10:25:58 1999
  state: 0x11<online,private> flags: 0x0<idle>
  secbytes:  512
  label area:  1024 blocks starting at disk block 3072 (10 used)
  user area:   17779016 blocks starting at disk block 4096

Note that in this example, the host name of the foreign disk is hugh, the disk's current owner.

For information on foreign disks, see “XVM Domains” in Chapter 2. For information on the steal command, see “Changing the Domain of a Physical Volume with the give and steal Commands”. The steal command should be used only when ownership cannot be changed using the give command.

The show command output indicates whether a physical volume has no physical connection to the system and would return an I/O error when read or write activity is attempted anywhere on the volume. In the following examples, the physical volume lcmtst has no physical connection on this system.

xvm:cluster>

 show vol

vol/c1                            0 online
vol/con1                          0 offline,no physical connection
vol/lmc1                          0 online,no physical connection
vol/lmctst3s2                     0 online
vol/lmctst3s3                     0 online
vol/lmctst3s4                     0 online

xvm:cluster> 

show -top vol/con1
vol/con1                          0 offline,no physical connection
    subvol/con1/data             400000 offline,pieceoffline
        concat/concat9               400000 offline,tempname,incomplete
            slice/lmctsts1               200000 online
            (empty)                           * *

xvm:cluster> 

show -top vol/lmc1
vol/lmc1                          0 online,no physical connection
    subvol/lmc1/data             200000 online
        mirror/mirror7               200000 online,tempname
            slice/lmctst2s1              200000 online
            slice/lmctsts0               200000 online

The show command can also be used to display information about other volume elements. For more examples of the show command see “Displaying Volume Elements: Using the show Command”.

Modifying Physical Volumes with the change Command

You can use the change command to change the name of an XVM physical volume and to change the state of statistics collection (to on, off, or reset). For examples of the change command see “The change Command”.

In addition you can use the change command to change an XVM system disk to an XVM option disk. This may be necessary if you need to delete the logical volumes on an XVM system disk, since volumes marked as swap volumes cannot be deleted. For information on deleting system disks, see “Deleting XVM System Disks”.

Probing a Physical Volume with the probe Command

The probe command probes a disk with XVM labels so that the system is able to recognize the disk as an XVM disk. Disks are probed automatically when the system is booted, but you must manually execute a probe command when you add an XVM disk to a running system. If you execute the probe command on a disk that has not been previously labeled, an error is returned.

The disk to be probed must first be available in the hardware inventory. Use the scsiadminswap(1M) command to introduce a disk to the system.

The following example probes drive 4 on controller 0:

xvm:cluster> probe dks0d4

The following example re-probes the XVM physical volume named fred:

xvm:cluster> probe fred

The following example probes all SCSI drives:

xvm:cluster> probe dks*

Regenerating XVM Physical Volumes using the dump command

You use the dump command to dump the commands to a file that will regenerate an XVM physical volume. For examples of the dump command, see “Reconstructing Volume Elements: Using the dump Command”.

Changing the Domain of a Physical Volume with the give and steal Commands

Under IRIX, you use the give command to change the domain of an XVM physvol, giving ownership of that physvol to another node or cluster. (XVM on Linux supports local XVM volumes only.)

You cannot use the give command on a physvol that has slices that are part of open subvolumes. For this reason, the give command will fail while a mirror revive is active. In general, you must unmount filesystems on XVM logical volumes that contain the XVM physvol and wait for mirror revives to complete before executing the give command on the physvol.

When you give a disk away, the new owning node or cluster must read the disk before the configuration is visible to the new owner. This happens in either of two ways:

  • Automatically on reboot

  • When the new owner uses the probe command to read the new disk

You can specify a physical volume to give away by either the physvol name or by the name of the disk itself. The following command relinquishes ownership of the disk dks0d4 to the owner named hosta:

xvm:local> give hosta dks0d4

The following command relinquishes ownership of the physical volume named fred to the cluster named mycluster:

xvm:local> give -cluster mycluster fred

In some circumstances, the node or cluster that currently owns the physical volume may be unable to execute the give command. In these cases, you can use the steal command to change the domain of an XVM physical volume. Only disks which are foreign to the current node or cluster can be the targets of a steal.


Caution: The steal command unconditionally resets the owner of an XVM physical volume to the current node or cluster. No attempt is made to inform the previous owner of the change in ownership. This could result in configuration corruption. The steal command should be used only when ownership cannot be changed using the give command.

Before using the steal command, you should ensure that the XVM physical volume you are stealing is not part of an XVM snapshot volume.

In a situation where you need to use the steal command to change the domain of an XVM physical volume, you may not know the name of the current owner of the physical volume. You can use the show command on a foreign disk to determine its current owner, as described in “Displaying Physical Volumes with the show Command”.

As with the give command, you cannot use the steal command on a physvol that has slices that are part of open subvolumes. In general, you must unmount filesystems on XVM logical volumes that contain the XVM physvol and wait for mirror revives to complete before executing the steal command on the physvol.

The following example resets ownership of the disk foreign/dks0d4vol. In this example, the disk must be owned by hosta for the steal to succeed. The disk will become a cluster disk owned by the current cluster.

xvm:cluster> steal hosta foreign/dks0d4vol

The following example also resets ownership of the disk foreign/dks0d4vol. In this example, the disk is brought into the local domain.

xvm:cluster> set domain local
xvm:local> steal hosta foreign/dks0d4vol

By default, the steal command takes ownership of a physical volume from a host. To take ownership of a physical volume that is owned by a cluster, you must use -cluster option. The following example resets ownership of disk foreign/dks0d4vol from cluster jiminy to the local host. The disk must be owned by the cluster jiminy for the steal to succeed:

xvm:local> steal -cluster jiminy foreign/dks0d4vol

If you use the steal command to take a disk from a running system, you may end up with the configuration showing the disk as both owned and foreign. Using the give command avoids this situation. To recover, you can use the reprobe command, as described in “Removing Configuration Information: Using the reprobe Command”.

For information on the set command, see “Changing the Current Domain with the set Command”. For information on local domains, cluster domains, and foreign disks, see “XVM Domains” in Chapter 2.

Removing Disks from the XVM Volume Manager with the unlabel Command

You use the unlabel command to remove an XVM label from a disk so that the disk is no longer an XVM disk. This restores the original partitioning scheme to the disk. In a clustered environment, you can unlabel only a disk that is attached to the system you are working from.

The following example removes the XVM label from the XVM physical volume named phys1:

xvm:cluster> unlabel phys1

The following example forcibly unlabels phys1, first deleting any slices that may exist:

xvm:cluster> unlabel -force phys1 

Logical Volume Commands

The following sections describe the xvm commands you use to create, modify, display, reconstruct, and delete volume elements.

Creating Volume Elements

There are separate xvm commands to create the following logical volume elements:

  • Slices

  • Concats

  • Mirrors

  • Stripes

  • Subvolumes

  • Volumes

These commands are summarized in the following sections.

The slice Command

The slice command creates slices from specified block ranges of XVM physical volumes.

As of the IRIX 6.5.26 release, there is a default restriction that all XVM slices are created on 32-sector boundaries on the disk and are some multiple of 32 sectors in length.If you do not supply a length, the address range will be from the indicated start block to the end of the free area containing the start block, rounded down to the highest multiple of 32 sectors that will fit. The start block itself must begin on a 32-sector boundary. You can explicitly remove this restriction with the -noalign flag.

For information on using the slice command to create the slices that are used to make up the volumes of a system disk, see “Configuring System Disks with the slice Command”.

The following example creates one slice covering the whole usable space of the XVM physical volume phys1:

xvm:cluster> slice -all phys1

The following example creates four equal-sized slices covering the XVM physical volume phys1:

xvm:cluster> slice -equal 4 phys1

The following example creates a slice starting with block 5,000 with a length of 100,000 blocks:

xvm:cluster> slice -start 5000 -length 100000 phys1

The following example divides the 100,000-block chunk beginning at block 5,000 into 4 equal-sized slices:

xvm:cluster> slice -start 5000 -length 100000 -equal 4 phys1 

The concat Command

The concat command creates a volume element that concatenates all of its child volume elements into one address space. When you create a concat, you must specify whether you are naming the generated volume to which it is attached or whether the system will generate a temporary volume name.

The following example concatenates the slices freds0 and wilmas0 into a larger address space. The created concat volume element has a system-generated temporary name and is contained in a volume with a system-generated temporary name:

xvm:cluster> concat -tempname slice/freds0 slice/wilmas0

The following example also concatenates the slices freds0 and wilmas0 into a larger address space. It explicitly names the resulting concat myconcat and the volume it belongs to concatvol:

xvm:cluster> concat -vename myconcat -volname concatvol slice/freds0 \
slice/wilmas0

The mirror Command


Note: To use the mirroring feature of the XVM Volume Manager, you must purchase and install the appropriate FLEXlm license on IRIX or LK license on SGI ProPack 5 for Linux.

The  mirror command creates a volume element that mirrors all of its child volume elements. When you create a mirror, you must specify whether you are naming the generated volume to which it is attached or whether the system will generate a temporary volume name.

When you create a mirror that has more than one piece, a message is written to the SYSLOG indicating that the mirror is reviving. This indicates that the system is beginning the process of mirroring the data. Another message is written to the SYSLOG when this process is complete. For large mirror components, this may take a long time. You cannot halt a mirror revive once it has begun except by detaching all but one of the pieces of the mirror.

Should the revive fail for any reason, a message will be written to the system console as well as to the SYSLOG. For more information, see “ Mirror Revives” in Chapter 9.

When you create a mirror, you can define a read policy and a primary leg for the mirror. These features are described in “Creating Mirrors” in Chapter 2.

When you create a mirror, you can specify that the mirror does not need to be resynchronized when it is created. Alternately, you can specify that the mirror will never need to be resynchronized; this is an option that is useful when you are mirroring a scratch filesystem. These features are described in “Creating Mirrors” in Chapter 2.

The components of a mirror do not have to be identical in size, but if they are not there will be unused space in the larger components.

The following example creates a mirror whose members are the slices freds0 and wilmas0. The volume that the mirror will be associated with will be named mirvol.

xvm:cluster> mirror -volname mirvol slice/freds0 slice/wilmas0

The following example creates a mirror, with members slice/freds0 and slice/wilmas0 and volume name newmirvol. In this example, a revive will not be initiated when the mirror is created.

xvm:cluster> mirror -volname newmirvol -clean slice/freds0 slice/wilmas0

The following example creates an empty mirror with a sequential read policy. To make the mirror usable, the members of the volume element will have to be explicitly attached using an attach command. This command creates a mirror with a system-generated name that is contained in a volume with a system-generated name.

xvm:cluster> mirror -tempname -rpolicy sequential

The following example creates a two-member mirror with a primary member named freds0. All reads will be directed to freds0, with writes going to both members. This command creates a mirror with a system-generated name that is contained in a volume with a system-generated name.

xvm:cluster> mirror -tempname -primary slice/freds0 slice/freds0 slice/wilmas0 

The stripe Command

The  stripe command creates a volume element that stripes a set of volume elements across an address space. When you create a stripe, you must specify whether you are naming the generated volume to which it is attached or whether the system will generate a temporary volume name.

It is legal to create a stripe that consists of volume elements of unequal size, although this may leave some space unused.

A stripe units has the restriction that it must be a multiple of 32 512-byte blocks. You can remove this restriction with the -noalign flag.

The actual size of the stripe volume element depends on the stripe unit size and the size of the volume elements that make up the stripe. In the simplest case, the volume elements are all the same size and are an even multiple of the stripe unit size. For example, if the stripe unit is 128 512-byte blocks (the default stripe unit size), and you create a stripe consisting of two slices that are each 256,000 blocks, all the space of each of the slices is used. The stripe size is the full 512,000 blocks of the two slices.

On the other hand, if two slices that make up a stripe are each 250,000 blocks and the stripe unit is 128 blocks, then only 249,984 of the blocks on each slice can be used for the stripe and the size of the stripe will be 499,968 blocks. This situation may arise when you create the slices on a disk by dividing the disk equally, or use the entire disk as a slice, and do not coordinate the resulting stripe size with the stripe unit size.

Even if one of the two slices that make up the two-slice stripe in the second example is 256,000 blocks (while the other is 250,000 blocks), the stripe size will be 499,968 blocks, since the same amount of space in each volume element that makes up the slice is used.

The general formula for determining what the stripe size will be is the following, where stripe_width is the number of volume elements that make up the stripe:

stripe_size = (smallest_stripe_member / stripe_unit) * stripe_unit * stripe_width

Note that this formula uses integer arithmetic.

You can view the stripe unit of an existing stripe with the show -extend (or -v) stripe command (where stripe is the name of the existing stripe).

For information on configuring stripes that span two host bus adaptors, see Chapter 5, “XVM Failover”..

The following example stripes the slices freds0 and wilmas0. The volume that the stripe is associated with will be named stripedvol.

xvm:cluster> stripe -volname stripedvol slice/freds0 slice/wilmas0

The following example stripes the mirrors mirror0 and mirror1 using a stripe unit size of 512 blocks:

xvm:cluster> stripe -tempname -unit 512 mirror[01]

The following example creates an empty stripe with room for four slices. Four volume elements must be attached to the stripe before it will come online.

xvm:cluster> stripe -tempname -pieces 4 

The subvolume Command

The subvolume command creates a subvolume and, optionally, attaches a specified volume element to the subvolume. The volume element attached to the subvolume cannot be a volume or another subvolume.

When you create a subvolume, you must specify whether you are naming the generated volume to which it is attached or whether the system will generate a temporary volume name.

You can create a subvolume of a system-defined type of data, log, or rt (real-time), or you can create a subvolume of a user-defined type. You cannot specify a subvolume name for a subvolume of a system-defined type.


Note: XVM on Linux does not support real-time subvolumes.

The following example creates a log subvolume and attaches concat0 to it. The volume associated with this subvolume will be named myvol.

xvm:cluster> subvolume -volname myvol -type log concat0 		

The following example creates a subvolume and attaches concat0 to it, setting the uid and mode of the block and character special files corresponding to the subvolume:

xvm:cluster> subvolume -tempname -uid 1823 -mode 0644 concat0

The following example creates a subvolume with a user-defined type of 100:

xvm:cluster> subvolume -tempname -type 100 concat0 

The volume Command

The  volume command creates an XVM volume and, optionally, attaches specified subvolumes to the volume.

The following example creates an empty volume named fred:

xvm:cluster> volume -volname fred

The following example groups data, log, and real-time subvolumes under a volume. The created volume has a system-generated temporary name.

xvm:cluster> volume -tempname vol0/data vol1/log vol2/rt 

Modifying Volume Elements

The XVM Volume manager provides the following commands to modify volume elements after you have created them:

  • change

  • attach

  • detach

  • remake

These commands are described in the following sections.

The change Command

The change command changes the attributes of an XVM physical volume or volume element that you have previously defined. You can change a variety of attributes of an XVM object using the change command, depending on the object. You can use the change command to enable statistics collection for an object, to bring a volume element back online that the kernel has disabled, and to manually disable and re-enable a volume element.

You can use the change command to rename an existing object. The name you give an object with this command remains persistent across reboots. You cannot change the name of a slice.

For a full list of the attributes that you can modify using the change command, see the help screen for this command.

The following example enables statistics for XVM physical volume pvol0 and the data subvolume of vol/fred:

xvm:cluster> change stat on phys/pvol0 vol/fred/data

The following example resets statistics for all objects that have statistics enabled:

xvm:cluster> change stat reset *

The attach Command

The attach command attaches an existing volume element to another existing volume element. For information on the restrictions that the XVM Volume Manager imposes on attachments, see “Attaching Volume Elements” in Chapter 2.

You can specify where to attach a volume element. If you do not explicitly indicate where to attach a volume element, the source volume element will be attached to the first (leftmost) hole in the target volume element. If there are no holes, the source volume element will be appended to the end (right).

You can attach multiple source volume elements to a single target volume element by using the attach command. When attaching multiple source volume elements, the position you specify for the attachment applies only to the first volume element; remaining volume elements will be placed to the right, filling holes or appending.

When you attach multiple source volume elements to a single target volume element, they are attached one at a time, in turn. If an attach in the list fails, XVM attempts to restore the volume elements to their previous parents. If a volume element cannot be restored, a warning message is generated and manual intervention is needed.

The following example attaches the slice freds0 to concat0 at the first available position:

xvm:cluster> attach slice/freds0 concat0

The following example attaches all subvolumes of vol0 to vol1:

xvm:cluster> attach vol0/* vol1

The following example attaches slice/freds0 to concat0, performing checks as if concat0 and slice/freds0 were part of open subvolumes, even if they are not:

xvm:cluster> attach -safe slice/freds0 concat0

The detach Command

The  detach command detaches a volume element from its parent. When you detach a volume element, a new volume (and possibly data subvolume) will be created, just as a volume is created when you create a volume element. You can name the generated volume explicitly, or you can specify that the volume be automatically generated with a temporary name. A subvolume of type data is automatically generated for the volume element you are detaching (unless the volume element you are detaching is itself a subvolume of a different type).

You cannot detach the last valid piece of an open mirror from that mirror, since this will cause the mirror to go offline.

If the volume element you detach is part of an open subvolume, its detachment cannot cause the subvolume state to go offline. The detach command provides a -force option to override this restriction and a -safe option to impose this restriction even if the subvolume is not open.

The following example detaches the volume element concat0 from its parent. The volume that concat0 is associated with after the detach will be named fred.

xvm:cluster> detach -volname fred concat0

The following example detaches concat0, even if it is part of an open subvolume, and the subvolume would go offline as a result:

xvm:cluster> detach -force -tempname concat0

The following example detaches concat0, but ensures that the detachment will not cause the subvolume to go offline, even if the corresponding subvolume is not currently open:

xvm:cluster> detach -safe -tempname concat0

The remake Command

The  remake command reorganizes volume elements in an XVM logical volume by collapsing holes in a volume element or by rearranging pieces under a volume element. You can use a single remake command as a convenient alternative to executing a series of attach and detach commands.

When you rearrange the pieces in a volume element, you can specify one of the following rearrangement methods with an option of the remake command:

swap 

Swaps the positions of two volume elements under a volume element

reorder 

Reorders the children under a volume element

The following example collapses any holes in the ve concat0:

xvm:cluster> remake concat0

The following example reorganizes concat0, swapping pieces 0 and 1:

xvm:cluster> remake concat0 swap concat0/0 concat0/1

The following example reorganizes concat0, reversing the order of its 3 pieces:

xvm:cluster> remake concat0 reorder concat0/2 concat0/1 concat0/0 

Modifying Volume Elements on a Running System

The XVM Volume Manager allows you to modify volume elements on a running system using the insert command and the collapse command, as described in the following sections.

The insert command

The insert command inserts a mirror or a concat volume element above another volume element. You cannot insert a volume element above a volume or a subvolume.

The insert command allows you to grow a volume element on a running system by inserting a concat or to add mirroring on a running system by inserting a mirror. The volume element you are growing or mirroring can be part of an open subvolume and can have active I/O occurring.

For example, if you begin with a simple logical volume named tinyvol that contains a single slice named freds0, the topology of the logical volume is as follows:

xvm:cluster> show -top tinyvol
vol/tinyvol                       0 online
    subvol/tinyvol/data          177792 online,open
        slice/freds0                 177792 online,open

You can insert a concat in the volume above the slice:

xvm:cluster> insert concat slice/freds0
</dev/cxvm/tinyvol> concat/concat0

The topology of the logical volume is now as follows:

xvm:cluster> show -top tinyvol
vol/tinyvol                       0 online
    subvol/tinyvol/data          177792 online,open
        concat/concat0               177792 online,tempname,open
            slice/freds0                 177792 online,open

You can now grow the volume by attaching another slice to the concat.

The following example inserts a one-member mirror over the volume element concat0. This allows other members to be attached and concat0 to be mirrored without having to take it offline.

xvm:cluster> insert mirror concat0

The following example inserts a one-member concat above the slice freds0. This allows other members to be attached, and allows the corresponding subvolume to be grown without having to take it offline.

xvm:cluster> insert concat slice/freds0 

The collapse Command

The  collapse command removes a layer from a logical volume tree by collapsing a volume element, linking the child of the volume element to the volume element's parents.

The collapse command can be used to collapse a mirror or concat in an open subvolume. Generally, this is used to reverse a previous insert operation.

For example, the following command sequence inserts a mirror above an existing concat named concat1 and then displays the topology of the resulting logical volume:

xvm:cluster> insert mirror concat1
</dev/cxvm/vol9>  mirror/mirror2
xvm:cluster> show -top vol9
vol/vol9                          0 online,tempname
    subvol/vol9/data            5926338 online
        mirror/mirror2              5926338 online,tempname
            concat/concat1              5926338 online,tempname
                slice/pebbless0             2963169 online
                slice/bettys0               2963169 online

The following sequence of commands reverses this insert operation by collapsing the mirror and displays the topology of the resulting logical volume:

xvm:cluster> collapse mirror/mirror2
xvm:cluster> show -top vol9
vol/vol9                          0 online,tempname
    subvol/vol9/data            5926338 online
        concat/concat1              5926338 online,tempname
            slice/pebbless0             2963169 online
            slice/bettys0               2963169 online

Displaying Volume Elements: Using the show Command

The show command display information about volume elements as well as physical volumes and unlabeled disks. This command includes an -extend option, which shows additional information about XVM physical volumes, slices, and stripes, and the command also includes a -verbose option, which displays as much information as possible about the indicated object.

The following example shows name, size, and state information for the object named concat0:

xvm:cluster> show concat0

The following example shows all XVM slices:

xvm:cluster> show slice/*

The following example shows the names of all XVM volumes:

xvm:cluster> show -name vol/*

The following example shows the names of all unlabeled disks on dks controller 0:

xvm:cluster> show -name unlabeled/dks0*

The following example shows statistics for the XVM physical volume named fred:

xvm:cluster> show -stat phys/fred

The following example shows the topology of the volume vol/myslice. This example uses the -extend option to display the stripe unit size of the stripes in the volume as well as the name and device path of the physical volumes associated with any slices in the volume. In this example, sample output is shown.

xvm:cluster> show -topology -extend vol/myslice
vol/myslice                    0 online
    subvol/myslice/data     17778688 online
        stripe/stripe0          17778688 online,tempname (unit size: 128)
            slice/jansads0           4444754 online (jansad:/dev/rdsk/dks2d19vol)
            slice/jansads1           4444754 online (jansad:/dev/rdsk/dks2d19vol)
            slice/jansads2           4444754 online (jansad:/dev/rdsk/dks2d19vol)
            slice/jansads3           4444754 online (jansad:/dev/rdsk/dks2d19vol)

Reconstructing Volume Elements: Using the dump Command

The dump command dumps XVM configuration commands to a file.

You can use the dump command to dump configuration information for an individual volume element, or to dump the configuration information for all of the volume elements under the volume element you specify.

You can also use the dump command to dump configuration commands for a physical volume. You must explicitly dump the physical volume separately from a volume element tree.

The following example dumps a one-line creation command for the volume named fred:

xvm:cluster> dump vol/fred

The following example dumps information for all volume elements under each volume:

xvm:cluster> dump -topology vol/*

The following example dumps the contents of all XVM physical volumes and volume trees to the file foo:

xvm:cluster> dump -topology -file foo phys/* vol/* 

Deleting Volume Elements: Using the delete Command

The delete command deletes a volume element. Parents of deleted volume elements remain and have open slots.

You cannot delete a volume element that is part of an open subvolume if doing so would cause the subvolume state to go offline. You can override this restriction with the -force option of the delete command.

If a volume element contains any attached children, it cannot be deleted. However, the delete command provides two options that override this restriction: the -all option, which deletes a volume element and all volume elements below it, and the -nonslice option, which deletes a volume element and all non-slice volume elements below it, detaching and keeping the slices. The -all and -nonslice options are mutually exclusive.

The following example deletes vol0 and any volume elements under it:

xvm:cluster> delete -all vol0

The following example deletes vol0 and descendants of vol0 except for slices. Slices will be detached and a volume and data subvolume will be generated automatically.

xvm:cluster> delete -nonslice vol0 

The swap partition of an XVM system disk cannot be deleted. This is to ensure that the swap partition cannot be deleted accidentally and cause a system panic. If you need to delete the logical volumes on a system disk so that you can unlabel the disk, you must first use the XVM change command to change the disk from a system disk to an option disk, as described in “Deleting XVM System Disks”.

Removing Configuration Information: Using the reprobe Command

If a disk becomes inaccessible and needs to be replaced, you must tear down the existing configuration information for that disk. In this circumstance, you may not be able to execute standard XVM configuration commands on logical volumes that include that disk. To recover from this situation, you can use the reprobe command of the XVM volume manager to remove previous configuration information from the kernel.

The following example illustrates a situation where you can use the reprobe command. In this example, there is a volume configured with a mirror:

vol/test
   mirror/mirror0
      slice/lun9s0
      slice/lun8s0

If lun8 begins to generate I/O errors, you may need to replace the disk. If you try to detach slice/lun8s0, however, the system will be unable to write the update to the disk and will not perform the detach. In this case, you can execute a reprobe lun8 command. This removes all the places where lun8 is used in a configuration, even though you cannot write to the lun8 physvol. After executing this command, you can attach a new slice to mirror/mirror0.

You can also use the reprobe command to recover from an inconsistent configuration that could arise when you use the steal command to take a disk from a running system. In this case, the disk label may not match the configuration information in the kernel and the configuration may show the disk as both owned and foreign. The reprobe command will remove the configuration information for the physvol from the kernel.

The reprobe command will remove configuration information for the indicated physvol only if the disk is inaccessible or if the configuration on the disk label does not match the current information in the kernel.

The following example removes the configuration information in the kernel for the XVM physvol named fred if fred is not available or if the configuration information in the disk label of fred does not match the configuration information in the kernel:

xvm:cluster> reprobe fred

XVM System Disks

Under IRIX, when you assign a disk to the XVM Volume Manager by labeling the disk, you have the option of labeling the disk so that it can be used as a system disk. This allows you to create XVM logical volumes that include the partitions of a system disk, which enables you, among other things, to configure an XVM root volume as a mirror, as described in “Mirroring XVM System Disks”.


Note: XVM on Linux does not support XVM root or swap disks, including XVM volumes as swap areas and swap files on filesystems on top of an XVM volume.



Note: You cannot label a GPT disk as an XVM system disk.

The following XVM system disk features are supported:

  • Root partitions can be mirrored

  • There can be multiple root partitions on a system disk

  • The usr and swap partitions can be used in any XVM logical volume configuration, including mirrors, concats, and stripes

  • A system disk can include slices that are not part of a root, usr, or swap partition

The XVM Volume Manager provides the option of labeling a disk so that it will mirror the system disk partitions on an existing XVM system disk.

The XVM Volume Manager allows you to convert existing, non-XVM system disks to XVM system disks, and then use their partitions as part of an XVM logical volume. After you have converted an existing system disk to an XVM system disk, you can convert the disk back to its original state by unlabeling the disk with the XVM unlabel command.

The following sections describe the commands you use to administer system disks:

Sample procedures for creating and mirroring an XVM system disk are provided in “Creating and Mirroring an XVM System Disk” in Chapter 7.

Creating XVM System Disks

Under IRIX, when you use the XVM label command to label a disk as an XVM disk, you can use the -type option to specify the type of XVM disk you are creating. (XVM on Linux does not support XVM system disks.)

There are three types of XVM disks: option, root, and usrroot.

option 

An XVM physvol of type option is the default XVM disk type. Using the XVM label command to label a disk as an option disk is described in “Assigning Disks to the XVM Volume Manager with the label Command”.

An XVM option disk includes partitions for the volume and volume header, as shown in Figure 1-1.

root 

An XVM physvol of type root includes at least one root partition and a swap partition in addition to partitions for the volume header and the whole volume, as shown in Figure 1-2.

When you label a disk as an XVM root disk, a logical volume for each root partition and a logical volume for the swap partition are created, as are slices of type root and swap which are mapped to the root and swap partitions; for information on slice types, see “Configuring System Disks with the slice Command”. The root volume that you create is named physvol_rootn, where physvol is the name of the XVM root physical volume and n is the number of the partition to which the root slice that makes up the volume is mapped. The swap volume is named physvol_swap1, since the swap partition is always partition 1.

If a root partition 0 already exists on the disk you are labeling as an XVM root disk, the existing partition table remains unchanged and is used to determine the number and size of the XVM root and swap slices that map to the root and slice partitions. In this case, the -rootblks and -swapblks options have no effect. This feature allows you to label an existing non-XVM system disk as an XVM system disk and maintain its current partitioning scheme for root and swap partitions. On an existing system disk, XVM root slices will be created for all partitions found except for partitions 1, 6, 8, 9 and 10. If partition 1 is present, an XVM swap slice will be mapped to it; if it is not present when you create an XVM root disk, the label command aborts. If partition 6 is present, an XVM usr slice will be mapped to it. You can override this feature by specifying the -clrparts option of the label command when labeling your system disk, in which case XVM will treat the disk as if there were no existing root partition 0.

If there is no existing root partition 0 on the disk, then by default, approximately ten percent of an XVM disk of type root is assigned to a swap slice that is mapped to the swap partition and the remainder of the usable portion of the disk is assigned to a root slice that maps to root partition 0; these percentages may differ on very large or very small disks or if there are multiple root slices on the disk. You can use the -swapblks and -rootblocks options of the label command to override these default sizes. Usable space on an XVM physvol of type root that is not used for root and swap partitions can be used for other XVM slices.

You can use the -rootslices slices option of the label command to specify multiple root slices for an XVM root disk. This parameter is ignored if partition 0 exists on the disk, unless you specify the -clrparts option. Additional root slices are mapped to partitions 2-5, 7, and 11-15.

You can create an XVM system disk without creating any slices by using the -noparts option of the label command. You can then create root or swap slices and map them to partitions by using the -type and the -partition options of the slice command, as described in “Configuring System Disks with the slice Command”.

usrroot 

An XVM physvol of type usrroot includes at least one root partition, a swap partition and a usr partition, as shown in Figure 1-3.

Labeling a disk as an XVM usrroot disk is similar to labeling a disk as an XVM root disk, except that a usr slice and volume are created in addition to the root slices and volumes, and the usr volume is mapped to partition 6. A usr volume is named physvol_usr6.

Just as for a root disk, if a root partition 0 already exists on the disk you are labeling as an XVM usrroot disk, the existing partition table remains unchanged and is used to determine the number and size of the XVM root, swap, and usr slices that map to the root, slice, and usr partitions unless you override this feature by specifying the -clrparts option of the label command. If there is no partition 1 or partition 6 on an existing system disk you are labeling as a usrroot disk, the label command aborts.

If there is no existing root partition 0 on the disk, then by default, approximately ten percent of an XVM disk of type usrroot is assigned to the swap partition and four percent is assigned to the root partition; these percentages may differ on very large or very small disks, or if there are multiple root partitions. You can use the -swapblks and -rootblocks options of the label command to override these default sizes. Usable space on an XVM physvol of type usrroot that is not used for root, swap, and usr partitions can be used for other XVM slices.

Just as for a root disk, you can use the -rootslices slices option of the label command to specify multiple root slices for an XVM usrroot disk.

You can create an XVM system disk without creating any slices by using the -noparts option of the label command. You can then create root, swap, or usr slices and map them to partitions by using the -type and the -partition options of the slice command, as described in “Configuring System Disks with the slice Command”.

 You must modify the fstab file to mount /usr.

You can configure an XVM root volume as a mirror, as described in “Mirroring XVM System Disks”. You can configure the swap volume and the usr volume to be any XVM logical volume configuration. For an example of a swap volume configuration that uses a concat, see “Configuring a swap Volume with a Concat” in Chapter 7.

When you create an XVM system disk, you must create the XVM disk from the local domain, since system disks are local to the node which boots from them.


Caution: Do not reconfigure a swap or usr volume on an XVM system disk on a running system; you must reboot the system from an alternate bootable disk. Changing the configuration of a swap or usr device may change the address space.

It is recommended that you create an XVM system disk from an existing non-XVM system disk. This not only allows you to use the fx disk utility to determine the partition layout if you choose, but it allows you to restore the disk to a non-XVM system disk at a later time, as described in “Deleting XVM System Disks”.

For a sample procedure to relabel a running root disk as an XVM disk, see “Creating a Mirrored XVM System Disk on a Running Root Disk” in Chapter 7.

The following example creates a system disk with combined root and usr filesystems out of dks0d3. The system disk physvol this example creates is named fred.

xvm:local> label -type root -name fred dks0d3

After you execute this command, a physvol named fred is created and two slices are defined on the physvol, one for root and one for swap, as shown in Figure 4-1. If dks0d3 was a system disk originally, the size of the root and swap slices is determined by the existing partition sizes.

Figure 4-1. XVM System Disk Physvol fred

XVM System Disk Physvol fred

In addition to the system disk, two logical volumes are created when you execute the command: logical volume fred_root0 for the root filesystem and logical volume fred_swap1 for the swap filesystem, as shown in Figure 4-2.

Figure 4-2. XVM Logical Volumes for Root and Swap

XVM Logical Volumes for Root and Swap

The following example creates a system disk with 5 root partitions. In this example, the -clrparts option is used so that the command will work even if the target disk is a non-XVM system disk with a different partition layout.

xvm:local> label -clrparts -rootslices 5 -type root dks1d2

This command creates the slices and volumes shown in the following output to the show -top command:

xvm:local> show -top vol/dks*

vol/dks1d2_root0                  0 online
    subvol/dks1d2_root0/data    3503056 online
        slice/dks1d2s0              3503056 online

vol/dks1d2_root2                  0 online
    subvol/dks1d2_root2/data    3503056 online
        slice/dks1d2s1              3503056 online

vol/dks1d2_root3                  0 online
    subvol/dks1d2_root3/data    3503056 online
        slice/dks1d2s2              3503056 online

vol/dks1d2_root4                  0 online
    subvol/dks1d2_root4/data    3503056 online
        slice/dks1d2s3              3503056 online

vol/dks1d2_root5                  0 online
    subvol/dks1d2_root5/data    3503056 online
        slice/dks1d2s4              3503056 online

vol/dks1d2_swap1                  0 online
    subvol/dks1d2_swap1/data     262144 online
        slice/dks1d2s5               262144 online

Configuring System Disks with the slice Command

If you have labeled a root or a usrroot disk with the -noparts option (in conjunction with the -clrparts option if the disk you labeled originally contained a partition 0), you can use the slice command to configure root, usr, and swap slices on a system disk and to map those slices to an appropriate partition. Even if you do not label a system disk with the -clrparts option, you can use available space on a system disk for additional system slices.

An XVM slice can be of type root, swap, usr, or option; option is the default type. You use the -type option of the slice command to specify a root, swap, or usr slice. This sets a flag in the slice structure and maps the slice to an appropriate partition for that slice type. By default, swap slices are mapped to partition 1, usr slices are mapped to partition 6, and root slices are mapped to the next available partition in list 0, 2-5, 7, and 11-15.

You can specify that a usr, root, or swap slice be mapped to a specific partition with the -partition option of the slice command. Partition 1 is the only valid partition number for a swap slice, and partition 6 is the only valid partition number for a usr slice. For a root slice, the partition number may be 0, 2-5, 7, or 11-15; by default the root slice is mapped to the next available partition on that list.

Mirroring XVM System Disks

To mirror a system disk (local and cluster), you label a disk or disks as XVM disks of type root or usrroot. You then use the -mirror option of the label command to specify the name of the XVM physvol you want to mirror. The new disks you label become mirrors of the root, swap, and usr volumes of the indicated disk. Executing this command does not add new logical volumes; it inserts mirrors into the existing root, swap, and usr logical volumes. Slices on the XVM system disks that are not system slices (type root, swap, or usr) are not mirrored with this command. The label -mirror command replaces the partition table on the new disk even if partition 0 is already present.

Alternately, you can create an additional XVM root or usrroot physvol without specifying a disk to mirror. You can then insert a mirror into an existing root, swap, or usr volume and attach the new system slices that were created on the new XVM physvol when you executed the label command or which you created explicitly with the slice command. “Creating and Mirroring an XVM System Disk” in Chapter 7 shows a comparison of the two ways of mirroring an XVM system disk.


Note: To use the mirroring feature of the XVM Volume Manager, you must purchase and install the appropriate FLEXlm license on IRIX or LK license on SGI ProPack 6 for Linux. XVM mirroring can be cluster or local mirroring and each has its license keys. XVM cluster mirroring requires a license key of cluster mirroring on server-capable nodes (MDS) for cluster nodes to access the cluster mirror volume. Clients in this environment do not need cluster mirror licenses installed. Any XVM physical volume with a local domain owned by a single node requires an XVM local mirror license installed. When the root filesystem is mirrored, the license for mirroring must be installed in either /etc/flexlm/license.dat or /var/flexlm/license.dat on IRIX or /etc/lk/keys.dat on SGI ProPack 6 for Linux or the system will not boot.

The following example creates a system disk that mirrors the logical volumes that were created on physvol fred in the section “Creating XVM System Disks”. No new volumes are created; instead, a mirror component is inserted into the existing root and swap logical volume.

xvm:local> label -type root -name wilma -mirror fred dks0d4

After you execute this command, a physvol named wilma is created and two slices are defined on the physvol, as shown in Figure 4-3.

Figure 4-3. XVM Mirrored Root Physvol

XVM Mirrored Root Physvol

The slices that are created on physvol wilma are inserted as mirrors into the existing root and swap logical volumes, as shown in Figure 4-4.

Figure 4-4. Root and Swap Mirrored Logical Volumes

Root and Swap Mirrored Logical Volumes

For examples of various system administration procedures involving creating and mirroring XVM system disks, see “Creating and Mirroring an XVM System Disk” in Chapter 7.

Upgrading to an XVM System Disk

In order to label an XVM system disk or to boot from an XVM system volume, you must be running IRIX release 6.5.12f or later. If you are running an earlier release, install IRIX 6.5.12f or later before performing either of these tasks. Alternately, if you have no system installed, you can install the system and label the XVM system disk from an IRIX 6.5.12 or later miniroot.

Procedures are provided for the following situations:

For information on booting from an XVM system disk, see “ Booting from an XVM System Disk”. For general information on system installation, see IRIX Admin: Software Installation and Licensing.

Upgrading to an XVM System Disk from IRIX 6.5.11 or Earlier

If you will be creating an XVM usr volume that contains a concat or a stripe, you must configure your XVM system volumes before installing the system on those volumes. This is because the usr volume must have the same address space during the install that it will have afterwards; a stripe or a concat will spread the address space over more than one slice.

If you are running an IRIX 6.5.11 or earlier system, use the following procedure to label and boot from an XVM system disk if it does not contain a usr volume that includes a concat or a stripe:

  1. Install IRIX 6.5.12f (or later) on your currently running system disk or on a different system disk that you will be using as your XVM system disk.

  2. Reboot from the newly-installed disk.

  3. Label the disk as an XVM system disk, using the -nopartchk option of the XVM label command. Label any additional disks that will be part of your XVM volumes. (It will also be possible to mirror system volumes after data has been written to the volumes.)

  4. Reboot the system.

If you are running an IRIX 6.5.11 or earlier system, to label the current system disk as an XVM system disk with a usr volume that includes a concat or a stripe, use the same procedure as you would use for an initial install, as described in “Upgrading to an XVM System Disk with No System Installed”.

Upgrading to an XVM System Disk from IRIX 6.5.12f or Later

If you are currently running an IRIX 6.5.12f or later system, use the following procedure to label a disk as an XVM system disk. You can label the currently running system disk as an XVM system disk.

  1. Label the disks you will be using for your XVM system volumes, using the -nopartchk option of the XVM label command when labeling the currently running system disk.

  2. If the new XVM system disk is the currently running system disk, reboot the system. If the new XVM system disk is a new disk, install the system to that disk.

  3. To upgrade to subsequent releases of IRIX, install the new release on the system disk and reboot from the disk.

Upgrading to an XVM System Disk with No System Installed

If you do not currently have an IRIX system installed, perform the following procedure to label and boot from an XVM system disk.

  1. Boot the IRIX 6.5.12f (or later) miniroot.

  2. Escape to the shell.

  3. Label the disks you will be using for your XVM system volumes, using the -nopartchk option of the XVM label command. Label any additional disks that will be part of your XVM volumes. (It will also be possible to mirror system volumes after data has been written to the volumes.)

  4. Reboot to the miniroot.

  5. Install the system.

  6. Boot the installed system.

Booting from an XVM System Disk

Booting from an XVM system disk requires no special steps. There are four environment variables that specify the location of root and swap that you must change to indicate a new root or swap partition:

  • root

  • OSLoadPartition

  • SystemPartition

  • swap

For information on the environment variables, see IRIX Admin: System Configuration and Operation. For additional examples of booting from XVM system disks, see “Creating and Mirroring an XVM System Disk” in Chapter 7.


Caution: When running from an XVM root partition, changing the system name in /etc/sysid creates a conflict between the host name in the XVM volume header and the name of the system. This will result in a system panic at the next system reboot unless you first boot the miniroot and run the XVM give command to assign the system disk physical volume to the new system name, as described in “Giving Away a System Disk from the Miniroot” in Chapter 7.


Deleting XVM System Disks

By default, the swap partition of an XVM system disk cannot be deleted. This is to ensure that the swap partition cannot be deleted accidentally and cause a system panic. If you need to delete the logical volumes on a system disk, you can do this in one of two ways:

  • Use the -force option of the unlabel command to unlabel the disk. This restores the partitioning scheme on the disk to its original state and the disk is no longer an XVM disk.

  • Use the XVM change command to change the disk from a system disk to an option disk. You can then delete the slices on the disk or the entire volumes that contain the slices. If slices that are mapped to partitions are deleted, the underlying partition is deleted as well.

Each of these procedures is described below.


Caution: Do not unlabel an XVM system disk on a system that is currently running from that disk.

If the XVM system disk was originally partitioned as a system disk, you can reconfigure the disk back to its original state using the following procedure:

  1. Reboot the system from an alternate root disk.

  2. Unlabel the disk, using the -force option of the unlabel command.

  3. If you want to run from the system disk you have unlabeled, you can now reboot from that disk.

Alternately, you can use the following procedure, which does not require that you have an alternate bootable disk:

  1. Run under the miniroot.

  2. Escape to the shell.

  3. Unmount the root (/root) filesystem.

  4. Unlabel the disk, using the -force option of the unlabel command.

  5. Reboot the system.

The following series of commands changes physvol xvmroot2 to an option disk, deletes the slices that make up the root and swap volumes (leaving the volumes as empty volumes), and unlabels the disk.

xvm:local> change option xvmroot2
xvm:local> delete xvmroot2/xvmroot2s0
xvm:local> delete xvmroot2/xvmroot2s1
xvm:local> unlabel xvmroot2

The following series of commands changes physvol xvmroot to an option disk, deletes the root and swap volumes and their child slices, and unlabels the disk.

xvm:local> change option xvmroot
xvm:local> delete -all vol/xvmroot_root
xvm:local> delete -all vol/xvmroot_swap
xvm:local> unlabel xvmroot