查看硬盘列表:
ls /dev/disk/by-id/
返回硬盘列表
ata-QEMU_DVD-ROM_QM00004 scsi-0BUYVM_SLAB_VOLUME-8888
格式化硬盘:
mkfs.ext4 -F /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888
挂载硬盘:
mount -o discard,defaults /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888 /home
开机自动挂载:
echo ‘/dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-8888 /home ext4 defaults,nofail,discard 0 0′ | tee -a /etc/fstab
红色是Block Storage(数据盘)名称, 蓝色是挂载到的目录,我是挂载到了/home 你可以根据自己需求修改.