Professional Documents
Culture Documents
VXVM Veritas Volume Manager-Commands
VXVM Veritas Volume Manager-Commands
/etc/vx/volboot file contains the host ID that was on the system when we installed VxVM.
#vxdg bootdg
#vxdg defaultdg
#vxdctl enable
Page 1 of 57
Display summary of all disks
#vxdisk –s list
Example
Page 2 of 57
Disk Configuration Stages
Example
Page 3 of 57
To create volume of specific size on specific disks
Example
#vxassist –g datadg make datavol 10g layout=stripe ncol=3 stripeunit=25k datadg01 datadg02 datadg03
Example
Evacuate Data from one disk to another disk except a particular disk.
Example
Page 4 of 57
Remove a Disk from VxVM Control and Uninitialize it
Step 1
Example
Step 2
#vxdiskunsetup device_tag
Example
#vxdiskunsetup c0t0d0
Rename a Disk
Example
Page 5 of 57
How to remove a disk from VxVM
#vxdisk rm disk_access_name
#/usr/lib/vxvm/bin/vxdiskunsetup disk_access_name
Example
#/usr/lib/vxvm/bin/vxdiskunsetup ct1t1d2
Example
If you want to remove volumes from a disk mydg02 and move it on to any other disk, use the command.
Page 6 of 57
Deport a Disk Group
Example
Example
Example
Example
Page 7 of 57
Import a Disk Group and Rename
Example
Example
(Note:Destroying a diskgroup places all its disks in a free disk pool in an uninitialized state)
Example
Example
Page 8 of 57
Create Simple Stripped Mirrored Volume (Non-Layered)
Example
Example
Another Example
Example
Example
Page 9 of 57
Determine how much a volume can expand
Example
Page 10 of 57
How to Remove a Volume
Page 11 of 57
How to Mirror a Volume
Example
Example
In this example remove the plex that contains the subdisk, that is part of a disk. State the disk name with an
exclamation point before disk name.
Another Example
Example
Page 12 of 57
How to Add DRL (Dirty Region Log) in RAID 5 Volume
Example
1. Round Robin
2. Preferred
3. Selected (default)
Example
Page 13 of 57
How to create volume on a particular disk
Example
How to rename a disk so that it is not used for allocating space unless specifically stated on command
line?
Example
Page 14 of 57
How to Create a new mirrored volume using selected disks
In the below example we have to create a new volume (mirrored) using selected disks.
Example
#vxdisksetup –i c0t1d0
#vxdisksetup –i c0t2d0
Example
Example
Page 15 of 57
Example
3a. Create a Mirrored Volume Using these 2 Disks with ordered allocation.
Example
Page 16 of 57
Resizing Volumes using vxresize command and vxassist command
Examples
Page 17 of 57
Determine how much free space is in a disk group
Example
Example
#vxdisk –p list
and
and
and
#vxdisk –e list
Page 18 of 57
How to resize a VxFS file System
Example
Example
Example
#df –k /datavol
Page 19 of 57
How to Display File system Type
Example
#fstype –v /dev/vx/dsk/datadg/datavol
Example
#mkdir /data
Example
#newfs /dev/vx/rdsk/datadg/datavol
#mkdir /data
Page 20 of 57
In Linux Environment How to Create VxFS File System
#mkdir /data
Page 21 of 57
How to find what is the server’s default file system
1. /
2. /usr/
3. /var
4. /opt
/opt/VRTSvxfs/bin
/usr/lib/fs/vxfs
/etc/fs/vxfs
Page 22 of 57
In LINUX what file systems cannot use VxFS
1. /
2. /boot
3. /etc
4. /lib
5. /var
6. /usr
1. /sbin
2. /usr/lib/fs/vxfs
#vxupgrade /mnt
Example
#vxupgarde –n 5 /mnt
#vxupgrade –n 6 /mnt
1. Directory Fragmentation
2. Extent Fragmentation (File Fragmentation)
Page 23 of 57
To monitor directory fragmentation
Example
#fsadm –D /mnt1
Example
#fsadm –E /home
#fsadm –d –D /mnt1
#fsadm –e –E –s /mnt1
Example
Example
Page 24 of 57
Perform Parallel file system check with intent log on 2 file systems in parallel
Example
Example
Example
Page 25 of 57
How to Create a File System Snapshot
Example
Example
#umount /snapmount
#vxdisksetup –i c1t0d1
2. Assign the disk to a disk group and give it a disk media name.
Page 26 of 57
How to Prevent a disk’s space from being used for hot relocation
Example
If we donot want space for subdisks to be used from disk datadg02 in that group.
To use a disk as a replacement disk for disk that has failed the replacement disk should be in a free disk pool but
CANNOT belong to a disk group.
Example
Page 27 of 57
How to unrelocate a Disk.
Example
When veritas loses contact (e.g if a fibre cable is removed between a server and a storage array) with an active
device, verits will place the device in a failed state. When situations like this arise, vxreattach utility can be used to
reconnect veritas to lost devices.
#vxreattach –c <-This would see if relocation is possible. If it is possible the proceed to next step)
#vxreattach –r datadg01
Example
To find out which disks in a disk group have configuration database use the command.
Page 28 of 57
How many disk types are there?
1. auto
2. cds (suitable for moving from one host to another)
3. sliced (For boot disks, not suitable for moving)
4. none
#vxcdsconvert
#vxdctl enable
#vxdctl mode
#vxdctl disable
#vxdctl stop
#vxconfigd
#vxdctl support
The Host ID that is used by VxVM to establish ownership of physical disks is listed in /etc/vx/volboot.
#vxdctl list
Page 29 of 57
How to Scan Operating System device tree after adding or removing LUNS (Solaris)?
Page 30 of 57
How to make VxVM aware of the new size of a LUN that has been resized?
Example
and
Page 31 of 57
How to Scan for newly added devices previously unknown to VxVM?
Example
Example
Example
Page 32 of 57
How to enable I/O to a controller
Page 33 of 57
Disk Errors
If the volume manager can access the provate region on the disk it marks the disk as FAILING. The plex with the
effected subdisks is set with the IOFAIL condition.
If the volume manger cannot access provate region on the disk it marks the disk as FAILED. The plex with the
effected subdisk is set with the NODEVICE state.
Page 34 of 57
How to replace a failed Drive.
Page 35 of 57
How to deal with intermittent disk failures
Prevent read I/O from accessing the failing disk by changing the volume read policy. For example to prefer to read
from plex vol01 -01instead of plex vol01-02
Remove the disk. To forcibly remove the disk without relocating data
Example
Example
Example
Page 36 of 57
How to change one plex of the volume to CLEAN state, so that other plexes copy data from that plex.
Once data copy is completed bring the entire volume on line and fully operational?
Example
Then do
Example
Page 37 of 57
How To recover a volume with Plex Problem
Example
Since plex vol01-01 is in DISABLED/RECOVER state, its data is better than vol01-02 plex
To recover the volume in this case follow the steps.
Page 38 of 57
How to encapsulate a disk under VxVm Control
Example
#/etc/init.d/vxvm-reconfig access_name
Example
#/etc/init.d/vxvm-reconfig c0t0d0
Page 39 of 57
How to Mirror Root Disk in Solaris
Option 1
To mirror only those file systems on the root disk that are required to boot the system, run the command:-
#/etc/vx/bin/vxrootmir alternate_boot_disk
Example
#/etc/vx/bin/vxrootmir rootdg02
Option 2
To mirror all other unmirrored volumes on the boot disk to an alternate disk
#vxbootsetup
Page 40 of 57
How to Mirror Root Disk in LINUX
To mirror all file systems on the root disk, run the following command
Example
Page 41 of 57
Removing Boot Disk from VxVM Control (Solaris)
Page 42 of 57
Booting from an alternate mirror (Solaris)
To boot the system using an alternate boot disk after failure of the primary boot disk
This variable must be set to “true” to enable the use of alternate boot disk.
Page 43 of 57
Where is currently imported disk group stored?
To remove and recreate the /var/vxvm/tempdb directory we can use the following command.
#vxconfigd –k –x cleartempdir
Page 44 of 57
How to create subdisks?
Note Length=sectors
Example
or
#vxprint –st
Example
Example
To move data off from subdisk mydg03-01 on to mydg12-01 and mydg12-02 subdisks, use the command.
Page 45 of 57
How to Split a subdisk?
Example
To split subdisk mudg03-02 into 2 subdisks mydg03-02 and mydg03-04, use the command
Example
Say we want to join 4 subdisks which are mydg03-02, mydg03-03, mydg03-04 and mydg03-05 into one subdisk
mydg03-02, use the command.
How to create a plex and associate a subdisk with the new plex?
Example
Page 46 of 57
How to associate subdisks to an existing Plex?
Example
Example
Example
Example
Page 47 of 57
Example
and also
Example
#vxprint -lp
Example
#vxprint –pt
Example
Page 48 of 57
How to Create a New Volume by Attaching Plexes?
Example
Example
Example
Example
Page 49 of 57
How to reattach a plex to a volume?
Example
If the vxinfo command shows that the volume is unstartablem set one of the plexes to CLEAN as follows.
Example
Page 50 of 57
Discovering maximum size of a volume
Find out how large a volume can you create within a disk group.
Example
Example
Example
#vxtask monitor
Page 51 of 57
How to abort a task
#vxtask abort
#vxtask list
#vxtask pause
#vxtask resume
Example
Page 52 of 57
How to add mirror to a volume by creating a plex and the attaching it to a volume?
Page 53 of 57
How to mirror all volumes in a disk group
#/etc/vx/bin/vxmirror –g disk_group_name –a
To mirror only those file systems on the root disk that are required to boot the system (Solaris) use.
#/etc/vx/bin/vxmirror att_boot_disk_name
Example
#/etc/vx/bin/vxmirror bootdg02
Example
Example
Page 54 of 57
How to Scan For disk devices previously unknown to the system?
#vxdctl –f enable
#vxddladm list
Page 55 of 57
How to identify the vendor ID and Product ID of disks in an array?
#/etc/vx/diag.d/vxscsiinq /dev/rdsk/device_access_name
Example
#/etc/vx/diag.d/vxscsiinq /dev/rdsk/c1t20d0s2
How to display the relationship between the device paths, disk access names, disk media names
and disk groups on a system?
#vxdisk path
or
How to display multipathing information for a particular device including LUN serial number and
array volume ID?
How to get consolidated information for all DMP nodes in the system?
Page 56 of 57
How to view multipathing information for a particular device?
Example
Example
How to display the DMP node that controls a particular physical path?
#vxdmpadm getdmpnode=disk_access_name
Example
#vxdmpadm getdmpnode=c0t5006016041E03B33d0s2
Page 57 of 57