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>

Bookmark the permalink.

Comments are closed.