如何扩充文件系统

查看逻辑卷信息

[root@slcz01db03 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSys1
  LV Name                LVDbSys1
  VG Name                VGExaDb
  LV UUID                ixlJ9Y-ajHv-I1RS-oUl7-AidJ-oiKG-VhSzIc
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:30:54 -0600
  LV Status              available
  # open                 1
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:0

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSys2
  LV Name                LVDbSys2
  VG Name                VGExaDb
  LV UUID                T23u0i-FRpM-E7ME-7UQ0-HoqD-v46E-ZBh6C3
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:30:54 -0600
  LV Status              available
  # open                 0
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:1

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSwap1
  LV Name                LVDbSwap1
  VG Name                VGExaDb
  LV UUID                EqvCb3-y52d-4ZNr-eG2W-7EUm-89K6-wwFA4H
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:11 -0600
  LV Status              available
  # open                 2
  LV Size                24.00 GiB
  Current LE             6144
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:2

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDoNotRemoveOrUse
  LV Name                LVDoNotRemoveOrUse
  VG Name                VGExaDb
  LV UUID                qLRpHH-SlMh-aRXA-nmeN-e8aM-3mIh-WQa3Yr
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:24 -0600
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:3

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbOra1
  LV Name                LVDbOra1
  VG Name                VGExaDb
  LV UUID                0KhVTx-df9i-RTnJ-Ymw3-Rz5Q-JQqt-0JjAP2
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:30 -0600
  LV Status              available
  # open                 1
  LV Size                100.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:4

通过df命令可以看到逻辑卷和文件系统之间的联系

[root@slcz01db03 ~]# df -k
Filesystem                    1K-blocks     Used  Available Use% Mounted on
devtmpfs                      660302404        0  660302404   0% /dev
tmpfs                        1320627200  1438624 1319188576   1% /dev/shm
tmpfs                         660313880     6208  660307672   1% /run
tmpfs                         660313880        0  660313880   0% /sys/fs/cgroup
/dev/mapper/VGExaDb-LVDbSys1   30832548 13159796   16083504  46% /
/dev/sda1                        499656    56216     406744  13% /boot
/dev/mapper/VGExaDb-LVDbOra1  103080888 50264320   47557304  52% /u01
tmpfs                         132062776        0  132062776   0% /run/user/0

扩充/u01 所在的逻辑卷

[root@slcz01db03 ~]# lvextend -L 1000G /dev/VGExaDb/LVDbOra1
  Size of logical volume VGExaDb/LVDbOra1 changed from 100.00 GiB (25600 extents) to 1000.00 GiB (256000 extents).
  Logical volume VGExaDb/LVDbOra1 successfully resized.

查看逻辑卷是否已经扩充

[root@slcz01db03 ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSys1
  LV Name                LVDbSys1
  VG Name                VGExaDb
  LV UUID                ixlJ9Y-ajHv-I1RS-oUl7-AidJ-oiKG-VhSzIc
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:30:54 -0600
  LV Status              available
  # open                 1
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:0

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSys2
  LV Name                LVDbSys2
  VG Name                VGExaDb
  LV UUID                T23u0i-FRpM-E7ME-7UQ0-HoqD-v46E-ZBh6C3
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:30:54 -0600
  LV Status              available
  # open                 0
  LV Size                30.00 GiB
  Current LE             7680
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:1

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbSwap1
  LV Name                LVDbSwap1
  VG Name                VGExaDb
  LV UUID                EqvCb3-y52d-4ZNr-eG2W-7EUm-89K6-wwFA4H
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:11 -0600
  LV Status              available
  # open                 2
  LV Size                24.00 GiB
  Current LE             6144
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:2

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDoNotRemoveOrUse
  LV Name                LVDoNotRemoveOrUse
  VG Name                VGExaDb
  LV UUID                qLRpHH-SlMh-aRXA-nmeN-e8aM-3mIh-WQa3Yr
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:24 -0600
  LV Status              available
  # open                 0
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:3

  --- Logical volume ---
  LV Path                /dev/VGExaDb/LVDbOra1
  LV Name                LVDbOra1
  VG Name                VGExaDb
  LV UUID                0KhVTx-df9i-RTnJ-Ymw3-Rz5Q-JQqt-0JjAP2
  LV Write Access        read/write
  LV Creation host, time localhost, 2019-08-12 14:31:30 -0600
  LV Status              available
  # open                 1
  LV Size                1000.00 GiB
  Current LE             256000
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           249:4

在扩充文件系统之前先查看一下文件系统的大小

[root@slcz01db03 ~]# df -k
Filesystem                    1K-blocks     Used  Available Use% Mounted on
devtmpfs                      660302404        0  660302404   0% /dev
tmpfs                        1320627200  1438624 1319188576   1% /dev/shm
tmpfs                         660313880     6208  660307672   1% /run
tmpfs                         660313880        0  660313880   0% /sys/fs/cgroup
/dev/mapper/VGExaDb-LVDbSys1   30832548 13146684   16096616  45% /
/dev/sda1                        499656    56216     406744  13% /boot
/dev/mapper/VGExaDb-LVDbOra1  103080888 50265788   47555836  52% /u01
tmpfs                         132062776        0  132062776   0% /run/user/0

扩充文件系统

[root@slcz01db03 ~]# resize2fs /dev/VGExaDb/LVDbOra1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/VGExaDb/LVDbOra1 is mounted on /u01; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 125
The filesystem on /dev/VGExaDb/LVDbOra1 is now 262144000 blocks long.

扩充文件系统大小后再查看文件系统大小

[root@slcz01db03 ~]# df -k
Filesystem                    1K-blocks     Used  Available Use% Mounted on
devtmpfs                      660302404        0  660302404   0% /dev
tmpfs                        1320627200  1438624 1319188576   1% /dev/shm
tmpfs                         660313880     6208  660307672   1% /run
tmpfs                         660313880        0  660313880   0% /sys/fs/cgroup
/dev/mapper/VGExaDb-LVDbSys1   30832548 13148196   16095104  45% /
/dev/sda1                        499656    56216     406744  13% /boot
/dev/mapper/VGExaDb-LVDbOra1 1031987352 50273712  938685604   6% /u01
tmpfs                         132062776        0  132062776   0% /run/user/0

一个简略的过程

[root@slcz01db03 ~]# lvextend -L 300G /dev/VGExaDb/LVDbSys1
  Size of logical volume VGExaDb/LVDbSys1 changed from 30.00 GiB (7680 extents) to 300.00 GiB (76800 extents).
  Logical volume VGExaDb/LVDbSys1 successfully resized.
  
[root@slcz01db03 ~]# resize2fs /dev/VGExaDb/LVDbSys1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/VGExaDb/LVDbSys1 is mounted on /; on-line resizing required
old_desc_blocks = 4, new_desc_blocks = 38
The filesystem on /dev/VGExaDb/LVDbSys1 is now 78643200 blocks long.

[root@slcz01db03 ~]# df -k
Filesystem                    1K-blocks     Used  Available Use% Mounted on
devtmpfs                      660302404        0  660302404   0% /dev
tmpfs                        1320627200  1438624 1319188576   1% /dev/shm
tmpfs                         660313880     6208  660307672   1% /run
tmpfs                         660313880        0  660313880   0% /sys/fs/cgroup
/dev/mapper/VGExaDb-LVDbSys1  309504832 13188368  283381904   5% /
/dev/sda1                        499656    56216     406744  13% /boot
/dev/mapper/VGExaDb-LVDbOra1 1031987352 50276636  938682680   6% /u01
tmpfs                         132062776        0  132062776   0% /run/user/0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值