increasing partition size

Issues related to applications and software problems
Post Reply
idiotbox37
Posts: 2
Joined: 2018/01/12 13:16:49

increasing partition size

Post by idiotbox37 » 2018/01/12 13:29:17

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!

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: increasing partition size

Post by scottro » 2018/01/12 14:29:11

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.
New users should check the FAQ and Read Me First pages

idiotbox37
Posts: 2
Joined: 2018/01/12 13:16:49

Re: increasing partition size

Post by idiotbox37 » 2018/01/12 14:51:14

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.

Post Reply