Sunteți pe pagina 1din 8

Veritas Volume Manager Command Line

Examples
Tags:
 Veritas VM

Volume Manager CLI examples:


---------------------------

display disk listings:

# vxdisk list

display volume manager object listings

# vxprint -ht

display free space in a disk group

# vxdg -g <diskgroup> free

list all volume manager tasks currently running on the system

# vxtask list

add a disk to Volume Manager (devicename = cXtXdX) (prompt driven)

# vxdiskadd <devicename>

designate/remove a disk as a hot-relocation spare

# vxedit set spare=on <diskname>

# vxedit set spare=off <diskname>

rename a disk
# vxedit rename <old_diskname> <new_diskname>

reserve/unreserve a disk (space won't be allocated unless specifically


mentioned in vxassist)

# vxedit set reserve=on <diskname>

# vxedit set reserve=off <diskname>

take a disk offline (first remove the disk from its disk group)
(devicename=cXtXdXs2)

#vxdisk offline <devicename>

remove a disk

(first, stop any applications associated with the volume,


unmount the volume, stop the volume,
if you need the data on the disk, move the volumes to another disk or
back up volume)

--removing the disk from its disk group:

# vxdg -g <diskgroup> rmdisk <diskname>

--remove the disk from volume manager control (devicename=cXtXdXs2)

# vxdisk rm <devicename>

display multipath information

# vxdisk list <diskname>

create a disk group

(see 'add a disk to volume manager - if the group does not exist, you
will be prompted)

upgrade a disk group

--list disk group version

# vxdg list <diskgroup>


--upgrade disk group to highest version currently running

# vxdg upgrade <diskgroup>

destroy a disk group

# vxdg destroy <diskgroup>

display disk group information

# vxdg list

# vxdg list <diskgroup>

move a disk group

(stop any applications associated with all volumes in the disk group,
unmount and stop all volumes in the disk group:

--deport (disable local access) the disk group to be moved on first


system

# vxdg deport <diskgroup>

--import (enable local access) the disk group and its disks from the
second system

# vxdg import <diskgroup>

--start all volumes in the disk group on the second system

# vxrecover -g <diskgroup> -sb

or # vxvol -g <diskgroup> startall

estimating maximum volume size (any_valid_type = raid5, stripe, mirror)

# vxassist -g <diskgroup> maxsize layout=<any_valid_type>

create a concatenated volume (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length> <diskname>


<diskname>
create a striped volume (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length> layout=stripe


<diskname> \
<diskname>

create a raid5 volume (without logging) (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length>


layout=raid5,nolog <diskname> \
<diskname> <diskname> <diskname>

create a raid5 volume (with logging) (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length> layout=raid5,log


<diskname> \
<diskname> <diskname> <diskname>

create a mirrored volume (without DRL) (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length>


layout=mirror,nolog <diskname> \
<diskname>

create a mirrored volume (with DRL) (length examples = 15g, 15m)

# vxassist -g <diskgroup> make <volumename> <length> layout=mirror,log


<diskname> \
<diskname>

mirror an existing volume

# vxassist mirror <volumename> <diskname_of_disk_to_be_mirrored>

mirror all volumes within a disk group

# vxmirror -g <diskgroup> -a

mirror the root (boot) disk


EEPROM variable "use-nvramrc?" must be set to true

# vxrootmir -v <medianame>

remove a mirror (use 'vxprint -g <diskgroup> -ht' to get plexname)

# vxplex -o rm dis <plexname>

add a log to an existing volume

# vxassist addlog <volumename> <diskname>

remove a log from an existing volume

# vxassist remove log <volumename>

create a raid 0+1 volume (without DRL)

# vxassist -g <diskgroup> make <volumename> <length> layout=mirror-


stripe,nolog \
nmirror=# nstripe=# <diskname> <diskname> <diskname>

create a raid 1+0 volume (without DRL)

# vxassist -g <diskgroup> make <volumename> <length> layout=stripe-


mirror,nolog \
nmirror=# nstripe=# <diskname> <diskname> <diskname>

resize a volume

# vxassist -g <diskgroup> growto <volumename> <length>

# vxassist -g <diskgroup> growby <volumename> <length>

# vxassist -g <diskgroup> shrinkto <volumename> <length>

# vxassist -g <diskgroup> shrinkby <volumename> <length>

estimate how much a volume can grow

# vxassist -g <diskgroup> maxgrow <volumename>


remove a volume

(stop all applications associated with the volume,


unmount volume (remove /etc/vfstab entry))

--stop volume

# vxvol stop <volumename>

-- remove volume (for raid 1+0, use 'rf-rm')

# vxedit -r rm <volumename>

or # vxassist remove volume <volumename>

change the volume read policy

# vxvol rdpol <policy> <volumename>

# vxvol rdpol prefer <volumename> <preferred_plex_name>

change volume attributes

# vxedit set <field>=<value> <volumename>

resize a filesystem (ufs cannot be shrunk, only grown)

# vxresize -g <diskgroup> <volumename> + <size>


# vxresize -g <diskgroup> <volumename> - <size>

join subdisks (must be in the order of offset on disks)

# vxsd join <subdisk> <subdisk> <subdisk>

»
 Add new comment
 64735 reads

create a striped volume (length examples = 15g, 15m)


Submitted by Anonymous (not verified) on Wed, 07/16/2008 - 04:41.

The syntax is incorrect for:


create a striped volume (length examples = 15g, 15m)
# vxassist -g make layout=stripe \

It should be something like this:

# vxassist -g testdg make testdgvol1 285503488 layout=stripe alloc=disk1,disk2,disk3,disk4

This brings the credibility of the rest of this document into question; You have not specified
which version of Veritas this applied to ;P

»
 reply

Correct for older versions


Submitted by admin on Wed, 07/16/2008 - 22:02.

It's been a while since I've used VXVM, but I can assure you these examples are correct. I cut
and pasted them as I ran them. I believe the last version I used was 4.0, and I believe these
examples were run on 3.x. Although, I can't claim that these commands are correct for newer
versions.

The same syntax is used in these examples as well:

http://www.adminschoice.com/docs/vxassist.htm
http://www.cuddletech.com/veritas/layeredvols/x74.html

What version does your example apply to? I'm all for keeping this info relevant and updated, so
feel free to post more details about the newer versions.

Thanks.

»
 reply

vxassist mirror <volumename> ...


Submitted by Afsin Toparlak (not verified) on Mon, 09/15/2008 - 17:27.

do you have more examples about this?

I want to add new disks into a group and mirror volumes from old to new disks. I want to be able
later to remove old disks and stop mirroring.

so I want to realisize a better move from one SAN to a new one.

Is it so possible?
What do think about volume movement? Is it secure?

thnx

»
 reply

Lifesaver
Submitted by Dave (not verified) on Thu, 11/06/2008 - 16:01.

Just want to you know that I refer to this page all the time and it's the only way I can ever
remember how to do all this stuff. Thanks!

»
 reply

Display Volume Manager Version


Submitted by WF (not verified) on Mon, 09/27/2010 - 05:04.

I thought would be useful to know how to do this on Solaris:


display Volume Manager version:
# pkginfo -l VRTSvxvm | grep VERSION | awk '{print $2}' | awk -F, '{print $1}'

S-ar putea să vă placă și