LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 10-18-2010, 11:09 AM   #1
gcmartin
LQ Newbie
 
Registered: Aug 2001
Posts: 15

Rep: Reputation: 0
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.)

Thanks in advance

Last edited by gcmartin; 10-18-2010 at 11:14 AM.
 
Old 10-18-2010, 01:29 PM   #2
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
Hi there GCMartin,

You'll use the lvm pvresize command.

There's a great tutorial here:

http://fedorasolved.org/Members/zcat...-new-partition

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.

Last edited by Stephannn; 10-18-2010 at 02:22 PM.
 
1 members found this post helpful.
Old 10-18-2010, 04:39 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.

Last edited by syg00; 10-18-2010 at 04:40 PM.
 
Old 10-19-2010, 12:07 PM   #4
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
@syg00,

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.'
 
Old 10-19-2010, 04:50 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 10-19-2010, 04:57 PM   #6
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
Oh, I completely agree; I can't stand LVM systems. Sadly, I'm not king of the world
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is my kubuntu window size reduced on reboot? fpat Linux - Newbie 2 03-30-2008 10:11 AM
Fedora 7 DVD | Reduced size!!! the_gripmaster Fedora 1 06-10-2007 07:11 AM
Increase the size of a fedore core 3 partiton fieldyweb Linux - Newbie 4 07-06-2005 08:26 AM
aborted SUSE 9.2 installation reduced hard disk size lkomito Linux - Newbie 2 07-04-2005 12:43 PM
Increasing partiton size of linux balanagireddy Linux - General 2 09-20-2003 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:56 AM.

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