LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Extend partition size (https://www.linuxquestions.org/questions/linux-server-73/extend-partition-size-4175639524/)

webnoob 10-01-2018 02:17 PM

Extend partition size
 
I am running Centos 7 Server Core and I would like to extend my root partition with all my uallocated space.
How do I do that?

michaelk 10-01-2018 02:43 PM

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.

ReinaldoGomes 10-01-2018 02:44 PM

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.

Ztcoracat 10-01-2018 02:50 PM

Here is a tutorial that will at the very least help you to understand and get you started.

https://geekpeek.net/increase-root-p...ze-lvm-centos/

What is the output of:

Code:

fdisk -l

webnoob 10-02-2018 06:09 AM

This is my disk
https://1drv.ms/u/s!AtdW7x8BDOLNpcwMcBNm0vgOlEr29g

webnoob 10-02-2018 12:59 PM

Any suggestions?

michaelk 10-02-2018 01:07 PM

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.

webnoob 10-02-2018 02:16 PM

I need a step-by-step, have never done it before.

Ztcoracat 10-02-2018 02:21 PM

Quote:

Originally Posted by webnoob (Post 5910266)
Any suggestions?

I have to agree with our Moderator.

Your best bet is to create a new partition. OR try his second suggestion.

https://linuxtechlab.com/beginners-guide-resizing-lvm/

https://blue42.net/linux/5-steps-lin...ume-no-reboot/

webnoob 10-02-2018 02:45 PM

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.

pan64 10-02-2018 02:52 PM

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

Ztcoracat 10-02-2018 03:29 PM

https://www.centos.org/docs/5/html/D...US/ch-lvm.html

https://www.centos.org/docs/5/html/C...olume_Manager/

Another alternative would be to give GParted a look.:)

https://gparted.org/features.php

webnoob 10-03-2018 01:06 PM

I used GParted.

Ztcoracat 10-03-2018 09:23 PM

Quote:

Originally Posted by webnoob (Post 5910694)
I used GParted.

Cool.:)
GParted is easier to work with. GParted Live has always worked great for me.

Were you able to extend or resize the partition that you wanted to?

webnoob 10-04-2018 12:55 PM

It looks like it. Yes it was extremely easy.


All times are GMT -5. The time now is 03:48 AM.