linux图形界面扩容lvm,linux下对LVM扩容

linux图形界面扩容lvm,linux下对LVM扩容操作环境:VirtualBox下RedHat6.464位版本扩容原因:/dev/vg_rhel64/lv_root占用率达到100%,导致部分应用无法继续运行操作过程:1.关闭系统,在虚拟机中添加一块10G的磁盘2.查看新添加磁盘对应的名称[root@rhel64~]#fdisk-cul得知磁盘对应名称为/dev/sdc3.给sdc分区,只分一个区sdc1[root@rhel64…

大家好,又见面了,我是你们的朋友全栈君。

操作环境:VirtualBox下RedHat6.4 64位版本

扩容原因:/dev/vg_rhel64/lv_root 占用率达到100%,导致部分应用无法继续运行

操作过程:

1.关闭系统,在虚拟机中添加一块10G的磁盘

2.查看新添加磁盘对应的名称

[root@rhel64 ~]# fdisk -cul 得知磁盘对应名称为 /dev/sdc

3.给sdc分区,只分一个区sdc1

[root@rhel64 ~]# fdisk -cu /dev/sdc

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xa655ad49.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):

Using default value 20971519

Command (m for help): p

Disk /dev/sdc: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0xa655ad49

Device Boot Start End Blocks Id System

/dev/sdc1 2048 20971519 10484736 83 Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

4.在sdc1上创建pv

[root@rhel64 ~]# pvcreate /dev/sdc1

Physical volume “/dev/sdc1” successfully created

5.查看pv的情况

[root@rhel64 ~]# pvdisplay

— Physical volume —

PV Name /dev/sdb2

VG Name vg_rhel64

PV Size 14.51 GiB / not usable 3.00 MiB

Allocatable yes (but full)

PE Size 4.00 MiB

Total PE 3714

Free PE 0

Allocated PE 3714

PV UUID VBVnoj-7R81-0BgJ-j8Tr-nq2W-i84v-xJZlqZ

— Physical volume —

PV Name /dev/sda5

VG Name vg_myvg

PV Size 1.00 GiB / not usable 4.00 MiB

Allocatable yes (but full)

PE Size 4.00 MiB

Total PE 255

Free PE 0

Allocated PE 255

PV UUID CmX1Tx-1LdX-wtRf-qXoX-Myg3-WR5g-klwUg9

— Physical volume —

PV Name /dev/sda6

VG Name vg_myvg

PV Size 1021.00 MiB / not usable 0

Allocatable yes (but full)

PE Size 4.00 MiB

Total PE 255

Free PE 0

Allocated PE 255

PV UUID Q9FgFp-0gHF-KMtK-Vrfa-2f95-eKRg-7bq40d

“/dev/sdc1” is a new physical volume of “10.00 GiB”

— NEW Physical volume —

PV Name /dev/sdc1

VG Name

PV Size 10.00 GiB

Allocatable NO

PE Size 0

Total PE 0

Free PE 0

Allocated PE 0

PV UUID KrvMui-Kzmd-qGdP-SBl6-yYfZ-Q5Y6-PA1Vv0

6.查看系统当前vg的情况

[root@rhel64 ~]# vgdisplay

— Volume group —

VG Name vg_rhel64

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 3

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 1

Act PV 1

VG Size 14.51 GiB

PE Size 4.00 MiB

Total PE 3714

Alloc PE / Size 3714 / 14.51 GiB

Free PE / Size 0 / 0

VG UUID Yb3iGX-1SdP-MoFz-I4iS-0oDt-NhVD-SE5UAr

— Volume group —

VG Name vg_myvg

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 1

Open LV 1

Max PV 0

Cur PV 2

Act PV 2

VG Size 1.99 GiB

PE Size 4.00 MiB

Total PE 510

Alloc PE / Size 510 / 1.99 GiB

Free PE / Size 0 / 0

VG UUID x9sUhJ-gQ4c-avxR-daQ1-ceib-VtGF-nvwqv9

7.给vg扩容

[root@rhel64 ~]# vgextend vg_rhel64 /dev/sdc1

Volume group “vg_rhel64” successfully extended

8.查看扩容后vg的情况

[root@rhel64 ~]# vgdisplay

— Volume group —

VG Name vg_rhel64

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 4

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 2

Open LV 2

Max PV 0

Cur PV 2

Act PV 2

VG Size 24.50 GiB

PE Size 4.00 MiB

Total PE 6273

Alloc PE / Size 3714 / 14.51 GiB

Free PE / Size 2559 / 10.00 GiB

VG UUID Yb3iGX-1SdP-MoFz-I4iS-0oDt-NhVD-SE5UAr

— Volume group —

VG Name vg_myvg

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 1

Open LV 1

Max PV 0

Cur PV 2

Act PV 2

VG Size 1.99 GiB

PE Size 4.00 MiB

Total PE 510

Alloc PE / Size 510 / 1.99 GiB

Free PE / Size 0 / 0

VG UUID x9sUhJ-gQ4c-avxR-daQ1-ceib-VtGF-nvwqv9

9.查看系统当前lv的情况

[root@rhel64 ~]# lvdisplay

— Logical volume —

LV Path /dev/vg_rhel64/lv_root

LV Name lv_root

VG Name vg_rhel64

LV UUID Y2oXR6-yrXx-fetw-GiOl-iHmc-HbOV-fIUc83

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2017-11-13 21:47:39 +0800

LV Status available

#open 1

LV Size 12.54 GiB

Current LE 3210

Segments 1

Allocation inherit

Read ahead sectors auto

currently set to 256

Block device 253:0

— Logical volume —

LV Path /dev/vg_rhel64/lv_swap

LV Name lv_swap

VG Name vg_rhel64

LV UUID OuuBWZ-WqMd-kZ5B-ka62-Ifgy-hfD5-6bpdZL

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2017-11-13 21:47:42 +0800

LV Status available

#open 1

LV Size 1.97 GiB

Current LE 504

Segments 1

Allocation inherit

Read ahead sectors auto

currently set to 256

Block device 253:1

— Logical volume —

LV Path /dev/vg_myvg/lv_mylv

LV Name lv_mylv

VG Name vg_myvg

LV UUID vFq38A-3mJ1-RRso-2EcI-e9gO-wz2a-YWU3x8

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2018-01-12 14:14:35 +0800

LV Status available

#open 1

LV Size 1.99 GiB

Current LE 510

Segments 2

Allocation inherit

Read ahead sectors auto

currently set to 256

10.给lv扩容

[root@rhel64 ~]# lvextend /dev/vg_rhel64/lv_root /dev/sdc1

Extending logical volume lv_root to 22.54 GiB

Logical volume lv_root successfully resized

11.查看扩容后的lv

[root@rhel64 ~]# lvdisplay

— Logical volume —

LV Path /dev/vg_rhel64/lv_root

LV Name lv_root

VG Name vg_rhel64

LV UUID Y2oXR6-yrXx-fetw-GiOl-iHmc-HbOV-fIUc83

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2017-11-13 21:47:39 +0800

LV Status available

#open 1

LV Size 22.54 GiB

Current LE 5769

Segments 2

Allocation inherit

Read ahead sectors auto

currently set to 256

Block device 253:0

— Logical volume —

LV Path /dev/vg_rhel64/lv_swap

LV Name lv_swap

VG Name vg_rhel64

LV UUID OuuBWZ-WqMd-kZ5B-ka62-Ifgy-hfD5-6bpdZL

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2017-11-13 21:47:42 +0800

LV Status available

#open 1

LV Size 1.97 GiB

Current LE 504

Segments 1

Allocation inherit

Read ahead sectors auto

currently set to 256

Block device 253:1

— Logical volume —

LV Path /dev/vg_myvg/lv_mylv

LV Name lv_mylv

VG Name vg_myvg

LV UUID vFq38A-3mJ1-RRso-2EcI-e9gO-wz2a-YWU3x8

LV Write Access read/write

LV Creation host, time rhel64.oracle.com, 2018-01-12 14:14:35 +0800

LV Status available

#open 1

LV Size 1.99 GiB

Current LE 510

Segments 2

Allocation inherit

Read ahead sectors auto

currently set to 256

Block device 253:2

12.查看系统当前的分区情况

[root@rhel64 ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/vg_rhel64-lv_root

13G 12G 104M 100% /

tmpfs 1.5G 72K 1.5G 1% /dev/shm

/dev/sdb1 485M 33M 427M 8% /boot

/dev/sda1 18G 172M 17G 1% /u01

/dev/sda2 7.9G 146M 7.4G 2% /software

/dev/mapper/vg_myvg-lv_mylv

2.0G 11M 1.9G 1% /lvm

没有扩容

13.对/扩容

[root@rhel64 ~]# resize2fs /dev/vg_rhel64/lv_root

resize2fs 1.41.12 (17-May-2010)

Filesystem at /dev/vg_rhel64/lv_root is mounted on /; on-line resizing required

old desc_blocks = 1, new_desc_blocks = 2

Performing an on-line resize of /dev/vg_rhel64/lv_root to 5907456 (4k) blocks.

The filesystem on /dev/vg_rhel64/lv_root is now 5907456 blocks long.

14.查看扩容后分区的情况

[root@rhel64 ~]# df -Th

Filesystem Type Size Used Avail Use% Mounted on

/dev/mapper/vg_rhel64-lv_root

ext4 23G 12G 9.5G 56% /

tmpfs tmpfs 1.5G 72K 1.5G 1% /dev/shm

/dev/sdb1 ext4 485M 33M 427M 8% /boot

/dev/sda1 ext4 18G 172M 17G 1% /u01

/dev/sda2 ext4 7.9G 146M 7.4G 2% /software

/dev/mapper/vg_myvg-lv_mylv

ext4 2.0G 11M 1.9G 1% /lvm

可以看到,/分区由原来的13G扩容到了23G

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/151497.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 怎么理解泊松分布_泊松分布公式

    怎么理解泊松分布_泊松分布公式1甜在心馒头店公司楼下有家馒头店:每天早上六点到十点营业,生意挺好,就是发愁一个事情,应该准备多少个馒头才能既不浪费又能充分供应?老板统计了一周每日卖出的馒头(为了方便计算和讲解,缩小了数据):均值为:按道理讲均值是不错的选择(参见如何理解最小二乘法?),但是如果每天准备5个馒头的话,从统计表来看,至少有两天不够卖,的时间不够卖:你“甜在心馒头店”又不是…

    2022年8月30日
    3
  • redis+springboot_redis部署

    redis+springboot_redis部署目录1、搭建环境2、测试Redis3、StringRedisTemplate3.1、介绍3.2、StringRedisTemplate常用操作3.3、StringRedisTemplate的使用4、RedisTemplate4.1、介绍4.2、RedisTemplate常用操作4.3、RedisTemplate的使用SpringBootData(数据)Redis中提供了RedisTemplate和StringRedisTemplate,其中StringRedisTemplate是RedisTem.

    2022年9月22日
    3
  • 在VMware Vcenter添加一块网卡后,启动虚机找不到网卡,发现有一个ens38(redhat7.5)…

    在VMware Vcenter添加一块网卡后,启动虚机找不到网卡,发现有一个ens38(redhat7.5)…

    2021年7月7日
    103
  • pdf拆分保留书签_pdf补丁

    pdf拆分保留书签_pdf补丁PDF补丁丁0.2.7.2版软件已经更新,请在博客首页(http://pdfpatcher.cnblogs.com)下载最新版。2010年6月11日更新功能介绍PDF补丁丁是一个用于修改PDF文件信息的工具。它具有以下功能:生成PDF文件:通过导入一批图片或已有PDF文件,生成包含图片及已有PDF文件指定页面范围的PDF文件。在生成文件时还可挂上书签。用此功能…

    2025年5月24日
    6
  • lspci 指令_plsr指令

    lspci 指令_plsr指令1.指令名称lspci2.指令简介lspci是一个用于显示系统中所有PCI/PCIe总线及设备信息的工具。默认情况下,它只显示设备的最简要信息。通过传入指定参数,可以输出更详细的信息,或者可以按照特定格式输出,以便于用其他程序进行解析。有些PCI/PCIe的设备信息需要在root权限下才能获取到。3.参数先来看看不加任何参数时输出的结果。bryan@bryan-pc:~$lspci00:00.0Hostbridge:IntelCorporation8.

    2025年10月14日
    4
  • 2109-全国大学生电子设计竞赛-F-纸张数识别(内含arduino代码以及题解)[通俗易懂]

    2109-全国大学生电子设计竞赛-F-纸张数识别(内含arduino代码以及题解)[通俗易懂]题目:一,任务设计并制作纸张计数显示装置,其组成如图1所示。两块平行极板(极板A、极板B)分别通过导线a和导线b连接到测量显示电路,装置可测量并显示置于极板A与极板B之间的纸张数量。二,要求1,基本要求(1)极板A和极板和极板B上的金属电极部分均为边长50mm0mm±1mm的正方形,导线a和导线b长度均为500mm…

    2022年5月6日
    51

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号