VXVM Cheat Sheet
VXVM Cheat Sheet
Prashant Sreedharan
Overview:
--------
The purpose of this paper is to
quickly get you up to speed in Veritas,
and to act as a quick referance. All new
users to Veritas are HIGHLY encouraged to
first read the Veritas users guides enlucded
with Veritas, and found on docs.sun.com
Remember!: Almost all commands can use several
diffrent options that are similar
across all commands. The most used
of these is "-g <diskgroup>" which
specifies which Disk Group the command
will be executed on. For instance,
vxinfo will only display volume information
for volumes in the rootdg, to see
volumes in the datadg, for instance, use:
Ex: "vxinfo -g datadg"
-----------------------------------------------
DISPLAY and MONITORING
-----------------------------------------------
vxdisk list
List all disks used by Veritas (VX).
vxdisk list <diskname>
Display detailed information about a
single disk, including mutlipathing
information, size, type, Vx version,
and more.
vxprint
Display report style information about
the current status of all Vx componants,
including disks, subdisks, plexes, and
volumes.
vxprint <componant>
Display report style information about
the current status of ONLY the componant
you request. So for instance,
"vxprint vol01" shows information about
all subcomponants of vol01. This works
for plexes, disk groups, etc.
vxprint -hrt
Display detailed information about all
Vx componanats, including stwdith,
ncolumns, offsets, layout type, read-
policy, and more. This is best for
a true picture of your configuration.
vxdg list
Display listing and state information
of all Disk Groups.
vxdg list <diskgroup name>
Display detailed information about
a diskgroup, including flags, version,
logs status, etc.
vxinfo
Display volume status and volume type.
By default, only displays "rootdg",
to display a diffrent Disk Group,
use "vxinfo -g <dgname>".
vxassist maxgrow <volume>
This command will output the maximum size
the volume specified can increased by,
specified in sectors.
--------------------------------------------------
DISK TASKS and COMMANDS
--------------------------------------------------
vxdiskadd <devname>
Adds a disk to Vx by Initializing and Encapsolating
it. Specified by its device name (ex: c0t1d0s2).
NOTE: You'll need to reboot to finalize the
disk addition!
This command, can also be used to add a disk to
a specified disk group. Just follow the prompts.
No reboots needed for changing DG's.
vxedit rename <oldname> <newname>
Rename a Vx disk. Ex: "vxedit rename disk01 disk05"
vxedit set reserve=on <diskname>
Sets the "reserve" flag to a Vx disk. This
is used to keep specific disks from being
accidentally, or generally used.
vxdisk offline <diskname>
Used to "offline" a disk. The disk should
be removed from its diskgroup before being
offlined.
vxdisk rm <devname>
Used to remove disks from Vx control completely.
Ex: "vxdisk rm c0t1d0s2" Make sure to
removed the disk from its diskgroup, and offline
the disk before removing it.
vxedit set spare=on <diskname>
Sets the "spare" flag to a Vx disk. This is used
to make the specified disk a hot spare, which
is then added to the "hot spare pool".
vxedit set spare=off <diskname>
Same as above but removes the disk from the
"hot spare pool".
----------------------------------------------------
DISK GROUPS and COMMANDS
----------------------------------------------------
vxdg init <diskgroup> <diskname>=<devname>
Creates a new disk group, and assigns the naming
scheme to the first disk added to the group.
ex: "vxdg init newdg newdg01=c0t10d0s2".
NOTE: This is kinda tricky because the disk that
you're adding can't be a member of ANY DG, but
must be initialized. It's easier to use
"vxdiskadd", and add the disk to a newdg by
specifying a new DG name for the DG field.
vxdg deport <diskgroup>
Disabled a diskgroup, but doesn't remove it. Often
used as an organized pool of disk to realocate, and
to moved DG's from one system to another.
vxdg import <diskgroup>
Reverse of above. Enables local access to the specified
disk group.
vxdg -n <newdgname> <olddgname>
Change a Disk Groups name.
vxdg list <dgname>
Use this to check the version numbers of Disk
Groups. Shows other details about the DG too.
vxdg destroy <dgname>
Removes the specified DG, and frees all its disks
back to general use by Vx.
-= Quick Chart!: Disk Group Version Number Translation
VxVM Introduced Supported
Release Version Versions
------- ------------ ---------
1.2 10 10
1.3 15 15
2.0 20 20
2.2 30 30
2.3 40 40
2.5 50 50
3.0 60 20-60
-----------------------------------------------------------
SUBDISKS and COMMANDS
-----------------------------------------------------------
-------------
Volume Growth Procudure:
1) You can use vxassist to estimate the max size of
a given volume based on the disks you wish to add:
ex: # vxassist -g rootdg maxgrow vol01 disk01 disk02 disk03
2) Next, actually grow the volume (NOT THE FS) via the
command (assuming maxgrow outputed 10639360 as the maxsize):
ex:# vxassist -g rootdg growto vol01 10639360 disk01 disk02 disk03
3) Now VxVM grinds away, monitor with vxtask.
4) Now Grow the Filesystem, for UFS use:
# /usr/lib/fs/ufs/mkfs -F ufs -M /export /dev/vx/rdsk/rootdg/vol01 10639360
for VXFS ufs:
# /usr/lib/fs/vxfs/fsadm -b 10639360 -r /dev/vx/rdsk/rootdg/vol01 /mnt
---------------------------------------------------------------
5) Done!
----------
Changing User/Group of a Raw Volume: (ex:)
vxedit -g xxxdg set group=dba data_vol_123
vxedit -g xxxdg set user=oracle data_vol_123
---------------------------------------------------------------