Few VXVM stuff

VXVM Setup in HP-UX

1. Run vxinstall to initialize at least one disk in rootdg.

2. Then you run vxdiskadm to add other disks

3. Create a /etc/vx/disks.exclude file if you want some disks to be excluded from vxvm

4. The files /etc/vx/cntrls.exclude and /etc/vx/disks.exclude are for the controllers and disks which will be
excluded to be used by vxinstall or vxdiskadm so the disks under that controllers or the sepcified disks
will not be included to any Disk Group. But all the other commmands will work

5. To determine whether the volume daemon is enabled, use the following
command: vxdctl mode

6. To enable the volume daemon, use the following command:
vxdctl enable

7. To start the vxconfigd daemon, use the following command:
vxconfigd

8. Verify that vxiod daemons are running by entering this command:
vxiod

9. If no vxiod daemons are currently running, start some by entering this
command: vxiod set 10
where 10 can be substituted by the desired number of vxiod daemons. It is recommended that at least on
vxiod daemon exist for each CPU in the system.

Initial Setup
Step 1. Place disks under Volume Manager control.
Step 2. Create new disk groups (if you do not want to use rootdg or you want
other disk groups).
Step 3. Create volumes.
Step 4. Put file system(s) in volumes.

VXVM Commands & Tips

To display free space in the system, use the following command:
# vxdg free

To display free space for a disk group, use the following command:
# vxdg -g diskgroup free

To display general information for all subdisks, use the following command:
# vxprint -st

To display complete information about a particular subdisk by using the following command:
# vxprint -l subdisk_name (ex disk01)

Creating Volumes

To create a new volume by entering:
# vxassist make volume_name length
(Ex. vxassist make god 4000m)

To create a new volume in a particular subdisk
# vxassist make volume_name length subdisk
(Ex. vxassist make god 4000m disk02)

To create a 30 megabyte striped volume on three specific disks (disk03, disk04, and disk05)
# vxassist make agni 4000m layout=stripe disk03 disk04 disk05

Now create a file systems in it and mount and change /etc/fstab (HP-UX) or /etc/vfstab (Soaris)
# newfs -F vxfs -o largefiles /dev/vx/rdsk/agni
# mkdir /agni
# mount /dev/vx/dsk/agni /agni

To move a disk between disk groups, remove the disk from one disk group and add it to the other.
For example, to move the physical disk c0t3d0 (attached with the disk name disk04) from disk group
rootdg and add it to disk group mktdg, use the following commands:
# vxdg rmdisk disk04
# vxdg -g mktdg adddisk mktdg02=c0t3d0

To remove disk02 from rootdg, use the following command:
# vxdg rmdisk disk02
If the disk has subdisks on it when you try to remove it, you will get an error message.

To remove disk02 from rootdg with chance of data loss, use the following command:
# vxdg rmdisk disk02 -k

To remove it from Volume Manager control completely, as follows:
# vxdisk rm devicename
(Ex. vxdisk rm c1t0d0)

Monitoring Free Space in VXFS

Extent fragmentation should be monitored with fsadm_vxfs(1M) or the -o s options of df_vxfs(1M).
There are three factors which can be used to determine the degree of fragmentation:
• percentage of free space in extents of less than eight blocks in length
• percentage of free space in extents of less than 64 blocks in length
• percentage of free space in extents of length 64 blocks or greater
An unfragmented file system will have the following characteristics:
• less than 1 percent of free space in extents of less than eight blocks in length
• less than 5 percent of free space in extents of less than 64 blocks in length
• more than 5 percent of the total file system size available as free extents in lengths of 64 or
more blocks

A badly fragmented file system will have one or more of the following characteristics:
• greater than 5 percent of free space in extents of less than 8 blocks in length
• more than 50 percent of free space in extents of less than 64 blocks in length
• less than 5 percent of the total file system size available as free extents in lengths of 64 or more blocks

The optimal period for scheduling of extent reorganization runs can be determined by choosing a reasonable
interval, scheduling fsadm runs at the initial interval, and running the extent fragmentation report
feature of fsadm before and after the reorganization.
The "before" result is the degree of fragmentation prior to the reorganization. If the degree of
fragmentation is approaching the figures for bad fragmentation, then the interval between fsadm runs should
be reduced. If the degree of fragmentation is low, the interval between fsadm runs can be increased.
The "after" result is an indication of how well the reorganizer is performing. The degree of fragmentation
should be close to the characteristics of an unfragmented file system. The file system may be a candidate
for expansion. (Full file systems tend to fragment and are difficult to defragment.) It is also possible that
the reorganization is not being performed at a time during which the file system in question is relatively idle.
Directory reorganization is not nearly as critical as extent reorganization, but regular directory reorganization
will improve performance. It is advisable to schedule directory reorganization for file systems when the extent
reorganization is scheduled. The following is a sample script that is run periodically at 3:00 A.M. from cron
for a number of file systems:
outfile=/tmp/fsadm_out.&212#;/bin/date +'%m%d'&212#;
for i in /home /home2 /project /db
do
/bin/echo "Reorganizing $i"
/bin/timex fsadm -F vxfs -e -E -s $i
/bin/timex fsadm -F vxfs -s -d -D $i
done > $outfile 2>