Unless otherwise noted, articles © 2005-2008 Doug Spencer, SecurityBulletins.com. Linking to articles is welcomed. Articles on this site are general information and are NOT GUARANTEED to work for your specific needs. I offer paid professional consulting services and will be happy to develop custom solutions for your specific needs. View the consulting page for more information.


Veritas Cluster Server Scripts

From SecurityBulletins.com

Jump to: navigation, search

The following commands have worked on Solaris 9. It will need modifications to work with other operating systems and filesystem naming structures.

Turn a set of currently mounted filesystems into a CFSMount block for main.cf:

df -k | grep MOUNTS | perl -ne 'print "CFSMount mnt_ID_$3 (\n\tmountpoint = \"$2$3\"\n\tBlockDevice = \"$1\"\n\tMountOpt = \"cluster\"\n\tPrimary = PRIMARY_SYSTEM\n\t)\n\n" if /^(\S+)\s+.*\s+(\S+)(d\d\d)$/' > /tmp/cfsmounts.txt

MOUNTS = the a filter to get just the specific mounts you want.

ID = An ID you want to use to identify this CFSMount uniquely in the cluster config.

PRIMARY_SYSTEM = the system that is primary for this resource.


Generate the CVMVolDg resources from a manually mounted filesystem.

df -k  | grep MOUNTS | perl -ne 'print "CVMVolDg vol_ID_$4 (\n\tCVMDiskGroup = DISKGROUP\n\tCVMVolume = { $2 }\n\tCVMActivation = sw\n\t)\n\n" if /^(\S+)\/(\S+)\s+.*\s+(\S+)(d\d\d)$/' > /tmp/vols.txt

DISKGROUP = the Veritas disk group


Generate dependencies:

grep CFSMount /tmp/cfsmounts.txt | perl -ne 'print "\t$1$2 requires vol_VOLID_$2\n" if /(mnt\S+)(d..)\s/' > /tmp/deps.txt

VOLID = the identifier prefix of your volumes.

To create standard mounts with Veritas Filesystem:

df -k | grep MOUNTS | 'print "Mount mnt_ID_$3 (\n\tMountPoint = \"$2$3\"\n\tBlockDevice = \"$1\"\n\tFSType = vxfs\n\tFsckOpt = \"-y\"\n\t)\n\n" if /^(\S+)\s+.*\s+(\S+?)(\d+)$/'
Personal tools