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

LVM expansion of linux root partition

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

Share

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

Linux root partition LVM expansion # df-h look at the current situation of the hard disk

# lsblk View disk Directory

# fdisk-l you can see the newly added hard disk / dev/sdb

# Division:

Npentert8eW

# lvm lvm > vgdisplay can first check whether there is any space left in the volume group to expand. If so, directly expand. If not, add a new hard disk and view the VG group name: Centos

# lvm > pvcreate / dev/sdb1 creates a lvm physical volume using the new entire hard drive

# add the newly created physical volume to the VG group

# vgdisplay can see allocated space and remaining unallocated space # perform capacity expansion: lvextend-L + 10G / dev/centos/root

# check the xfs when the file system type, such as Xfs ext4, can be seen by this machine

# refresh the file system (formatted) xfs_growfs / dev/centos/root

# View the partition again, and the capacity has been expanded

Note: if the file type is ext4, format command: resize2fs / dev/centos/root mkfs.ext4 / dev/centos/root summary: 1, add disk need 3 steps: partition, format, mount. 2. To make the disk into a logical volume (LV): first do the physical volume, then do the volume group and finally split the desired capacity from the volume group. 3. Mount needs to create a mount point, but if you want the mount to take effect permanently, you have to modify the configuration file / etc/fstab. 4. To understand the sda1 sda2 sda3 Sdb1 sdb2 sdb35 of disk partitions and the ID that knows the file type of the device, for example: swap (82) ext4 (83) lvm (8e)

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