LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 02-11-2020, 03:35 PM   #1
kenw232
Member
 
Registered: May 2006
Posts: 115

Rep: Reputation: 12
CentOS LVM expand root to extended partitions?


I am running out of space. So I created a new primary partition under Centos 7 and added it to my logical volume to expand /dev/mapper/centos-root. worked great.

Now I need to do it again, and will need to do it again in the future. But I already have 3 primary partitions. Therefore I need to make my forth partition an Extended partition right. Can I now add and use Linux LVM partitions called sda5 and sda6? is there any limit? I want to add space on demand without running out of partitions in the future.

eg. https://snipboard.io/86w3I1.jpg
 
Old 02-11-2020, 03:43 PM   #2
kenw232
Member
 
Registered: May 2006
Posts: 115

Original Poster
Rep: Reputation: 12
how do I extend the extended partition? so I can add more Linux LVMs in the future when I want? If I expand the VM disk and do this:
Command (m for help): n
All primary partitions are in use
Adding logical partition 7
No free sectors available

I get "No free sectors available". but the disk has plenty of space free.
 
Old 02-11-2020, 04:07 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,484

Rep: Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098Reputation: 3098
Every time you expand the disk, all the new space will be outside the range of the extended partition - it (the extended) will need to be expanded to include all the new space before you can create new logical partitions. Can be done from fdisk, but you need to be careful - easier to use gparted if you have a GUI environment. This will give us a better view of your disk.
Code:
sudo parted /dev/sda "print free"
 
Old 02-11-2020, 05:23 PM   #4
kenw232
Member
 
Registered: May 2006
Posts: 115

Original Poster
Rep: Reputation: 12
Is there a command line utility that can simply expand an extendated partition to the max size free? Seems excessive that I have to boot gparted to do that.
 
Old 02-11-2020, 08:22 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,360

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
It would be more straightforward to give the VM an additional disk rather than expanding the existing disk. Then you can add that unpartitioned disk to the volume group. Future expansions of that new disk would be simple (pvresize) since there are no partitions to deal with.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Expand LVM home to root "resize2fs: Operation not permitted While trying to add group #512" dr.x Linux - Server 4 10-01-2019 07:49 AM
Cant expand root partition LVM |resize2fs: Operation not permitted While trying to add group #512 dr.x Linux - Server 9 07-18-2019 11:01 PM
Expand root and swap partitions? kenw232 CentOS 4 06-29-2016 08:34 AM
Extended partitions and LVM gargamel Linux - Server 5 07-19-2010 12:48 PM
Extended partitions? Location of partitions? General Linux - Hardware 13 05-03-2006 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 02:05 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration