Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-02-2012, 09:07 PM
|
#1
|
|
Member
Registered: Feb 2007
Distribution: Debian
Posts: 81
Rep:
|
How to add unallocated space to a logical volume? using LVM
Hello folks,
This is how my 2 TB (GPT) hard disk looks like
Code:
sda1 1 MiB Bios_boot
sda2 1024 GB LVM --- vg1 1024 GB --- lv1 24 GB ext4
--- lv2 1000 GB ext4
800 GB unallocated
sda3 200 GB ext4
What is the safest or better way to add 512 GB to lv2 ?
1. Resize sda2 to be 512 GB bigger with parted or gdisk and then pvresize, lvresize, resize2fs.
2. Create a new partition in the unallocated space, initialize it as a new pv and add it to the vg, then lvresize, resize2fs.
What's the best alternative? Are there performance penalties if the 2nd option is used?
Thank you very much
|
|
|
|
08-03-2012, 03:29 AM
|
#2
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,234
|
2.
No.
|
|
|
|
08-04-2012, 05:13 PM
|
#3
|
|
Member
Registered: Aug 2006
Posts: 601
Rep:
|
Quote:
Originally Posted by tauro_kpo
Hello folks,
This is how my 2 TB (GPT) hard disk looks like
Code:
sda1 1 MiB Bios_boot
sda2 1024 GB LVM --- vg1 1024 GB --- lv1 24 GB ext4
--- lv2 1000 GB ext4
800 GB unallocated
sda3 200 GB ext4
What is the safest or better way to add 512 GB to lv2 ?
1. Resize sda2 to be 512 GB bigger with parted or gdisk and then pvresize, lvresize, resize2fs.
2. Create a new partition in the unallocated space, initialize it as a new pv and add it to the vg, then lvresize, resize2fs.
What's the best alternative? Are there performance penalties if the 2nd option is used?
Thank you very much
|
Actually to me this isn't clear. Maybe you still have enough space in your volume group.
Further the partition table would help in saying the best/easiest path to take.
|
|
|
|
08-06-2012, 12:03 AM
|
#4
|
|
Member
Registered: Feb 2007
Distribution: Debian
Posts: 81
Original Poster
Rep:
|
syg00 And what if I did the method number one? Why method two is better? because it is simpler? Other people have told me that method is better so I am still in doubt.
deadeyes the disk uses a GUID partition table (GPT) and it's layout is the one I described before. All the partitions/lv are nearly full.
thanks
|
|
|
|
08-06-2012, 12:59 AM
|
#5
|
|
Member
Registered: Aug 2006
Posts: 601
Rep:
|
Quote:
Originally Posted by tauro_kpo
syg00 And what if I did the method number one? Why method two is better? because it is simpler? Other people have told me that method is better so I am still in doubt.
deadeyes the disk uses a GUID partition table (GPT) and it's layout is the one I described before. All the partitions/lv are nearly full.
thanks
|
Method 1 is a cleaner way. Method 2 is sort of patching different PVs together.
Method 2 is the easiest one as you don't have to reboot.
For method 1 you will have to reboot if your root filesystem is residing on it. Otherwhise you might be able to force your kernel to reread the partition table with for example partprobe, kpartx, ...
Note that in RHEL 6 for example you can't force the reread at all. (there is some upstream development going on about this).
|
|
|
1 members found this post helpful.
|
08-06-2012, 02:37 AM
|
#6
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,234
|
For 1) you have to manually delete the partition and reallocate it.
And get it completely correct or you risk destroying your filesystem.
2) has no such exposure, is achieved in simple steps, and is totally safe.
Your data, your choice.
|
|
|
|
08-17-2012, 10:41 AM
|
#7
|
|
LQ Newbie
Registered: Aug 2012
Posts: 1
Rep: 
|
Quote:
I have an inquiry similar to OP's.
My disk looks like this (and is a complete mess, somehow):
Code:
Number Start End Size Type File system Flags
1 1049kB 913GB 913GB primary ntfs
3 974GB 978GB 3585MB extended
5 974GB 978GB 3585MB logical
2 978GB 978GB 524MB primary ext4 boot
4 978GB 1000GB 22.1GB primary lvm
1 is my Windows storage partition (this is an external hard drive from which I boot Fedora 17)
2 is GRUB
4 is the Fedora LVM
5 is a logical partition of 3, but I've not the slightest idea of the purpose of these partitions.
There is ~57GiB of unallocated space directly after the NTFS partition.
Now, how would one go about removing partition 3/5, moving 4 to the correct position and extending the LVM into unallocated space? Better yet, is this even feasible, or should I just deal with a 20GiB root filesystem?
|
EDIT:
3/5 was a swap partition from an old Ubuntu install, so I deleted that, formatted the ~60GiB of free space, then found a nice redhat GUI tool that let me add the partition to the LVM. Now my question is whether there are any risks with having an LVM that's discontinuous on the disk? My boot partition is now between the two LVM partitions.
Last edited by BradenIsSouth; 08-17-2012 at 10:59 AM.
|
|
|
|
08-19-2012, 01:02 PM
|
#8
|
|
Member
Registered: Aug 2006
Posts: 601
Rep:
|
Quote:
Originally Posted by BradenIsSouth
EDIT:
3/5 was a swap partition from an old Ubuntu install, so I deleted that, formatted the ~60GiB of free space, then found a nice redhat GUI tool that let me add the partition to the LVM. Now my question is whether there are any risks with having an LVM that's discontinuous on the disk? My boot partition is now between the two LVM partitions.
|
That doesn't make a difference.
You shouldn't have any issues with that.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:20 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|