Esxi Centos7.9扩容磁盘空间

1.在虚机添加磁盘

看那个LUN有空间划分500G

Esxi Centos7.9扩容磁盘空间_第1张图片

2.通过SSH工具登录服务器

[root@localhost ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

fd0 2:0 1 4K 0 disk

sda 8:0 0 50G 0 disk

├─sda1 8:1 0 500M 0 part /boot

└─sda2 8:2 0 49.5G 0 part

├─centos-root 253:0 0 41.5G 0 lvm /

└─centos-swap 253:1 0 8G 0 lvm [SWAP]

sdb 8:16 0 1T 0 disk

└─vg0-lv0 253:2 0 1.5T 0 lvm /dbbackup

sdc 8:32 0 500G 0 disk

└─sdc1 8:33 0 500G 0 part

└─vg0-lv0 253:2 0 1.5T 0 lvm /dbbackup

sdd 8:48 0 500G 0 disk

sr0 11:0 1 1024M 0 rom

Esxi Centos7.9扩容磁盘空间_第2张图片

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

Welcome to fdisk (util-linux 2.23.2).

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

Be careful before using the write command.

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0xf043bc89.

Command (m for help): n

Partition type:

p primary (0 primary, 0 extended, 4 free)

e extended

Select (default p): p

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

First sector (2048-1048575999, default 2048):

Using default value 2048

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

Using default value 1048575999

Partition 1 of type Linux and of size 500 GiB is set

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[root@localhost ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

fd0 2:0 1 4K 0 disk

sda 8:0 0 50G 0 disk

├─sda1 8:1 0 500M 0 part /boot

└─sda2 8:2 0 49.5G 0 part

├─centos-root 253:0 0 41.5G 0 lvm /

└─centos-swap 253:1 0 8G 0 lvm [SWAP]

sdb 8:16 0 1T 0 disk

└─vg0-lv0 253:2 0 1.5T 0 lvm /dbbackup

sdc 8:32 0 500G 0 disk

└─sdc1 8:33 0 500G 0 part

└─vg0-lv0 253:2 0 1.5T 0 lvm /dbbackup

sdd 8:48 0 500G 0 disk

└─sdd1 8:49 0 500G 0 part

sr0 11:0 1 1024M 0 rom

Esxi Centos7.9扩容磁盘空间_第3张图片

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

Physical volume "/dev/sdd1" successfully created.

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name centos

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 49.50 GiB

PE Size 4.00 MiB

Total PE 12673

Alloc PE / Size 12672 / 49.50 GiB

Free PE / Size 1 / 4.00 MiB

VG UUID UcvgkA-OcFr-mqmH-zHnY-9fjk-1ejZ-rjJ28n

--- Volume group ---

VG Name vg0

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 4

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

PE Size 4.00 MiB

Total PE 390142

Alloc PE / Size 390142 /

Free PE / Size 0 / 0

VG UUID xFT1Co-ZKKD-2rst-Wzmc-tgoO-PFIc-yJmVTk

Esxi Centos7.9扩容磁盘空间_第4张图片

[root@localhost ~]# vgextend vg0 /dev/sdd1

Volume group "vg0" successfully extended

[root@localhost ~]# lvdisplay

--- Logical volume ---

LV Path /dev/centos/swap

LV Name swap

VG Name centos

LV UUID dn0PXn-sqgk-LfFj-wEst-t7nV-SNIA-d2n0ut

LV Write Access read/write

LV Creation host, time localhost, 2020-08-24 10:11:22 +0800

LV Status available

# open 2

LV Size 8.00 GiB

Current LE 2048

Segments 1

Allocation inherit

Read ahead sectors auto

- currently set to 8192

Block device 253:1

--- Logical volume ---

LV Path /dev/centos/root

LV Name root

VG Name centos

LV UUID cdf5MF-CGqO-grad-Ezw4-HRGh-XFEF-Ju7Vuo

LV Write Access read/write

LV Creation host, time localhost, 2020-08-24 10:11:23 +0800

LV Status available

# open 1

LV Size 41.50 GiB

Current LE 10624

Segments 1

Allocation inherit

Read ahead sectors auto

- currently set to 8192

Block device 253:0

--- Logical volume ---

LV Path /dev/vg0/lv0

LV Name lv0

VG Name vg0

LV UUID l4cfel-nH9X-oH2V-eFts-SjLe-Pv3d-Nf3ZxV

LV Write Access read/write

LV Creation host, time localhost, 2020-09-17 10:54:31 +0800

LV Status available

# open 1

LV Size

Current LE 390142

Segments 2

Allocation inherit

Read ahead sectors auto

- currently set to 8192

Block device 253:2

Esxi Centos7.9扩容磁盘空间_第5张图片

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name centos

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 49.50 GiB

PE Size 4.00 MiB

Total PE 12673

Alloc PE / Size 12672 / 49.50 GiB

Free PE / Size 1 / 4.00 MiB

VG UUID UcvgkA-OcFr-mqmH-zHnY-9fjk-1ejZ-rjJ28n

--- Volume group ---

VG Name vg0

System ID

Format lvm2

Metadata Areas 3

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 3

Act PV 3

VG Size

PE Size 4.00 MiB

Total PE 518141

Alloc PE / Size 390142 /

Free PE / Size 127999 /

VG UUID xFT1Co-ZKKD-2rst-Wzmc-tgoO-PFIc-yJmVTk

Esxi Centos7.9扩容磁盘空间_第6张图片

[root@localhost ~]# lvextend -l +127999 /dev/vg0/lv0

Size of logical volume vg0/lv0 changed from

Logical volume vg0/lv0 successfully resized.

[root@localhost ~]# resize2fs /dev/vg0/lv0

resize2fs 1.42.9 (28-Dec-2013)

Filesystem at /dev/vg0/lv0 is mounted on /dbbackup; on-line resizing required

old_desc_blocks = 191, new_desc_blocks = 253

The filesystem on /dev/vg0/lv0 is now 530576384 blocks long.

Esxi Centos7.9扩容磁盘空间_第7张图片

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/centos-root 42G 11G 31G 27% /

devtmpfs 3.9G 0 3.9G 0% /dev

tmpfs 3.9G 0 3.9G 0% /dev/shm

tmpfs 3.9G 410M 3.5G 11% /run

tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup

/dev/sda1 497M 172M 326M 35% /boot

/dev/mapper/vg0-lv0 2.0T 234G 1.7T 13% /dbbackup

tmpfs 783M 12K 783M 1% /run/user/42

tmpfs 783M 0 783M 0% /run/user/0

Esxi Centos7.9扩容磁盘空间_第8张图片

你可能感兴趣的:(Centos,elasticsearch,ssh,运维)