Formatting a BMS (physical.m2.medium) Disk

Scenarios

The data volumes of SAP HANA nodes can be used only after they are formatted and then attached to required directories.

This section describes how to format a BMS (physical.m2.medium) disk.

Procedure

  1. Log in to the jump host. Ensure that user root and the key file are used for authentication. Then, use SSH to switch to SAP HANA nodes.
  2. Use local disks (2 x 1.6 TB ES3600 SSD) to form RAID 1 and allocate the RAID 1 to the log volume.

    1. View the disk information.

      fdisk -l

    2. In the displayed information, locate the drive letters of the SSD disks, such as /dev/nvme0n1 and /dev/nvme1n1.
    3. Form RAID 1 and specify the drive letter.

      For example, if the drive letter is /dev/md0, run the following command:

      mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/nvme0n1 /dev/nvme1n1

      Enter y when the system displays Continue creating array?.

    4. Save the RAID configuration.

      mdadm -Ds >> /etc/mdadm.conf

      If any SSD card is faulty, you can perform the following operations to restore data after the card is replaced with a normal one.

      1. Install the hioadm tool. Run the hioadm info -d /dev/nvme1n1 command to locate the faulty SSD card, and replace the faulty SSD card with a normal one. Assume that the drive letter of the faulty disk is /dev/nvme1n1.
      2. Run the mdadm --manage /dev/md0 --remove /dev/nvme1n1 command to remove the drive letter of the faulty disk.
      3. Run the mdadm --manage /dev/md0 --add /dev/nvme2n1 command to add a new drive letter to restore data.
    5. Create the /hana/log/ directory.

      mkdir -p /hana/log/

    6. Create a file system.

      mkfs -t xfs -f /dev/md0

    7. Attach a disk.

      mount /dev/md0 /hana/log/

  3. Use LVM to logically divide local disks (7 x 1.8 TB 10K 2.5 SAS HDD) into a data volume and a shared volume.

    View the disk information and find the drive letter, for example, /dev/sdb.

    Run the following commands to partition the disk:

    parted /dev/sdb mklabel gpt y

    parted /dev/sdb mkpart primarty 0% 100%

  4. Run the following command to create a physical volume:

    pvcreate /dev/sdb1

  5. Run the following command to create a volume group:

    vgcreate vghana /dev/sdb1

  6. Run the following command to query the available capacity of the volume group:

    vgdisplay vghana

  7. Run the following commands to create logical volumes:

    lvcreate -n lvhanashared -L 2T vghana

    lvcreate -n lvhanadata -L 6T vghana

  8. Run the following commands to format the logical volumes and attach them to the corresponding directories:

    mkfs -t xfs /dev/mapper/vghana-lvhanadata

    mkfs -t xfs /dev/mapper/vghana-lvhanashared

    mkdir -p /hana/data

    mkdir -p /hana/shared

    mount /dev/mapper/vghana-lvhanadata /hana/data

    mount /dev/mapper/vghana-lvhanashared /hana/shared

  9. Run the following commands to write disk attaching relationships into the /etc/fstab file:

    /dev/mapper/vghana-lvhanadata /hana/data xfs defaults 0 0

    /dev/mapper/vghana-lvhanashared /hana/shared xfs defaults 0 0

    /dev/md0 /hana/log xfs defaults 0 0

  10. Format the data volume of the other BMS.