SSD磁盘挂载
pvcreate /dev/sdc
vgcreate datavg /dev/sdc
lvcreate -l 100%VG -n datalv01 datavg
mkfs.xfs /dev/mapper/datavg-datalv01
mkdir -p /Docker
mount /dev/mapper/datavg-datalv01 /Docker
echo "/dev/mapper/datavg-datalv01 /Docker xfs defaults 0 0">>/etc/fstab
cat /etc/fstab
数据盘动态扩容:
pvcreate /dev/sdd
vgextend datavgsdc /dev/sdd
lvextend -l +100%FREE /dev/mapper/datavg-datalv01
xfs_growfs /dev/mapper/datavg-datalv01
resize2fs /dev/mapper/VolGroup00-LVroot
云磁盘EBS根目录扩展
pvcreate /dev/vdb
pvdisplay
vgextend VolGroup00 /dev/vdb
vgdisplay
lvextend -L +310G /dev/mapper/VolGroup00-LVroot
lvs
resize2fs /dev/mapper/VolGroup00-LVroot # 非centos配置操作方式,忽略
xfs_growfs /dev/mapper/VolGroup00-LVroot
设置keepalived为开机自启动:
chkconfig keepalived on
命令行解释说明:
若数据盘要做LVM管理
执行下面命令自行挂载
pvcreate /dev/sdb #创建物理卷
vgcreate VolGroup01 /dev/sdb #创建卷组 VolGroup01
vgchange -a y VolGroup01 #激活卷组VolGroup01
lvcreate -l +100%free -n LVdata VolGroup01 # 创建逻辑卷LVdata
mkfs.xfs /dev/VolGroup01/LVdata #格式化逻辑卷LVdata,若是CentOS6则使用mkfs.ext4,若是CentOS7,使用mkfs.xfs
mkdir -p /data #创建挂载点/data
echo "/dev/VolGroup01/LVdata /data xfs defaults 0 0">>/etc/fstab #将挂载信息写入配置中
mount -a #挂载
df -h #查看已挂载的盘