SSM系统存储管理器系(简称ssm)是RHEL7/CentOS7 新增的功能,是一种统一的存储管理命令界面,由红帽公司开发,用于管理各种各样的存储设备。目前,有三种可供ssm使用的卷管理后端:LVM、brtfs和crypt
下面是ssm manual手册中对其的介绍
ssm - System Storage Manager: a single tool to manage your storage
System Storage Manager provides an easy to use command line interface to manage your storage using various technologies like lvm, btrfs, encrypted volumes and more.
In more sophisticated enterprise storage environments, management with Device Mapper (dm), Logical Volume Manager (LVM), or Multiple Devices (md) is becoming increasingly more difficult. With file systems added to the mix, the number of tools needed to configure and manage storage has grown so large that it is simply not user friendly. With so many options for a system administrator to consider, the opportunity for errors and problems is large.
下面介绍Centos7下使用SSM管理LVM卷
1、安装ssm
yum search system-storage-manager yum install system-storage-manager -y
2、查看硬盘及LVM信息
ssm list
可以看到pool池centos pool池下有两个volumes
/dev/centos/root
/dev/centos/opt
还有一块未使用的/dev/sdb ,可以用lsblk命令进行确认
3、将物理磁盘添加到LVM池
查看帮助说明
ssm add --h
将/dev/sdb裸盘加到centos池中
ssm add -p centos /dev/sdb
ssm list查看当前存储池Pool: centos,可以看到目前Free 20.00GB
4、使用ssm resize 扩展LVM卷
ssm resize --h ssm resize -s +100%FREE /dev/centos/opt ssm list
5、使用ssm resize 压缩LVM卷
ssm resize -s-20.00G /dev/centos/opt ssm remove /dev/sdb
其实这时pv中还是存在/dev/sdb的,需要手动移除
pvremove /dev/sdb
6、创建新的LVM池/卷
ssm create -s 10G -n storage --fstype ext4 -p ssm_storage /dev/sdb /mnt/storage ssm list
7、压缩及扩展LVM卷举例
例如:同一个Pool :centos下压缩/dev/centos/opt 卷的空间,将腾出的空间用于扩展/dev/centos/root卷
ssm resize -s-10%USED /dev/centos/opt ssm resize -s +100%FREE /dev/centos/root