SSM系统存储管理器的使用
系统存储管理器(又称ssm)是RHEL7/CentOS7 新增的功能,是一种统一的命令界面,由红帽公司开发,用于管理各种各样的存储设备。目前,有三种可供ssm使用的卷管理后端:LVM、brtfs和crypt
1)安装ssm系统存储管理器
[root@xuegod61 ~]# yum -y installsystem-storage-manager.noarch
2)ssm参数详解 ssm --help
-h, --help show this help message and exit
--version show program's version number andexit
-v, --verbose Show aditional information whileexecuting.
-f, --force Force execution in the case wheressm has some doubts
or questions.
-b BACKEND, --backend BACKEND
Choose backend to use.Currently you can choose from
(lvm,btrfs,crypt).
-n, --dry-run Dry run. Do not do anything, just parse thecommand
line options and gathersystem information if
necessary. Note thatwith this option ssm will not
perform all the checkas some of them are done by the
backends themselves.This option is mainly used for
debugging purposes
check Check consistency of the filesystem on the device.
resize Change or set the volume and filesystem size.
create Create a new volume with definedparameters.
list List information about alldetected, devices, pools,
volumes and snapshots in thesystem.
add Add one or more devices intothe pool.
remove Remove devices from the pool,volumes or pools.
snapshot Take a snapshot of the existingvolume.
mount Mount a volume with file systemto specified locaion.
3)ssm list列出所有设备,存储池,卷,快照。
4)将物理磁盘添加到LVM存储池
ssm add -p 存储池 设备
如:ssm add -p vg1 /dev/sdc
5)扩容LV 注:不能对创建了快照的lv进行扩容
ssm resize -s +1G /dev/vg/lv
注:
使用ssm存储管理器扩容,不需要再针对文进系统进行扩容
6)实例:
创建一个名为vg2的存储池,并在其上创建一个名为lv2,大小为1G的lvm卷,格式化为xfs文件系统,并将其挂载/lv2目录下
ssm create -s 1G -n lv2 --fstype xfs -p vg2 /dev/sde /lv2
-s:指定vg大小; -n:指定lv名;--fstype:指定格式化格式;-p:指定vg名; /dev/sde:指定磁盘;/lv2:指定挂载目录;
创建快照
ssm snapshot -s 500M -n lv2_sp /dev/vg2/lv2
移除LVM卷
ssm remove /dev/vg2/lv2_sp
注:删除已经挂载的卷,ssm会自动先将其卸载