Skip to contentSkip to conversation

Resizing PV

linux-lvm Måns Rullgård 2 participants 7 messages Sep 22, 2003 – Sep 23, 2003

lore
Share & tools
lore
#0 lore raw

Is it possible to reduce the size of a PV, freeing some space at the end? I can make sure that the end is unused, of course.

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#1 lore raw
Quoted 3 lines · Måns Rullgård

Is it possible to reduce the size of a PV, freeing some space at the end? I can make sure that the end is unused, of course.

No such command implemented yet.

Hack:
you can use LVM2 and change the text format of the metadata by hand before running vgcfgrestore to store it back onto the PVs.

If you want to follow this non-supported path, you want to take a copy of the original metadata file in /etc/lvm/backup/ to be able to back out gain.

Quoted 11 lines
Signature · 10 lines
-- 
Måns Rullgård
[email protected]


_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw
Quoted 5 lines · Heinz J . Mauelshagen
Quoted 2 lines

Is it possible to reduce the size of a PV, freeing some space at the end? I can make sure that the end is unused, of course.

No such command implemented yet.

Quoted 7 lines

Hack:
you can use LVM2 and change the text format of the metadata by hand before running vgcfgrestore to store it back onto the PVs.

If you want to follow this non-supported path, you want to take a copy of the original metadata file in /etc/lvm/backup/ to be able to back out gain.

I'm already using lvm2. I noticed the pvresize command, but it just says it's not implemented yet. Any chance it will be some time soon?

As for editing the metadata, I'm a little confused about the meaning of some fields. After running vgcfgbackup, I have this in the file:

        physical_volumes {

                pv0 {
                        id = "eZV4mb-jk4z-pyfm-tGbJ-mBSW-drRT-ZHtgmn"
                        device = "/dev/discs/disc0/part2"       # Hint only

                        status = ["ALLOCATABLE"]
                        pe_start = 65920
                        pe_count = 1189 # 37.1562 Gigabytes
                }
        }

What is the meaning of the pe_start field? If I wanted to reduce the size by, say, 1 GB, would it be correct to reduce pe_count by 32, the PE size being 32 MB?

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#3 lore raw
Quoted 11 lines · Måns Rullgård
Quoted 9 lines · Heinz J . Mauelshagen
Quoted 2 lines

Is it possible to reduce the size of a PV, freeing some space at the end? I can make sure that the end is unused, of course.

No such command implemented yet.

Hack:
you can use LVM2 and change the text format of the metadata by hand before running vgcfgrestore to store it back onto the PVs.

Quoted 6 lines
Quoted 3 lines

If you want to follow this non-supported path, you want to take a copy of the original metadata file in /etc/lvm/backup/ to be able to back out gain.

I'm already using lvm2. I noticed the pvresize command, but it just says it's not implemented yet. Any chance it will be some time soon?

We've got higher priority stuff in the works. Probably later this year.

Quoted 16 lines

As for editing the metadata, I'm a little confused about the meaning of some fields. After running vgcfgbackup, I have this in the file:

        physical_volumes {

                pv0 {
                        id = "eZV4mb-jk4z-pyfm-tGbJ-mBSW-drRT-ZHtgmn"
                        device = "/dev/discs/disc0/part2"       # Hint only

                        status = ["ALLOCATABLE"]
                        pe_start = 65920
                        pe_count = 1189 # 37.1562 Gigabytes
                }
        }
Quoted 3 lines

What is the meaning of the pe_start field? If I wanted to reduce the size by, say, 1 GB, would it be correct to reduce pe_count by 32, the PE size being 32 MB?

pe_start is the sector offset into the device.
Yes, you need to reduce pe_count by 32 making it 1157 and vgcfgrestore. You need to have recent LVM2 code so that vgcfgrestore updates the pe_count properly (and of course, the 32 PEs need to be empty).

Quoted 11 lines
Signature · 10 lines
-- 
Måns Rullgård
[email protected]


_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#4 lore raw
Quoted 1 line · Heinz J . Mauelshagen

pe_start is the sector offset into the device.

OK, I thought it might be, but I wasn't sure.

Quoted 2 lines

Yes, you need to reduce pe_count by 32 making it 1157 and vgcfgrestore. You need to have recent LVM2 code so that vgcfgrestore updates the pe_count

How recent? Is this new enough?

LVM version: 2.00.03 (2003-07-13)
Library version: 1.00.02-ioctl (2003-07-12)
Driver version: 4.0.0

I'm using whatever device-mapper is in Linux 2.6.0-test5.

Quoted 1 line

properly (and of course, the 32 PEs need to be empty).

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#5 lore raw
Quoted 6 lines · Måns Rullgård
Quoted 1 line · Heinz J . Mauelshagen

pe_start is the sector offset into the device.

OK, I thought it might be, but I wasn't sure.

Quoted 8 lines
Quoted 2 lines

Yes, you need to reduce pe_count by 32 making it 1157 and vgcfgrestore. You need to have recent LVM2 code so that vgcfgrestore updates the pe_count

How recent? Is this new enough?

LVM version: 2.00.03 (2003-07-13)
Library version: 1.00.02-ioctl (2003-07-12)
Driver version: 4.0.0

Should do it.

Quoted 2 lines

I'm using whatever device-mapper is in Linux 2.6.0-test5.

That's ok. device-mapper isn't involved in such
userspace metadata updates to the PVs.

Quoted 13 lines
Quoted 2 lines

properly (and of course, the 32 PEs need to be empty).

Signature · 9 lines
Måns Rullgård
[email protected]


_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#6 lore raw
Quoted 8 lines · Heinz J . Mauelshagen
Quoted 8 lines
Quoted 1 line

pe_start is the sector offset into the device.

OK, I thought it might be, but I wasn't sure.

Quoted 3 lines

Yes, you need to reduce pe_count by 32 making it 1157 and vgcfgrestore. You need to have recent LVM2 code so that vgcfgrestore updates the pe_count

Quoted 7 lines
Quoted 5 lines

How recent? Is this new enough?

LVM version: 2.00.03 (2003-07-13)
Library version: 1.00.02-ioctl (2003-07-12)
Driver version: 4.0.0

Should do it.

It seemed to work. Thanks for the help.

Signature · 2 lines
M�ns Rullg�rd
[email protected]