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 increase LV Space dynamically by linux

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

Share

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

This article will explain in detail how linux dynamically increases LV space for you. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

1. Add hard disk

Do what you have to do.

Need to restart after adding (do you know how not to restart)

This is the newly added hard disk [root@localhost ~] # fdisk-l / dev/sdb Disk / dev/sdb: 5368 MB, 5368709120 bytes 255heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk / dev/sdb doesn't contain a valid partition table

two。 Create PV

The command is simple.

-- the command is simple [root@localhost ~] # pvcreate / dev/sdb Physical volume "/ dev/sdb" successfully created-- you can see the new PV [root@localhost ~] # pvdisplay / dev/hdc: open failed: No medium found-Physical volume-PV Name / dev/sda2 VG Name VolGroup00 PV Size 9.90 GB / not usable 22. 76 MB Allocatable yes (but full) PE Size (KByte) 32768 Total PE 316 Free PE 0 Allocated PE 316 PV UUID n5fS6M-jBiH-n9vU-pBTd-iOCv-BbTe-BUeNZo "/ dev/sdb" is a new physical volume of "5.00 GB"-NEW Physical volume-PV Name / dev/sdb VG Name PV Size 5.00 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID TDs3mN-3ON3-eHbl-cohr-7Hr3-8608-jiLlXG

3. Add PV to VG

-- specify the corresponding VG and PV [root@localhost ~] # vgextend VolGroup00 / dev/sdb Volume group "VolGroup00" successfully extended-- see the new 5G added to the VG Status is not assigned [root@localhost ~] # vgdisplay-Volume group-VG Name VolGroup00 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 14.84 GB PE Size 32.00 MB Total PE 475 Alloc PE / Size 316 / 9.88 GB Free PE / Size 159 / 4.97 GB VG UUID x1uyPD-qBgE-2yQV-T1Cb-IGIz-e4LB-fghf1W

4. Extended LV

-- first add 2G training [root@localhost] # lvextend-L + 2G / dev/VolGroup00/LogVol00 Extending logical volume LogVol00 to 10.88GB Logical volume LogVol00 successfully resized-- after success, you have not seen a new space [root@localhost ~] # df-m Filesystem 1M-blocks Used Available Use% Mounted on / dev/mapper/VolGroup00-LogVol00 8804 7362 98889 /- -need to manually refresh [root@localhost ~] # resize2fs / dev/VolGroup00/LogVol00 resize2fs 1.39 (29-May-2006) Filesystem at / dev/VolGroup00/LogVol00 is mounted on / On-line resizing required Performing an on-line resize of / dev/VolGroup00/LogVol00 to 2850816 (4k) blocks. The filesystem on / dev/VolGroup00/LogVol00 is now 2850816 blocks long. -- now [root@localhost] # df-m Filesystem 1M-blocks Used Available Use% Mounted on / dev/mapper/VolGroup00-LogVol00 10788 7365 2867 72% /

If you need to zoom out first, use the following command:

Lvreduce-L-20g / dev/mapper/vg_mysvr-lv_home

Resize2fs / dev/mapper/vg_my-lv_home

Lvextend-L + 20g / dev/mapper/vg_mysvr-lv_root

Resize2fs / dev/mapper/vg_mysvr-lv_root

On "linux how to dynamically increase LV space" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

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: 0

*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