13.7 Sample Scripts for a Linux POSIX Volume Cluster Resource

The scripts in this section are based on the sample values in the following table. Ensure that you replace the sample values with the ones you used in your solution.

IMPORTANT:Do not comment out commands that are automatically generated for parameters that define the cluster resource, such as the mount point, IP address, container name, file system type, and device.

Variable

Template Value

Sample Value

Description

RESOURCE_IP

a.b.c.d

10.10.10.44

IP address of the virtual cluster server for this cluster resource

Container_name

name

csm44

The name you gave to the cluster segment manager.

MOUNT_DEV

/dev/evms/$container_name/volume_name

/dev/evms/$container_name/lxvol44

The Linux path for the EVMS volume you created, such as lxvol44.

MOUNT_FS

reiserfs

ext3

The file system type you made on the EVMS volume.

MOUNT_POINT

/mnt/mount_point

/mnt/lxvol44

The mount location for the EVMS volume you created. This example shows a mount location with a directory named the same as the EVMS volume name (lxvol44). You can mount the EVMS volume anywhere.

After you create a resource, you can modify its IP address, administrator credentials, the order or IP addresses of the LDAP servers, or other attributes by using the procedure in Section 8.9, Moving a Cluster, or Changing IP Addresses, LDAP Server, or Administrator Credentials for a Cluster.

13.7.1 Sample Load Script for the Linux POSIX Volume Cluster Resource

The following is an example load script for the cluster resource for a Linux POSIX volume:

#! /bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# define the IP address
RESOURCE_IP=10.10.10.44
# define the file system type
MOUNT_FS=ext3
#define the container name
container_name=csm44
# define the device
MOUNT_DEV=/dev/evms/$container_name/lxvol44
# define the mount point
MOUNT_POINT=/mnt/lxvol44

#activate the container
exit_on_error activate_evms_container $container_name $MOUNT_DEV $NCS_TIMEOUT

# mount the file system
ignore_error mkdir -p $MOUNT_POINT
exit_on_error mount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

# add the IP address
exit_on_error add_secondary_ipaddress $RESOURCE_IP

exit 0

13.7.2 Sample Unload Script for the Linux POSIX Volume Cluster Resource

The following is an example unload script for the cluster resource for a Linux POSIX volume:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# define the IP address
RESOURCE_IP=10.10.10.44
# define the file system type
MOUNT_FS=ext3
#define the container name
container_name=csm44
# define the device
MOUNT_DEV=/dev/evms/$container_name/lxvol44
# define the mount point
MOUNT_POINT=/mnt/lxvol44

# unmount the volume
sleep 10 # if not using SMS for backup, please comment out this line
exit_on_error umount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

# del the IP address
ignore_error del_secondary_ipaddress $RESOURCE_IP

# deactivate the container
ignore_error deactivate_evms_container $container_name $NCS_TIMEOUT

# return status
exit 0

13.7.3 Sample Monitor Script for a Linux POSIX Volume Cluster Resource

The following is an example monitor script for the cluster resource for a Linux POSIX volume:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# define the IP address
RESOURCE_IP=10.10.10.44
# define the file system type
MOUNT_FS=ext3
#define the container name
container_name=csm44
# define the device
MOUNT_DEV=/dev/evms/$container_name/lxvol44
# define the mount point
MOUNT_POINT=/mnt/lxvol44

# test the file system
exit_on_error status_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

# status the IP address
exit_on_error status_secondary_ipaddress $RESOURCE_IP

# (optional) status of the eDirectory service
#exit_on_error rcndsd status 

# (optional) status of the Linux User Management service
# exit_on_error namcd status 

exit 0