Veritas: Creating and Administering Disk Groups (Veritas Volume Manager – VxVM)


You can use the vxdg command to create a new disk group. A disk group must contain at least one disk at the time it is created. You also have the option to create a shared disk group for use in a cluster environment.

Disks must be placed in disk groups before they can be used by VxVM. You can create disk groups to organize your disks into logical sets of disks.

Create Disk Group, Volumes and File systems:

– List all available disk
# vxdisk list

– To list all disk with size
# vxdisk -o size list

– To change view of device name
# vxddladm set namingscheme=osn
# vxddladm set namingscheme=ebn

– Initialize the disk
# vxdisksetup -i sdb

– Uninitialize the disk
# vxdiskunsetup -C sdb

– Initiate or Create a disk group
# vxdg init datadg datadg01=sdb

– Add disk to disk group
# vxdg -g datadg adddisk datadg02=sdc

– Remove disk from disk group
# vxdg -g datadg rmdisk datadg03

– Rename device name in Volume Manager
# vxedit -g datadg rename sdc datadg02

– Destroy disk group
# vxdg destroy datadg

– Destroy multiple disk group in one command
# vxdisk list

DEVICE       TYPE            DISK         GROUP        STATUS
cciss/c0d0   auto:LVM        -            -            online invalid
sde          auto:cdsdisk    dg01disk01   dg01         online thinrclm
sdf          auto:cdsdisk    dg01disk02   dg01         online thinrclm

Referring to above output, now execute
# vxdg destroy dg01
# for z in $(vxdisk list|grep cdsdisk| awk '{print $1}'); do vxdiskunsetup -f $z;done

– To find out the current size of the volume
# vxlist vol

– Check for maximum available size (free size)
# vxassist -g datadg maxsize
# vxassist -g datadg maxsize layout=mirror

– Check how much the volume can be grown
# vxassist -g datadg maxgrow vol01

– Create a volume
# vxassist -g datadg make datavol01 100m

– Create a volume with mirror copy
# vxassist -g datadg make datavol02 100m layout=mirror

– Add mirror copy for a volume
# vxassist -g datadg mirror datavol01 datadg03

– Remove volume from disk group
# vxassist -g datadg remove mirror datavol01

– Resize volume from disk group
# vxresize -g datadg vol01 +200G

– Create a file system
# mkfs -t vxfs /dev/vx/dsk/datadg/datavol01
# mkfs -t vxfs /dev/vx/dsk/datadg/datavol02

– Create mount point
# mkdir /data01
# mkdir /data02

– Mount a file system
# mount -t vxfs /dev/vx/dsk/datadg/datavol01 /data01
# mount -t vxfs /dev/vx/dsk/datadg/datavol02 /data02

Add entry in /etc/fstab to make it persistent after reboot

/dev/vx/dsk/diskgroup/volume_name – When data is written to files, it is actually written to the block device file
/dev/vx/rdsk/diskgroup/volume_name – When fsck is run on the file system, the raw device file is checked

ref: link


This entry was posted in Linux, Storage, UNIX and tagged , , , , , , . Bookmark the permalink.