逻辑卷LVM批量初始化脚本
lvm批量初始化脚本
#!/usr/bin/env bash which lvm||yum install lvm2 -y which xfs_admin||yum install xfsprogs -y partition="/data${1}" #挂载点 vgname=hoolink_vg_${1} #逻辑卷组名称 lvname=hoolink_lv_${1} #逻辑卷名称 fdisk /dev/sd${2} << EOF n p 1 1 t 8e w EOF disk="/dev/sd${2}1" pvcreate $disk vgcreate $vgname $disk lvcreate -l 100%VG -n $lvname $vgname mkfs.xfs /dev/$vgname/$lvname mkdir -p $partition echo "/dev/$vgname/$lvname $partition xfs defaults 0 0" >> /etc/fstab mount -a
喜欢请赞赏一下啦^_^
微信赞赏
支付宝赞赏