0% found this document useful (0 votes)
60 views

Administrative Guide: Veritas Volume Manager

The document provides instructions for performing various operations with Veritas Volume Manager including initializing disks and disk groups, creating and modifying volumes, displaying configuration information, removing volumes and disks, and troubleshooting volumes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Administrative Guide: Veritas Volume Manager

The document provides instructions for performing various operations with Veritas Volume Manager including initializing disks and disk groups, creating and modifying volumes, displaying configuration information, removing volumes and disks, and troubleshooting volumes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

VERITAS VOLUME MANAGER

1
Volume

LAB EXERCISE

F O R I N T E R N A L C I R C U L AT I O N O N LY

Administrative Guide
User for Lab session:

1 User login: admin


Password: welcome

2 User login: techm


Password: test123

Initializing disks and disk groups


cfgadm al scan for disk attached / LUNS

/etc/vx/bin/vxdisksetup -i c2t5d0
/etc/vx/bin/vxdisksetup -i c2t8d0

Initializes the physical devices c2t5d0 c2t8d0 as VM disks

vxdg init mydg disk10=c2t5d0 disk20=c2t8d0 cds=off


creates a VM disk group containing the VM disks c2t5d0 c2t8d0

Creating Volumes
vxassist g mydg make martin 100m
makes a volume called martin in the diskgroup mydg

vxassist g mydg make martin 100m disk10


makes a volume called martin using disk10

vxassist g mydg make martin 100m layout=stripe disk10 disk20


creates a 100mb striped volume called martin using disks10 and disk20

vxassist mirror martin disk10 disk20


uses disk10 and disk20 ro make a mirror on volume called martin

vxassist g mydg make martin 50m layout=mirror


makes a 50Mb mirror using any 2 disks

vxassist g mydg make martin 50m layout=mirror disk10 disk20


makes a 50mb mirror using disk10 and disk20

vxassist g mydg make martin 50m layout=mirror,stripe disk10 disk20 disk1 disk2
makes a 50Mb stripe using disk10 and disk20 mirrored across disk1 and disk2

vxassist g mydg make martin 50m layout=mirror,stripe,log disk10 disk20 disk1 disk2
makes a 50Mb stripe using disk10 and disk20 mirrored across disk1 and disk2 and uses a
log subdisk

vxassist g mydg make martin 100m layout=raid5


makes a 100m raid5 volume

2
Displaying VXVM Configuration
vxdg list
lists all diskgroups

vxdisk list
lists all disks under VM control and which group their in

vxdisk list disk10


lists the properties of disk10

vxprint -vt
vxprint -l volume_name
vxprint -vl

display's info about the volumes

vxprint -lp
vxprint -l plex_name
displays info about plexes

vxprint -st
vxprint -l disk##-##
displays info about subdisks

ssaadm display -p c#
show disk iops over 10 seconds...

vxtrace vol
traces all i/o on a volume..

vxstat -d
to report disk stats

vxdg g mydg free


displays the free space on the disks

to list all volumes on your primary boot disk enter


vxprint -t -v -e 'aslist.aslist.sd_disk="boot_disk_name"'

vxassist maxgrow vol


tells you how much you can grow a volume by

Removing Volumes/Disks
vxdisk rm c#t#d#s2
to remove a disk so it's out of vm control

vxedit -rf rm martin


removes a volume called martin and plex(es) and subdisks though

To remove a volume (Version 3.X ONLY)


vxassist -g remove volume

To destroy an imported disk group (Version 3.X ONLY)


vxdg destroy

3
Modifying Volumes
vxmirror rootdisk disk10
mirrors all the volumes on the rootdisk to disk10

vxmirror -g datadg disk10 disk2


mirrors all the volumes in datadg on disk disk10 to disk disk2

vxassist -g rootdg mirror vol01 disk2


mirrors vol01 (in rootdg) to disk2

vxassist mirror martin

will mirror the volume martin

to make a mirror manually try

/usr/sbin/vxmake -g rootdg sd disk2-01 dm_name=disk2 dm_offset=0 len=81920


to create a subdisk on disk2 calling the subdisk disk2-01 the len 81920 is
81920sectors x 512bytes =40M

vxmake plex martin-02 sd=disk2-01


creates a plex called martin-02 using subdisk disk2-01

vxplex att martin martin-02


attaches the plex martin-02 to volume martin

Growing/Shrinking Volumes
this shows how you how much you can grow a volume by..
vxassist maxgrow vol01
Volume vol01 can be extended by 18245632 to 18450432 (9009Mb)

vxassist growto martin 2000


grows a volume to 2000 512byte sectors

vxassist growby martin 2000


increases the volume martin by 2000 512byte sectors

vxassist shrinkto vol_name 1000


will shrink a volume by 1000 sectors,
make sure you don't shrink a volume below the current
size of the filesystem

vxassist shrinkby vol_name 1000


shrinks a volume by 1000 sectors

vxvol set len=100000 vol_name


will change the length to 100000 sectors

4
it cannot increase the volume unless spce is available in the
plexes (use vxassist)

vxsd -s SIZE split orignal_sd newdisk newdisk


this will split an existing subdisk in 2 of the specified SIZE

vxsd join sd1 sd2 new_sd


joins subdisk1 and subdisk1 to create a new subdisk

Starting/Stopping/Fixing Volumes
ssaadm -t 1|2|3 stop|start controller #
so start/stop disk trays...

vxrecover -s vol_name
will start a volume

vxrecover -s
will start all volumes

vxvol maint vol_name


puts a volume in to maintenance mode

vxmend off plex_name


to offline a plex

vxplex att vol_name plex_name


attches and starts the plex in a volume

vxmend on plex_name
to start plex in volume

if the volume won't start up try


vxinfo volume_name

vxedit set user=martin group=techies mode=0666 volume


sets the owner as martin the group as techies and the mode to rw-rw-rw
on a volume

vxvol rdpol round volume


sets a round robin read policy on a volume

vxvol rdpol prefer vol_name plex_anme


sets a prefered plex to read from.

vxedit set comment="message" disk1-01


sets the comment field to testing

vxedit set putil01="go away" vol01


sets the putil01 to "go away"

vxrecover -b vol
well bring stale plexes back online, -b indcates background job

vxassist move volume !disk10


move the voume to a disk other than disk10

5
vxmend fix clean plex_name
sets the plex to a clean state so you can start vol and access data

vxsd aslog vol01-01 disk02-01


adds a log disk (disk02-01) to the volume vol01-01

vxassist addlog volume_name


creates a log disk for a raid5 volume.

there are dome variables you can set for debugging

S_DEBUG - prints info when running mode sense command


P_DEDUG - prints info for each ext library function called
I_DEBUG prints progress during get status function
O_DEBUG prints when files are opened

Miscellaneous Commands
vxsd mv disk2-01 disk10-01
moves the contents of subdisk disk2-01 to disk10-01
then moves subdisk disk10-01 into the plex where subdisk disk2-01
once lived, leaving disk2-01 to your mercy :)

to make a subdisk

vxmake sd disk2-02 disk2,0,8000


this would create a subdisk called disk2-02 at the start of disk2
and would be 8000blocks (4000k) long.
if you wanted to create another subdisk on this disk the offset would be
8000 as this is where the next free space would be onthe disk so...
vxmake sd disk2-02 disk2,8000,8000 would create another 8000block
subdisk.

vxdiskadd c#t#d#
to add bring a new disk under vm control

or you can try...


vxdisksetup -i c#t#d#

vxvol -g dg volname stop


this stops a volume

vxprint -ht volume


to display info a stripe looks like this..
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v martin fsgen ENABLED ACTIVE 204800 SELECT martin-01


pl martin-01 martin ENABLED ACTIVE 205776 STRIPE 4/128 RW
sd disk04-01 martin-01 disk04 0 51408 0/0 c1t1d2 ENA
sd disk05-01 martin-01 disk05 0 51408 1/0 c1t2d0 ENA
sd disk02-01 martin-01 disk02 0 51408 2/0 c1t3d0 ENA

6
sd disk03-01 martin-01 disk03 0 51408 3/0 c1t4d0 ENA

a mirror like this...

vxprint -ht martin


Disk group: rootdg

V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX


PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v martin fsgen ENABLED ACTIVE 204800 SELECT martin-01


pl martin-01 martin ENABLED ACTIVE 205776 STRIPE 4/128 RW
sd disk04-01 martin-01 disk04 0 51408 0/0 c1t1d2 ENA
sd disk05-01 martin-01 disk05 0 51408 1/0 c1t2d0 ENA
sd disk02-01 martin-01 disk02 0 51408 2/0 c1t3d0 ENA
sd disk03-01 martin-01 disk03 0 51408 3/0 c1t4d0 ENA
pl martin-02 martin ENABLED TEMPRMSD 205632 CONCAT - WO
sd disk10-01 martin-02 disk10 0 205632 0 c1t1d3 ENA

a raid5 like this...

unix# vxprint -ht martin


Disk group: rootdg

V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX


PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE

v martin raid5 ENABLED ACTIVE 40992 RAID -


pl martin-01 martin ENABLED ACTIVE 42336 RAID 4/32 RW
sd disk04-01 martin-01 disk04 0 14112 0/0 c1t1d2 ENA
sd disk06-01 martin-01 disk06 0 14112 1/0 c1t1d4s2 ENA
sd disk05-01 martin-01 disk05 0 14112 2/0 c1t2d0 ENA
sd disk02-01 martin-01 disk02 0 14112 3/0 c1t3d0 ENA
pl martin-02 martin ENABLED LOG 2016 CONCAT - RW
sd disk03-01 martin-02 disk03 0 2016 0 c1t4d0 ENA

vxplex -o rm dis plex deletes a plex, or volume if used


with -f

vxplex det plex-0#


detach's one half of the plex..

if a volume is unstartable try

try to start it by setting one of the plexes in a mirror to CLEAN using


vxmend mirror plex_name

if this doesn't get the plex back into a kernel state of enabled
try

vxplex att vol_name plex_name

7
to dissociate a subdisk try
vxsd dis disk##-##

remove a subdisk by
vxedit rm disk##-##

this command show's you what the lagest stripe you


can currently have ?
vxassist maxsize layout=stripe
Maximum volume size: 17833984 (8708Mb)s

same again for raid5


vxassist maxsize layout=raid5
Maximum volume size: 12300288 (6006Mb)

Converting Mirror Layouts (Version 3.x ONLY)

To convert a mirrored-stripe to a striped-mirror


vxassist -g convert layout=stripe-mirror

To convert a striped-mirror to a mirrored-stripe


vxassist -g convert layout=mirror-stripe

To convert a striped mirror to a RAID 5.


vxassist -g relayout layout=raid5

To change the number of columns, in a RAID 5, to 5


vxassist -g relayout ncol=5

Managing active VXVM tasks (Version 3.x ONLY)


To list current tasks
vxtask list

To continue to display current tasks


vxtask monitor

To pause task 256


vxtask pause 256

To resume task 256


vxtask resume 256

To abort task 256


vxtask abort 256

8
Other new commands for Version 3.x ONLY

To change the stripe unit size to 25K


vxassist -g relayout stwidth=25k

To continue a discontinued relayout operation (process must be stopped)


vxrelayout -g start

To reverse a discontinured relayout operstion (process must be stopped)


vxrelayout -g reverse

To get the status of a layout operation


vxrelayout -g status

To upgrade an older disk to support v3.x relayout operations


vxdg -t 60 upgrade

9
Basic VxVM Commands
disk operations
disk group operations
volume operations

disk operations
action command line
Initialize a disk vxdisksetup -i device
List disks owned by local and
vxdisk -o alldgs list
remote hosts
List disk header vxdisk list diskname|device
/etc/vx/bin/vxevac -g diskgroup from_disk to_disk1
Evacuate a disk to_disk2 ...
Rename a disk vxedit -g diskgroup rename oldname newname
Set spare, no hot relocation, or vxedit -g diskgroup set {spare|nohotuse|reserve}=on|
reserved space on a disk off diskname

Unrelocate a disk /etc/vx/bin/vxunreloc -g diskgroup original_diskname

disk group operations


action command line
Create a disk group vxdg init diskgroup diskname=device
Add a disk to disk group vxdg -g diskgroup adddisk diskname=device
Remove a disk from disk group vxdg -g diskgroup rmdisk diskname
Deport, import or destroy a disk
vxdg {deport|import|destroy} diskgroup
group
List disk groups vxdg list [diskgroup]
Show free/spare space pool vxdg -g diskgroup {free|spare}
Upgrade disk group version vxdg [-T version] upgrade diskgroup
Rewrite disk headers, vxdg flush diskgroup targetdg object...
configuration copies, and kernel or
log copies in a disk group vxdctl enable (for all disk groups )

Move an object between disk


vxdg move sourcedg targetdg object...
groups
Split objects between disk groups vxdg split sourcedg targetdg object...
Join disk groups vxdg join sourcedg targetdg

10
List objects affected by a disk
vxdg listmove sourcedg targetdg object...
group move operation

volume operations
action command line
vxassist -g diskgroup make vol_name size{m|g|s}
Create a volume layout=format diskname
Remove a volume vxedit -g diskgroup -rf rm vol_name
(unmount and stop the volume or
first) vxassist -g diskgroup remove volume vol_name

Start a volume vxvol -g diskgroup start vol_name


Stop a volume vxvol -g diskgroup stop vol_name
vxprint -g diskgroup -vt vol_name
Display a volume
vxprint -g diskgroup -l vol_name
vxvol -g diskgroup rdpol round vol_name

vxvol -g diskgroup rdpol prefer vol_name


Change volume read policy preferred_plex_name
vxvol -g diskgroup rdpol select vol_name
Mirror an existing plex vxassist -g diskgroup mirror vol_name
vxassist -g diskgroup -b snapstart vol_name
Create a snapshot volume
vxassist -g diskgroup snapshot vol_name new_volume
Abort a snapshot vxassist -g diskgroup snapabort orig_vol_name
Reassociate a snapshot vxassist -g diskgroup snapback snapshot_vol
Dissociate a snapshot vxassist -g diskgroup snapclear snapshot_vol
Print snapshot information vxassist -g diskgroup snapprint vol_name
vxassist -g diskgroup relayout vol_name
Relayout a volume layout=new_layout [attributes...]
Convert to or from a layered vxassist -g diskgroup convert vol_name
layout layout=new_layout [attributes...]

Add a log to a volume vxassist -g diskgroup addlog vol_name

11
12

You might also like