Resizing PVs (was: Installation Impressions)

2011-02-05 Thread Nikolaus Rath
Sam Sharpe lists.red...@samsharpe.net writes:
 On 5 February 2011 20:53, Nikolaus Rath nikol...@rath.org wrote:
 JFTR, unfortunately PVs cannot be made smaller. The whole idea of LVM is
 to do all the resize operations *within* the containers.

 JFTR, unfortunately, you'll need to raise a bug against the  pvresize
 manpage then...

 http://linux.die.net/man/8/pvresize

 ---
 Shrink the PV on /dev/sda1 prior to shrinking the partition with fdisk
 (ensure that the PV size is appropriate for your intended new
 partition size):

 pvresize --setphysicalvolumesize 40G /dev/sda1
 ---

 When filing the report, please state why your assertion for the
 record is correct over the maintainer's.

You can shrink a PV, but you will loose the extents that are stored in
the space that you have truncated. I don't consider that resizing.

From the same manpage that you looked up:

,
| pvresize will refuse to shrink PhysicalVolume if it has allocated
| extents after where its new end would be. In the future, it should
| relocate these elsewhere in the volume group if there is sufficient free
| space, like pvmove does. 
`

Unfortunately, pvmove can only move extends to other PVs but not to a
different location in the same PV.


Why so aggressive?


   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


Re: Resizing PVs (was: Installation Impressions)

2011-02-05 Thread Sam Sharpe
On 5 February 2011 22:15, Nikolaus Rath nikol...@rath.org wrote:
 You can shrink a PV, but you will loose the extents that are stored in
 the space that you have truncated. I don't consider that resizing.

That's interesting. I do consider it resizing... It's not the function
of the pvresize command to move the LVs around so that it is possible
to downsize the PV. That's something that the admin must do.

If I use fdisk to resize a partition, is it fdisk's job to resize the
filesystem?

 From the same manpage that you looked up:

 ,
 | pvresize will refuse to shrink PhysicalVolume if it has allocated
 | extents after where its new end would be. In the future, it should
 | relocate these elsewhere in the volume group if there is sufficient free
 | space, like pvmove does.
 `

Yup, that is true - so you need to free up those extents first. Often
this is done by adding a second temporary PV to the VG.

 Unfortunately, pvmove can only move extends to other PVs but not to a
 different location in the same PV.

Yes, so it won't do exactly what you want in one command, so you have
to do it a different way. I have in the past added a second PV,
Extended the VG to this PV, then moved enough LVs to that second PV to
make reducing the original PV feasible. But the fact remains, that you
can shrink a Physical Volume.

 Why so aggressive?

I wasn't being particularly aggressive, but I do actually dislike
people saying (or abbreviating) just for the record when they are
incorrect or the facts are disputed. The only thing that goes in the
official record are the facts.

-- 
Sam
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


Re: Resizing PVs (was: Installation Impressions)

2011-02-05 Thread Chris Adams
Once upon a time, Nikolaus Rath nikol...@rath.org said:
 You can shrink a PV, but you will loose the extents that are stored in
 the space that you have truncated. I don't consider that resizing.

Changing the size of something is called resizing.

 Unfortunately, pvmove can only move extends to other PVs but not to a
 different location in the same PV.

Not true.  It isn't as straightforward; you have to know a map of the
PEs and specify them to the pvmove command like (assuming the
destination PEs are not in use):

pvmove /dev/sda2:1000-1100 /dev/sda2:100-200

IIRC you get a warning, and it is slow (obviously, reading and writing a
bunch of data on the same drive is slow).
-- 
Chris Adams cmad...@hiwaay.net
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


Re: Resizing PVs (was: Installation Impressions)

2011-02-05 Thread Michael D. Setzer II
http://fedorasolved.org/Members/zcat/shrink-lvm-for-new-partition

Does that link have the information for handling the physical resizing?

I had used the LVM option in the past, but have gone to making regular 
partitions on install, but do have some machines with old LVM setups. 

+--+
  Michael D. Setzer II -  Computer Science Instructor  
  Guam Community College  Computer Center  
  mailto:mi...@kuentos.guam.net
  mailto:msetze...@gmail.com
  http://www.guam.net/home/mikes
  Guam - Where America's Day Begins
  G4L Disk Imaging Project maintainer 
  http://sourceforge.net/projects/g4l/
+--+

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

BOINC@HOME CREDITS
SETI10331255.834230   |   EINSTEIN 5371421.810851
ROSETTA  2765286.340461   |   ABC  4335306.527607

-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines