This chapter contains examples of common XVM administration procedures. After an overview of some things to keep in mind before you begin, it provides the following procedures:
Before configuring an XVM logical volume, you may need to assess the status of your disks and your system:
Before you can label a disk as an XVM disk, it must be formatted as an SGI disk. Under IRIX, if your disk has not been initialized during factory set-up, use the fx) command to initialize the disk.Under Linux, use the fdisk command to format the disk as an SGI disk.
If you attempt to use the XVM Volume Manager to label a disk that is not an SGI disk, you will get an error message indicating that the disk volume header partition is invalid. In this case you will need to use the fx or fdisk command to initialize the disk.
When you run the xvm command under IRIX, you may get a message indicating that cluster services have not been enabled on the node and that you will only be able to manipulate local objects until cluster services are started. For information on starting cluster services, see CXFS Version 2 Software Installation and Administration Guide.
Before beginning any of the procedures in this chapter, you may find it useful to execute an xvm show unlabeled/* command to view the names of the disks on the system that have not been assigned to the XVM Volume Manager.
You will not be able to label disks as XVM disks if they contain partitions currently in use as mounted filesystems. In a CXFS cluster, any XVM physical volumes that will be shared must be physically connected to all nodes in the cluster.
In general, you will find it useful to use the options of the show command to view your system configuration and status. For example, the show -v stripe0 command displays the stripe unit (in this case for stripe0).
To configure XVM logical volumes, you need to be logged in as root. However, you can display logical volume configuration information even if you do not have root privileges.
![]() | Note: As you configure an XVM logical volume, keep in mind that at any time you can view extended help information for an XVM command by entering the help command with the -v[erbose] option. For example, you can view the full help screen that includes the options for the slice command by entering the following: xvm:cluster> help -v slice |
When configuring logical volumes under Linux, you may need to keep the following requirements in mind:
To use XVM under SGI ProPack, you must obtain and install the appropriate FLEXlm license.
You may need to confirm that the xvm-standalone kernel module is loaded. You can use the lsmod command, as in the following example:
[root}# lsmod | grep xvm xvm-standalone 717208 0 |
Before you can label a disk as an XVM disk, it must be formatted as an SGI disk. Use the fdisk command to format the disk as an SGI disk. This requires that you use the Expert command of fdisk, and then select the option that creates an IRIX partition table.
The following example shows the procedure for creating a simple logical volume that stripes data across three disks. In this example, the entire usable space of each disk is used for the slice.
Figure 5-1 shows the logical volume this example creates.
Assign disks to XVM to manage. This example assigns three disks to the XVM Volume Manager. You need to perform this procedure only once for each disk that you will be using to create XVM logical volumes.
# xvm xvm:cluster> label -name disk0 dks2d70 disk0 xvm:cluster> label -name disk1 dks2d71 disk1 xvm:cluster> label -name disk2 dks2d72 disk2 |
You may want to view all the disks that have been assigned to the XVM volume manager as XVM physical volumes to verify what you have labeled:
xvm:cluster> show phys/* phys/disk0 35542780 online phys/disk1 35542780 online phys/disk2 35542780 online |
Create a slice that consists of all of the usable blocks of each of the XVM physical volumes:
xvm:cluster> slice -all disk* </dev/cxvm/disk0s0> slice/disk0s0 </dev/cxvm/disk1s0> slice/disk1s0 </dev/cxvm/disk2s0> slice/disk2s0 |
Create a stripe that consists of the three slices you have defined. In this example, the generated volume will be named stripedvol explicitly. A data subvolume will automatically be generated as well.
The following command names the generated volume stripedvol:
xvm:cluster> stripe -volname stripedvol slice/disk0s0 slice/disk1s0 slice/disk2s0 </dev/cxvm/stripedvol> stripe/stripe0 |
In this example:
/dev/rcxvm/stripedvol is the name of the volume on which you can execute the mkfs command
stripe/stripe0 is the name of the stripe object
In this example, the name of the stripe object is subject to change on subsequent boots but the name of the volume is not.
View the topology of the logical volume you have created:
xvm:cluster> show -top stripedvol vol/stripedvol 0 online subvol/stripedvol/data 106627968 online stripe/stripe0 106627968 online,tempname slice/disk0s0 35542780 online slice/disk1s0 35542780 online slice/disk2s0 35542780 online |
Exit the xvm tool by typing exit (or quit or bye). You can then execute the mkfs command on the volume.
xvm:cluster> exit # mkfs /dev/cxvm/stripedvol meta-data=/dev/cxvm/stripedvol isize=256 agcount=51, agsize=261344 blks data = bsize=4096 blocks=13328496, imaxpct=25 = sunit=16 swidth=48 blks, unwritten=1 naming =version 1 bsize=4096 log =internal log bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 |
You can now mount the filesystem. For a shared filesystem in a CXFS cluster, you mount the filesystem with the CXFS GUI or the cmgr(1M) command, as described in CXFS Version 2 Software Installation and Administration Guide.
For a local filesystem that is not part of a cluster, you can put a logical volume in the fstab file and use the mount command to mount the filesystem you created.
The following example shows the procedure for creating a stripe on the outer third of a disk. It also includes some advice on naming volume elements.
Figure 5-2 shows the logical volume this example creates.
Assign disks to XVM to manage. This example assigns four disks to XVM. Note that four separate controllers are chosen for better stripe performance.
xvm:cluster> label -name lucy dks21d0 lucy xvm:cluster> label -name ricky dks22d0 ricky xvm:cluster> label -name ethyl dks23d0 ethyl xvm:cluster> label -name fred dks24d0 fred |
In this example, you use one-third of each disk for the stripe.
There are two ways to partition a disk into thirds. You can allocate the entire disk, but only use the last third. For example, for disk lucy you could do the following (and use slice/lucys2 for the stripe):
xvm:cluster> slice -equal 3 lucy </dev/cxvm/lucys0> slice/lucys0 </dev/cxvm/lucys1> slice/lucys1 </dev/cxvm/lucys2> slice/lucys2 |
Alternately, you can confine the block range explicitly to one-third of the disk. For example, you can do the following to allocate the last third of the other disks (ricky, ethyl, and fred):
xvm:cluster> slice -start 11852676 -length 5926340 ricky </dev/cxvm/rickys0> slice/rickys0 xvm:cluster> slice -start 11852676 -length 5926340 ethyl </dev/cxvm/ethyls0> slice/ethyls0 xvm:cluster> slice -start 11852676 -length 5926340 fred </dev/cxvm/freds0> slice/freds0 |
Verify the allocation.
The following example shows the allocation on lucy, the disk divided into three equal stripes:
The following example verifies the allocation on ricky, one of the disks that was allocated explicitly:
xvm:cluster> show -v ricky XVM physvol phys/ricky ========================= ... --------------------------------------------------- 0 11852676 (unused) 11852676 5926340 slice/rickys0 ------------------------------------------------------------------- |
Create the stripe. In this example, the generated volume is explicitly named I_Love_Lucy.
xvm:cluster> stripe -volname I_Love_Lucy -unit 128 slice/lucys2 \ slice/rickys0 slice/ethyls0 slice/freds0 </dev/cxvm/I_Love_Lucy> stripe/stripe0 |
Sometimes it may be useful to categorize portions of a complex volume by name. For example, you may want to name a portion of a volume faststripe so that a search can be done for volumes that have fast stripe objects. The following command names a stripe as well as the volume:
xvm:cluster> stripe -volname I_Love_Lucy -vename faststripe0 \ -unit 128 slice/lucys2 slice/rickys0 slice/ethys0 slice/freds0 </dev/cxvm/I_Love_Lucy> stripe/faststripe0 |
When you name the stripe as in the preceding example, you can use wildcards to show all fast stripes:
xvm:cluster> show -top stripe/fast* stripe/faststripe0 23705088 online slice/lucys2 5926340 online slice/rickys0 5926340 online slice/ethyls0 5926340 online slice/freds0 5926340 online |
You can also use wildcards to show all objects starting with `I', as in the following example:
xvm:cluster> show I* vol/I_Love_Lucy 0 online |
Exit the xvm tool by typing exit (or quit or bye). You can now execute the mkfs command on the volume.
xvm:cluster> exit hugh3 2# mkfs /dev/cxvm/I_Love_Lucy meta-data=/dev/rxvm/I_Love_Lucy isize=256 agcount=26, agsize=256416 blks data = bsize=4096 blocks=6666528, imaxpct=25 = sunit=16 swidth=48 blks, unwritten=1 naming =version 1 bsize=4096 log =internal log bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 |
Mount the filesystem. For a shared filesystem in a CXFS cluster, you mount the filesystem with the CXFS GUI or the cmgr(1M) command, as described in CXFS Version 2 Software Installation and Administration Guide.
If your XVM volume is a local volume, you can put a logical volume in the fstab file and use the mount command to mount the filesystem you created.
The following example creates an XVM logical volume that includes both a data subvolume and a log subvolume. In this example, the data subvolume consists of all the usable space of two disks, and the log subvolume consists of all the usable space of a third disk.
Figure 5-3 shows the logical volume this example creates.
Assign three disks to XVM to manage.
# xvm xvm:cluster> label -name disk0 dks0d2 disk0 xvm:cluster> label -name disk1 dks0d3 disk1 xvm:cluster> label -name disk2 dks5d42 disk2 |
Create a slice that consists of all of the usable blocks of each of the XVM physical volumes you have created:
xvm:cluster> slice -all disk* </dev/xvm/disk0s0> slice/disk0s0 </dev/xvm/disk1s0> slice/disk1s0 </dev/xvm/disk2s0> slice/disk2s0 |
Combine two of the slices into a concat. In this example, the generated volume is named concatvol.
xvm:cluster> concat -volname concatvol slice/disk0s0 slice/disk1s0 </dev/cxvm/concatvol> concat/concat3 |
You can view the configuration of the volume you have defined that does not yet contain a log subvolume:
xvm:cluster> show -top vol/concatvol vol/concatvol 0 online subvol/concatvol/data 35554848 online concat/concat3 35554848 online,tempname slice/disk0s0 17777424 online slice/disk1s0 17777424 online |
Create the log subvolume consisting of the third slice you created. Use the -tempname option to indicate that the system will generate a temporary name for the volume. You will not need to name this volume, as you will be attaching the log subvolume to the existing concatvol volume.
xvm:cluster> subvol -tempname -type log slice/disk2s0 </dev/cxvm/vol7_log> subvol/vol7/log |
Attach the log subvolume to the existing concatvol volume.
xvm:cluster> attach subvol/vol7/log vol/concatvol vol/concatvol |
Display the logical volume:
xvm:cluster> show -top vol/concatvol vol/concatvol 0 online subvol/concatvol/data 35554848 online concat/concat3 35554848 online,tempname slice/disk0s0 17777424 online slice/disk1s0 17777424 online subvol/concatvol/log 17779016 online slice/disk2s0 17779016 online |
The following example creates an XVM logical volume that includes a data subvolume, a log subvolume, and a real-time subvolume. Two similar ways of performing this procedure are shown.
Figure 5-4 shows the logical volume this example creates.
This example assumes that you have already assigned disks to XVM to manage and that you have previously created the five slices you will use to build the logical volume:
slice/disk1s0
slice/disk2s0
slice/disk3s0
slice/disk4s0
slice/disk5s0.
Create the concat that will comprise the data subvolume:
xvm:cluster> concat -tempname slice/disk1s0 slice/disk2s0 </dev/cxvm/vol0> concat/concat0 |
Create the stripe that will comprise the real-time subvolume:
xvm:cluster> stripe -tempname slice/disk3s0 slice/disk4s0 </dev/cxvm/vol1> stripe/stripe1 |
Create the data subvolume:
xvm:cluster> subvolume -tempname -type data concat/concat0 </dev/cxvm/vol2> subvol/vol2/data |
Create the real-time subvolume:
xvm:cluster> subvolume -tempname -type rt stripe/stripe1 </dev/cxvm/vol3_rt> subvol/vol3/rt |
Create the log subvolume:
xvm:cluster> subvolume -tempname -type log slice/disk5s0 </dev/cxvm/vol4_log> subvol/vol4/log |
Create the logical volume that contains the three subvolumes:
xvm:cluster> volume -volname myvol subvol/vol2/data \ subvol/vol4/log subvol/vol3/rt vol/myvol |
Display the logical volume:
xvm:cluster> show -top myvol vol/myvol 0 online subvol/myvol/data 35558032 online concat/concat0 35558032 online,tempname slice/disk1s0 17779016 online slice/disk2s0 17779016 online subvol/myvol/log 8192 online slice/disk5s0 8192 online subvol/myvol/rt 35557888 online stripe/stripe1 35557888 online,tempname slice/disk3s0 17779016 online slice/disk4s0 17779016 online |
The following sequence of commands generates the same volume, but with one less step since the volume name is established with the concat command. The log and real-time subvolumes are subsequently attached.
xvm:cluster> concat -volname myvol slice/disk1s0 slice/disk2s0 </dev/cxvm/myvol> concat/concat1 xvm:cluster> stripe -tempname slice/disk3s0 slice/disk4s0 </dev/cxvm/vol6> stripe/stripe2 xvm:cluster> subvolume -tempname -type rt stripe/stripe2 </dev/cxvm/vol7_rt> subvol/vol7/rt xvm:cluster> subvolume -tempname -type log slice/disk5s0 </dev/cxvm/vol8_log> subvol/vol8/log xvm:cluster> attach subvol/vol8/log subvol/vol7/rt myvol vol/myvol xvm:cluster> show -top myvol vol/myvol 0 online subvol/myvol/data 35558032 online concat/concat1 35558032 online,tempname slice/disk1s0 17779016 online slice/disk2s0 17779016 online subvol/myvol/log 8192 online slice/disk5s0 8192 online subvol/myvol/rt 35557888 online stripe/stripe2 35557888 online,tempname slice/disk3s0 17779016 online slice/disk4s0 17779016 online |
When you configure an XVM logical volume, you can create the volume's hierarchy from the bottom up or from the top down. The example in this section creates the same XVM logical volume as in the example in “Creating a Logical Volume with a Data and Log Subvolume” and shown in Figure 5-3, but it creates an empty volume first before attaching the child volume elements for that volume.
Assign three disks to XVM to manage:
# xvm xvm:cluster> label -name disk0 dks0d2 disk0 xvm:cluster> label -name disk1 dks0d3 disk1 xvm:cluster> label -name disk2 dks5d42 disk2 |
Create a slice that consists of all of the usable blocks of each of the XVM physical volumes you have created:
xvm:cluster> slice -all disk* </dev/cxvm/disk0s0> slice/disk0s0 </dev/cxvm/disk1s0> slice/disk1s0 </dev/cxvm/disk2s0> slice/disk2s0 |
Create an empty volume named topdownvol:
xvm:cluster> volume -volname topdownvol vol/topdownvol |
Display the volume:
xvm:cluster> show -top vol/top* vol/topdownvol 0 offline (empty) * * |
Create an empty concat volume element and display the result:
xvm:cluster> concat -tempname </dev/cxvm/vol8> concat/concat5 xvm:cluster> show -top vol/vol8 vol/vol8 0 offline,tempname subvol/vol8/data 0 offline,pieceoffline concat/concat5 0 offline,tempname (empty) * * |
Attach the generated data subvolume that contains the concat to topdownvol and display the result:
xvm:cluster> attach subvol/vol8/data vol/topdownvol vol/topdownvol xvm:cluster> show -top vol/topdownvol vol/topdownvol 0 offline subvol/topdownvol/data 0 offline,pieceoffline concat/concat5 0 offline,tempname (empty) * * |
Attach two slices to fill the empty concat and display the result:
xvm:cluster> attach slice/disk0s0 slice/disk1s0 concat/concat5 </dev/cxvm/topdownvol> concat/concat5 xvm:cluster> show -top vol/topdownvol vol/topdownvol 0 online subvol/topdownvol/data 35554848 online concat/concat5 35554848 online,tempname slice/disk0s0 17777424 online slice/disk1s0 17777424 online |
Create a log subvolume:
xvm:cluster> subvol -tempname -type log </dev/cxvm/vol9_log> subvol/vol9/log |
Attach the log subvolume to topdownvol and display the result:
xvm:cluster> attach subvol/vol9/log vol/topdownvol vol/topdownvol xvm:cluster> show -top vol/topdownvol vol/topdownvol 0 offline subvol/topdownvol/data 35554848 online concat/concat5 35554848 online,tempname slice/disk0s0 17777424 online slice/disk1s0 17777424 online subvol/topdownvol/log 0 offline (empty) * * |
Attach the third slice to the log subvolume and display the results:
xvm:cluster> attach slice/disk2s0 subvol/topdownvol/log </dev/cxvm/topdownvol_log> subvol/topdownvol/log xvm:cluster> show -top vol/topdownvol vol/topdownvol 0 online subvol/topdownvol/data 35554848 online concat/concat5 35554848 online,tempname slice/disk0s0 17777424 online slice/disk1s0 17777424 online subvol/topdownvol/log 17779016 online slice/disk2s0 17779016 online |
The following example creates a logical volume with striped mirrors. In this example the logical volume contains a stripe that consists of two mirrors, each mirroring a slice that contains all of the usable blocks of an XVM physical volume.
![]() | Note: To use the mirroring feature of the XVM Volume Manager, you must purchase the XFS Volume Plexing software option and obtain and install a FLEXlm license. |
Figure 5-5 shows the logical volume this example creates.
Assign four disks to XVM to manage:
xvm:cluster> label -name disk0 dks2d70 disk0 xvm:cluster> label -name disk1 dks2d71 disk1 xvm:cluster> label -name disk2 dks2d72 disk2 xvm:cluster> label -name disk3 dks2d73 disk3 |
Create a slice out of all of the usable blocks on each XVM physical volume:
xvm:cluster> slice -all disk* </dev/cxvm/disk0s0> slice/disk0s0 </dev/cxvm/disk1s0> slice/disk1s0 </dev/cxvm/disk2s0> slice/disk2s0 </dev/cxvm/disk3s0> slice/disk3s0 |
Create two mirrors, each consisting of two of the slices you have defined. Since you are creating new mirrors that will be written to before they are read, you can specify the -clean option. This indicates that the mirrors do not need to be synchronized on creation.
If you do not specify the -clean option, executing this command initiates a mirror revive, which synchronizes the data on the slices. A message indicating that a revive has begun would be written to the SYSLOG, and another message would be written to the SYSLOG when the revive completes.
You will not need to define a persistent name for the volume that will be generated.
xvm:cluster> mirror -tempname -clean slice/disk0s0 slice/disk1s0 </dev/cxvm/vol2> mirror/mirror1 xvm:cluster> mirror -tempname -clean slice/disk2s0 slice/disk3s0 </dev/cxvm/vol3> mirror/mirror2 |
Create a stripe that consists of the two mirrors you have defined, naming the volume that will be generated to contain the stripe. This command attaches the mirrors to the stripe.
xvm:cluster> stripe -volname mirvol mirror/mirror1 mirror/mirror2 </dev/cxvm/mirvol> stripe/stripe2 |
Display the XVM logical volume:
xvm:cluster> show -top mirvol vol/mirvol 0 online subvol/mirvol/data 71085312 online stripe/stripe2 71085312 online,tempname mirror/mirror1 35542780 online,tempname slice/disk0s0 35542780 online slice/disk1s0 35542780 online mirror/mirror2 35542780 online,tempname slice/disk2s0 35542780 online slice/disk3s0 35542780 online |
Exit the xvm tool by typing exit (or quit or bye). You can now execute the mkfs command on the volume.
xvm:cluster> exit 3# mkfs /dev/cxvm/mirvol meta-data=/dev/cxvm/mirvol isize=256 agcount=17, agsize=261440 blks data = bsize=4096 blocks=4444352, imaxpct=25 = sunit=16 swidth=32 blks, unwritten=1 naming =version 1 bsize=4096 log =internal log bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 |
Mount the filesystem. For a filesystem in a CXFS cluster, you mount a filesystem with the CXFS GUI or the cmgr(1M) command, as described in CXFS Version 2 Software Installation and Administration Guide. For a local filesystem, you can put a logical volume in the fstab file and use the mount command.
This section describes the procedures for the following tasks:
The two mirroring procedures show two alternate ways of creating the same mirrored root and swap partitions.
In addition, this section describes the procedure for the following task:
“Creating a Mirrored XVM System Disk on a Running Root Disk”
The following procedure shows how to create an XVM system disk and then mirror the disk by using the -mirror option of the label command. The procedure described in “Mirroring a System Disk through Mirror Insertion” shows how to create the same mirrored system disk by inserting mirrors into the logical volume and then attaching slices to the empty mirror leg.
Label a disk as an XVM disk of type root.
The following command labels dks0d3 and names the physvol root_1:
xvm:local> label -type root -name root_1 dks0d3 root_1 |
Executing this command creates the physvol root_1 with two slices, as shown in Figure 5-6.
You can see the layout of the slices on the physvol root_1 with the show -v command:
xvm:local> show -v phys/roo* XVM physvol phys/root_1 ========================= ... Physvol Usage: Start Length Name --------------------------------------------------- 0 262144 slice/root_1s1 262144 17515280 slice/root_1s0 ... |
In addition to creating the slices, executing this command creates the logical volume root_1_root0 and the logical volume root_1_swap1, as shown in Figure 5-7.
You can display the layout of the logical volumes with the show -top command:
xvm:local> show -top vol/root* vol/root_1_root0 0 online subvol/root_1_root0/data 17515280 online slice/root_1s0 17515280 online vol/root_1_swap1 0 online subvol/root_1_swap1/data 262144 online slice/root_1s1 262144 online |
Install the operating system on the new system disk.Before installing, you must do the following:
Exit from the XVM Volume Manager
xvm:local> quit |
Execute the mkfs command on the root filesystem
hugh2 4# mkfs /dev/lxvm/root_1_root0 meta-data=/dev/lxvm/root_1_root0 isize=256 agcount=9, agsize=243268 blks data = bsize=4096 blocks=2189410, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 1 bsize=4096 log =internal log bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 |
Mount the root filesystem:
hugh2 3# mkdir /mnt hugh2 5# mount /dev/lxvm/root_1_root0 /mnt |
You can now install the operating system on /mnt.
There are four environment variables that specify the location of root and swap that you change to indicate a new root or swap partition: root, OSLoadPartition, SystemPartition, and swap. For information on the environment variables, see IRIX Admin: System Configuration and Operation.
Reboot the operating system:
xvm:local> quit hugh2 2# /etc/reboot [...] The system is ready hugh2 1# |
Label the disk to use as a mirror of the system disk.
The following example labels disk dks0d4 as an XVM physvol of type root name root_2:
xvm:local> label -type root -name root_2 -mirror root_1 dks0d4 </dev/lxvm/root_1_root0> mirror/mirror2 </dev/lxvm/root_1_swap1> mirror/mirror3 root_2 |
Executing this command creates the physvol root_2, which contains two slices, as shown in Figure 5-8.
In addition to creating the slices, executing this command mirrors the logical volume root_1_root0 and the logical volume root_1_swap1, as shown in Figure 5-9.
You can see the layout of the mirrored root and swap logical volumes with the show -top command:
xvm:local> show -top vol/roo* vol/root_1_root0 0 online subvol/root_1_root0/data 17516872 online mirror/mirror2 17516872 online,tempname slice/root_1s0 17516872 online slice/root_2s0 17516872 online vol/root_1_swap1 0 online subvol/root_1_swap1/data 262144 online mirror/mirror3 262144 online,tempname slice/root_1s1 262144 online slice/root_2s1 262144 online |
The following procedure shows how to create the same mirrored system disk that was created in the procedure described in “Mirroring a System Disk with the label -mirror Command”. In this procedure, however, the mirrored disk is created by inserting mirrors into the logical volume and then attaching slices to the empty mirror leg.
Label a disk as an XVM disk of type root.
The following command labels dks0d3 and names the physvol root_1:
xvm:local> label -type root -name root_1 dks0d3 root_1 |
Executing this command creates the physvol root_1 with two slices, which is the same configuration that is shown in Figure 5-6.
This command also creates the logical volume root_1_root0 and the logical volume root_1_swap1, as is shown in Figure 5-7.
Install the operating system on the new system disk, as described in step 2 of “Mirroring a System Disk with the label -mirror Command”.
Reboot the operating system, as described in step 3 of “Mirroring a System Disk with the label -mirror Command”.
Insert mirrors into the root and swap logical volumes, above the slices that make up the root and swap partitions on those volumes.
The following commands insert mirrors into the logical volumes root_1_root0 and root_1_swap1, above the slices root_1s1 and root_1s0:
xvm:local> insert mirror slice/root_1s0 </dev/lxvm/root_1_root0> mirror/mirror5 xvm:local> insert mirror slice/root_1s1 </dev/lxvm/root_1_swap1> mirror/mirror6 |
After you have inserted the mirrors, the logical volumes root_1_root and root_1_swap are configured as shown in Figure 5-10.
You can view the logical volume configuration after the insertion of the mirrors with the show -top command:
xvm:local> show -top vol/root_1* vol/root_1_root0 0 online subvol/root_1_root0/data 17516872 online mirror/mirror5 17516872 online,tempname slice/root_1s0 17516872 online vol/root_1_swap1 0 online subvol/root_1_swap1/data 262144 online mirror/mirror6 262144 online,tempname slice/root_1s1 262144 online |
Create a second system disk of type root:
xvm:local> label -type root -name root_2 dks5d7 root_2 |
Executing this command creates the physvol root_2, which contains two slices. This is the same configuration shown in Figure 5-8. The root and slice partitions on this second disk need to be at least as large as the root and swap partitions on the first disk, so that they can be mirrored.
Executing this command also generates logical volumes root_2_root0 and root_2_swap1. You can use the show -top command to see the logical volume configuration:
xvm:local> show -top vol/root_2* vol/root_2_root0 0 online subvol/root_2_root0/data 17516872 online slice/root_2s0 17516872 online vol/root_2_swap1 0 online subvol/root_2_swap1/data 262144 online slice/root_2s1 262144 online |
Attach the slices on root_2 to the mirrors that you inserted into the logical volumes root_1_root0 and root_1_swap1:
xvm:local> attach slice/root_2s0 mirror/mirror5 </dev/lxvm/root_1_root0> mirror/mirror5 xvm:local> attach slice/root_2s1 mirror/mirror6 </dev/lxvm/root_1_swap1> mirror/mirror6 |
The root and swap logical volumes are now configured as in Figure 5-9. You can use the show -top command to view the configuration:
xvm:local> show -top vol/root_1* vol/root_1_root0 0 online subvol/root_1_root0/data 17516872 online mirror/mirror5 17516872 online,tempname,reviving:53% slice/root_1s0 17516872 online slice/root_2s0 17516872 online vol/root_1_swap1 0 online subvol/root_1_swap1/data 262144 online mirror/mirror6 262144 online,tempname slice/root_1s1 262144 online slice/root_2s1 262144 online |
Attaching the slices on root_2 to the root_1_root0 and root_1_swap1 logical volumes leaves root_2_root0 and root_2_swap1 as empty logical volumes, as shown by the following command:
xvm:local> show -top vol/root_2* vol/root_2_root0 0 offline subvol/root_2_root0/data 17516872 offline,incomplete (empty) * * vol/root_2_swap1 0 offline subvol/root_2_swap1/data 262144 offline,incomplete (empty) * * |
These empty logical volumes will be deleted the next time you reboot, or you can delete them manually. The following command deletes the two empty volumes, as is verified by the show command that follows it.
xvm:local> delete -all vol/root_2_root0 vol/root_2_swap1 xvm:local> show vol/roo* vol/root_1_root0 0 online vol/root_1_swap1 0 online |
The following procedure labels a running root disk as an XVM system disk and then, after rebooting the system, creates a three-way mirror of the system disk. Note that when you are creating an XVM system disk you must be in the local domain.
![]() | Note: When you label an existing system disk as an XVM disk, the layout for partition 0 and partition 1 remains unchanged from the current layout. |
From the local domain, label the current running root disk as an XVM system disk.
The following command labels root disk dks0d1 as an XVM physvol of type root named xvmdisk:
xvm:local> label -nopartchk -type root -name xvmdisk dks0d1 xvmdisk |
Executing this command creates the physvol xvmdisk with two slices, as shown in Figure 5-11.
In addition to creating the XVM slices for root and swap, executing this command creates the logical volume xvmdisk_root0 and the logical volume xvmdisk_swap1, as shown in Figure 5-12.
Reboot the operating system. This is necessary to ensure that the open volumes of the running root disk are closed and then opened to go through the XVM I/O path before the disks are mirrored.
xvm:local> quit hugh2 2# /etc/reboot [...] The system is ready hugh2 1# |
Bring up the XVM Volume Manager in the local domain, since the system disk is generally used to boot only one node:
hugh2 1# xvm -domain local |
Label the two disks you will use as mirrors for the XVM system disk.
The following command labels disks dks0d3 and dks0d4 as XVM disks of type root that will mirror xvmdisk. Note that since you are creating logical volumes in the local domain, the volumes are in the /dev/lxvm directory.
xvm:local> label -type root -mirror xvmdisk dks0d3 dks0d4 </dev/lxvm/xvmdisk_swap1> mirror/mirror0 </dev/lxvm/xvmdisk_root0> mirror/mirror1 dks0d3 dks0d4 |
Executing this command creates two physvols, named dks0d3 and dks0d4 by default. Each of these physvols contains two slices, as shown in Figure 5-13.
In addition to creating the slices, this command mirrors the logical volume xvmdisk_root0 and the logical volume xvmdisk_swap1 as a three-way mirror, as shown in Figure 5-14.
You can see the layout of the slices on xvmdisk, dks0d3, and dks0d4 with the show -v command.
xvm:local> show -v phys/* XVM physvol phys/dks0d3 ========================= ... Physvol Usage: Start Length Name --------------------------------------------------- 0 262144 slice/dks0d3s1 262144 17515280 slice/dks0d3s0 ... XVM physvol phys/dks0d4 ========================= ... Physvol Usage: Start Length Name --------------------------------------------------- 0 262144 slice/dks0d4s1 262144 17515280 slice/dks0d4s0 ... XVM physvol phys/xvmdisk ========================= ... Physvol Usage: Start Length Name --------------------------------------------------- 0 262144 slice/xvmdisks1 262144 17515280 slice/xvmdisks0 ... |
You can see the layout of the mirrored root and swap logical volumes with the show -top command. In this example, the mirrors have just begun to revive.
xvm:local> show -top vol vol/xvmdisk_root0 0 online subvol/xvmdisk_root0/data 17515280 online,open mirror/mirror0 17515280 online,tempname,reviving:2%,open slice/xvmdisks0 17515280 online,open slice/dks0d3s0 17515280 online,open slice/dks0d4s0 17515280 online,open vol/xvmdisk_swap1 0 online subvol/xvmdisk_swap1/data 262144 online,open mirror/mirror1 262144 online,tempname,reviving:queued,open slice/xvmdisks1 262144 online,open slice/dks0d3s1 262144 online,open slice/dks0d4s1 262144 online,open |
The following procedure shows how to configure an XVM system disk with a swap volume that includes a concat. This procedure does not relabel the currently running root disk.
This procedure creates a root logical volume that consists of one slice on an XVM system disk, and a swap logical volume that consists of two slices that make of a concat, as shown in Figure 5-15.
In this example, the two slices that make up the swap volume are on two different disks.
The following command labels disk dks1d2 as an XVM system disk named bootdisk. The -clrparts option of the XVM label command is used to override the existing partitioning scheme on the disk, if the disk already contains a partition 0.
xvm:local> label -clrparts -type root -name bootdisk dks1d2 bootdisk |
Executing this command creates the physvol bootdisk with two slices, as shown in Figure 5-16.
In addition to creating the XVM slices for root and swap, executing this command creates the logical volumes bootdisk_root0 and bootdisk_swap1, as shown in Figure 5-17.
The show -top command shows the topology of the logical volumes, and indicates the size of the root and swap slices:
xvm:local> show -top vol/bootdis* vol/bootdisk_root0 0 online subvol/bootdisk_root0/data 17515280 online slice/bootdisks0 17515280 online vol/bootdisk_swap1 0 online subvol/bootdisk_swap1/data 262144 online slice/bootdisks1 262144 online |
The following command labels a second disk, dks1d3, as an XVM system disk named moreswap. The -noparts option of the XVM label command is used because we do not want a root partition on this disk and we will be defining the swap volume on this disk manually. This example assumes that this second disk is not already a system disk containing a partition 0, or we would need to use the -clrparts option of the XVM label command.
xvm:local> label -noparts -type root -name moreswap dks1d3 moreswap |
Create a swap slice on moreswap:
xvm:local> slice -type swap -start 0 -length 262144 moreswap </dev/lxvm/moreswaps0> slice/moreswaps0 |
Executing this command creates the swap slice on the physvol moreswap, as shown in Figure 5-18.
Create an empty two-piece concat, to which you will attach the two swap slices:
xvm:local> concat -tempname -pieces 2 </dev/lxvm/vol15> concat/concat3 |
Attach the two swap slices to the concat:
xvm:local> attach slice/bootdisks1 slice/moreswaps0 concat3 </dev/lxvm/vol15> concat/concat3 |
Attach the concat to the swap subvolume:
xvm:local> attach concat3 subvol/bootdisk_swap1/data </dev/lxvm/bootdisk_swap1> subvol/bootdisk_swap1/data |
This creates the logical swap volume that is shown in Figure 5-15.
You can see the layout of the root and swap logical volumes you created with the show -top command:
xvm:local> show -t vol/bootdis* vol/bootdisk_root0 0 online subvol/bootdisk_root0/data 17515280 online slice/bootdisks0 17515280 online vol/bootdisk_swap1 0 online subvol/bootdisk_swap1/data 524288 online concat/concat3 524288 online,tempname slice/bootdisks1 262144 online slice/moreswaps0 262144 online |
The following procedure reconfigures a filesystem while the filesystem is online by mirroring the data in a new configuration, then detaching the original configuration. It is not necessary to unmount the filesystem to perform this procedure.
![]() | Note: To use the mirroring feature of the XVM Volume Manager, you must purchase the XFS Volume Plexing software option and obtain and install a FLEXlm license. |
Figure 5-19 shows the configuration of the original filesystem that has been built and mounted.
In the example, the original filesystem is a filesystem that consists of a single slice. It is named myfs, and is configured as follows:
xvm:cluster> show -top myfs vol/myfs 0 online subvol/myfs/data 102400 online,open slice/disk5s0 102400 online,open |
This procedure reconfigures this filesystem into one that consists of a four-way stripe.
Create the slices that will make up the four-way stripe. The stripe that you are creating should be the same size as the existing filesystem, so in this example each slice is one-quarter the size of the filesystem.
xvm:cluster> slice -length 25600 phys/disk[1234] </dev/cxvm/disk1s0> slice/disk1s0 </dev/cxvm/disk2s0> slice/disk2s0 </dev/cxvm/disk3s0> slice/disk3s0 </dev/cxvm/disk4s0> slice/disk4s0 |
Create the four-way stripe. This example does not specify a stripe unit, which accepts the default stripe unit of 128 blocks. In this case, using the default stripe unit uses all the blocks of each slice, since the slices are multiples of the stripe unit in size.
xvm:cluster> stripe -tempname slice/disk[1234]s0 </dev/cxvm/vol5> stripe/stripe5 |
Display the stripe configuration:
xvm:cluster> show -top stripe5 stripe/stripe5 102400 online,tempname slice/disk1s0 25600 online slice/disk2s0 25600 online slice/disk3s0 25600 online slice/disk4s0 25600 online |
Insert a temporary mirror above the point that will be reconfigured. In this example, that point is slice/disk5s0.
xvm:cluster> insert mirror slice/disk5s0 </dev/cxvm/myfs> mirror/mirror5 |
Display the logical volume:
xvm:cluster> show -top myfs vol/myfs 0 online subvol/myfs/data 102400 online,open mirror/mirror5 102400 online,tempname,open slice/disk5s0 102400 online,open |
Figure 5-20 shows the configuration of the filesystem myfs after the insertion of the mirror.
Attach the stripe to the mirror, which is mirror5 in this example. This will initiate a revive, which replicates the data of slice/disk5s0 on stripe5.
xvm:cluster> attach stripe/stripe5 mirror/mirror5 </dev/cxvm/myfs> mirror/mirror5 |
Display the logical volume:
xvm:cluster> show -top myfs vol/myfs 0 online subvol/myfs/data 102400 online,open mirror/mirror5 102400 online,tempname,open slice/disk5s0 102400 online,open stripe/stripe5 102400 online,tempname,open slice/disk1s0 25600 online,open slice/disk2s0 25600 online,open slice/disk3s0 25600 online,open slice/disk4s0 25600 online,open |
Figure 5-21 shows the configuration of the filesystem myfs after the stripe has been attached to the mirror.
Detach slice/disk5s0 from the mirror. You must wait for the mirror revive to complete before you can do this, since you can not detach the last valid piece of an open mirror, and until the revive completes the slice is the only valid leg of the mirror.
xvm:cluster> detach slice/disk5s0 </dev/cxvm/disk5s0> slice/disk5s0 |
Figure 5-22 shows the configuration of the filesystem myfs after the original slice has been detached.
Remove the mirror layer from the tree by collapsing around the mirror:
xvm:cluster> collapse mirror/mirror5 |
The filesystem is now configured as a four-way stripe. Display the logical volume:
xvm:cluster> show -top myfs vol/myfs 0 online subvol/myfs/data 102400 online,open stripe/stripe5 102400 online,tempname,open slice/disk1s0 25600 online,open slice/disk2s0 25600 online,open slice/disk3s0 25600 online,open slice/disk4s0 25600 online,open |
Figure 5-23 shows the final configuration of the filesystem myfs.
The following sections describe the procedure for creating and modifying a logical volume. In this procedure, the modifications to the logical volume are made after you have made a filesystem on the logical volume and mounted the filesystem.
This procedure is divided into the following steps:
Creating the logical volume
Growing the logical volume
Mirroring data on the logical volume
Converting a concat to striped data using mirroring
Removing a mirror
Mirroring individual stripe members
These steps are described in the following sections.
![]() | Note: To use the mirroring feature of the XVM Volume Manager, you must purchase the XFS Volume Plexing software option and obtain and install a FLEXlm license. |
The following procedure creates a simple logical volume that contains a single slice. Figure 5-24 shows the original XVM logical volume this procedure creates.
Create a slice on the physvol pebble, naming the generated volume that contains the slice tinyvol:
xvm:cluster> slice -volname tinyvol -start 17601210 -length 177792 \ pebble </dev/cxvm/tinyvol> slice/pebbles0 |
Exit the XVM CLI by typing exit and then create a filesystem:
xvm:cluster> exit # mkfs /dev/cxvm/tinyvol meta-data=/dev/cxvm/tinyvol isize=256 agcount=5, agsize=4445 blks data = bsize=4096 blocks=22224, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 1 bsize=4096 log =internal log bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 |
Mount the filesystem. For a shared filesystem in a CXFS cluster, you mount a filesystem with the CXFS GUI or the cmgr(1M) command, as described in CXFS Version 2 Software Installation and Administration Guide.
For a local filesystem, you can put a logical volume in the fstab file and use the mount command to mount the filesystem you created.
The following procedure grows the logical volume you have created. Figure 5-25 shows the logical volume after the insertion of a concat to grow the logical volume.
Display the logical volume tinyvol, showing the topology of the volume:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 177792 online,open slice/pebbles0 177792 online,open |
Change the volume tinyvol to include a concat container:
xvm:cluster> insert concat slice/pebbles0 </dev/cxvm/tinyvol> concat/concat3 |
Display the results of the insert command:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 177792 online,open concat/concat3 177792 online,tempname,open slice/pebbles0 177792 online,open |
Find or make a free slice on the physvol bambam:
xvm:cluster> slice -start 0 -length 177792 bambam </dev/xvm/bambams0> slice/bambams0 |
Attach the slice to tinyvol. There are two different ways to specify the concat volume element to which you are attaching the slice.
The following command attaches the slice by the relative location of the volume element:
xvm:cluster> attach slice/bambams0 tinyvol/data/0 </dev/cxvm/tinyvol> concat/concat3 |
The following command attaches the slice by referring to the object name of the volume element:
xvm:cluster> attach slice/bambams0 concat3 |
For information on referring to object names and relative locations in XVM commands, see “Object Names in XVM” in Chapter 3.
Display the results of the attach command:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open concat/concat3 355584 online,tempname,open slice/pebbles0 177792 online,open slice/bambams0 177792 online,open |
Exit the XVM CLI by typing exit and then grow the filesystem. Use the mount point where you mounted the filesystem with the CXFS GUI. In this example, the mount point is /clusterdisk:
xvm:cluster> exit # xfs_growfs /clusterdisk meta-data=/clusterdisk isize=256 agcount=5, agsize=4445 blks data = bsize=4096 blocks=22224, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 1 bsize=4096 log =internal bsize=4096 blocks=1168 realtime =none extsz=65536 blocks=0, rtextents=0 data blocks changed from 22224 to 44448 |
The following procedure creates a mirror for the data in the filesystem. Figure 5-26 shows the XVM logical volume after the insertion of the mirror.
Change tinyvol to include a mirror container:
# xvm xvm:cluster> insert mirror tinyvol/data/0 </dev/cxvm/tinyvol> mirror/mirror3 |
Display the results of the mirror insert:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open mirror/mirror3 355584 online,tempname,open concat/concat3 355584 online,tempname,open slice/pebbles0 177792 online,open slice/bambams0 177792 online,open |
Find free space or make a new slice of the same size:
xvm:cluster> slice -start 0 -length 355584 wilma </dev/cxvm/wilmas0> slice/wilmas0 |
Attach the slice to the mirror:
xvm:cluster> attach slice/wilmas0 tinyvol/data/0 </dev/cxvm/tinyvol> mirror/mirror3 |
Display the results of the attach. In this example, the revive that was initiated when the slices were attached to the mirror has not yet completed:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open mirror/mirror3 355584 online,tempname,open concat/concat3 355584 online,tempname,open slice/pebbles0 177792 online,open slice/bambams0 177792 online,open slice/wilmas0 355584 online,reviving:11% |
The following procedure converts the previously created concat to a stripe that replaces the concat in the mirror. Figure 5-27 shows the resulting XVM logical volume.
Break the mirror:
xvm:cluster> detach -tempname mirror3/0 </dev/cxvm/vol6> concat/concat3 |
Delete the concat object, detaching and keeping the slices that make it up:
xvm:cluster> delete -nonslice concat3 </dev/cxvm/pebbles0> slice/pebbles0 </dev/cxvm/bambams0> slice/bambams0 |
Create a stripe using the slices:
xvm:cluster> stripe -tempname -unit 128 slice/pebbles0 slice/bambams0 </dev/cxvm/vol7> stripe/stripe0 |
Attach the stripe to the mirror:
xvm:cluster> attach stripe0 mirror3 |
Display the results of the attach. In this example, the revive that was initiated when the stripes were attached to the mirror has not yet completed.
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open mirror/mirror3 355584 online,tempname,open stripe/stripe0 355584 online,tempname,reviving:5% slice/pebbles0 177792 online,open slice/bambams0 177792 online,open slice/wilmas0 355584 online,open |
The following procedure removes the mirror layer from the logical volume. Figure 5-28 shows the XVM logical volume after the mirror has been removed.
Detach the slice on which the data is mirrored:
xvm:cluster> detach -tempname slice/wilmas0 </dev/cxvm/wilmas0> slice/wilmas0 |
Remove the mirror layer:
xvm:cluster> collapse mirror3 |
Display the results of the collapse command:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open stripe/stripe0 355584 online,tempname,open slice/pebbles0 177792 online,open slice/bambams0 177792 online,open |
The following procedure mirrors the individual slices that make up the stripe. Figure 5-29 shows the XVM logical volume this example yields.
Place the slices within mirror containers. The following examples demonstrate alternate methods of specifying slices:
xvm:cluster> insert mirror tinyvol/data/0/0 </dev/cxvm/tinyvol> mirror/mirror4 xvm:cluster> insert mirror slice/bambams0 </dev/cxvm/tinyvol> mirror/mirror5 |
Display the results of the two insert commands:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open stripe/stripe0 355584 online,tempname,open mirror/mirror4 177792 online,tempname,open slice/pebbles0 177792 online,open mirror/mirror5 177792 online,tempname,open slice/bambams0 177792 online,open |
Find some free space or reuse some unused slices:
xvm:cluster> slice -start 0 -length 177792 betty </dev/cxvm/bettys0> slice/bettys0 xvm:cluster> show slice/wilmas0 slice/wilmas0 355584 online,autoname |
Attach the slices to the mirrors. Note that wilmas0 is larger than pebbles0. The mirror will continue to use the smallest size.
xvm:cluster> attach slice/wilmas0 tinyvol/data/0/0 </dev/cxvm/tinyvol> mirror/mirror4 xvm:cluster> attach slice/bettys0 stripe0/1 </dev/cxvm/tinyvol> mirror/mirror4 |
Display the results of the attach:
xvm:cluster> show -top tinyvol vol/tinyvol 0 online subvol/tinyvol/data 355584 online,open stripe/stripe1 355584 online,tempname,open mirror/mirror4 177792 online,tempname,open slice/pebbles0 177792 online,open slice/wilmas0 355584 online,open mirror/mirror5 177792 online,tempname,open slice/bambams0 177792 online,open slice/bettys0 177792 online,open |