LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 02:35 PM   #1
kenw232
Member
 
Registered: May 2006
Posts: 125

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, 02:43 PM   #2
kenw232
Member
 
Registered: May 2006
Posts: 125

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, 03:07 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
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, 04:23 PM   #4
kenw232
Member
 
Registered: May 2006
Posts: 125

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, 07:22 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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



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 06: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 10:01 PM
Expand root and swap partitions? kenw232 CentOS 4 06-29-2016 07:34 AM
Extended partitions and LVM gargamel Linux - Server 5 07-19-2010 11:48 AM
Extended partitions? Location of partitions? General Linux - Hardware 13 05-03-2006 02:01 PM

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

All times are GMT -5. The time now is 10:43 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
Open Source Consulting | Domain Registration