Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We need more information. It depends on how your system is partitioned and where your unallocated space is located on your disk drive.
By default CentOS 7 uses LVM and formats the partitions using xfs. Without to much trouble you can create a partition, extend the volume group and add the space to your root logical volume.
It depends on your scenario. The basic concept is: Delete the current partition -> Create a new partition -> Expand the filesystem
Assuming that you have a single standard (non-LVM) partition on /dev/sda, with XFS filesystem, the process would be something like:
Backup your data first!!
Code:
fdisk /dev/sda
d (delete partition, accepting all defaults)
n (create partition, accepting all defaults)
w (save changes)
xfs_growfs /dev/sda1
But this is just the basics. The actual process depends on how many partitions you have on your disk, where it starts and where it ends, whether it is a standard or LVM etc. Google will give you tons of samples.
The easiest method would be to create a partition using the free space and then create a PV. You can extend the volume group and logical volume to use the additional space.
The second method would be to resize the LVM partition and then extend the VG and LV for your root filesystem.
I tried this guide https://linuxtechlab.com/beginners-guide-resizing-lvm/ but it makes no sense to me and it fails at the first command "fdisk /dev/sdd" "fdisk: could not open /dev/sdd: no such file or filecatalog.
People keeps telling me that Linux is so much better then Windows. I never thought extending a disk or partition should be so complicated.
this is a logical volume. It is not linux itself, it is a relatively complex disk handling system. On windows most probably you have never seen anything like this, but this Centos was installed/configured using logical volumes. Therefore if you wish to make any modification you need to learn what is it all about. https://en.wikipedia.org/wiki/Logical_volume_management
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.