linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] how to online resize pv?
@ 2012-07-30 19:14 Stefan Priebe
  2012-07-30 19:25 ` Scott Merrilees
  2012-07-30 20:25 ` Stuart D Gathman
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Priebe @ 2012-07-30 19:14 UTC (permalink / raw)
  To: linux-lvm

Hello list,

i'm able to resize my block device online. The kernel also shows the 
correct new size in blockdev --getsize64.

But then i got stuck to extend the pv as i'm unable to extend my 
partition table without reboot.

Disk /dev/vda: 48,3GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name       Flags
  1      1049kB  2097kB  1049kB               GRUB_BOOT  bios_grub
  2      2097kB  32,2GB  32,2GB               Linux LVM  lvm

If i delete 2 and recreate it starting at the same sector i can't reread 
the part. table.

Is there a way todo online resizing?

Greets
Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-30 19:14 [linux-lvm] how to online resize pv? Stefan Priebe
@ 2012-07-30 19:25 ` Scott Merrilees
  2012-07-31  6:25   ` Stefan Priebe
  2012-07-30 20:25 ` Stuart D Gathman
  1 sibling, 1 reply; 12+ messages in thread
From: Scott Merrilees @ 2012-07-30 19:25 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

partprobe ?
On Jul 31, 2012 5:23 AM, "Stefan Priebe" <s.priebe@profihost.ag> wrote:

> Hello list,
>
> i'm able to resize my block device online. The kernel also shows the
> correct new size in blockdev --getsize64.
>
> But then i got stuck to extend the pv as i'm unable to extend my partition
> table without reboot.
>
> Disk /dev/vda: 48,3GB
> Sector size (logical/physical): 512B/512B
> Partition Table: gpt
>
> Number  Start   End     Size    File system  Name       Flags
>  1      1049kB  2097kB  1049kB               GRUB_BOOT  bios_grub
>  2      2097kB  32,2GB  32,2GB               Linux LVM  lvm
>
> If i delete 2 and recreate it starting at the same sector i can't reread
> the part. table.
>
> Is there a way todo online resizing?
>
> Greets
> Stefan
>
> ______________________________**_________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/**mailman/listinfo/linux-lvm<https://www.redhat.com/mailman/listinfo/linux-lvm>
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-**HOWTO/<http://tldp.org/HOWTO/LVM-HOWTO/>
>

[-- Attachment #2: Type: text/html, Size: 1527 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-30 19:14 [linux-lvm] how to online resize pv? Stefan Priebe
  2012-07-30 19:25 ` Scott Merrilees
@ 2012-07-30 20:25 ` Stuart D Gathman
  2012-07-30 20:45   ` Stefan Priebe
  1 sibling, 1 reply; 12+ messages in thread
From: Stuart D Gathman @ 2012-07-30 20:25 UTC (permalink / raw)
  To: LVM general discussion and development

On Jul 30, Stefan Priebe transmitted in part:

> Number  Start   End     Size    File system  Name       Flags
> 1      1049kB  2097kB  1049kB               GRUB_BOOT  bios_grub
> 2      2097kB  32,2GB  32,2GB               Linux LVM  lvm
>
> If i delete 2 and recreate it starting at the same sector i can't reread the 
> part. table.
>
> Is there a way todo online resizing?

Only when no partition is open.  That is one reason why LVM is an
improvement over partition tables.  You don't have to use a partition
table, just use the entire device as a PV.  However, most admins use a
partition table with a single partition so that other OSes will
recognize the disk as in use (and hopefully not overwrite without
warning if accidentally presented).

If you have multiple drives, you might be able to migrate stuff off,
remove the PV, resize, add the PV back to the VG.

I use software RAID1/RAID10.  You can remove the partition from the RAID
array, resize, then add it back and resync.  Repeat for other mirror
legs to actually use the space.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-30 20:25 ` Stuart D Gathman
@ 2012-07-30 20:45   ` Stefan Priebe
  2012-07-31  5:10     ` Fred van Zwieten
       [not found]     ` <501700E1.4040708@bmsi.com>
  0 siblings, 2 replies; 12+ messages in thread
From: Stefan Priebe @ 2012-07-30 20:45 UTC (permalink / raw)
  To: LVM general discussion and development

Am 30.07.2012 22:25, schrieb Stuart D Gathman:
> On Jul 30, Stefan Priebe transmitted in part:
>
>> Number  Start   End     Size    File system  Name       Flags
>> 1      1049kB  2097kB  1049kB               GRUB_BOOT  bios_grub
>> 2      2097kB  32,2GB  32,2GB               Linux LVM  lvm
>>
>> If i delete 2 and recreate it starting at the same sector i can't
>> reread the part. table.
>>
>> Is there a way todo online resizing?
>
> Only when no partition is open.  That is one reason why LVM is an
> improvement over partition tables.  You don't have to use a partition
> table, just use the entire device as a PV.

that was my idea too but grub2 then refuses to install onto /dev/vda. It 
says it cannot find a filesystem on hd0 which is /dev/vda.

Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-30 20:45   ` Stefan Priebe
@ 2012-07-31  5:10     ` Fred van Zwieten
  2012-07-31  6:26       ` Stefan Priebe
       [not found]     ` <501700E1.4040708@bmsi.com>
  1 sibling, 1 reply; 12+ messages in thread
From: Fred van Zwieten @ 2012-07-31  5:10 UTC (permalink / raw)
  To: LVM general discussion and development

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

Try this<http://epsilon.eridani.nl/2012/06/11/hot-resize-lvm2-lv-in-vmware-linux-gues/>

Fred


On Mon, Jul 30, 2012 at 10:45 PM, Stefan Priebe <s.priebe@profihost.ag>wrote:

> Am 30.07.2012 22:25, schrieb Stuart D Gathman:
> > On Jul 30, Stefan Priebe transmitted in part:
> >
> >> Number  Start   End     Size    File system  Name       Flags
> >> 1      1049kB  2097kB  1049kB               GRUB_BOOT  bios_grub
> >> 2      2097kB  32,2GB  32,2GB               Linux LVM  lvm
> >>
> >> If i delete 2 and recreate it starting at the same sector i can't
> >> reread the part. table.
> >>
> >> Is there a way todo online resizing?
> >
> > Only when no partition is open.  That is one reason why LVM is an
> > improvement over partition tables.  You don't have to use a partition
> > table, just use the entire device as a PV.
>
> that was my idea too but grub2 then refuses to install onto /dev/vda. It
> says it cannot find a filesystem on hd0 which is /dev/vda.
>
> Stefan
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

[-- Attachment #2: Type: text/html, Size: 1977 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-30 19:25 ` Scott Merrilees
@ 2012-07-31  6:25   ` Stefan Priebe
  2012-07-31 10:02     ` andreas nastke
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Priebe @ 2012-07-31  6:25 UTC (permalink / raw)
  To: scott, LVM general discussion and development; +Cc: Scott Merrilees

Am 30.07.2012 21:25, schrieb Scott Merrilees:
> partprobe ?

does not work when the partition is mounted

Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-31  5:10     ` Fred van Zwieten
@ 2012-07-31  6:26       ` Stefan Priebe
  2012-07-31  9:25         ` Bryn M. Reeves
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Priebe @ 2012-07-31  6:26 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: Fred van Zwieten


Am 31.07.2012 07:10, schrieb Fred van Zwieten:
> Try this
> <http://epsilon.eridani.nl/2012/06/11/hot-resize-lvm2-lv-in-vmware-linux-gues/>

this just guarantees / updates the disk size. THis is not my problem the 
disk size is correct. I just can't change the partition table.

Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
       [not found]     ` <501700E1.4040708@bmsi.com>
@ 2012-07-31  6:58       ` Stefan Priebe
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Priebe @ 2012-07-31  6:58 UTC (permalink / raw)
  To: Stuart D Gathman; +Cc: linux-lvm

this does not work for me.

no partition table on vda:

# parted -l
Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/system-root: 21,5GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
  1      0,00B  21,5GB  21,5GB  xfs


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/system-boot: 210MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system  Flags
  1      0,00B  210MB  210MB  ext2


Error: /dev/vda: unrecognised disk label

# grub-install /dev/vda
/usr/sbin/grub-setup: error: unable to identify a filesystem in hd0; 
safety check can't be performed.

sure as there is no filesystem on sda.

Greets
Stefan

Am 30.07.2012 23:47, schrieb Stuart D Gathman:
> On 07/30/2012 04:45 PM, Stefan Priebe expounded in part:
>>
>>> Only when no partition is open.  That is one reason why LVM is an
>>> improvement over partition tables.  You don't have to use a partition
>>> table, just use the entire device as a PV.
>>
>>
>> that was my idea too but grub2 then refuses to install onto /dev/vda.
>> It says it cannot find a filesystem on hd0 which is /dev/vda.
> Grub2 supports LV boot partition now.  Most distro installers do not
> support this by default, however.  I set up my wife's laptop to boot
> from LV.  Here is an outline:
>
> http://forums.fedoraforum.org/showthread.php?t=264174
>
> The key line is adding GRUB_PRELOAD_MODULES=lvm so that grub can find
> the LV.  If your installer doesn't support it, you have to create the
> LVs, and copy filesystems from an installed system on another drive,
> then run grub2-install.
>
> I haven't tried Fedora 17 installer, to see if it can install grub2 with
> no partition table.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-31  6:26       ` Stefan Priebe
@ 2012-07-31  9:25         ` Bryn M. Reeves
  2012-07-31  9:50           ` Stefan Priebe - Profihost AG
  0 siblings, 1 reply; 12+ messages in thread
From: Bryn M. Reeves @ 2012-07-31  9:25 UTC (permalink / raw)
  To: LVM general discussion and development

On Tue, 2012-07-31 at 08:26 +0200, Stefan Priebe wrote:
> Am 31.07.2012 07:10, schrieb Fred van Zwieten:
> > Try this
> > <http://epsilon.eridani.nl/2012/06/11/hot-resize-lvm2-lv-in-vmware-linux-gues/>
> 
> this just guarantees / updates the disk size. THis is not my problem the 
> disk size is correct. I just can't change the partition table.

Reading between the lines in that post the user added a new partition on
the newly-allocated region of disk (this is fine - it's only in-use
partitions that are a problem) and then extended the VG onto the new
partition.

It's an OK workaround if you have no option but I normally prefer to
arrange some downtime and enlarge the existing partition rather than end
up with multiple PVs on the same disk (the tools work fine I just feel
it looks messy).

Bryn. 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-31  9:25         ` Bryn M. Reeves
@ 2012-07-31  9:50           ` Stefan Priebe - Profihost AG
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Priebe - Profihost AG @ 2012-07-31  9:50 UTC (permalink / raw)
  To: LVM general discussion and development

Am 31.07.2012 11:25, schrieb Bryn M. Reeves:
> On Tue, 2012-07-31 at 08:26 +0200, Stefan Priebe wrote:
>> Am 31.07.2012 07:10, schrieb Fred van Zwieten:
>>> Try this
>>> <http://epsilon.eridani.nl/2012/06/11/hot-resize-lvm2-lv-in-vmware-linux-gues/>
>>
>> this just guarantees / updates the disk size. THis is not my problem the
>> disk size is correct. I just can't change the partition table.
>
> Reading between the lines in that post the user added a new partition on
> the newly-allocated region of disk (this is fine - it's only in-use
> partitions that are a problem) and then extended the VG onto the new
> partition.
>
> It's an OK workaround if you have no option but I normally prefer to
> arrange some downtime and enlarge the existing partition rather than end
> up with multiple PVs on the same disk (the tools work fine I just feel
> it looks messy).

OK that's right that's why i had the other idea to use the whole disk 
for LVM but then grub doesn't want to install ;-(

Stefan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-31  6:25   ` Stefan Priebe
@ 2012-07-31 10:02     ` andreas nastke
  2012-07-31 11:30       ` Stefan Priebe - Profihost AG
  0 siblings, 1 reply; 12+ messages in thread
From: andreas nastke @ 2012-07-31 10:02 UTC (permalink / raw)
  To: LVM general discussion and development

how about

- create new part on other drive
- add that to vg
- pvmove part 2 to other drive
- remove part2 from vg
- pvremove part 2
- delete part 2
- create new (larger) part 2
- partprobe
- then add new part to vg and 'pvmove' back

andreas

Stefan Priebe schrieb:
> Am 30.07.2012 21:25, schrieb Scott Merrilees:
>> partprobe ?
> 
> does not work when the partition is mounted
> 
> Stefan
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [linux-lvm] how to online resize pv?
  2012-07-31 10:02     ` andreas nastke
@ 2012-07-31 11:30       ` Stefan Priebe - Profihost AG
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Priebe - Profihost AG @ 2012-07-31 11:30 UTC (permalink / raw)
  To: LVM general discussion and development

Yes that's a workaround - i just wanted to know if this is the only way 
and if it is correct that there's no other way.
Am 31.07.2012 12:02, schrieb andreas nastke:
> how about
>
> - create new part on other drive
> - add that to vg
> - pvmove part 2 to other drive
> - remove part2 from vg
> - pvremove part 2
> - delete part 2
> - create new (larger) part 2
> - partprobe
> - then add new part to vg and 'pvmove' back
>
> andreas
>
> Stefan Priebe schrieb:
>> Am 30.07.2012 21:25, schrieb Scott Merrilees:
>>> partprobe ?
>>
>> does not work when the partition is mounted
>>
>> Stefan
>>
>> _______________________________________________
>> linux-lvm mailing list
>> linux-lvm@redhat.com
>> https://www.redhat.com/mailman/listinfo/linux-lvm
>> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-07-31 11:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 19:14 [linux-lvm] how to online resize pv? Stefan Priebe
2012-07-30 19:25 ` Scott Merrilees
2012-07-31  6:25   ` Stefan Priebe
2012-07-31 10:02     ` andreas nastke
2012-07-31 11:30       ` Stefan Priebe - Profihost AG
2012-07-30 20:25 ` Stuart D Gathman
2012-07-30 20:45   ` Stefan Priebe
2012-07-31  5:10     ` Fred van Zwieten
2012-07-31  6:26       ` Stefan Priebe
2012-07-31  9:25         ` Bryn M. Reeves
2012-07-31  9:50           ` Stefan Priebe - Profihost AG
     [not found]     ` <501700E1.4040708@bmsi.com>
2012-07-31  6:58       ` Stefan Priebe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).