Centos 6.8 uses LVM to add multiple new hard disks and increase the root directory capacity

Centos 6.8 uses LVM to add multiple new hard disks and increase the root directory capacity

My system is Centos 6.8 64-bit. I have added 5 new hard disks and all the space has been increased to the root directory.
All operations are performed as root user and under ssh.

1. Check the hard disk status

 fdisk -l


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

 fdisk /dev/sdb

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

3. 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 volume group

 vgextend vg /dev/sdb1

Add all partitions to the vg volume group

5. Check the lv path name through lvdisplay because mkfs.ext4 will use this name 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

<<:  ServerBundle: $77/month/Opteron 6212/32GB memory/2TB hard disk/unlimited traffic/Los Angeles

>>:  Sentris: $25/year/2GB memory/60GB space/1TB traffic/4 IP/KVM/Seattle

Recommend

Hostabulous: $10/month/1GB memory/60GB space/2TB traffic/2 IP/KVM/Canada

Hostabulous, a Canadian hosting provider, was fou...

Map the IP address on the VPS to the dedicated server through IPIP tunneling

Given that some service providers will launch ver...

anyhk 2GB RAM 200Mbps port unlimited traffic Hong Kong HKT KVM VPS review

Details : anyhk: 9.99 yuan/month/256MB memory/5GB...

$25/month/2G memory/160G space/2T traffic dedicated server - Sentris

Sentris was founded in 1997 and started providing...

CyclonesServers: $6/month/1GB memory/75GB space/3TB bandwidth/KVM/Los Angeles

CyclonesServers, founded in 2013, provides OpenVZ...

Unreal Servers: $25/month/L5420/16GB memory/1TB hard disk/20TB traffic/Kansas

Unreal Servers, an American hosting company, was ...

Recommend Burst VPS a coupon code

$ 4.46/month Non-Agency Price! It refers to the &...

Favorite VPS: Prometeus vs. Linode

The quality of a VPS directly affects the growth ...

Vultr 1GB RAM SSD Hard Drive KVM Japan Tokyo Simple Review

Details: Vultr: $5/month/1 CPU/768MB memory/15GB ...