Uploaded by Ganesh Gopalakrishnan V

OCI custom boot volume resize Linux 8

advertisement
OCI custom boot volume size – ResizeExtend unallocated/free space in linux
AUG 8
Posted by pacesettergraam
Rate This
When we are trying to create OCI Instance with more space specifying the custom size is not
fully usable. Only a certain space is utilized and rest sits as free space. So now we are going to
Resize and Extend it to utilize that space. The same will be applicable for all the distros. Here
I have taken Oracle Linux 8 in OCI with a E2.1 Micro shape
Execute cfdisk command to display the partition Information
$ sudo cfdisk
Here in the above screenshot there is 153GB free and rest has been utilized.
Execute the below command to change to fdisk mode
$ sudo fdisk /dev/sda
Enter p to print the current partition table. It’s very important to keep note of the numeric
values of the START and END columns for the /dev/sda3 partition, as we’re going to need
them soon enough.
Once done, type d to access the delete mode, and then the number of the partition record
that you want to remove (that would be 3 in the above scenario).
Type n to create a brand-new second partition for utilizing the free space
Just Ensure START numeric value you’ve recorded earlier – which should be the suggested
default; also, make sure that the end is at the end of the disk – which should also be the
default.
Now we need to change the partition type from Linux to Linux LVM: to do so, type t to access
the change partition type mode, then 3 , then 31 and that’s it.
When done, type p to review your new partition layout. Be sure to triple-check that the start
of the new second partition is exactly where the old second partition was: this is very
important! In case you did it wrong, type d to delete the wrong partition and start over.
If everything looks right, issue w to write the partition table to disk.
Now we can reboot
Right after writing the new partition table to disk, you’ll immediately get a system error
message due to the fact that the partition table couldn’t be accessed for read, because the
disk is in use. That’s why we need to reboot our system.
$ sudo reboot
After the reboot Issue the below command
$ sudo pvresize /dev/sda3
Run cfdisk again now. If everything went good, you should see the following
The next thing we need to do now is to extend our logical volume into that space. In order to
do that we need to retrieve its path, which can be done by issuing the following command:
sudo lvdisplay -v
It should be the first of the list: however, you can easily figure out what it is by looking at the
volume sizes. In the above scenario, the path is /dev/ocivolume/root .
Once retrieved, we can extend that logical volume with the following command:
sudo lvextend -l +100%FREE /dev/ocivolume/root
Now that the logical volume has successfully been extended to use all the unallocated space,
we still have to perform one last step: increase the file system to match the logical volume
size. Doing that is just as easy as typing one of the following command, depending if we’re
using EXT4 (which should be the default nowadays) or XFS. A reboot has been performed and
Again, we have to use the logical volume path here, the same one that we’ve used with
the lvextend command a moment ago.
For EXT4, type the following:
sudo resize2fs /dev/ocivolume/root
For XFS, type the following:
sudo xfs_growfs /root
Now just checking extended size is reflecting
Source/Learned from
Share this:




Twitter
Facebook
More
Related
Connect OCI with VNC as GUIMay 14, 2021In "Free Tools/Apps"
Using Calibre to convert pdf to epub formatAugust 28, 2013In "linux"
How to uninstall linux from windows in dual bootJanuary 19, 2017In "Free Tools/Apps"
About pacesettergraam
A good and realistic person
View all posts by pacesettergraam »
Posted on August 8, 2021, in Oracle and tagged cfdisk, Ext4, extend, Extending file system, fdisk, free
space, lvextend, OCI, OCI free space, pvresize, resize, utilize, XFS. Bookmark the permalink. Leave a
comment.
← Query to get Supplier Contact Email and Address Email in Oracle Apps
Converting Number to decimal in Oracle SQL →

LEAVE A COMMENT

Leave a Reply
COMMENTS 0
Download