RHEL7使用ssm命令管理LVM的方法

2019-10-13 13:12:50王振洲

10.查看结果

[root@localhost ~]# ssm list
-----------------------------------------------------------
Device    Free   Used   Total Pool  Mount point
-----------------------------------------------------------
/dev/sda           50.00 GB     PARTITIONED
/dev/sda1          500.00 MB     /boot   
/dev/sda2           2.02 GB     SWAP   
/dev/sda3           47.50 GB     /     
/dev/sdb  0.00 KB 5.00 GB  5.00 GB vg00       
/dev/sdc  0.00 KB 5.00 GB  5.00 GB vg00       
/dev/sdd  3.99 GB 1.01 GB  5.00 GB vg00       
/dev/sde  4.00 GB 1.00 GB  5.00 GB mysoft      
-----------------------------------------------------------
--------------------------------------------------
Pool  Type Devices   Free   Used   Total 
--------------------------------------------------
mysoft lvm  1    4.00 GB  1.00 GB  5.00 GB 
vg00  lvm  3    3.99 GB 11.00 GB 14.99 GB 
--------------------------------------------------
----------------------------------------------------------------------------------------
Volume      Pool  Volume size FS    FS size    Free Type  Mount point
----------------------------------------------------------------------------------------
/dev/vg00/lv00  vg00    11.00 GB ext2  11.00 GB  10.31 GB linear /mnt   
/dev/mysoft/soft mysoft   1.00 GB xfs  1014.00 MB 1013.88 MB linear /soft   
/dev/sda1          500.00 MB xfs  496.67 MB  406.23 MB part  /boot   
/dev/sda3          47.50 GB xfs   47.47 GB  43.87 GB part  /     
----------------------------------------------------------------------------------------

11.对LVM卷快照

 

[root@localhost ~]# ssm snapshot /dev/mysoft/soft
 Rounding up size to full physical extent 208.00 MiB
 Logical volume "snap20160531T120543" created
[root@localhost ~]# ssm list snapshots
------------------------------------------------------------------------------
Snapshot             Origin Pool  Volume size   Size Type 
------------------------------------------------------------------------------
/dev/mysoft/snap20160531T120543 soft  mysoft  208.00 MB 21.30 KB linear
------------------------------------------------------------------------------

 12.删除LVM卷

[root@localhost ~]# ssm remove /dev/mysoft/soft
Device '/dev/mysoft/soft' is mounted on '/soft' Unmount (N/y/q) ? Y
Do you really want to remove active logical volume snap20160531T120543? [y/n]: y
 Logical volume "snap20160531T120543" successfully removed
Do you really want to remove active logical volume soft? [y/n]: y
 Logical volume "soft" successfully removed

13.查看结果

[root@localhost ~]# ssm list
-----------------------------------------------------------
Device    Free   Used   Total Pool  Mount point
-----------------------------------------------------------
/dev/sda           50.00 GB     PARTITIONED
/dev/sda1          500.00 MB     /boot   
/dev/sda2           2.02 GB     SWAP   
/dev/sda3           47.50 GB     /     
/dev/sdb  0.00 KB 5.00 GB  5.00 GB vg00       
/dev/sdc  0.00 KB 5.00 GB  5.00 GB vg00       
/dev/sdd  3.99 GB 1.01 GB  5.00 GB vg00       
/dev/sde  5.00 GB 0.00 KB  5.00 GB mysoft      
-----------------------------------------------------------
--------------------------------------------------
Pool  Type Devices   Free   Used   Total 
--------------------------------------------------
mysoft lvm  1    5.00 GB  0.00 KB  5.00 GB 
vg00  lvm  3    3.99 GB 11.00 GB 14.99 GB 
--------------------------------------------------
----------------------------------------------------------------------------------
Volume     Pool Volume size FS   FS size    Free Type  Mount point
----------------------------------------------------------------------------------
/dev/vg00/lv00 vg00   11.00 GB ext2  11.00 GB  10.31 GB linear /mnt   
/dev/sda1        500.00 MB xfs  496.67 MB 406.23 MB part  /boot   
/dev/sda3        47.50 GB xfs  47.47 GB  43.87 GB part  /     
----------------------------------------------------------------------------------