Unallocated space
-
@sjensen The following commands should work for you. I am not liable for any issue or consequence that may arise from using those commands! Make sure you have a full backup/snapshot of the server and use the commands with precaution and think about it instead of blindly doing copy & paste!!
There are probably different ways of extending your space in this scenario. To keep it as simple as possible for you I decided to not extend the existing LVM physical volume (way more things can go wrong going this way) but adding the new space to the existing logical volume.
So we start by creating a new partition in that unallocated space using GParted. Probably that will be
sda6
then.If that has been achieved you want to create a LVM physical volume (PV) on that new partition.
pvcreate /dev/sda6 Physical volume "/dev/sda6" successfully created
Now extend the volume group (VG) to use that new PV and check afterwards:
vgextend FOGserver-vg /dev/sda6 Volume group "FOGserver-vg" successfully extended pvs PV VG Fmt ... /dev/sda5 FOGserver-vg lvm2 ... /dev/sda6 FOGserver-vg lvm2 ...
After extending the VG you should be able add that new space to the logical volume of your root partition:
lvextend /dev/FOGserver-vg/root /dev/sda6 Extending logical volume root to xx.xx GiB Logical volume root successfully resized
As a final step you need to resize the filesystem to use that new space:
resize2fs /dev/FOGserver-vg/root
-
Thanks this good it helps me to learn a little more about linux. I will let you know the outcome.
-
@sjensen ok so i got through this part: So we start by creating a new partition in that unallocated space using GParted. Probably that will be sda6 then.
If that has been achieved you want to create a LVM physical volume (PV) on that new partition.
Then noticed this warning.
-
@sjensen Hmmm, possibly GParted want’s to format the newly created partition with a filesystem. You don’t want that as we want to add that new partition to an existing filesystem. Just ignore the warning and see if you can mark this partition to be LVM instead of ext4!
It being
sda3
is ok. GParted is creating a primary partition instead of an extended and therefore uses 3 instead of 6 as number. That’s fine. -
The only choice i get for LVM is LVM2pv, would that be ok to use?
-
@sjensen Yes, sounds fine to me.
-
That worked, this is what i see now. I would assume i should go back to the commands you listed before and try to run those?
-
@sjensen said:
I would assume i should go back to the commands you listed before and try to run those?
Yes, just use
/dev/sda3
instead of where I wrote/dev/sda6
… -
Here is the final result. Does this look correct?
-
@sjensen To see if you have more space available where you want it, run
df -h
-
@Sebastian-Roth said in Unallocated space:
df -h
Looks like i’m good to go. Thanks very much for all your help. I will save the commands for future reference.