Skip to main content
1 of 3

Cant Resize Main Partition On Centos 7

I ordered a dedicated server and it came with a primary partition of 20gb and a second partition of 1.8TB. I see no point in this as i plan to use it as a web server. As such i need to put pretty much everything into /var. I have rebooted in rescue mode and i have deleted the 1.8TB partition. My FS now looks like this

NAME   MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
sda      8:0    0    1.8T  0 disk
├─sda1   8:1    0 1004.5K  0 part
├─sda2   8:2    0   19.5G  0 part
└─sda4   8:4    0    511M  0 part

I thought i could use the partid app to resize the primary (sda2) partition (https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-disk-storage-parted-resize-part.html), but when i run the command it tells me it is no longer supported.

Error: The resize command has been removed in parted 3.0

I found another tutorial that said to use resize2fs. I ran the command and i get the following.

root@rescue:~# resize2fs /dev/sda2
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 5119744 (4k) blocks long.  Nothing to do!

I have around 1.7TB of free space that is not assigned to any partition. All i want to do is assign all of this space to sda2. This is the primary partition and i want it to have all of the space. Am i missing something simple here?

The lvextend command seems to be along the right lines, but still it doesnt work.

root@rescue:~# lvextend -L +1700G /dev/sda2
  Path required for Logical Volume "sda2"
  Please provide a volume group name
  Run `lvextend --help' for more information.