RHEL7使用ssm命令管理LVM的方法
1.安装ssm
[root@localhost~]#yum-yinstallsystem-storage-manager.noarch
2.检查硬盘和LVM信息
[root@localhost~]#sudossmlist ---------------------------------------------------------//物理设备 DeviceFreeUsedTotalPoolMountpoint --------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb4.00GB1.00GB5.00GBvg00 /dev/sdc5.00GB0.00KB5.00GBvg00 /dev/sdd5.00GB /dev/sde5.00GB --------------------------------------------------------- ----------------------------------------------//存储池 PoolTypeDevicesFreeUsedTotal ---------------------------------------------- vg00lvm28.99GB1.00GB9.99GB ---------------------------------------------- ----------------------------------------------------------------------------------//存储池中的LVM卷 VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------- /dev/vg00/lv00vg001.00GBext21.00GB957.62MBlinear /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------
3.将物理磁盘添加到LVM池中
[root@localhost~]#ssmadd-pvg00/dev/sdd Physicalvolume"/dev/sdd"successfullycreated Volumegroup"vg00"successfullyextended
4.查看当前存储池
[root@localhost~]#ssmlist --------------------------------------------------------- DeviceFreeUsedTotalPoolMountpoint --------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb4.00GB1.00GB5.00GBvg00 /dev/sdc5.00GB0.00KB5.00GBvg00 /dev/sdd5.00GB0.00KB5.00GBvg00 /dev/sde5.00GB --------------------------------------------------------- ------------------------------------------------ PoolTypeDevicesFreeUsedTotal ------------------------------------------------ vg00lvm313.99GB1.00GB14.99GB ------------------------------------------------ ---------------------------------------------------------------------------------- VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------- /dev/vg00/lv00vg001.00GBext21.00GB957.62MBlinear /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------
5.扩大LVM卷
[root@localhost~]#ssmresize-s+10G/dev/vg00/lv00 fsck,来自util-linux2.23.2 /dev/mapper/vg00-lv00:11/65536files(0.0%non-contiguous),4763/262144blocks Extendinglogicalvolumelv00to11.00GiB Logicalvolumelv00successfullyresized resize2fs1.42.9(28-Dec-2013) Resizingthefilesystemon/dev/mapper/vg00-lv00to2883584(4k)blocks. Thefilesystemon/dev/mapper/vg00-lv00isnow2883584blockslong.
6.查看结果
[root@localhost~]#ssmlist --------------------------------------------------------- DeviceFreeUsedTotalPoolMountpoint --------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb0.00KB5.00GB5.00GBvg00 /dev/sdc0.00KB5.00GB5.00GBvg00 /dev/sdd3.99GB1.01GB5.00GBvg00 /dev/sde5.00GB --------------------------------------------------------- ------------------------------------------------ PoolTypeDevicesFreeUsedTotal ------------------------------------------------ vg00lvm33.99GB11.00GB14.99GB ------------------------------------------------ ---------------------------------------------------------------------------------- VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------- /dev/vg00/lv00vg0011.00GBext211.00GB10.31GBlinear /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------
7.更新文件系统
[root@localhost~]#mke2fs/dev/vg00/lv00
8.挂载结果
[root@localhost~]#df-hT 文件系统类型容量已用可用已用%挂载点 /dev/sda3xfs48G3.6G44G8%/ devtmpfsdevtmpfs906M0906M0%/dev tmpfstmpfs914M80K914M1%/dev/shm tmpfstmpfs914M8.9M905M1%/run tmpfstmpfs914M0914M0%/sys/fs/cgroup /dev/sda1xfs497M116M382M24%/boot /dev/mapper/vg00-lv00ext211G5.0M11G1%/mnt
9.创建新的LVM池
[root@localhost~]#mkdir/soft [root@localhost~]#ssmcreate-s1G-nsoft--fstypexfs-pmysoft/dev/sde/soft //create创建、-s1G指定大小、-nsoft文件名称、--fstypexfs文件系统、-pmysoft指定存储池名称、/dev/sde/soft指定那块磁盘挂载哪个目录上 Physicalvolume"/dev/sde"successfullycreated Volumegroup"mysoft"successfullycreated Logicalvolume"soft"created meta-data=/dev/mysoft/softisize=256agcount=4,agsize=65536blks =sectsz=512attr=2,projid32bit=1 =crc=0 data=bsize=4096blocks=262144,imaxpct=25 =sunit=0swidth=0blks naming=version2bsize=4096ascii-ci=0ftype=0 log=internallogbsize=4096blocks=2560,version=2 =sectsz=512sunit=0blks,lazy-count=1 realtime=noneextsz=4096blocks=0,rtextents=0
10.查看结果
[root@localhost~]#ssmlist ----------------------------------------------------------- DeviceFreeUsedTotalPoolMountpoint ----------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb0.00KB5.00GB5.00GBvg00 /dev/sdc0.00KB5.00GB5.00GBvg00 /dev/sdd3.99GB1.01GB5.00GBvg00 /dev/sde4.00GB1.00GB5.00GBmysoft ----------------------------------------------------------- -------------------------------------------------- PoolTypeDevicesFreeUsedTotal -------------------------------------------------- mysoftlvm14.00GB1.00GB5.00GB vg00lvm33.99GB11.00GB14.99GB -------------------------------------------------- ---------------------------------------------------------------------------------------- VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------------- /dev/vg00/lv00vg0011.00GBext211.00GB10.31GBlinear/mnt /dev/mysoft/softmysoft1.00GBxfs1014.00MB1013.88MBlinear/soft /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------------
11.对LVM卷快照
[root@localhost~]#ssmsnapshot/dev/mysoft/soft Roundingupsizetofullphysicalextent208.00MiB Logicalvolume"snap20160531T120543"created [root@localhost~]#ssmlistsnapshots ------------------------------------------------------------------------------ SnapshotOriginPoolVolumesizeSizeType ------------------------------------------------------------------------------ /dev/mysoft/snap20160531T120543softmysoft208.00MB21.30KBlinear ------------------------------------------------------------------------------
12.删除LVM卷
[root@localhost~]#ssmremove/dev/mysoft/soft Device'/dev/mysoft/soft'ismountedon'/soft'Unmount(N/y/q)?Y Doyoureallywanttoremoveactivelogicalvolumesnap20160531T120543?[y/n]:y Logicalvolume"snap20160531T120543"successfullyremoved Doyoureallywanttoremoveactivelogicalvolumesoft?[y/n]:y Logicalvolume"soft"successfullyremoved
13.查看结果
[root@localhost~]#ssmlist ----------------------------------------------------------- DeviceFreeUsedTotalPoolMountpoint ----------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb0.00KB5.00GB5.00GBvg00 /dev/sdc0.00KB5.00GB5.00GBvg00 /dev/sdd3.99GB1.01GB5.00GBvg00 /dev/sde5.00GB0.00KB5.00GBmysoft ----------------------------------------------------------- -------------------------------------------------- PoolTypeDevicesFreeUsedTotal -------------------------------------------------- mysoftlvm15.00GB0.00KB5.00GB vg00lvm33.99GB11.00GB14.99GB -------------------------------------------------- ---------------------------------------------------------------------------------- VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------- /dev/vg00/lv00vg0011.00GBext211.00GB10.31GBlinear/mnt /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------
14.删除存储池
[root@localhost~]#ssmremovemysoft Volumegroup"mysoft"successfullyremoved
15.查看结果
[root@localhost~]#ssmlist --------------------------------------------------------- DeviceFreeUsedTotalPoolMountpoint --------------------------------------------------------- /dev/sda50.00GBPARTITIONED /dev/sda1500.00MB/boot /dev/sda22.02GBSWAP /dev/sda347.50GB/ /dev/sdb0.00KB5.00GB5.00GBvg00 /dev/sdc0.00KB5.00GB5.00GBvg00 /dev/sdd3.99GB1.01GB5.00GBvg00 /dev/sde5.00GB --------------------------------------------------------- ------------------------------------------------ PoolTypeDevicesFreeUsedTotal ------------------------------------------------ vg00lvm33.99GB11.00GB14.99GB ------------------------------------------------ ---------------------------------------------------------------------------------- VolumePoolVolumesizeFSFSsizeFreeTypeMountpoint ---------------------------------------------------------------------------------- /dev/vg00/lv00vg0011.00GBext211.00GB10.31GBlinear/mnt /dev/sda1500.00MBxfs496.67MB406.23MBpart/boot /dev/sda347.50GBxfs47.47GB43.87GBpart/ ----------------------------------------------------------------------------------
以上就是小编为大家带来的RHEL7使用ssm命令管理LVM的方法全部内容了,希望大家多多支持毛票票~