0

I need some steps I can follow from the Putty session so I can extend the CentOS v8 VM without losing its data?

I have already extended the disk space in the VMDK into 60 GB from its initial 40 GB.

[root@PRDSVR08-VM etc]# fdisk -l /dev/sda
Disk /dev/sda: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: gpt
Disk identifier: 8FD17E63-2BF2-48B9-BA7A-79D8BEC3F9AF


Device       Start      End  Sectors  Size Type
/dev/sda1     2048  1230847  1228800  600M EFI System
/dev/sda2  1230848  3327999  2097152    1G Linux filesystem
/dev/sda3  3328000 33552383 30224384 14.4G Linux LVM
[root@PRDSVR08-VM etc]# sudo fdisk /dev/sda


Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.



Command (m for help): d
Partition number (1-3, default 3): 3


Partition 3 has been deleted.


Command (m for help): n
Partition number (3-128, default 3): 3
First sector (3328000-33554398, default 3328000):
Last sector, +sectors or +size{K,M,G,T,P} (3328000-33554398, default 33554398):


Created a new partition 3 of type 'Linux filesystem' and of size 14.4 GiB.
Partition #3 contains a LVM2_member signature.


Do you want to remove the signature? [Y]es/[N]o:
Do you want to remove the signature? [Y]es/[N]o: N


Command (m for help): p


Disk /dev/sda: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: gpt
Disk identifier: 8FD17E63-2BF2-48B9-BA7A-79D8BEC3F9AF


Device       Start      End  Sectors  Size Type
/dev/sda1     2048  1230847  1228800  600M EFI System
/dev/sda2  1230848  3327999  2097152    1G Linux filesystem
/dev/sda3  3328000 33554398 30226399 14.4G Linux filesystem


Command (m for help): w
The partition table has been altered.
Syncing disks.

The disk space is somehow still the same but the FS seems to be different?

[root@PRDSVR08-VM etc]# fdisk -l /dev/sda
Disk /dev/sda: 16 GiB, 17179869184 bytes, 33554432 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
Disklabel type: gpt
Disk identifier: 8FD17E63-2BF2-48B9-BA7A-79D8BEC3F9AF


Device       Start      End  Sectors  Size Type
/dev/sda1     2048  1230847  1228800  600M EFI System
/dev/sda2  1230848  3327999  2097152    1G Linux filesystem
/dev/sda3  3328000 33554398 30226399 14.4G Linux filesystem
[root@PRDSVR08-VM etc]#

How to rectify the issue above?

Thank you in advance.

Senior Systems Engineer
  • 1,275
  • 2
  • 33
  • 62
  • 3
    Your system still only sees a 16GB disk, neither 40 or 60 GB. You need to rescan your SCSI bus first. How to do this [has been covered often enough](https://serverfault.com/search?q=rescan+scsi). – Gerald Schneider Aug 12 '20 at 07:14
  • 3
    Another thing: Your sda3 partition was originally of the type `LVM`, yet you recreated it as a normal Linux partition. If your system uses LVM you need to use the LVM tools to extend the partition. This has also been covered often. – Gerald Schneider Aug 12 '20 at 07:31

0 Answers0