Formatting a BMS Disk
Scenarios
The data volumes of SAP HANA nodes can be used only after they are formatted and then attached to required directories.
Procedure
- 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.
- Use SSD disks to form RAID 1.
- View the disk information.
fdisk -l
- Locate the drive letters of the SSD disks, such as /dev/nvme0n1 and /dev/nvme1n1.
- 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?.
- Save the RAID configuration.
mdadm -Ds >> /etc/mdadm.conf
If one SSD card is damaged and the damaged drive letter is /dev/nvme1n1, perform the following operations to restore data:
- Run the mdadm --manage /dev/md0 --remove /dev/nvme1n1 command to remove the drive letter.
- Stop the node, replace the SSD card, and then start the node.
- Run the mdadm --manage /dev/md0 --add /dev/nvme*n1 command to add a new drive letter to restore data. Replace * with the drive letter based on the actual situation.
- Create the /hana/log/ directory.
mkdir -p /hana/log/
- Create a file system.
mkfs -t xfs -f /dev/md0
- Attach a disk.
mount /dev/md0 /hana/log/
- View the disk information.
- Use LVM to logically divide the disk into a data volume and a shared volume.
Run the following commands to partition the disk:
parted /dev/sda mklabel gpt y
parted /dev/sda mkpart primarty 0% 100%
- Run the following command to create a physical volume:
pvcreate /dev/sda1
- Run the following command to create a volume group:
vgcreate vghana /dev/sda1
- Run the following command to query the available capacity of the volume group:
vgdisplay vghana
- Run the following commands to create logical volumes:
lvcreate -n lvhanashared -L 3T vghana
lvcreate -n lvhanadata -L 9T vghana
- 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
- 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
Last Article: Formatting the Disks Attached to an NFS Server
Next Article: Formatting Disks Attached to an SAP Application Node
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.