In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how Centos7 uses SSM to manage LVM volumes. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The system Storage Manager (SSM) provides a command line interface to manage storage in various technologies. Storage systems are becoming more and more complex by using DM, LVM, and MD. This results in a system that is unfriendly to users, making errors and problems more likely to occur. SSM alleviates this problem by creating a unified user interface.
Environment
Centos7.7 Minimal
System-storage-manager 0.4-9
Install SSM
[root@localhost ~] # yum-y install system-storage-manager
List devices, volumes, etc.
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. Currently, the following are supported:
Ext3
Ext4
Xfs
Btrfs
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 volumes, pool
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.
SSM alleviates this problem by creating a unified user interface.
The above is how Centos7 uses SSM to manage LVM volumes. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.