Sample manual to use Veritas volume manager
Initialize the disks
/etc/vx/bin/vxdisksetup -if sda
/etc/vx/bin/vxdisksetup -if sdb
/etc/vx/bin/vxdisksetup -if sdc
/etc/vx/bin/vxdisksetup -if sdd
/etc/vx/bin/vxdisksetup -if sde
Create disk group vg01
/usr/sbin/vxdg init vg01 vg0101=sda vg0102=sdb vg0103=sdc vg0104=sdd vg0105=sde
Create volume lv01– RAID1 (mirror) (512 MB)
/usr/sbin/vxassist -g vg01 -b make lv01 1048576s layout=nostripe,log nmirror=2
Create volume lv02 – RAID0 (stripe) over 3 disks with strip size 128kB (250 MB)
/usr/sbin/vxassist -g vg01 -b make lv02 512000s
layout=striped stripeunit=128 ncolumn=3
Create volume lv02 – RAID5 over 4 disks with strip size 32kB (4096 MB)
/usr/sbin/vxassist -g vg01 -b make lv03 8388608s
layout=raid5,log stripeunit=32 ncolumn=4
Create volume lv04 – RAID10 over 4 disks with strip size 128kB, strip over 2 disks and mirror over 2 disks (1024 MB)
/usr/sbin/vxassist
-g vg01 -b make lv04 2097152s layout=strippe-mirror,log
nmirror=2 stripeunit=128 ncolumn=2
Create
Veritas filesystem on lv01 with parameters: version 6 layout, 512000
sectors, 256000 blocks of size 1024, log size 1024 blocks (default)
/sbin/mkfs -t vxfs /dev/vx/rdsk/vg01/lv01
Create
Veritas filesystem on lv03 with parameters: version 6 layout, 8388672
sectors, 524292 blocks of size 8192, log size 2048 blocks and
largefiles supported
/sbin/mkfs -t vxfs -o bsize=8192,largefiles /dev/vx/rdsk/vg01/lv03
Reduce
lv03 from 4GB to 3GB (operation is possible to be done on the fly i.e.
on mounted filesystem. You should have enough free diskspace)
/etc/vx/bin/vxresize -f -g vg01 lv03 6291456s
Create a snapshot of lv02.
Prepare for snapshots
/usr/sbin/vxassist -b -g vg01 snapstart lv02
Create snapshot with name SNAP2-lv02
/usr/sbin/vxassist -g vg01 snapshot lv02 SNAP2-lv02
Resync snapshot from original volume
/usr/sbin/vxassist -g vg01 snapback SNAP2-lv02
Resync original volume from snapshot
usr/sbin/vxassist -g vg01 -o resyncfromreplica snapback SNAP2-lv02
Clear snapshot
/usr/sbin/vxassist -g vg01 snapclear SNAP2-lv02
Additing additional mirror to logical volume lv01 (to have 3 mirrors)
/usr/sbin/vxassist -b -g vg01 mirror lv01 layout=nostripe
Remove mirror from logical volume lv01 (to have 2 mirrors)
/usr/sbin/vxplex -g vg01 -o rm dis lv01-04
Set round-robin policy for mirrored volume lv01
/usr/sbin/vxvol -g vg01 rdpol round lv01