Page 1 of 1

increasing partition size

Posted: 2018/01/12 13:29:17
by idiotbox37
I have a partition(sda2) size set to 300GB and i have 200Gb of free space(no partition, no file system). I need to add the 200GB to the existing sda2 partition. I'm using command line, no gui installed. I understand the process should be similar to the following:

- create partition from free disk space (fdisk)
- configure file system for new partition (mkfs)
- expand existing partition /dev/sda2 w/ new partition (not sure how, fdisk again?)

The tricky part is that i have an application that stores data on the sda2 partition and the data needs to remain intact. Would it be better to copy all the data to a new, temporary partition and then rebuild sd2 and move the data back? Thanks!

Re: increasing partition size

Posted: 2018/01/12 14:29:11
by scottro
You should always make backups.

You don't specify if it's an LVM partition or not. If it's an LVM partition, I have a page with links to better pages at http://srobb.net/lvm.html
If it's not, then the easiest way to do it is with the graphic gparted. The partition should be unmounted I think, so you would make a gparted live CD and boot from that.

XFS partitions can be grown while mounted.

https://access.redhat.com/documentation ... de/xfsgrow

https://access.redhat.com/articles/1190213 for increasing the partition size. If the filesystem is ext4 there's another article linked on that page to increase file size.

Re: increasing partition size

Posted: 2018/01/12 14:51:14
by idiotbox37
Thanks! The file system is ext4.

It is running as a VM so i'm going to back up the entire VM before i make any changes.

your LVM link is great. Now i'm thinking it would be worth the effort to move everything to a new LVM partition because additional storage expansion is on our roadmap.