{"id":176288,"date":"2020-04-11T10:00:32","date_gmt":"2020-04-11T02:00:32","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=176288"},"modified":"2020-05-11T09:24:19","modified_gmt":"2020-05-11T01:24:19","slug":"centos7-ssm-lvm","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos7-ssm-lvm.html","title":{"rendered":"Centos7\u4f7f\u7528SSM\u7ba1\u7406LVM\u5377"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n \u7cfb\u7edf\u5b58\u50a8\u7ba1\u7406\u5668(SSM)\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4\u884c\u63a5\u53e3\u6765\u7ba1\u7406\u5404\u79cd\u6280\u672f\u4e2d\u7684\u5b58\u50a8\u3002\u901a\u8fc7\u4f7f\u7528DM\u3001LVM\u548cMD\uff0c\u5b58\u50a8\u7cfb\u7edf\u53d8\u5f97\u8d8a\u6765\u8d8a\u590d\u6742\u3002\u8fd9\u5c31\u9020\u6210\u4e86\u4e00\u4e2a\u5bf9\u7528\u6237\u4e0d\u53cb\u597d\u7684\u7cfb\u7edf\uff0c\u4f7f\u9519\u8bef\u548c\u95ee\u9898\u66f4\u5bb9\u6613\u51fa\u73b0\u3002SSM\u901a\u8fc7\u521b\u5efa\u7edf\u4e00\u7684\u7528\u6237\u754c\u9762\u6765\u7f13\u89e3\u8fd9\u4e00\u95ee\u9898\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u73af\u5883<\/strong><\/div>\n
    \n
  • Centos7.7 Minimal<\/li>\n
  • system-storage-manager 0.4-9<\/li>\n<\/ul>\n
    \u5b89\u88c5SSM<\/strong><\/div>\n
    \r\n[root@localhost ~]# yum -y install system-storage-manager\r\n<\/pre>\n
    \u5217\u51fa\u8bbe\u5907\u3001\u5377\u7b49\u4fe1\u606f<\/strong><\/div>\n

    \u4f7f\u7528ssm list<\/span> \u663e\u793a\u6240\u6709\u68c0\u6d4b\u5230\u7684\u8bbe\u5907\u3001\u6c60\u3001\u5377\u548c\u5feb\u7167\u7684\u4fe1\u606f\uff1a<\/p>\n

    \r\n[root@localhost ~]# ssm list\r\n-----------------------------------------------------------\r\nDevice        Free      Used     Total  Pool    Mount point\r\n-----------------------------------------------------------\r\n\/dev\/sda                      40.00 GB                     \r\n\/dev\/sda1                      1.00 GB          \/boot      \r\n\/dev\/sda2  4.00 MB  38.99 GB  39.00 GB  centos             \r\n\/dev\/sdb                       2.00 GB                     \r\n\/dev\/sdc                       2.00 GB                     \r\n\/dev\/sdd                       2.00 GB                     \r\n-----------------------------------------------------------\r\n--------------------------------------------------\r\nPool    Type  Devices     Free      Used     Total  \r\n--------------------------------------------------\r\ncentos  lvm   1        4.00 MB  38.99 GB  39.00 GB  \r\n--------------------------------------------------\r\n--------------------------------------------------------------------------------------\r\nVolume            Pool    Volume size  FS      FS size       Free  Type    Mount point\r\n--------------------------------------------------------------------------------------\r\n\/dev\/centos\/root  centos     36.99 GB  xfs    36.97 GB   34.44 GB  linear  \/          \r\n\/dev\/centos\/swap  centos      2.00 GB                              linear             \r\n\/dev\/sda1                     1.00 GB  xfs  1014.00 MB  864.65 MB          \/boot      \r\n--------------------------------------------------------------------------------------\r\n[root@localhost ~]#\r\n<\/pre>\n

    \"\"
    \n\u53ef\u4ee5\u4f7f\u7528ssm list --help<\/span>\u67e5\u8be2\u5e2e\u52a9\u4fe1\u606f\u3002<\/p>\n

    \u521b\u5efa\u65b0\u7684\u6c60\u3001\u903b\u8f91\u5377\u3001\u548c\u6587\u4ef6\u7cfb\u7edf<\/strong><\/div>\n

    \u4f7f\u7528\/dev\/sdb,\/dev\/sdc,\/dev\/sdd\u4e09\u5757\u786c\u76d8\u521b\u5efavg0\u6c60\uff0c\u521b\u5efalv1\u903b\u8f91\u5377\uff0c\u5927\u5c0f\u4e3a1G\uff0c\u683c\u5f0f\u5316\u4e3axfs\u6587\u4ef6\u7cfb\u7edf\u683c\u5f0f\uff0c\u6302\u8f7d\u5230\/mnt\/volume1\u76ee\u5f55\u3002<\/p>\n

    \r\n# \u521b\u5efa\u6302\u8f7d\u76ee\u5f55\r\n[root@localhost ~]# mkdir \/mnt\/volume1\r\n# \u521b\u5efa\u903b\u8f91\u5377\r\n[root@localhost ~]# ssm create -s 1G -n lv1 -p vg0 --fstype xfs \/dev\/sd{b,c,d} \/mnt\/volume1\r\n  Physical volume \"\/dev\/sdb\" successfully created.\r\n  Physical volume \"\/dev\/sdc\" successfully created.\r\n  Physical volume \"\/dev\/sdd\" successfully created.\r\n  Volume group \"vg0\" successfully created\r\n  Logical volume \"lv1\" created.\r\nmeta-data=\/dev\/vg0\/lv1           isize=512    agcount=4, agsize=65536 blks\r\n         =                       sectsz=512   attr=2, projid32bit=1\r\n         =                       crc=1        finobt=0, sparse=0\r\ndata     =                       bsize=4096   blocks=262144, imaxpct=25\r\n         =                       sunit=0      swidth=0 blks\r\nnaming   =version 2              bsize=4096   ascii-ci=0 ftype=1\r\nlog      =internal log           bsize=4096   blocks=2560, version=2\r\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\r\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\r\n# \u67e5\u770b\u662f\u5426\u6302\u8f7d\r\n\r\n[root@localhost ~]# df -h\r\nFilesystem               Size  Used Avail Use% Mounted on\r\ndevtmpfs                 898M     0  898M   0% \/dev\r\ntmpfs                    910M     0  910M   0% \/dev\/shm\r\ntmpfs                    910M  9.6M  901M   2% \/run\r\ntmpfs                    910M     0  910M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/centos-root   37G  2.6G   35G   7% \/\r\n\/dev\/sda1               1014M  150M  865M  15% \/boot\r\ntmpfs                    182M     0  182M   0% \/run\/user\/0\r\n\/dev\/mapper\/vg0-lv1     1014M   33M  982M   4% \/mnt\/volume1\r\n<\/pre>\n

    \"\"
    \n--fstype<\/span>\u9009\u9879\u652f\u6301\u7684\u6587\u4ef6\u7c7b\u578b\uff0c\u76ee\u524d\u652f\u6301\u7684\u6709\uff1a<\/p>\n

      \n
    • ext3<\/li>\n
    • ext4<\/li>\n
    • xfs<\/li>\n
    • btrfs<\/li>\n<\/ul>\n

      -s<\/span>\u9009\u9879\u6307\u5b9a\u903b\u8f91\u5377\u7684\u5927\u5c0f\u3002<\/p>\n

      -n<\/span>\u9009\u9879\u6307\u5b9a\u6307\u5b9a\u903b\u8f91\u5377\u7684\u540d\u79f0<\/p>\n

      -p<\/span>\u9009\u9879\u9700\u8981\u4f7f\u7528\u54ea\u4e00\u4e2a\u6c60\uff0c\u5982\u679c\u6c60\u4e0d\u5b58\u5728\uff0c\u4f1a\u521b\u5efa\u6c60\u3002<\/p>\n

      \/dev\/sd{b,c,d}<\/span>\u4f7f\u7528\/dev\/sdb , \/dev\/sdc ,\/dev\/sdd\u8fd9\u4e09\u4e2a\u78c1\u76d8\u3002<\/p>\n

      \u6269\u5c55\u903b\u8f91\u5377<\/strong><\/div>\n

      ssm resize<\/span>\u547d\u4ee4\u53ef\u4ee5\u8c03\u6574\u5377\u7684\u5927\u5c0f\u3002\u4e0b\u9762\u7684\u4f8b\u5b50\u662f\u7ed9lv1\u903b\u8f91\u5377\u589e\u52a02G\u7a7a\u95f4\uff0c\u603b\u7a7a\u95f4\u4e3a3G\u3002<\/p>\n

      \r\n[root@localhost ~]# ssm resize -s +2G vg0\/lv1\r\n  Size of logical volume vg0\/lv1 changed from 1.00 GiB (256 extents) to 3.00 GiB (768 extents).\r\n  Logical volume vg0\/lv1 successfully resized.\r\n[root@localhost ~]# df -h\r\nFilesystem               Size  Used Avail Use% Mounted on\r\ndevtmpfs                 898M     0  898M   0% \/dev\r\ntmpfs                    910M     0  910M   0% \/dev\/shm\r\ntmpfs                    910M  9.6M  901M   2% \/run\r\ntmpfs                    910M     0  910M   0% \/sys\/fs\/cgroup\r\n\/dev\/mapper\/centos-root   37G  2.6G   35G   7% \/\r\n\/dev\/sda1               1014M  150M  865M  15% \/boot\r\ntmpfs                    182M     0  182M   0% \/run\/user\/0\r\n\/dev\/mapper\/vg0-lv1      3.0G   33M  3.0G   2% \/mnt\/volume1\r\n<\/pre>\n

      \"\"<\/p>\n

      \u521b\u5efa\u5feb\u7167<\/strong><\/div>\n

      \u4e3alv1\u903b\u8f91\u5377\u521b\u5efa\u5feb\u7167<\/p>\n

      \r\n[root@localhost ~]# ssm snapshot \/dev\/vg0\/lv1 \r\n  Rounding up size to full physical extent 412.00 MiB\r\n  Logical volume \"snap20200325T195111\" created.\r\n[root@localhost ~]# ssm list snap\r\n------------------------------------------------------------------------\r\nSnapshot                      Origin  Pool  Volume size     Used  Type  \r\n------------------------------------------------------------------------\r\n\/dev\/vg0\/snap20200325T195111  lv1     vg0     412.00 MB  0.00 KB  linear\r\n<\/pre>\n
      \u5220\u9664\u5377\u3001\u6c60<\/strong><\/div>\n

      \u5728\u8fd9\u91cc\u5220\u9664\u5377\u548c\u6c60\u3002\u9996\u5148\u8981\u5378\u8f7d\u5206\u533a\u3002<\/p>\n

      \r\n[root@localhost ~]# umount \/mnt\/volume1\/\r\n# \u5220\u9664vg0\u6c60\u548clv1\u5377\r\n[root@localhost ~]# ssm remove  vg0\r\nDo you really want to remove volume group \"vg0\" containing 2 logical volumes? [y\/n]: y\r\nDo you really want to remove active origin logical volume vg0\/lv1 with 1 snapshot(s)? [y\/n]: y\r\n  Logical volume \"snap20200325T195111\" successfully removed\r\n  Logical volume \"lv1\" successfully removed\r\n  Volume group \"vg0\" successfully removed\r\n<\/pre>\n

      \"\"
      \n\u7136\u540e\u4ece\u7269\u7406\u5377\u91cc\u9762\u628a\/dev\/sdb,\/dev\/sdc,\/dev\/sdd\u79fb\u9664\u6389\u3002<\/p>\n

      \r\n[root@localhost ~]# pvremove \/dev\/sd{b,c,d}\r\n  Labels on physical volume \"\/dev\/sdb\" successfully wiped.\r\n  Labels on physical volume \"\/dev\/sdc\" successfully wiped.\r\n  Labels on physical volume \"\/dev\/sdd\" successfully wiped.\r\n<\/pre>\n
      \u603b\u7ed3<\/strong><\/div>\n

      SSM\u901a\u8fc7\u521b\u5efa\u7edf\u4e00\u7684\u7528\u6237\u754c\u9762\u6765\u7f13\u89e3\u8fd9\u4e00\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

      Centos7.7 Minimal system-storage-manager 0.4-9 [root@lo […]<\/p>\n","protected":false},"author":309,"featured_media":176289,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-176288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/176288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=176288"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/176288\/revisions"}],"predecessor-version":[{"id":176295,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/176288\/revisions\/176295"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/176289"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=176288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=176288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=176288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}