How to add unallocated space to a logical volume? using LVM
Linux - HardwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.