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

Online 5 Euro France and Netherlands Dedicated Server Simple Review

Details : Online: €4.99/month/C2350/4GB memory/50...

HostYun 1GB RAM 50Mbps Port Hong Kong Direct KVM VPS Review

Details : HostYun: 17 yuan/month/1GB memory/10GB ...

Chicago VPS: $1/month/128MB RAM/10GB SSD space/100GB bandwidth/OpenVZ

ChicagoVPS is a US hosting provider that has rece...

Host Honey: $10/month/ATOM/2GB memory/160GB space/20TB traffic/US

Host Honey seems to be a newly established hostin...

HostUS: $15/year/2 CPU/512M/50G/1000G/2 IP/OpenVZ

HostUS是2012年成立的美國主機商,提供各類型主機,數據中心均位于美國的亞特蘭大。推出的一款...

kts24 1GB RAM 1Gbps Unlimited Traffic Netherlands KVM VPS Review

It was on sale before, but it’s out of stock. The...

DediPath: $3.8/month/1GB memory/20GB SSD space/5TB traffic/KVM/Los Angeles

DediPath, an American merchant, has been introduc...

ProviderService 256MB RAM German KVM VPS Review

Special package, Germany only: UltraVPS.eu: €10/y...