本篇内容主要讲解“Centos7怎么使用SSM管理LVM卷”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Centos7怎么使用SSM管理LVM卷”吧!
ssm全称Spring+SpringMVC+MyBatis,是目前比较主流的Java EE企业级框架,适用于搭建各种大型的企业级应用系统。ssm还可指“软系统方法论”,是一项运用系统思考解决非系统问题的定性研究技术。
[root@localhost ~]# yum -y install system-storage-manager
使用ssm list 显示所有检测到的设备、池、卷和快照的信息:
[root@localhost ~]# ssm list----------------------------------------------------------- Device Free Used Total Pool Mount point ----------------------------------------------------------- /dev/sda 40.00 GB /dev/sda1 1.00 GB /boot /dev/sda2 4.00 MB 38.99 GB 39.00 GB centos /dev/sdb 2.00 GB /dev/sdc 2.00 GB /dev/sdd 2.00 GB ----------------------------------------------------------- -------------------------------------------------- Pool Type Devices Free Used Total -------------------------------------------------- centos lvm 1 4.00 MB 38.99 GB 39.00 GB -------------------------------------------------- -------------------------------------------------------------------------------------- Volume Pool Volume size FS FS size Free Type Mount point -------------------------------------------------------------------------------------- /dev/centos/root centos 36.99 GB xfs 36.97 GB 34.44 GB linear / /dev/centos/swap centos 2.00 GB linear /dev/sda1 1.00 GB xfs 1014.00 MB 864.65 MB /boot -------------------------------------------------------------------------------------- [root@localhost ~]#
可以使用ssm list –help查询帮助信息。
使用/dev/sdb,/dev/sdc,/dev/sdd三块硬盘创建vg0池,创建lv1逻辑卷,大小为1G,格式化为xfs文件系统格式,挂载到/mnt/volume1目录。
# 创建挂载目录[root@localhost ~]# mkdir /mnt/volume1# 创建逻辑卷[root@localhost ~]# ssm create -s 1G -n lv1 -p vg0 --fstype xfs /dev/sd{b,c,d} /mnt/volume1 Physical volume "/dev/sdb" successfully created. Physical volume "/dev/sdc" successfully created. Physical volume "/dev/sdd" successfully created. Volume group "vg0" successfully created Logical volume "lv1" created. meta-data=/dev/vg0/lv1 isize=512 agcount=4, agsize=65536 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=262144, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0# 查看是否挂载[root@localhost ~]# df -hFilesystem Size Used Avail Use% Mounted on devtmpfs 898M 0 898M 0% /dev tmpfs 910M 0 910M 0% /dev/shm tmpfs 910M 9.6M 901M 2% /run tmpfs 910M 0 910M 0% /sys/fs/cgroup /dev/mapper/centos-root 37G 2.6G 35G 7% / /dev/sda1 1014M 150M 865M 15% /boot tmpfs 182M 0 182M 0% /run/user/0 /dev/mapper/vg0-lv1 1014M 33M 982M 4% /mnt/volume1
fstype选项支持的文件类型,目前支持的有:
-s选项指定逻辑卷的大小。
-n选项指定指定逻辑卷的名称
-p选项需要使用哪一个池,如果池不存在,会创建池。
/dev/sd{b,c,d}使用/dev/sdb , /dev/sdc ,/dev/sdd这三个磁盘。
ssm resize命令可以调整卷的大小。下面的例子是给lv1逻辑卷增加2G空间,总空间为3G。
[root@localhost ~]# ssm resize -s +2G vg0/lv1 Size of logical volume vg0/lv1 changed from 1.00 GiB (256 extents) to 3.00 GiB (768 extents). Logical volume vg0/lv1 successfully resized. [root@localhost ~]# df -hFilesystem Size Used Avail Use% Mounted on devtmpfs 898M 0 898M 0% /dev tmpfs 910M 0 910M 0% /dev/shm tmpfs 910M 9.6M 901M 2% /run tmpfs 910M 0 910M 0% /sys/fs/cgroup /dev/mapper/centos-root 37G 2.6G 35G 7% / /dev/sda1 1014M 150M 865M 15% /boot tmpfs 182M 0 182M 0% /run/user/0 /dev/mapper/vg0-lv1 3.0G 33M 3.0G 2% /mnt/volume1
为lv1逻辑卷创建快照
[root@localhost ~]# ssm snapshot /dev/vg0/lv1 Rounding up size to full physical extent 412.00 MiB Logical volume "snap20200325T195111" created. [root@localhost ~]# ssm list snap------------------------------------------------------------------------ Snapshot Origin Pool Volume size Used Type ------------------------------------------------------------------------ /dev/vg0/snap20200325T195111 lv1 vg0 412.00 MB 0.00 KB linear
在这里删除卷和池。首先要卸载分区。
[root@localhost ~]# umount /mnt/volume1/# 删除vg0池和lv1卷[root@localhost ~]# ssm remove vg0Do you really want to remove volume group "vg0" containing 2 logical volumes? [y/n]: y Do you really want to remove active origin logical volume vg0/lv1 with 1 snapshot(s)? [y/n]: y Logical volume "snap20200325T195111" successfully removed Logical volume "lv1" successfully removed Volume group "vg0" successfully removed
然后从物理卷里面把/dev/sdb,/dev/sdc,/dev/sdd移除掉。
[root@localhost ~]# pvremove /dev/sd{b,c,d} Labels on physical volume "/dev/sdb" successfully wiped. Labels on physical volume "/dev/sdc" successfully wiped. Labels on physical volume "/dev/sdd" successfully wiped.
到此,相信大家对“Centos7怎么使用SSM管理LVM卷”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。