C H A P T E R  10

Modifying and Adding Disk Partitions for Replicated Data on Linux

This chapter describes how to examine or modify the configuration of a disk partition on the master-eligible nodes. Master-eligible nodes can have more than one disk. The disk partitions discussed in this chapter pertain to the disk that contains the cluster configuration. For more information about disk partitioning, see “Volume Management” in the Netra High Availability Suite 3.0 1/08 Foundation Services Overview.

The disk on a dataless node is not used to store cluster data and is not discussed in this chapter. For information about the initial disk configuration of a dataless node, see the Netra High Availability Suite 3.0 1/08 Foundation Services Manual Installation Guide for the Solaris OS.

This chapter contains the following sections:


Using the parted Utility to Display and Modify the Configuration of a Disk Partition on a Linux Node

This section describes how to use the parted utility to display and modify the configuration of a disk partition. For additional information, see the parted8 man page.

Before you change the configuration of a disk partition, you must stop all the nodes in the cluster. You must also change the size of the corresponding data partition and bitmap partition on the other master-eligible node.

procedure icon  To Display the Configuration of a Disk Partition on a Linux Node

Use this procedure to identify the name of each partition on a disk and to determine whether a disk partition is big enough.

  1. Log in to a master-eligible node as superuser.

  2. Run the parted utility to display partitions of the disk:


    # parted /dev/sda print
    

    Output similar to the following is displayed in the console window:


    Disk geometry for /dev/scsi/host0/bus0/target0/lun0/disc: 0.000-70007.196 megabytes
     Disk label type: msdos
    Minor    Start       End     Type      Filesystem  Flags
    1          0.031   8189.384  primary   ext3        boot
    2       8189.385  12291.921  primary   linux-swap 
    3      12291.921  70001.982  extended 
    5      12291.952  16386.613  logical   ext3 
    6      16386.645  20481.306  logical   ext3 
    7      20481.337  21501.057  logical   ext3 
    8      21501.088  39997.771  logical   ext3 
    Information: Don’t forget to update /etc/fstab, if necessary.
    

procedure icon  To Change the Size of a Disk Partition on a Master-Eligible Node on Linux

Changing the size of a disk partition using the parted command requires that the partition that is going to be changed is deleted, and then recreated with the new size. There must also be enough unused space on the disk to allow the partition to be increased.



caution icon

Caution - Deleting a partition also deletes all data on that partition. Make a backup copy of the data before deleting a partition.



  1. Log in to a master-eligible node as superuser.

  2. Delete the partition that you want to modify:


     # parted /dev/sda rm 8
    

    This deletes partition number 8.

  3. Recreate the partition with increased size:


    # parted /dev/sda mkpart logical ext3 21501.058 70007.196
    

  4. Verify the change by displaying the new partition table:


    # parted /dev/sda print
    Disk geometry for /dev/scsi/host0/bus0/target0/lun0/disc: 0.000-70007.196 mbytes
    Disk label type: msdos
    Minor    Start       End     Type      Filesystem  Flags
    1          0.031   8189.384  primary   ext3        boot
    2       8189.385  12291.921  primary   linux-swap 
    3      12291.921  70001.982  extended 
    5      12291.952  16386.613  logical   ext3 
    6      16386.645  20481.306  logical   ext3 
    7      20481.337  21501.057  logical   ext3 
    8      21501.088  70001.982  logical   ext3 
    



    Note - Refer to the parted8man page for more information about changing the partitions on a disk.




Increasing the Size of a Replicated Data Partition on a Physical Disk on a Linux Node

This section describes how to increase the size of a replicated data partition on a physical disk.

procedure icon  To Increase the Size of a Replicated Data Partition on a Physical Disk on a Linux Node

  1. Log in to a cluster node and note which node is the master node and which node is the vice-master node.


    # nhcmmstat -all
    

  2. Stop the cluster.

    For information, see To Shut Down a Cluster.

  3. Log in to the original master node in single-user mode, as superuser:

  4. Back up the partition by using a tool such as dump.

    For information, see the dump8 man page.

  5. Identify the name of the data partition that you want to modify.

    For information, see To Display the Configuration of a Disk Partition on a Linux Node.

  6. Change the size of the data partition.

    For information, see To Change the Size of a Disk Partition on a Master-Eligible Node on Linux.

  7. Verify that the metadata partition is the correct size.

    1. Identify the name of the local metadata partition associated with the chosen data partition.

      For information, see To Display the Configuration of a Disk Partition on a Linux Node.

    2. Confirm that the metadata partition is at least the following size:

      128 Mbyte * Number of replicated file systems

      If there are two replicated file systems, then the size of the meta data partition should be at least 256 MBytes.

      If the metadata partition is not big enough, increase the size of this partition, as described in To Change the Size of a Disk Partition on a Master-Eligible Node on Linux.

  8. Restore the data on the partition using the restore command.

    For information, see the restore8 man page.

  9. Log in to the old vice-master node in single-user mode, as superuser:

  10. Change the size of the data partition by repeating Step 5 through Step 7.

  11. Reboot the original master node as described in To Perform a Clean Reboot of a Linux Node.

  12. When the master node has booted fully, reboot the original vice-master node as described in To Perform a Clean Reboot of a Linux Node.

  13. Log in to the master node as superuser.

  14. Verify that the vice-master node is synchronized with the master node:


    # drbdadm cstate all
    

    If the drbdadm command indicates "SyncSource," then synchronization is currently taking place. When the drbdadm command indicates "Connected," the vice-master node is synchronized with the master node.

  15. Restart the diskless and dataless nodes.

    For information, see To Restart a Node.


Increasing the Size of a Replicated Data Partition on a Virtual Disk on a Linux Node

This section describes how to increase the size of a replicated data partition created by the Logical Volume Manager. This replicated partition is called a soft partition. Perform this procedure to facilitate back up or to increase the partition size available to services or applications.

procedure icon  To Increase the Size of a Replicated Data Partition on a Virtual Disk on a Linux Node

  1. Log in to a cluster node and note which node is the master node and which node is the vice-master node:


    # nhcmmstat -all
    

  2. Stop the cluster.

    For information, see To Shut Down a Cluster.

  3. Log in to the original master node in single-user mode, as superuser:

  4. Back up the partition by using a tool such as dump.

    For information, see the dump8 man page.

  5. Start the LVM and mount the file system.

    For example, mount /dev/vg0/lvol4 on home2, as follows:


    # /etc/init.d/nhlvm start
    # mount -t ext3 /dev/vg0/lvol4 /home2
    

  6. Add space to the virtual disk by adding a new, unused partition to the volume group.

    For example, add /dev/sda8 to the vg0 device:


    # vgextend vg0 /dev/sda8
    

    For more information about virtual disks, see the Logical Volume Manager How To at: http://tldp.org/HOWTO/LVM-HOWTO/

  7. Grow the file system to its new size:


    # resize2fs /dev/vg0/lvol4
    

  8. Verify that the metadata partition is the correct size.

    1. Identify the name of the local metadata partition associated with the chosen data partition.

      For information, see To Display the Configuration of a Disk Partition on a Linux Node.

    2. Confirm that the metadata partition is at least the following size:

      128 Mbyte * Number of replicated file systems

      If there are two replicated file systems, then the size of the metadata partition should be at least 256 MBytes.

      If the bitmap partition is not big enough, increase the size of this partition as described in To Change the Size of a Disk Partition on a Master-Eligible Node on Linux.

  9. Log in to the original vice-master node in single-user mode, as superuser.

  10. Add space to the virtual disk on the vice-master by repeating Step 6.

  11. Repeat Step 8 on the vice-master node.

  12. Reboot the master node as described in To Perform a Clean Reboot of a Linux Node.

  13. When the master node has fully booted, reboot the vice-master node as described in To Perform a Clean Reboot of a Linux Node.

  14. Log in to the master node as superuser.

  15. Verify that the vice-master node is synchronized with the master node:

    For versions earlier than the Solaris 10 OS:


    # drbdadm cstate all
    

    If the drbdadm command indicates "SyncSource," then synchronization is currently taking place. When the drbdadm command indicates "Connected," the vice-master node is synchronized with the master node.

  16. Restart the diskless nodes or dataless nodes.

    For information, see To Restart a Node.

  17. Confirm that the nodes have the correct configuration:


    # nhadm check
    

    For information, see the nhadm8 man page.


Adding a Mirrored Data Partition to a Virtual Disk on a Linux Node

This section describes how to add a mirrored data partition to your disk configuration. To configure a virtual disk on the master-eligible nodes, you must include the Logical Volume Manager software in the initial cluster configuration. For information about configuring the LVM, see the Netra High Availability Suite 3.0 1/08 Foundation Services Manual Installation Guide for the Solaris OS.

procedure icon  To Add a Mirrored Data Partition to a Virtual Disk on a Linux Node

  1. Stop the cluster.

    For information, see To Shut Down a Cluster.

  2. Log in to a master-eligible node in single-user mode, as superuser:

  3. Create two virtual disk partitions: one data partition and one metadata partition.

    The metadata partition can be skipped if the system already has sufficient large metadata partition. The size of the metadata partition must be at least 128 MBytes multiplied by the number of replicated file systems. For information, see the Logical Volume Manager How To at: http://tldp.org/HOWTO/LVM-HOWTO/

  4. Create a file system on the new partition.

    For information, see the mkfs8 man page.

  5. Ensure that the partition is replicated by adding the RNFS.Slice parameter for the new soft partition to the nhfs.conf file.

    For information, see the nhfs.conf5 man page.

  6. Add the RNFS.Slice parameter for the new partitions to the nhfs.conf file.

    The RNFS.Slice parameter is used to replicate the partition.

  7. Repeat Step 2 through Step 6 for the second master-eligible node.

    The changes you make must be identical on both master-eligible nodes.

  8. Reboot all of the peer nodes.

    For information, see To Restart a Cluster.

  9. Verify that the vice-master node is synchronized with the master node:


    # drbdadm cstate all
    

    If the drbdadm command indicates "SyncSource," then synchronization is currently taking place. When the drbdadm command indicates "Connected," the vice-master node is synchronized with the master node.

    If the vice-master node is not synchronized with the master node, resynchronize it:


    # nhcrfsadm -f all
    

  10. Confirm that the nodes have the correct configuration:


    # nhadm check
    

    For information, see the nhadm8 man page.