How to extend a CentOS 6 root ext4 partition?

General support questions
Post Reply
Rich-H
Posts: 3
Joined: 2017/05/06 13:16:13

How to extend a CentOS 6 root ext4 partition?

Post by Rich-H » 2017/12/29 17:39:24

Hi,

I need to expand the root (Linux - ext4) partition on a CentOS 6.9 VMWare VM. This is not an LVM partition, but we have two additional disks - each with it's own vg, lv & pv.

I understand that parted and gparted doesn't work in this situation and that the \ partition must be the last partition (which it is not). I think that I'll have to move swap partition. I've already increased the size of sda from 100G to 160G in VMWare, but haven't rebooted yet - so the increase size isn't showing up in df -h.

What procedure can i use?

The outputs from df -h, fdisk -l, mount, cat /etc/fstab, pvdisplay, vgdisplay & lvdisplay are below.

Thanks!

[root@ushquttechp01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 95G 87G 2.6G 98% /
tmpfs 1.9G 392K 1.9G 1% /dev/shm
/dev/sda1 189M 125M 55M 70% /boot
/dev/mapper/syslog-syslog
99G 24G 70G 26% /var/log/syslog-ng
/dev/mapper/elasticsearch--indices-elasticsearch--indices
99G 64G 30G 69% /var/lib/elasticsearch



[root@ushquttechp01 ~]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003c59c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 203776 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 12533 100458496 83 Linux
/dev/sda3 12533 13055 4194304 82 Linux swap / Solaris

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
43 heads, 44 sectors/track, 110843 cylinders
Units = cylinders of 1892 * 512 = 968704 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00009da5

Device Boot Start End Blocks Id System
/dev/sdb1 2 110844 104856576 8e Linux LVM

Disk /dev/sdc: 128.8 GB, 128849018880 bytes
255 heads, 63 sectors/track, 15665 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1f9caa21

Device Boot Start End Blocks Id System
/dev/sdc1 1 15665 125829081 8e Linux LVM

Disk /dev/mapper/syslog-syslog: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/elasticsearch--indices-elasticsearch--indices: 107.4 GB, 107369988096 bytes
255 heads, 63 sectors/track, 13053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000




[root@ushquttechp01 ~]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/mapper/syslog-syslog on /var/log/syslog-ng type ext4 (rw)
/dev/mapper/elasticsearch--indices-elasticsearch--indices on /var/lib/elasticsearch type ext4 (rw)




[root@ushquttechp01 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun May 31 17:50:48 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=f9cca363-75a4-42d5-afa6-a901830e99d6 / ext4 defaults 1 1
UUID=be85bca2-c613-4ec7-ac76-8632854ce87a /boot ext4 defaults 1 2
UUID=2599e66d-2d14-4d13-ba3c-be4907ff2cd2 swap swap defaults 0 0
#UUID=577bda65-366c-4fb9-a7ae-5d9b446e7cc4 /var/log/syslog-ng ext4 defaults 0 2
UUID=aa7729e7-504d-4e9f-aa42-d9082464fd1b /var/log/syslog-ng ext4 defaults 0 2
UUID=2200ddd6-2cd6-469e-a099-8f21b3b13f82 /var/lib/elasticsearch ext4 defaults 0 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0



[root@ushquttechp01 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/syslog/syslog
LV Name syslog
VG Name syslog
LV UUID AshnN6-yPNZ-JTcW-hP8g-FYfG-vIKJ-ih8Iue
LV Write Access read/write
LV Creation host, time ushquttechp01.swissarmy.com, 2017-10-06 11:36:13 -0400
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Logical volume ---
LV Path /dev/elasticsearch-indices/elasticsearch-indices
LV Name elasticsearch-indices
VG Name elasticsearch-indices
LV UUID YVfb2X-SKR6-5loB-Puap-oz6O-ntRY-ivSLvq
LV Write Access read/write
LV Creation host, time ushquttechp01.swissarmy.com, 2017-10-25 15:58:47 -0400
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25599
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1



[root@ushquttechp01 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sdc1
VG Name syslog
PV Size 120.00 GiB / not usable 3.96 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 30719
Free PE 5119
Allocated PE 25600
PV UUID M4dhHQ-B2dg-zA1c-N8bb-w0zh-8JdE-hd54ZN

--- Physical volume ---
PV Name /dev/sdb1
VG Name elasticsearch-indices
PV Size 100.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25599
Free PE 0
Allocated PE 25599
PV UUID SAcFkc-0FJR-eH5a-9NwZ-3i1y-idk9-JEqiq6



[root@ushquttechp01 ~]# vgdisplay
--- Volume group ---
VG Name syslog
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 120.00 GiB
PE Size 4.00 MiB
Total PE 30719
Alloc PE / Size 25600 / 100.00 GiB
Free PE / Size 5119 / 20.00 GiB
VG UUID Vp0ErL-5PGM-11DO-ZGne-suFZ-Th7n-02mttd

--- Volume group ---
VG Name elasticsearch-indices
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GiB
PE Size 4.00 MiB
Total PE 25599
Alloc PE / Size 25599 / 100.00 GiB
Free PE / Size 0 / 0
VG UUID dguQxI-RP1T-gS3A-fdm5-fSbs-CzjY-7VhViC

Post Reply