Following on from our previous article, In this post I go ahead in my new server and first check out the disk status on my server:
The command gives the following output:
Now that’s a bit of surprise, I had allocated on my VMware 20 GB of which only around ~5GB is being represented on the file usage, where the rest ??
So there are few concepts behind the scene of how disk management works in Ubuntu, but rather me re-iterating the same, I would be more happy to provide the reference links which helped improve my understanding of disk management in Ubuntu and of which i carved my way of extending the partition size to full amount of VMware allocated.
Looking at the stats from running the following commands we see that ~15GB is not allocated at the PV/VG/LV
And at the last command it seems only the 4GB allocation has been done to the LV (logical volume), which is what we need the free space to be allocated. And from the status it seems the PV/VG both have 15 GB free unallocated.
So lets get started:
We first get the additional information about the LV using the following command
Once we have the information, we execute the following commands to extend out the 100% free space on the VG to LV
And now our LV size has increased from 4GB to 19GB.
But still, the complete success if a short hop away, as the extension of LV do not reflect on the file system.
Hence with the final execution of command the file system is now extended to utilise the full space provided by the VMware and with the reference links we can easily extend out and disk management our Ubuntu server.
Now, to cover another scenario where we increase the physical disk size from VMWare.
I now go ahead and extended the OS physical disk size from 20GB to 30GB. And post this I run the following commands to even extend out my file system by extra 10 GB space.
To check the available new space on the OS I run the following command:
In this case we would have to go ahead and extend the os disk as follows:
Here in the above, we can see the free space available and with the friendly menu system we can “Resize” and then “Write” out the new partition to the system.
Post which the PV status is as follows:
Now this takes us back to the start of this post that our PV is now extended out to 30 GB and just following the steps from the post we can repeat the same to follow it thorugh ot our file system.
Hope it helps.