Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Centos7 use SSM to manage LVM volumes

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how Centos7 uses SSM to manage LVM volumes". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how Centos7 uses SSM to manage LVM volumes".

Ssm, whose full name is Spring+SpringMVC+MyBatis, is a mainstream Java EE enterprise framework at present, which is suitable for building all kinds of large-scale enterprise application systems. Ssm can also refer to "soft system methodology", which is a qualitative research technology that uses systematic thinking to solve non-systematic problems.

Environment Centos7.7 Minimalsystem-storage-manager 0.4-9 install SSM [root @ localhost ~] # yum-y install system-storage-manager lists devices, volumes and other information

Use ssm list to display information for all detected devices, pools, volumes, and snapshots:

[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 14.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 ~] #

You can use ssm list-help to query help information.

Create new pools, logical volumes, and file systems

Use / dev/sdb,/dev/sdc,/dev/sdd three hard drives to create a vg0 pool, create lv1 logical volumes with a size of 1G, format them into xfs file system format, and mount them to the / mnt/volume1 directory.

# create a mount directory [root@localhost ~] # mkdir / mnt/volume1# create a logic volume [root@localhost ~] # ssm create-s 1G-n lv1-p vg0-- fstype xfs / dev/sd {bmeme cje 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=0data = bsize=4096 blocks=262144 Imaxpct=25 = sunit=0 swidth=0 blksnaming = version 2 bsize=4096 ascii-ci=0 ftype=1log = internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime = none extsz=4096 blocks=0 Rtextents=0# check whether to mount [root@localhost ~] # df-hFilesystem Size Used Avail Use% Mounted ondevtmpfs 898M 0898M 0% / devtmpfs 910M 0910m 0% / dev/shmtmpfs 910M 9.6m 901m 2% / runtmpfs 910M 0910M 0% / sys/fs/cgroup/dev / mapper/centos-root 37G 2.6G 35G 7% / / dev/sda1 1014M 150M 865M 15% / boottmpfs 182M 0 182m 0% / run/user/0/dev/mapper/vg0-lv1 1014M 33M 982M 4% / mnt/volume1

The file types supported by the fstype option are:

Ext3ext4xfsbtrfs

The-s option specifies the size of the logical volume.

The-n option specifies the name of the specified logical volume

The-p option requires which pool to use, and if the pool does not exist, it will be created.

/ dev/sd {brecast c dev/sdd} use the three disks / dev/sdb, / dev/sdc, / dev/sdd.

Extended logical Volume

The ssm resize command resizes the volume. The following example is to add 2G space to the lv1 logical volume, with a total space of 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 ondevtmpfs 898M 0898M 0% / devtmpfs 910M 0910M 0% / dev/shmtmpfs 910M 9.6M 901m 2% / runtmpfs 910M 0910M 0% / sys/fs/cgroup/dev/ Mapper/centos-root 37G 2.6G 35G 7% / / dev/sda1 1014M 150M 865M 15% / boottmpfs 182m 0 182m 0% / run/user/0/dev/mapper/vg0-lv1 3.0G 33m 3.0G 2% / mnt/volume1 create a snapshot

Create a snapshot of a lv1 logical volume

[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 Delete Volume, Pond

Delete volumes and pools here. The first step is to uninstall the partition.

[root@localhost ~] # umount / mnt/volume1/# Delete VG0 pool and lv1 volume [root@localhost ~] # ssm remove vg0Do you really want to remove volume group "vg0" containing 2 logical volumes? YDo you really want to remove active origin logical volume vg0/lv1 with 1 snapshot (s)? [YBO]: y Logical volume "snap20200325T195111" successfully removed Logical volume "lv1" successfully removed Volume group "vg0" successfully removed

Then remove / dev/sdb,/dev/sdc,/dev/sdd from the physical volume.

[root@localhost ~] # pvremove / dev/sd {bmeme cpene 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. At this point, I believe you have a deeper understanding of "how Centos7 uses SSM to manage LVM volumes". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report