linux文件系统扩容操作步骤,仅供参考


1、查看/opt/XXXXXX/product/ess/apache-tomcat-ess/webapps/doc文件系统使用率为91%,需要扩容

[root@CMDI-DZQZ-Svr /]# df -h
文件系统                    容量  已用  可用 已用% 挂载点
devtmpfs                     16G     0   16G    0% /dev
tmpfs                        16G     0   16G    0% /dev/shm
tmpfs                        16G  105M   16G    1% /run
tmpfs                        16G     0   16G    0% /sys/fs/cgroup
/dev/mapper/cl-root          64G   59G  5.4G   92% /
/dev/mapper/cl-home          32G  7.1G   25G   23% /home
/dev/sda1                  1014M  195M  820M   20% /boot
/dev/mapper/VG--Ess-ESS500  4.0T  3.6T  400G   91% /opt/XXXXXX/product/ess/apache-tomcat-ess/webapps/doc
tmpfs                       3.2G     0  3.2G    0% /run/user/0
tmpfs                       3.2G     0  3.2G    0% /run/user/1000
[root@CMDI-DZQZ-Svr /]#


2、查看文件系统类型为xfs

[root@CMDI-DZQZ-Svr /]# cat /etc/fstab
...

/dev/mapper/cl-root     /                       xfs     defaults        0 0
UUID=151d47fd-8320-44da-9898-9c9799cb4c5d /boot                   xfs     defaults        0 0
/dev/mapper/cl-home     /home                   xfs     defaults        0 0
/dev/mapper/cl-swap     none                    swap    defaults        0 0
/dev/VG-Ess/ESS500 /opt/XXXXXX/product/ess/apache-tomcat-ess/webapps/doc  xfs   defaults   1  1
[root@CMDI-DZQZ-Svr /]#

3、查看当前逻辑卷所使用的磁盘
[root@CMDI-DZQZ-Svr /]# pvs
  PV         VG     Fmt  Attr PSize   PFree  
  /dev/sda2  cl     lvm2 a--  <99.00g      0 
  /dev/sdb   VG-Ess lvm2 a--   <4.00t <92.09g
[root@CMDI-DZQZ-Svr /]#

4、查看新分配的磁盘,名称为sdc

[root@CMDI-DZQZ-Svr /]# fdisk -l

....................

Disk /dev/sdc:4 TiB,4398046511104 字节,8589934592 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
[root@CMDI-DZQZ-Svr /]#

5、使用sdc创建PV

[root@CMDI-DZQZ-Svr /]# pvcreate /dev/sdc
  Physical volume "/dev/sdc" successfully created.
[root@CMDI-DZQZ-Svr /]#


6、将sdc添加到VG中。

[root@CMDI-DZQZ-Svr /]# vgextend VG-Ess /dev/sdc
  Volume group "VG-Ess" successfully extended
[root@CMDI-DZQZ-Svr /]#

7、扩容对应LV
[root@CMDI-DZQZ-Svr /]# lvextend -L +3.9T -n /dev/VG-Ess/ESS500 
  Rounding size to boundary between physical extents: 3.90 TiB.
  Size of logical volume VG-Ess/ESS500 changed from 3.91 TiB (1025000 extents) to 7.81 TiB (2047362 extents).
  Logical volume VG-Ess/ESS500 successfully resized.
[root@CMDI-DZQZ-Svr /]#

8、扩容LV对应的文件系统
[root@CMDI-DZQZ-Svr /]# xfs_growfs /dev/VG-Ess/ESS500 
meta-data=/dev/mapper/VG--Ess-ESS500 isize=512    agcount=4100, agsize=256000 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=1049600000, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           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 1049600000 to 2096498688
[root@CMDI-DZQZ-Svr /]#

9、扩容之后查看文件系统使用率,降为46%
[root@CMDI-DZQZ-Svr /]# df -h
文件系统                    容量  已用  可用 已用% 挂载点
devtmpfs                     16G     0   16G    0% /dev
tmpfs                        16G     0   16G    0% /dev/shm
tmpfs                        16G  105M   16G    1% /run
tmpfs                        16G     0   16G    0% /sys/fs/cgroup
/dev/mapper/cl-root          64G   59G  5.4G   92% /
/dev/mapper/cl-home          32G  7.1G   25G   23% /home
/dev/sda1                  1014M  195M  820M   20% /boot
/dev/mapper/VG--Ess-ESS500  7.9T  3.6T  4.3T   46% /opt/XXXXXX/product/ess/apache-tomcat-ess/webapps/doc
tmpfs                       3.2G     0  3.2G    0% /run/user/0
tmpfs                       3.2G     0  3.2G    0% /run/user/1000
[root@CMDI-DZQZ-Svr /]# vgs

你可能感兴趣的:(linux,linux,docker,centos)