LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-01-2018, 02:17 PM   #1
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Rep: Reputation: Disabled
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?
 
Old 10-01-2018, 02:43 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
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.
 
Old 10-01-2018, 02:44 PM   #3
ReinaldoGomes
LQ Newbie
 
Registered: Jul 2016
Posts: 15

Rep: Reputation: Disabled
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.
 
Old 10-01-2018, 02:50 PM   #4
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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
 
Old 10-02-2018, 06:09 AM   #5
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
This is my disk
https://1drv.ms/u/s!AtdW7x8BDOLNpcwMcBNm0vgOlEr29g
 
Old 10-02-2018, 12:59 PM   #6
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Any suggestions?
 
Old 10-02-2018, 01:07 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
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.
 
Old 10-02-2018, 02:16 PM   #8
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
I need a step-by-step, have never done it before.
 
Old 10-02-2018, 02:21 PM   #9
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by webnoob View Post
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/
 
Old 10-02-2018, 02:45 PM   #10
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-02-2018, 02:52 PM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,030

Rep: Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344Reputation: 7344
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
 
Old 10-02-2018, 03:29 PM   #12
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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
 
Old 10-03-2018, 01:06 PM   #13
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
I used GParted.
 
Old 10-03-2018, 09:23 PM   #14
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by webnoob View Post
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?
 
Old 10-04-2018, 12:55 PM   #15
webnoob
LQ Newbie
 
Registered: Mar 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
It looks like it. Yes it was extremely easy.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extend Partition size. osama.mansoor Linux - Newbie 2 11-25-2015 03:56 PM
LXer: Extend LVM partition size when there is no free space in the Volume Group LXer Syndicated Linux News 0 06-23-2014 07:00 PM
how to extend / partition size in ext2 format jogendra.jangid Linux - Server 1 01-10-2014 12:20 AM
how can i extend partition size in redhat linux enterprise without formatting? tanmoy chakraborty Red Hat 5 07-01-2010 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration