* [linux-lvm] Can I create a PV that only uses a portion of a partition?
@ 2008-03-07 18:34 Lionel Kernux
2008-03-10 8:21 ` Luca Berra
0 siblings, 1 reply; 6+ messages in thread
From: Lionel Kernux @ 2008-03-07 18:34 UTC (permalink / raw)
To: linux-lvm
Hi again,
I have a 1.4TB disk that contains 1 parttition /dev/sda1.
Currently I have 1 PV that was created from /dev/sda1.
I have 1 VG created using the PV /dev/sda1.
I'd like to create some more VG's using the one disk.
Can I:
resize the PV /dev/sda1 and then create a new PV using the freed space?
I have a feeling that the relationship between partitions:PV's is 1:1.
Is this the case?
I was short-sighted when I created the PV and VG on this machine and
basically made one giant PV and one giant VG allocating it. Now I'd
like to be more granular.
I'm thinking the only way is to pvresize to shrink the PV, then shrink
the partition, then create some new partitions in the recovered space,
then create some new PV's from the new partitions, then create some
new VG's from the new PV's.
Any help?
Thanks
LK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Can I create a PV that only uses a portion of a partition?
2008-03-07 18:34 [linux-lvm] Can I create a PV that only uses a portion of a partition? Lionel Kernux
@ 2008-03-10 8:21 ` Luca Berra
2008-03-10 15:12 ` Bryn M. Reeves
0 siblings, 1 reply; 6+ messages in thread
From: Luca Berra @ 2008-03-10 8:21 UTC (permalink / raw)
To: linux-lvm
On Fri, Mar 07, 2008 at 01:34:16PM -0500, Lionel Kernux wrote:
>I was short-sighted when I created the PV and VG on this machine and
>basically made one giant PV and one giant VG allocating it. Now I'd
>like to be more granular.
creating multiple PV on the same disk makes no sense.
if you were to do this you could well do without LVM and avoid the
hassle.
PV = Physical Volume = LVM idea of a single DISK
VG = Volume Group = a set of PV
LV = Logical Volume = where you put your data
i believe your problem is you created a giant LV, not a giant PV.
in this case you could resize the filesystem that is inside that LV
then lvresize the LV and create more LVs in the remaining space.
L.
--
Luca Berra -- bluca@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Can I create a PV that only uses a portion of a partition?
2008-03-10 8:21 ` Luca Berra
@ 2008-03-10 15:12 ` Bryn M. Reeves
2008-03-10 17:45 ` Stuart D. Gathman
0 siblings, 1 reply; 6+ messages in thread
From: Bryn M. Reeves @ 2008-03-10 15:12 UTC (permalink / raw)
To: LVM general discussion and development
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Luca Berra wrote:
> On Fri, Mar 07, 2008 at 01:34:16PM -0500, Lionel Kernux wrote:
>> I was short-sighted when I created the PV and VG on this machine and
>> basically made one giant PV and one giant VG allocating it. Now I'd
>> like to be more granular.
> creating multiple PV on the same disk makes no sense.
> if you were to do this you could well do without LVM and avoid the
> hassle.
Not necessarily; Lionel could have perfectly valid reasons for wanting
to have multiple volume groups on the same disk.
> I'm thinking the only way is to pvresize to shrink the PV, then shrink
> the partition, then create some new partitions in the recovered space,
> then create some new PV's from the new partitions, then create some
> new VG's from the new PV's.
Yes, this approach should work fine - the only catch is if there are
extents already allocated in the area of the partition that you want to
shrink. In this case you can use pvmove with /path/to/dev:start-end
arguments to relocate any troublesome extents.
Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFH1U/C6YSQoMYUY94RAiT1AJwJ3thr96MqSrXQIhIwf4h0wy2gIwCgteux
Rj7mBPM9Enev1ONmE1U+ZnU=
=y5SC
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Can I create a PV that only uses a portion of a partition?
2008-03-10 15:12 ` Bryn M. Reeves
@ 2008-03-10 17:45 ` Stuart D. Gathman
2008-03-11 7:48 ` Marek Podmaka
0 siblings, 1 reply; 6+ messages in thread
From: Stuart D. Gathman @ 2008-03-10 17:45 UTC (permalink / raw)
To: LVM general discussion and development
On Mon, 10 Mar 2008, Bryn M. Reeves wrote:
> > creating multiple PV on the same disk makes no sense.
> > if you were to do this you could well do without LVM and avoid the
> > hassle.
>
> Not necessarily; Lionel could have perfectly valid reasons for wanting
> to have multiple volume groups on the same disk.
I commonly use multiple PVs. This wastes a little space, but it allows me to
do things like:
o Use md raid1 mirroring with smaller (20-30G) pieces that need syncing.
Very important on systems where md driver can't remember its sync
status between reboots.
o Rearrange PVs while operating by creating, syncing and removing md raid1
mirrors.
Granted, these should be replaced with LVM mirroring and pvmove. But
LVM mirroring doesn't seem to be mainstream with rhel5, and pvmove doesn't
seem as trustworthy as a result (since it depends on temporary mirroring
to move LVs while operating).
Also, when upgrading a system with LVM1 to LVM2, I prefer to create
a new VG and when committed to new OS, move LVs and incorporate PVs
of old VG. Although I've also just created an LVM1 LV for new OS, I'm
then left with a LVM1 VG, and I'm afraid to run the convert. :-)
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Can I create a PV that only uses a portion of a partition?
2008-03-10 17:45 ` Stuart D. Gathman
@ 2008-03-11 7:48 ` Marek Podmaka
2008-03-11 16:29 ` Stuart D. Gathman
0 siblings, 1 reply; 6+ messages in thread
From: Marek Podmaka @ 2008-03-11 7:48 UTC (permalink / raw)
To: LVM general discussion and development
Hello,
Monday, March 10, 2008, 18:45:15, Stuart D. Gathman wrote:
> o Use md raid1 mirroring with smaller (20-30G) pieces that need syncing.
> Very important on systems where md driver can't remember its sync
> status between reboots.
I didn't have md failure on recent kernels... now the reboot while
syncing is possible? On older kernels it just started from the
beginning.
But this approach has a performance penalty - from the md raid1 kernel
sources it seems that it does try to optimize reads (choose from which
of the mirrored drive to read block), but it does not work with multiple
md devices on the same disks (each md has its own information about
the current position of drive heads and doesn't know that the md is
also "using" the same drives).
--
bYE, Marki
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-lvm] Can I create a PV that only uses a portion of a partition?
2008-03-11 7:48 ` Marek Podmaka
@ 2008-03-11 16:29 ` Stuart D. Gathman
0 siblings, 0 replies; 6+ messages in thread
From: Stuart D. Gathman @ 2008-03-11 16:29 UTC (permalink / raw)
To: Marek Podmaka, LVM general discussion and development
On Tue, 11 Mar 2008, Marek Podmaka wrote:
> I didn't have md failure on recent kernels... now the reboot while
> syncing is possible? On older kernels it just started from the
> beginning.
Yes, recent kernels keep a sync status in the raid superblock.
> But this approach has a performance penalty - from the md raid1 kernel
> sources it seems that it does try to optimize reads (choose from which
> of the mirrored drive to read block), but it does not work with multiple
> md devices on the same disks (each md has its own information about
> the current position of drive heads and doesn't know that the md is
> also "using" the same drives).
Mirroring of any description is fairly pointless unless the mirrors
are on separate devices. Not only for performance, but because the
main point is to protect you from single disk device failure.
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-03-11 16:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-07 18:34 [linux-lvm] Can I create a PV that only uses a portion of a partition? Lionel Kernux
2008-03-10 8:21 ` Luca Berra
2008-03-10 15:12 ` Bryn M. Reeves
2008-03-10 17:45 ` Stuart D. Gathman
2008-03-11 7:48 ` Marek Podmaka
2008-03-11 16:29 ` Stuart D. Gathman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.