Hitachi

For Linux(R) (x86) Systems HA Monitor Cluster Software


6.4.5 Specifying the udev rules

Use a udev rules file to specify the owner, group, and permissions of the device file on the shared disk that was specified in the scsi_device or dmmp_device operand in the server environment definition.

If the device file on the shared disk is opened in the write mode, that event is sent to the udev rules when the device file is closed and the file is placed in the status specified in the udev rules (if udev rules are not specified, the default status). HA Monitor opens a device file on the shared disk in the write mode in order to reserve the shared disk specified in the scsi_device or dmmp_device operand in the server environment definition. If you change the permissions by using chmod or chown, the device file is reset to the status specified in the udev rules. Therefore, you must use the udev rules to change permissions.

An example of setting the owner, group, and permissions (specifying a symbolic link in the scsi_device operand) is shown below. If you want to use HDLM multipath software, contact your Hitachi sales representative. If you want to use multipath software (DMMP or HFC-PCM), see the documentation for the respective product.

  1. Under /etc/udev/rules.d, create a rule file for setting the owner, group, and permissions.

    The following shows how to create a rule file:

    # touch /etc/udev/rules.d/numeric-value-rule-name.rule
    Legend:

    numeric-value: Any 2-digit number

    rule-name: Any character string

    The example shown below specifies 99 for numeric-value and my-rules for rule-name.

    Example:
    # touch /etc/udev/rules.d/99-my-rules.rules

    Note the following:

    • Make sure that the specified rule name does not duplicate the name of any other rule file under /etc/udev/rules.d.

    • If you specify multiple rule files for the same device, the rule file with the largest number will be used.

    • We recommend that you specify a number that is larger than any disk device-related udev rule. By default, 60 or a smaller number is specified for a disk device-related udev rule.

  2. Edit the rule file.

    Add the following line by editing the rule file (use a program such as vi editor):

    ACTION=="add|change", SYMLINK=="symbolic-link", OWNER="owner-name", GROUP="group-name", MODE="permission", OPTIONS+="nowatch"

    For symbolic-link, specify the scsi_device operand value without /dev/. The following shows an example:

    ACTION=="add|change", SYMLINK=="disk/by-id/scsi-360060e8010462fe004f2b6ae00000065", OWNER="user1", GROUP="group1", MODE="0666", OPTIONS+="nowatch"
  3. Restart the OS to apply the rule file.

  4. Copy the file edited in step 2 to the remote host, and then perform step 3.

    There is no need to edit a symbolic link under /dev/disk/by-id because it is always the same value regardless of the referencing host.