• Centos 如何扩充/增加磁盘


    1:使用背景

    废话不多说,磁盘空间不足,增加磁盘,然后扩充现有不足空间磁盘。

    本次以Vmware进行测验。

    2:我们本次要增加的就是这个 

    3:我们先添加一个磁盘,20G,添加过程不在赘述

    4:添加完成后,要重启一下,要不然系统无法识别

    5:添加完成后,我们查看是否添加成功

    6:添加成功后,我们开始对分区进行操作

    [root@localhost /]# fdisk /dev/sdb

    7:创建物理卷

    [root@localhost /]# pvcreate /dev/sdb1
      Physical volume "/dev/sdb1" successfully created.

    8:查看新建的物理卷和大小,记住VG name 组名

    9:将添加新的物理卷,加载到cl卷组

    [root@localhost /]# vgextend cl /dev/sdb1 
      Volume group "cl" successfully extended

    10:再次查看物理卷,也可以使用vgdisplay命令

    11:增加磁盘空间

    [root@localhost /]# lvresize -L +19.99G /dev/mapper/cl-root                      #/dev/mapper/cl-root 是磁盘分区的文件系统名 df -h 的时候可以看到
      Rounding size to boundary between physical extents: 19.99 GiB.
      Size of logical volume cl/root changed from 17.00 GiB (4351 extents) to 36.99 GiB (9469 extents).
      Logical volume cl/root su

    12:重新识别分区大小

    [root@localhost /]# resize2fs /dev/mapper/cl-root
    resize2fs 1.42.9 (28-Dec-2013)
    resize2fs: Bad magic number in super-block 当尝试打开 /dev/mapper/cl-root 时
    找不到有效的文件系统超级块.

    13:如果出现“找不到有效的文件系统超级块”错误,用一下命令即可

    [root@localhost /]# xfs_growfs /dev/mapper/cl-root
    meta-data=/dev/mapper/cl-root    isize=512    agcount=4, agsize=1113856 blks
             =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=1        finobt=0 spinodes=0
    data     =                       bsize=4096   blocks=4455424, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
    log      =internal               bsize=4096   blocks=2560, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    data blocks changed from 4455424 to 9696256

    14:查看磁盘空间是否添加成功

  • 相关阅读:
    LeetCode 1245. Tree Diameter
    LeetCode 1152. Analyze User Website Visit Pattern
    LeetCode 1223. Dice Roll Simulation
    LeetCode 912. Sort an Array
    LeetCode 993. Cousins in Binary Tree
    LeetCode 1047. Remove All Adjacent Duplicates In String
    LeetCode 390. Elimination Game
    LeetCode 1209. Remove All Adjacent Duplicates in String II
    LeetCode 797. All Paths From Source to Target
    LeetCode 1029. Two City Scheduling
  • 原文地址:https://www.cnblogs.com/willamwang/p/12082465.html
Copyright © 2020-2023  润新知