Centos 6.8 使用LVM添加多个新硬盘、增加根目录容量

888u

Last update at :2024-04-23,Edit by888u

My system is Centos 6.8 64-bit, 5 new hard drives have been added, and all space has been added to the root directory. All are operated under root user and ssh.

1. Check the hard disk status

fdisk -l

2. Partition each hard disk into 1 area and set it to lvm format

fdisk /dev/sdb

Enter n, p, 1, Enter, Enter, t, 8e, and w respectively to create the following partitions: /dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1, /dev/ sdf1

3. To create a physical volume (PV), first check the existing physical volume (PV)

pvdisplay

Create a physical volume (PV)

pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1

4. Add PV to volume group (VG)

vgdisplay

Add the new PV to the vg group volume

vgextend vg /dev/sdb1

Add all partitions to the vg group volume

5. Check the lv path name through lvdisplay because mkfs.ext4 will use this name later instead of the name of the created lv.

lvdisplay

6. Format partition

mkfs.ext4 /dev/sdb1

7. Expand the root directory capacity

lvextend -L +1.8T /dev/vg/root

7. Refresh the root directory capacity

resize2fs /dev/vg/root

Recommended site searches: cloud server, asp.net host, website ip query, telecommunications server rental, Beijing domain name registration application free space, how much does website registration cost, independent ip, ip query, php host space,

Centos 6.8 使用LVM添加多个新硬盘、增加根目录容量

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码