* [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be used for another partition/purpose outside of LVM
@ 2005-02-06 20:15 Ajeet Nankani
2005-02-06 20:24 ` Alasdair G Kergon
0 siblings, 1 reply; 3+ messages in thread
From: Ajeet Nankani @ 2005-02-06 20:15 UTC (permalink / raw)
To: LVM general discussion & development
I have hda6 as the only PV in a Volume Group which contains 2 Logical
Volumes.
I have around 42 contiguous free PEs at the end of PV.
I want to reduce this PV by 42 or less PEs so that i can reduce hda6 and
create one more partion hda7(Fat32) for some other work.
There is not any straight command to do it atleat untill now, because i
tried to use pvresize and it said that command not implemented yet.
I thought of one way, but i am not sure it would work or not, so i need
you people comments on it.
First i will create a meta data backup of the Volume Group with the
command
vgcfgbackup which would give me meta file data as below
================================================
description = "Created *after* executing 'pvmove -v -i 60 --alloc
anywhere /dev/hda6:233-264 /dev/hda6:192-223'"
creation_host = "XXXXX" # Linux XXXXX 2.6.9-1.667 #1 Tue Nov 2
14:41:25 EST 2004 i686
creation_time = 1107716048 # Sun Feb 6 19:54:08 2005
VolGroup00 {
id = "cdEPbO-5o71-hUIa-szPC-FAra-E79P-cdbuTS"
seqno = 17
status = ["RESIZEABLE", "READ", "WRITE"]
extent_size = 65536 # 32 Megabytes
max_lv = 0
max_pv = 0
physical_volumes {
pv0 {
id = "BQSuB1-GYJf-bfdM-wnZd-JJgi-fZAM-jm4th6"
device = "/dev/hda6" # Hint only
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 266 # 8.3125 Gigabytes
}
}
logical_volumes {
LogVol00 {
id = "6WyF9L-t4dJ-8HrR-NdTo-CoZh-NKvl-z6fidr"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {
start_extent = 0
extent_count = 192 # 6 Gigabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 0
]
}
}
LogVol01 {
id = "N3auhB-e9br-76Cw-Eqvw-c31w-mq3Y-T5QBp8"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {
start_extent = 0
extent_count = 32 # 1024 Megabytes
type = "striped"
stripe_count = 1 # linear
stripes = [
"pv0", 192
]
}
}
}
}
=====================================================================
Now here if i edit it and in physical volume section where it says that
pe_count = 266, i change it to pe_count = 224 which is the last PE used
by the Logical Volume.
after saving it if i run vgcfgrestore with this file, will my PV be
reduced?? after that i can reduce hda6 with parted or similar utility.
Any comments??
Thanks.
-ajeet.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be used for another partition/purpose outside of LVM
2005-02-06 20:15 [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be used for another partition/purpose outside of LVM Ajeet Nankani
@ 2005-02-06 20:24 ` Alasdair G Kergon
2005-02-06 21:01 ` [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be usedfor " Ajeet Nankani
0 siblings, 1 reply; 3+ messages in thread
From: Alasdair G Kergon @ 2005-02-06 20:24 UTC (permalink / raw)
To: LVM general discussion and development
On Sun, Feb 06, 2005 at 12:15:48PM -0800, Ajeet Nankani wrote:
> vgcfgbackup which would give me meta file data as below
> extent_size = 65536 # 32 Megabytes
> device = "/dev/hda6" # Hint only
> pe_start = 384
> pe_count = 266 # 8.3125 Gigabytes
> extent_count = 192 # 6 Gigabytes
> "pv0", 0
0-191
> extent_count = 32 # 1024 Megabytes
> "pv0", 192
192-223
> Now here if i edit it and in physical volume section where it says that
> pe_count = 266, i change it to pe_count = 224 which is the last PE used
> by the Logical Volume.
Yes.
> after saving it if i run vgcfgrestore with this file, will my PV be
> reduced??
That's what pvresize would do.
> after that i can reduce hda6 with parted or similar utility.
and the new size is 384 sectors plus 224 extents of 65536 sectors each.
Alasdair
--
agk@redhat.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be usedfor another partition/purpose outside of LVM
2005-02-06 20:24 ` Alasdair G Kergon
@ 2005-02-06 21:01 ` Ajeet Nankani
0 siblings, 0 replies; 3+ messages in thread
From: Ajeet Nankani @ 2005-02-06 21:01 UTC (permalink / raw)
To: LVM general discussion and development
On Sun, 6 Feb 2005 20:24:40 +0000, "Alasdair G Kergon" <agk@redhat.com>
said:
> On Sun, Feb 06, 2005 at 12:15:48PM -0800, Ajeet Nankani wrote:
> > vgcfgbackup which would give me meta file data as below
>
> > extent_size = 65536 # 32 Megabytes
>
> > device = "/dev/hda6" # Hint only
>
> > pe_start = 384
> > pe_count = 266 # 8.3125 Gigabytes
>
> > extent_count = 192 # 6 Gigabytes
> > "pv0", 0
>
> 0-191
>
> > extent_count = 32 # 1024 Megabytes
> > "pv0", 192
>
> 192-223
>
> > Now here if i edit it and in physical volume section where it says that
> > pe_count = 266, i change it to pe_count = 224 which is the last PE used
> > by the Logical Volume.
>
> Yes.
>
> > after saving it if i run vgcfgrestore with this file, will my PV be
> > reduced??
>
> That's what pvresize would do.
but pvresize says command not implemented yet.
also what this "pe_start = 384" in meta data means.
Thanks
-ajeet.
>
> > after that i can reduce hda6 with parted or similar utility.
>
> and the new size is 384 sectors plus 224 extents of 65536 sectors each.
>
> Alasdair
> --
> agk@redhat.com
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-06 21:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-06 20:15 [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be used for another partition/purpose outside of LVM Ajeet Nankani
2005-02-06 20:24 ` Alasdair G Kergon
2005-02-06 21:01 ` [linux-lvm] Reducing PV/ Reclaiming free PEs from a PV to be usedfor " Ajeet Nankani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox