Need help extending from 20TB to 32TB ext.4 partition on CentOS 7

Chad Killion
Chad Killion used Ask the Experts™
on
Hello,

I have a VM with a very large disk that I need to make larger.  I tried following some stuff online, but now I am ununsure of the process and want to stop and get help before going further.  The VM in question had a 20TB disk (sdb) which I extended to 32TB and rebooted the system.  Then I did the following:

[root@machinename ~]# fdisk /dev/sdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition number (2-128, default 2): p
Partition number (2-128, default 2): 
First sector (34-68719476702, default 41015625728): 
Last sector, +sectors or +size{K,M,G,T,P} (41015625728-68719476702, default 68719476702): 
Created partition 2


Command (m for help): p

Disk /dev/sdb: 35184.4 GB, 35184372088832 bytes, 68719476736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 434C3ED5-B129-4811-8E4A-B3E63AB708B6


#         Start          End    Size  Type            Name
 1         2048  41015625727   19.1T  Microsoft basic primary
 2  41015625728  68719476702   12.9T  Linux filesyste 

Command (m for help): t
Partition number (1,2, default 2): 2
Partition type (type L to list all types): 8e
Type of partition 2 is unchanged: Linux filesystem

Command (m for help): w
The partition table has been altered!

[root@machinename ~]# partprobe -s
/dev/sda: msdos partitions 1 2 3
/dev/sdb: gpt partitions 1 2
[root@machinename ~]# fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000b6ceb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    33554431    15727616   8e  Linux LVM
/dev/sda3        33554432   104857599    35651584   8e  Linux LVM
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdb: 35184.4 GB, 35184372088832 bytes, 68719476736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: 434C3ED5-B129-4811-8E4A-B3E63AB708B6


#         Start          End    Size  Type            Name
 1         2048  41015625727   19.1T  Microsoft basic primary
 2  41015625728  68719476702   12.9T  Linux filesyste 

Disk /dev/mapper/centos-root: 50.9 GB, 50885296128 bytes, 99385344 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 1719 MB, 1719664640 bytes, 3358720 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@machinename ~]# pvcreate /dev/sdb2
  Physical volume "/dev/sdb2" successfully created.

Open in new window


This is where I am currently.  All I really want is for the volume on sdb to show a 32TB partition rather than the 20TB partition it started with.  How can I accomplish this?  I need to do this several more times, so help to fix this one, and help from the beginning if I did something wrong already would be appreciated.  Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
looks like all you need to do now is
resize2fs /dev/vda2

Open in new window

Author

Commented:
Thanks, but I figured this out on my own hours ago. Had to delete original partition first, make new, then resize. See link I posted above for details If you are interested

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial