Common Interview Questions related to VxVM
How to add a disk to a disk group in Veritas Volume Manager?
Ans:To add the physical disk c0t0d0 in the disk group homedg calling it disk90 in Veritas Volume Manager:
# vxdg -g homedg adddisk disk90=c0t0d0
How to remove a disk from a disk group in Veritas Volume Manager?
Ans:To remove a disk, disk90, from a disk group, homedg, in Veritas Volume Manager:
# vxdg -g homedg rmdisk disk90
How to clear an import in Veritas Volume Manager after a crash?
Ans:# vxdisk clearimport c0t0d0s0
How to list all disks and display their status in VxVM?
Ans:# vxdisk list
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 c0t0d1
# vxdisksetup -i c0t0d1
Note: 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?
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 disable/deport a disk group?
Ans:# vxdg deport <disk group>
How to rename a disk group during import operation?
Ans:# vxdg –t –n <new disk group> import <disk group>
How to rename a disk group during deport operation?
Ans:# vxdg –n <new disk group> deport <disk group>
How to clear locks on disk group during import?
Ans:# vxdg –C import <disk group>
How to forcible import the disk group?
Ans:# vxdg –f import <disk group>
How to move disk group object from one DG to another?
Ans:# vxdg –o expand move <source DG> <target DG> <DG object>
# vxdg –o expand move datadg newdatadg disk01
It will move the entire associated object with disk02 from datadg to newdatadg.
How to split a disk group to form a new disk group?
Ans: # vxdg –o expand split <old DG> <new DG> disk01 disk02
It will create a new DG with two specified disks.
How to join two DGs into one?
Ans:# vxdg join <source DG> <target DG>
How to destroy a disk group?
Ans:# vxdg destroy <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.
# 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 10
Note: 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,10000
If 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?
Ans:To rebuild the partition table after recovering from a root disk failure after re-mirroring the disk in Veritas Volume Manager:
# vxmksdpart -g rootdg diskpart 1 0x03 0x01
How to attach a plex to a volume in Veritas Volume Manager?
Ans:# vxplex att <volume_name> <plex-name>
How to display all the available information in Veritas Volume Manager?
Ans:# vxprint –ht
How to display all the information about plexes in Veritas Volume Manager?
Ans:# vxprint -l <plex-name>
# vxprint –lp
How to display all the information about subdisks in Veritas Volume Manager?
Ans:# vxprint -l <diskname>
# vxprint –st
How to display all the information about volumes in Veritas Volume Manager?
Ans:# vxprint -l volumename
# vxprint -vl
# vxprint –vt
How to list all the volumes on a boot disk Veritas Volume Manager?
Ans:# vxprint -t -v -e ‘aslist.aslist.sd_disk=”boot-disk-name”‘
How to bring a volume back online in background mode in Veritas Volume Manager?
Ans:# vxrecover -b volume
How to recover a volume in Veritas Volume Manager?
Ans:# vxrecover -s <volume-name>
How to recover all volumes in Veritas Volume Manager?
Ans:To start recovery of all volumes in Veritas Volume Manager:
# vxrecover –s
How to add a log disk to a volume in Veritas Volume Manager?
Ans:# vxsd aslog <disk-name> <volume-name>
How to join subdisks in Veritas Volume Manager?
Ans:To join subdisk-88 and subdisk-77 to create the new bigger subdisk-99:
# vxsd join subdisk-88 subdisk-77 subdisk-99
How to move the contents of a subdisk to another in Veritas Volume Manager?
Ans:To move the contents of subdisk-90 to subdisk-80 in Veritas Volume Manager:
# vxsd mv subdisk-90 subdisk-80
How to report disk statistics in Veritas Volume Manager?
Ans:# vxstat –g diskgroup –d
How to trace all the I/O on the selected volume in Veritas Volume Manager?
Ans:# vxtrace <volume-name>
Veritas Volume Manager GUI
How to put a volume in maintenance mode in Veritas Volume Manager?
Ans:# vxvol maint <volume_name>
How to stop a volume in a disk group in Veritas Volume Manager?
Ans:# vxvol -g <disk-group> stop <volume-name>
How to check which tasks is running in Veritas Volume Manager?
Ans:# vxtask list
# vxtask monitor
How to change the naming scheme?
Ans:# vxddladm set namingscheme=<osn/ebn> <persistence=yes/no>
How to get the list of all enclosure?
Ans:# vxdmpadm listenclosure all
How to check how many disks are in a particular enclosure?
Ans# vxdmpadm getdmpnode enclosure=<enclosure name>
How to get the path of a particular disk or how to check the enclosure of a particular device?
Ans# vxdmpadm getsubpaths dmpnodename=<device name (c1t2d0)>
# vxdisk list <device name (c1t2d0)>
How to restart VxVM configuration Daemon?
Ans# vxconfigd -k
How to find the actual disk device name while disks are showing in enclosure based naming scheme?
Note: When disks are showing in enclosure based scheme, is shows disks name as EMC0_0, EMC0_1 rather than c0t0d0
Ans# vxdisk list –e <enc disk name (ENC0_1)>
How to start failed VxVM object, which got failed due to changed from OS based naming scheme to enclosure based naming.
Ans(1)First deport the disk group
(2)Run below given command
(3)Now import the disk group.
How to reserve a disk for special purpose or vice versa? (Reserve disk can’t use for normal volume operation)
Ans:# vxedit –g <Disk Group> set reserve=on diskname
# vxedit –g <Disk Group> set reserve=off diskname
How do you determine by how much a Veritas Volume can be expanded?
Ans: # vxassist –g <DG> maxgrow <volume>
How do you grow a Veritas VXVM volume?
Ans: # vxresize –g <DG> <volume> +5g
How many partitions are created in a disk when we initialize the disk under VxVM?
Ans: 2 partitions
Private region created on slice 3
Public region created on slice4
What is the length of Private Region?
Ans:VxVM 5.0 =32Mb
VxVM 4.0 = 1 Mb
How do you determine Volume Status in Veritas VxVM?
Ans: # vxprint -htv
Why would you deport a diskgroup in VxVM?
Ans:Normally we deport a disk group when we want to import that disk group on
# vxdg deport <DG>
Interactive front end to the vxdisk program in VxVM?
How to display free space on the disks in Veritas volume Manager?
Ans:# vxdg free
How to find how much a volume can be grown by in Veritas Volume Manager?
Ans:# vxassist maxgrow <volume-name>
How to find the largest raid5 partition you can have in Veritas Volume Manager?
Ans:# vxassist maxsize layout=raid5
How to find the largest stripe you can have in VxVM?
Ans:# vxassist maxsize layout=stripe
How to move a volume to another disk except a particular one in Veritas Volume Manager?
Ans:To move a volume vg01 to any other disk except disk90 in Veritas Volume Manager:
# vxassist move vg01 !disk90
How to set a preferred plex to read from in Veritas Volume Manager?
Ans:# vxvol rdpol prefer <volume-name> <plex-name>
How to set a round robin read policy on the volume in Veritas Volume Manager?
Ans:# vxvol rdpol round volume_name
How to verify and enable largefile support on a vxfs filesystem?
Ans:To verify if largefile support is enabled on a VXFS filesystem:
# fsadm -F vxfs /dir_name
If you need to enable largefile support:
# fsadm -F vxfs -o largefiles /dir_name
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.
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 disk90
Below 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> 100m
Example 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 grow the size of a volume in Veritas Volume Manager?
Ans:Examples to grow the size of the volume vg01 to 2000 512byte sectors:
# vxassist growto vg01 2000
# vxassist growby vg01 2000
How to mirror a volume on any free disk in Veritas Volume Manager?
Ans:To mirror a volume vg01 on any free disk in Veritas Volume Manager:
# vxassist mirror vg01
How to mirror volumes in a disk group in Veritas Volume Manager?
Ans:Example to mirror volume vol80 to vol90 in the disk group rootdg:
# vxassist -g rootdg mirror vol80 vol90
How to shrink the size of a volume in Veritas Volume Manager?
Ans:Examples to shrink the volume vg01 by 2000 512byte sectors:
# vxassist shrinkto vg01 2000
# vxassist shrinkby vg01 2000
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 mode
Or 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?
To verify the vxconfigd daemon in Veritas Volume Manager:
# vxdctl mode
To enable the vxconfigd daemon:
# vxdctl enable
To disable the vxconfigd daemon:
# vxdctl disable
# vxdmpadm setattr path c3t10d0s2 pathtype=primary
# vxdmpadm setattr path c4t10d0s2 pathtype=secondary
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.
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.
3) Create the file system on this slice
# mkfs –F ufs /dev/rdsk/c0t0d0s0
4) Mount the root slice on /a
# mount /dev/dsk/c0t0d0s0 /a
5) Now restore the / file system from backup.
6) Now run the installboot command to install bootblk.
# cd /usr/platform/`uname –i`/lib/fs/ufs
# installboot bootblk /dev/rdsk/c0t0d0s0
# installboot /usr/platform/`uname –i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
7) Now restore /usr file system if it is there.
8) Create /etc/vx/reconfig.d/state.d/install-db file to prevent the configuration daemon from starting.
# touch /a/etc/vx/reconfig.d/state.d/install-db
9) Now comment 2 lines in /etc/system file as given below
# cp /a/etc/system /a/etc/system.orig
# vi /a/etc/system
* set vxio:vol_rootdev_is_volume=1
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:
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.
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
5) Now reboot the system to make the changes.