Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to expand the LVM capacity of ProxmoxVE virtual machine

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to expand the LVM capacity of the ProxmoxVE virtual machine. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

-- lvm expansion of Proxmox VE virtual machine (/ insufficient dev/mapper/centos-root space)

1:. First check our root partition usage

[root@localhost] # df-h

File system capacity used available used% mount point

/ dev/mapper/centos-root 50G 48G 2.5G 96% /

Devtmpfs 16G 0 16G 0% / dev

Tmpfs 16G 196K 16G 1% / dev/shm

Tmpfs 16G 17M 16G 1% / run

Tmpfs 16G 0 16G 0% / sys/fs/cgroup

/ dev/sda1 1014M 168M 847M 17% / boot

/ dev/mapper/centos-home 39G 17G 23G 43% / home

Tmpfs 3.2G 0 3.2G 0% / run/user/0

2: expand the disk in the virtual machine, restart the virtual machine-/ dev/sda is directly added from 144G to 644G (expanded 500G disk)

[root@localhost ~] # fdisk-l

Disk / dev/sda:644.2 GB, 644245094400 bytes, 1258291200 sectors

Units = sector of 1 * 512 = 512 bytes

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

Igamo size (minimum / best): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000623eb

Device Boot Start End Blocks Id System

/ dev/sda1 * 2048 2099199 1048576 83 Linux

/ dev/sda2 2099200 209715199 103808000 8e Linux LVM

Disk / dev/mapper/centos-root:53.7 GB, 53687091200 bytes, 104857600 sectors

Units = sector of 1 * 512 = 512 bytes

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

Igamo size (minimum / best): 512 bytes / 512 bytes

Disk / dev/mapper/centos-swap:10.7 GB, 10737418240 bytes, 20971520 sectors

Units = sector of 1 * 512 = 512 bytes

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

Igamo size (minimum / best): 512 bytes / 512 bytes

Disk / dev/mapper/centos-home:41.9 GB, 41871736832 bytes, 81780736 sectors

3: create a new partition

[root@localhost ~] # fdisk / dev/sda

Welcome to fdisk (util-linux 2.23.2).

The changes remain in memory until you decide to write them to disk.

Think twice before using the write command.

Command (enter m for help): n

Partition type:

P primary (2 primary, 0 extended, 2 free)

E extended

Select (default p): P

Area number (3pd4, default 3): 3

Start sector (209715200-1258291199, default is 209715200): enter

The default value of 209715200 will be used

Last sector, + sector or + size {K _ Magne _ M _ G} (209715200-1258291199, default is 1258291199): enter

The default value of 1258291199 will be used

Partition 3 has been set to Linux type and size to 500 GiB

Command (enter m for help): t

Partition number (1-3, default 3): 3

Hex code (enter L to list all codes): 8e

Changed the type of partition "Linux" to "Linux LVM"

Command (enter m for help): W

The partition table has been altered!

Calling ioctl () to re-read partition table.

Prompt error: restart the computer

WARNING: Re-reading the partition table failed with error 16: equipment or resources are busy.

The kernel still uses the old table. The new table will be used at

The next reboot or after you run partprobe (8) or kpartx (8)

Synchronizing disks.

4: check the disk condition and whether the new disk / dev/sda3 is marked as LVM

[root@localhost ~] # fdisk-l

Disk / dev/sda:644.2 GB, 644245094400 bytes, 1258291200 sectors

Units = sector of 1 * 512 = 512 bytes

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

Igamo size (minimum / best): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000623eb

Device Boot Start End Blocks Id System

/ dev/sda1 * 2048 2099199 1048576 83 Linux

/ dev/sda2 2099200 209715199 103808000 8e Linux LVM

/ dev/sda3 209715200 1258291199 524288000 8e Linux LVM

5: view the disk number

[root@localhost ~] # ls / dev/sd*

/ dev/sda / dev/sda1 / dev/sda2 / dev/sda3

6: create a new physical volume for pv

[root@localhost ~] # pvcreate / dev/sda3

Physical volume "/ dev/sda3" successfully created.

7: check the vgs group. VFree is 0.

[root@localhost ~] # vgs

VG # PV # LV # SN Attr VSize VFree

Centos 1 3 0 wz--n-

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 210

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report