更新时间:2022-02-10 GMT+08:00

创建文件系统

  1. 查看未格式化的磁盘,执行fdisk -l
  2. 格式化磁盘和逻辑卷

    mkfs.xfs /dev/vdb

    mkfs.xfs /dev/vdc

    mkfs.xfs /dev/vde

    创建文件系统目录

    执行:mkdir -p /usr/sap /hana/log /hana/data /hana/share

    获取磁盘的UUID: blkid

    在/etc/fstab创建挂载点

    echo "UUID=662******81dbf9783 /usr/sap xfs defaults 0 0" >>/etc/fstab

    echo "UUID=0c5********19734f /hana/log xfs defaults 0 0" >>/etc/fstab

    echo "UUID=3ae******05166 /hana/share xfs defaults 0 0" >>/etc/fstab

  3. 创建LVM卷

    执行以下命令

    pvcreate /dev/vdd /dev/vde

    vgcreate vghana /dev/vdd /dev/vde

    vgdisplay vghana

    lvcreate -i 2 -l 100%VG -n lvhanadata vghana

    mkfs.xfs /dev/mapper/vghana-lvhanadata

    uuid3=`blkid /dev/mapper/vghana-lvhanadata | awk '{print $2}'|awk -F"\"" '{print $2}'`

    echo "UUID=$uuid3 /hana/data xfs defaults 0 0" >> /etc/fstab

    挂载所有磁盘 mount -a,再执行df -h查看磁盘挂载情况