linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] How to resize a PV located on a SAN LUN
@ 2007-04-20 11:47 Micha Holzmann
  2007-04-20 17:10 ` Thomas Hager
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Micha Holzmann @ 2007-04-20 11:47 UTC (permalink / raw)
  To: linux-lvm

Hello,

since a few weeks we have an IBM SAN environment with Blade-Center.
The SAN controller is a DS4700 formerly known as FASTt. We have a LUN
with 200 GB of size. The LUN ist partioned:


fdisk -l /dev/sda

Disk /dev/sda: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         125     1004031   83  Linux
/dev/sda2             126       26108   208708447+   5  Extended
/dev/sda5             126         188      506016   83  Linux
/dev/sda6             189        1185     8008371   83  Linux
/dev/sda7            1186        1435     2008093+  83  Linux
/dev/sda8            1436        1560     1004031   83  Linux
/dev/sda9            1561        1810     2008093+  83  Linux
/dev/sda10           1811        2060     2008093+  83  Linux
/dev/sda11           2061        4053    16008741   83  Linux
/dev/sda12           4054       24960   167935446   8e  Linux LVM
/dev/sda13          24961       26108     9221278+  82  Linux swap



Now i had to increase the size of partition of sda12 which is a LVM.
I am not sure which is the right way. Within the storage managment
software i can increase the size of the LUN. After rebooting the machine
the additional space is appended at the end of partitions and it is
marked as free. How can i now increase the LVM partition. Which
tool/programm i do need for this task?

Best regards,
Micha

-- 
Who the hell is General Failure, and why he is reading my disk?

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

* Re: [linux-lvm] How to resize a PV located on a SAN LUN
  2007-04-20 11:47 [linux-lvm] How to resize a PV located on a SAN LUN Micha Holzmann
@ 2007-04-20 17:10 ` Thomas Hager
  2007-04-23 10:06   ` PeS
  2007-04-20 17:11 ` Michael T. Babcock
  2007-04-28 23:35 ` Louis Guillaume
  2 siblings, 1 reply; 5+ messages in thread
From: Thomas Hager @ 2007-04-20 17:10 UTC (permalink / raw)
  To: linux-lvm

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

On Fri, 2007-04-20 at 13:47 +0200, Micha Holzmann wrote:
> Hello,
hi,

> Now i had to increase the size of partition of sda12 which is a LVM.
why would you want to do that? if your vg is running out of free
extents, why not just add a new LUN from the SAN and extend the vg with
it?

> I am not sure which is the right way. Within the storage managment
> software i can increase the size of the LUN. After rebooting the machine
> the additional space is appended at the end of partitions and it is
> marked as free. How can i now increase the LVM partition. Which
> tool/programm i do need for this task?
you can't really increase the physical volume, because there's a swap
partition between your physical volume and the free space.
use fdisk to partition the free space as /dev/sda14, create a physical
volume on the new partition (pvcreate /dev/sda14) and extend the
volume group with the new physical volume (vgextend yourvg /dev/sda14).

hth,
tom.

-- 
Thomas "Duke" Hager                       {duke,hager}@sigsegv.at
GPG: 1024D/D27F858C            http://www.sigsegv.at/gpg/duke.gpg
=================================================================
"Never Underestimate the Power of Stupid People in Large Groups."



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [linux-lvm] How to resize a PV located on a SAN LUN
  2007-04-20 11:47 [linux-lvm] How to resize a PV located on a SAN LUN Micha Holzmann
  2007-04-20 17:10 ` Thomas Hager
@ 2007-04-20 17:11 ` Michael T. Babcock
  2007-04-28 23:35 ` Louis Guillaume
  2 siblings, 0 replies; 5+ messages in thread
From: Michael T. Babcock @ 2007-04-20 17:11 UTC (permalink / raw)
  To: linux-lvm

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

Micha Holzmann wrote:
> Now i had to increase the size of partition of sda12 which is a LVM.
> I am not sure which is the right way. Within the storage managment
> software i can increase the size of the LUN. After rebooting the machine
> the additional space is appended at the end of partitions and it is
> marked as free. How can i now increase the LVM partition. Which
> tool/programm i do need for this task?
>   

The easy way would be to create a new partition to use that free space, 
then use pvcreate to make it a physical volume and then add it to the 
volume group.  This would mean you'd have two physical volumes on the 
device belonging to the same volume group.
-- 
Michael T. Babcock
http://mikebabcock.ca


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

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

* Re: [linux-lvm] How to resize a PV located on a SAN LUN
  2007-04-20 17:10 ` Thomas Hager
@ 2007-04-23 10:06   ` PeS
  0 siblings, 0 replies; 5+ messages in thread
From: PeS @ 2007-04-23 10:06 UTC (permalink / raw)
  To: LVM general discussion and development

Thomas Hager wrote:
> On Fri, 2007-04-20 at 13:47 +0200, Micha Holzmann wrote:
>> Hello,
> hi,
> 
>> Now i had to increase the size of partition of sda12 which is a LVM.
> why would you want to do that? if your vg is running out of free
> extents, why not just add a new LUN from the SAN and extend the vg with
> it?

Maybe, because their SAN configuration get bloated with smaller LUNs? 
When SAN enables extending size, why not use it?

>> I am not sure which is the right way. Within the storage managment
>> software i can increase the size of the LUN. After rebooting the machine
>> the additional space is appended at the end of partitions and it is
>> marked as free. How can i now increase the LVM partition. Which
>> tool/programm i do need for this task?
> you can't really increase the physical volume, because there's a swap
> partition between your physical volume and the free space.
> use fdisk to partition the free space as /dev/sda14, create a physical
> volume on the new partition (pvcreate /dev/sda14) and extend the
> volume group with the new physical volume (vgextend yourvg /dev/sda14).

As it's swap partition, he can recreate it. So create new swap partition 
/dev/sda14 at the end of extended disk. Then mkswap /dev/sda14, swapon 
/dev/sda14, swapoff /dev/sda13. Delete /dev/sda13, add size to 
/dev/sda12 using fdisk. Then use pvresize /dev/sda12 (it'll autodetect 
new size). And after this, you can see free PE in vg.

Or better, if you can disable swap partition for some time, switch it 
off, delete sda13, resize sda12, pvresize sda12 and create new LV for 
swap inside VG. With this, next time you add some space, you won't 
move/delete swap partition, just resize(fdisk) and pvresize sda12.

> hth,
> tom.

Hope this helps,
PeS

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

* Re: [linux-lvm] How to resize a PV located on a SAN LUN
  2007-04-20 11:47 [linux-lvm] How to resize a PV located on a SAN LUN Micha Holzmann
  2007-04-20 17:10 ` Thomas Hager
  2007-04-20 17:11 ` Michael T. Babcock
@ 2007-04-28 23:35 ` Louis Guillaume
  2 siblings, 0 replies; 5+ messages in thread
From: Louis Guillaume @ 2007-04-28 23:35 UTC (permalink / raw)
  To: linux-lvm

Micha Holzmann wrote:
> Hello,
> 
> since a few weeks we have an IBM SAN environment with Blade-Center.
> The SAN controller is a DS4700 formerly known as FASTt. We have a LUN
> with 200 GB of size. The LUN ist partioned:
> 
> 
> fdisk -l /dev/sda
> 
> Disk /dev/sda: 214.7 GB, 214748364800 bytes
> 255 heads, 63 sectors/track, 26108 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1   *           1         125     1004031   83  Linux
> /dev/sda2             126       26108   208708447+   5  Extended
> /dev/sda5             126         188      506016   83  Linux
> /dev/sda6             189        1185     8008371   83  Linux
> /dev/sda7            1186        1435     2008093+  83  Linux
> /dev/sda8            1436        1560     1004031   83  Linux
> /dev/sda9            1561        1810     2008093+  83  Linux
> /dev/sda10           1811        2060     2008093+  83  Linux
> /dev/sda11           2061        4053    16008741   83  Linux
> /dev/sda12           4054       24960   167935446   8e  Linux LVM
> /dev/sda13          24961       26108     9221278+  82  Linux swap
> 
> 
> 
> Now i had to increase the size of partition of sda12 which is a LVM.
> I am not sure which is the right way. Within the storage managment
> software i can increase the size of the LUN. After rebooting the machine
> the additional space is appended at the end of partitions and it is
> marked as free. How can i now increase the LVM partition. Which
> tool/programm i do need for this task?
> 
> Best regards,
> Micha
> 


Others have suggested what is probably your only option if you're stuck
with this configuration, i.e. create a new PV and add it to the volume
group.

This configuration seems a little strange to me. How come you
partitioned the LUN this way? Using LVM for everything would have been
much more flexible in general.

If you had created a single PV from the whole LUN and created Logical
Volumes for each "partition", you would not have any problem now: You
would be able to simply do a "pvresize" then "lvextend" to grow the LV,
then resize2fs (assuming ext[23]).

Louis

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

end of thread, other threads:[~2007-04-28 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-20 11:47 [linux-lvm] How to resize a PV located on a SAN LUN Micha Holzmann
2007-04-20 17:10 ` Thomas Hager
2007-04-23 10:06   ` PeS
2007-04-20 17:11 ` Michael T. Babcock
2007-04-28 23:35 ` Louis Guillaume

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).