LV reduced in VG Now, How do I reduce the FS and Partiton size of the PV?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
LV reduced in VG Now, How do I reduce the FS and Partiton size of the PV?
I have a HDD that has 2 partitions. the 2nd partition is the VG and I want to reduce its size. I have reduced the Largest LV in the VG and now have free space in the VG. But, I am clueless on how to proceed to reduce the partiton size so that I can use it for another need.
When done, I expect to have 3 parttions total on the HDD. But first, I could some help in understanding the steps necessary for me to take, to move the free space out of the partition that has the Volume Group. Then, i can use fdisk on that 3rd partition for my needs.
I already know how to expand a Volume group by adding PVs, but, I do NOT know and cannot find how to reduce it to recover the free space in the VG to be used in a new partiton. (Better explained..."I want to reduce the physical partition size that the VG represents.)
From there, the PV can be reduced, allowing you to use fdisk to resize the physical partition the PV resides on. This will require that you actually delete the partition you wish to resize, then create a new partition of the size necessary. It's vital that you change the system ID of the 'resized' partition to 8e (Linux LVM) before you write the new partition table, or else you will destroy the existing PV.
Obviously, as you're dealing with some tricky disk operations, make sure you backup all of the data on the disk, lest a mistake or mistype causes the disk to be wiped. If you need any further clarification, just let me know.
Handy tutorial - it was a major limitation of LVM that it was (apparently) designed by people who never gave a thought to reducing (or replacing) pvs. Lots of bits had to be "tacked on" later.
I use it only under sufferance.
To be fair, the same method is used when you reduce the physical file system and underlying partition on non-PV systems; Gparted just makes the process 'invisible.'
Yes, I'm aware of that. I subscribe to the theory that this shouldn't need another block device layer to add complexity. I liked zfs on OpenSolaris, and I like btrfs on Linux. Conceptually a much better option. Not that I'd use btrfs in production yet.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.