How to clear an import in Veritas Volume Manager after a crash?

How to list all disks and display their status in VxVM?

How to remove a grayed out or obsolete disk, or remove a disk from a disk group in Veritas Volume Manager?

Ans:# vxdisk rm disk01

How to remove a disk so that it is no longer under Veritas Volume Manager controls?

Ans:# vxdisk rm c0t0d0

How to add or bring a disk under Veritas Volume Manager control?

Ans:To add or bring a disk under Veritas Volume Manager control:# vxdiskadd c0t0d1or# vxdisksetup -i c0t0d1Note: It might help to newfs the s2 slice of the disk and perform a vxdctl enable to get it to add a disk.

How to remove a volume and any subdisks and plexes associated in VxVM?

Ans:# vxedit -rf rm volume_name

How to rename the disk disk90 to be called disk80 in the group rootdg in Veritas Volume Manager?

Ans:# vxedit -g rootdg rename disk90 disk80

How to set disk90 in the group homedg to be a hot spare in Veritas Volume Manager?

Ans:# vxedit -g homedg set spare=on disk90

How to set the comment field of subdisk subdisk01-01 to “comments are here”?

Ans:# vxedit set comment”comments are here” subdisk01-01

How to sets the user to ep, the group to epgrp and the mode rw-rw-rw on the volume vg01?

Ans:# vxedit set user=ep group=epgrp mode=0666 vg01

How to display the default disk group?

Ans:#vxdg defaultdg

How to set the default disk group?

Ans:# vxdctl defaultdg <disk group>

How to display disk group information?

Ans:# vxdg listor# vxdg list <disk group>

how to display free disk space in disk group?

Ans:# vxdg freeor# vxdg –g <disk group> free

How to create a disk group?

Ans:# vxdg init <disk group> cds=on|off

How to create a disk group with a specified disk group version no.?

Ans:# vxdg –T <DG version> init <disk group>

How to make a non CDS disk group to CDS disk group or vice versa?

Ans:# vxdg –g <disk group> set cds=on|off

How to import a disk group?

Ans# vxdg import <disk group>

How to import a destroyed disk group?

Ans:First you must know the DG ID of the destroyed disk group name. You can get the DG ID by displaying the included disk of destroyed DG.# vxdg import <DG ID>

How to join two DGs into one?

How to destroy a disk group?

How to upgrade a Disk group?

Ans:# vxdg upgrade <disk group>It will upgrade the DG to the highest DG version supported by VxVM.Or# vxdg –T <Version No.> <disk group>To upgrade to a specified version no.

How to get volume information in Veritas Volume Manager?

Ans:# vxinfo <volume-name>

How set the number of kernel thread in Veritas Volume Manager?

Ans:# vxiod set 10Note: This is the daemon that allows for extended I/O calls without blocking calling processes. As this is a kernel thread you cannot see it with ps command so you have to use the vxiod command to see if it is running.

How to create a plex from a subdisk in Veritas Volume Manager?

Ans:# vxmake plex <plex-name> sd=<sub-disk-name>

How to make a subdisk from a disk in Veritas Volume Manager?

Ans:To make a subdisk called subdisk-80 at the beginning of the disk disk80 of size 10000 blocks:# vxmake sd subdisk-80 disk80,0,10000If you wanted to put another subdisk on this disk then you would have an offset of the size of the previous subdisk (10000 in our case):# vxmake sd subdisk-81 disk80,10000,20000

How to set a plex offline in Veritas Volume Manager?

Ans:# vxmend off <plex-name>

How to set a plex online in Veritas Volume Manager?

Ans:# vxmend on <plex-name>

How to set a plex to a clean state in Veritas Volume Manager?

Ans:# vxmend fix clean plex-name

How to mirror all the volumes on the disk rootdisk to disk90 in Veritas Volume Manager?

Ans:# vxmirror rootdisk disk90

How to rebuild the partition table after a root disk failure in Veritas Volume Manager?

How to add a log disk for a volume in Veritas Volume Manager?

Ans:To add a log disk for a raid5 or mirror of a volume in Veritas Volume Manager:# vxassist addlog volume-name

How to encapsulate the root disk?

Ans:We can encapsulate the root disk by vxdiskadm command.# vxdiskadm à Encapsulate one or more disks

How to mirror the root volume?

Ans:We can mirror all the volumes needed to boot with the below command:# vxrootmir <c0t1d0>It will mirror all the file systems needed to boot on the c0t1d0 disk.

How to remove rootability?

Ans:We can un-encapsulate the root disk and take it out from all the file systems needed to boot the system from VxVM control by command vxunroot. This utility make the necessary changes to boot the system without VxVM support.# vxunroot

How to create a mirror on a previously defined volume in Veritas Volume Manager?

Below command is to use the disks disk80 and disk90 to make a mirror on the volume called vg01:# vxassist mirror vg01 disk80 disk90Below command will make a 50 mb mirror on volume called vg01 using any two free disks:# vxassist mirror vg01 50m layout=mirror

How to create a raid5 volume in Veritas Volume Manager?

Ans:To create a raid5 volume in Veritas Volume Manager using any available disks:# vxassist make vg01 100m layout=raid5

How to create a volume in Veritas Volume Manager?

Ans:Example to make a volume called vg01 of size 100m using any available disk:# vxassist –g <DG> make <vol> 100mExample to make a volume called vg01 to be 100m big using the disk disk80:# vxassist –g <DG> make <vol> 100m disk80

How to create a volume with a mirror and log in Veritas Volume Manager?

Ans:Example to make a volume named vg01 with 50mb stripe disk using disks disk80 and disk90 and mirror this on a stripped mirror using disk92 and disk95 and use a log subdisk:# vxassist–g <DG> make <vol> layout=mirror,stripe,log disk80 disk90 disk92 disk95

How to create a volume with a mirror in Veritas Volume Manager?

Ans:Example to make a volume vg01 with a 50mb mirror using the two disks disk80 and disk90:# vxassist –g <DG> make <vol> 100m layout=mirror disk80 disk90

How to shrink the size of a volume in Veritas Volume Manager?

How to verify the main daemon for Veritas Volume Manager?

Ans:vxconfigd is the main daemon of Veritas Volume Manager which must be running at all times. It is started at system startup.We can check its status by below given way:# vxdctl modeOr we can verify it is running with a ps command:# ps -ef | grep vxconfigd

How to enable, disable or verify the vxconfigd daemon in Veritas Volume Manager?

What is vxbootsetup utility?

Ans:The vxbootsetup utility configures physical disks so that they can be used to boot the system. Before vxbootsetup is called to configure a disk, mirrors of the root, swap, /usr and /var volumes (if they exist) should be created on the disk. These mirrors should be restricted mirrors of the volume. The vxbootsetup utility configures a disk by writing a boot track at the beginning of the disk and by creating physical disk partitions in the UNIX VTOC that match the mirrors of the root, swap, /usr and /var.With no medianame arguments, all disks that contain usable mirrors of the root, swap, /usr and /var volumes are configured to be bootable. If medianame arguments are specified, only the named disks are configured.vxbootsetup requires that the root volume is named rootvol and has a usage type of root. The swap volume is required to be named swapvol and to have a usage type of swap. The volumes containing /usr and /var (if any) are expected to be named usr and var, respectively.

What is vxrootmir utility?

Ans:The vxrootmir script creates mirrors of volumes required in booting. It creates a mirror for rootvol, swapvol and standvol. It also creates mirrors of usr, var and home if they exist as separate volumes on the boot disk. The mirror is created on the specified disk media device.The specified disk media device should have enough space to contain the mirror for all the source volumes mentione above, or else it will fail. Also, corresponding slices must be free because it is used to create the partition for root.All disk partitions for the new volume mirrors are created.This script is called by the vxmirror command if the root disk is required to be mirrored. It is also called from the vxdiskadm menus through the choice of the mirror volumes on a disk operation.

What is vxmirror utility?

Ans:The vxmirror command provides a mechanism to mirror all the contents of a specified disk, to mirror all currently un-mirrored volumes in the specified disk group, or to change or display the current defaults for mirroring. All volumes that have only a single plex (mirror copy), will be mirrored by adding an additional plex.Volumes containing subdisks that reside on more than one disk will not be mirrored by vxmirror.vxmirror is generally called from the vxdiskadm menus. It is not an interactive command and once called, will continue until completion of the operation or until a failure is detected.

What is vxunroot utility?

Ans:The vxunroot script causes the root, swap, usr and var file systems to be converted back into being accessible directly through disk partitions instead of through volume devices. Other changes made to ensure the booting of the system from the root volume are also removed such that the system will boot with no dependency on the Volume Manager.For vxunroot to work properly, all but one plexes of rootvol, swapvol, usr and var should be removed. The plexes left behind for the above volumes should be the ones created by vxrootmir or the original ones created when the root disk was encapsulated. This will ensure that the underlying subdisks will have equivalent partitions defined for them on the disk. If none of these conditions are met, the vxunroot operation will fail and none of the volumes will be converted to disk partitions.

Common Procedures

How to recover from the root disk and root-mirror disk failure?

1) Boot the system into single user mode from Solaris installation CD.

ok boot cdrom –s

2) Use the format command to create partitions on the new root disk (c0t0d0s2). These should be identical in size to those on the original root disk before encapsulation unless you are using this procedure to change their sizes.

10) Now edit the vfstab file to replace the volume device names with the disk slices.

11) Now remove the /a/dev/vx/dsk/bootdg and /a/dev/vx/rdsk/bootdg

# rm /a/dev/vx/dsk/bootdg

# rm /a/dev/vx/rdsk/bootdg

12) Now reboot the system. System will be booted into multi user mode.

# init 6

How to recover the VxVM configuration after reinstallation of Solaris?

Reinstallation is necessary if all copies of your root disks are damaged, or if certain critical files are lost due to file system damage. Disconnect all the disks which are not involved in reinstallation process.

1)Install the Solaris OS

2)Install the VxVM software and also install the VxVM license also.

3)Recover the VxVM configuration.

4)touch the /etc/vx/reconfig.d/state.d/install-db file

5)Shut down the system

6)Reattach the disks which were removed before installation.

7)Reboot the system and when the system comes up, bring it into single user mode.

8)Remove the /etc/vx/reconfig.d/state.d/install-db file

9)Start VxVM IO daemons.

# vxiod set 10

10)Start the VxVM daemon in disable mode

# vxconfigd –m disable

11)Initialize the vxconfigd daemon

# vxdctl init

12)Initialize the DMP subsystem

# vxdctl initdmp

13)Now start the vxconfigd daemon

# vxdctl enable

14)Now reboot the system

Now the configuration preserved on the disks not involved in the reinstallation has now been recovered.

How to convert the SVM meta devices into VxVM volumes?

There are three utilities used to convert SVM meta devices into VxVM volumes.

1) Run the preconvert utility to analyze the current SVM configuration:

# preconvert

The preconvert utility analyzes the current Solaris Volume Manager configuration and builds a description for the new VxVM configuration. preconvert does not make any changes to the Solaris Volume Manager configuration or to the host system.

2) Now run the showconvert utility to display the preconvert conversions plan into readable format.

# showconvert

3) Now run the convertname utility to display the VxVM volume names.

# convertname /dev/md/dsk/d12

Note: The convertname utility takes Solaris Volume Manager device paths as arguments (metadevice paths or raw disk paths) and returns the VxVM volume path for the device as it will show after the conversion.

4) Now run the doconvert utility to start the actual conversion process

About iGURKUL

IGURKUL I.T. Training Hub offering various Career Certification courses in Computer Networking, Unix, Linux, Cloud Computing and DevOps Technologies. With its rich experience in IT training service sector, iGURKUL has been able to set Industry best practices in IT Training for the past five years.

In Past five years, more than 5000 professionals have been trained by iGURKUL for System administration, Cloud Computing and DevOps Skill set through our Online Training portal www.unixadminschool.com. And , each day , more than 10000 working professionals from all over the globe visiting our knowledge base www.unixadminschool.com/blog for the best practices and Knowledge learning.