All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Adding PVs to a group
@ 2008-04-18 21:45 Charles Marcus
  2008-04-18 21:51 ` Charles Marcus
  2008-04-19 17:57 ` Charles Marcus
  0 siblings, 2 replies; 12+ messages in thread
From: Charles Marcus @ 2008-04-18 21:45 UTC (permalink / raw)
  To: linux-lvm

Hello,

I'm still fairly new to using LVM, and I need to do something on a live 
server, so just need to be sure of what I'm doing...

Hardware:

3ware 9500S-8 Raid card with 8 Seagate 160GB hard drives

Ports 0 & 1 are mirrored, and contain:

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         100      803218+  83  Linux
/dev/sda2             101         163      506047+  82  Linux swap
/dev/sda3             164        2654    20008957+  83  Linux
/dev/sda4            2655       19450   134913870   83  Linux

The other 6 are set up in a Raid 10, and contain:

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       24900   200009218+  8e  Linux LVM
/dev/sdb2           24901       58352   268703190   8e  Linux LVM

pvscan shows:

myhost # pvscan
   /dev/cdrom: open failed: Read-only file system
   Attempt to close device '/dev/cdrom' which is not open.
   PV /dev/sdb1   VG vg2   lvm2 [190.74 GB / 0    free]
   Total: 1 [190.74 GB] / in use: 1 [190.74 GB] / in no VG: 0 [0   ]
myhost #

lvscan shows:

myhost # lvscan
   ACTIVE            '/dev/vg2/home' [50.00 GB] inherit
   ACTIVE            '/dev/vg2/usr' [20.00 GB] inherit
   ACTIVE            '/dev/vg2/var' [120.74 GB] inherit
myhost #

So, /dev/sdb2 was being used for backups, but I was finally able to 
convince the boss to let me get a QNAP NAS, so am using that for backups 
now.

What I want to do is make the space from /dev/sdb2 available to my vg2 
volume group, so I can extend my /var partition (it is filling up fast - 
damn email packrats)....

Am I correct in that all I need to do is:

vgextend vg2 /dev/sdb2

then I can extend any of the logical volumes?

What I want to do is add all of /dev/sdb2 to the /var partition, so am I 
correct taht to do this I would do:

lvextend -l %FREE /dev/vg2/var

(I think the %FREE is how I tell it to use all of it, right?)

then resize the filesystem (it is reiserfs):

umount /dev/vg2/var
resize_reiserfs /dev/vg2/var
mount -t reiserfs /dev/vg2/var /var

Thanks for any help and/or suggestions...

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-18 21:45 [linux-lvm] Adding PVs to a group Charles Marcus
@ 2008-04-18 21:51 ` Charles Marcus
  2008-04-19  0:18   ` dave
  2008-04-19 17:57 ` Charles Marcus
  1 sibling, 1 reply; 12+ messages in thread
From: Charles Marcus @ 2008-04-18 21:51 UTC (permalink / raw)
  To: LVM general discussion and development

On 4/18/2008, Charles Marcus (CMarcus@Media-Brokers.com) wrote:
> 
> Ports 0 & 1 are mirrored, and contain:
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sda1               1         100      803218+  83  Linux
> /dev/sda2             101         163      506047+  82  Linux swap
> /dev/sda3             164        2654    20008957+  83  Linux
> /dev/sda4            2655       19450   134913870   83  Linux

Should have been more specific...

/dev/sda1 = /boot
/dev/sda2 = swap
/dev/sda3 = /
/dev/sda4 = /backups

> The other 6 are set up in a Raid 10, and contain:
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdb1               1       24900   200009218+  8e  Linux LVM
> /dev/sdb2           24901       58352   268703190   8e  Linux LVM 

These are:

/dev/sdb1 = /home, /usr, and /var
/dev/sdb2 = nothing (was being used for backups)

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-18 21:51 ` Charles Marcus
@ 2008-04-19  0:18   ` dave
  2008-04-21 10:16     ` Bryn M. Reeves
  0 siblings, 1 reply; 12+ messages in thread
From: dave @ 2008-04-19  0:18 UTC (permalink / raw)
  To: LVM general discussion and development

sounds fine to me.

I had never heard of the %FREE thing though. To fill out a vg I would just check how many extents are available and use that on the command line with -l, remember there are no spaces between -l and the number of extents given.

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-18 21:45 [linux-lvm] Adding PVs to a group Charles Marcus
  2008-04-18 21:51 ` Charles Marcus
@ 2008-04-19 17:57 ` Charles Marcus
  2008-04-20  3:19   ` David Robinson
  1 sibling, 1 reply; 12+ messages in thread
From: Charles Marcus @ 2008-04-19 17:57 UTC (permalink / raw)
  To: LVM general discussion and development

Actually, now I'm confusing myself...

Currently, /dev/sdb is partitioned into two partitions...

Since I'm no longer using the second partition at all, wouldn't it be 
simpler/cleaner to just delete the second partition entirely (using 
fdisk) and then just resize /dev/sdb1 to include the new free space 
using vgextend?

Or will that not work?

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-19 17:57 ` Charles Marcus
@ 2008-04-20  3:19   ` David Robinson
  2008-04-20 16:42     ` Charles Marcus
  0 siblings, 1 reply; 12+ messages in thread
From: David Robinson @ 2008-04-20  3:19 UTC (permalink / raw)
  To: LVM general discussion and development

Charles Marcus wrote:
> Actually, now I'm confusing myself...
> 
> Currently, /dev/sdb is partitioned into two partitions...
> 
> Since I'm no longer using the second partition at all, wouldn't it be 
> simpler/cleaner to just delete the second partition entirely (using 
> fdisk) and then just resize /dev/sdb1 to include the new free space 
> using vgextend?
> 
> Or will that not work?

That will work. You'll need to run pvresize after resizing the 
partition, and you wouldn't need to use vgextend.

--Dave

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-20  3:19   ` David Robinson
@ 2008-04-20 16:42     ` Charles Marcus
  2008-04-20 22:40       ` David Robinson
  2008-04-21  0:22       ` Ross Boylan
  0 siblings, 2 replies; 12+ messages in thread
From: Charles Marcus @ 2008-04-20 16:42 UTC (permalink / raw)
  To: LVM general discussion and development

On 4/19/2008, David Robinson (zxvdr.au@gmail.com) wrote:
>> Since I'm no longer using the second partition at all, wouldn't it 
>> be simpler/cleaner to just delete the second partition entirely 
>> (using fdisk) and then just resize /dev/sdb1 to include the new free 
>> space using vgextend?
>>
>> Or will that not work?

> That will work. You'll need to run pvresize after resizing the 
> partition, and you wouldn't need to use vgextend.

Thanks for taking the time to hold my hand a little through this David...

OT: this list seems a little on the dead side... is there a more active 
LVM oriented list that you are aware of?

Anyway...

Ok, so I guess the only question I have is - does it matter?

Is my following evaluation correct? :

It is much simpler - because I can do this without rebooting - to just do:

vgextend vg2 /dev/sdb2, then

lvextend -L+100G /dev/vg2/var, then

resize_reiserfs -f /dev/vg2/var

than it is to:

delete /dev/sdb2, reboot, then

resize /dev/sdb1, reboot, then

run pvresize, *then*

run lvextend...

So, again - does it really matter? Is having my vg2 in one big LVM 
partition 'better' than having it consist of two different partitions?

I'm thinking it does *not* matter, so will most likely go with the 
first/easiest option, unless you (or someone else) provides a good 
reason to take option 2...

Thanks again,

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-20 16:42     ` Charles Marcus
@ 2008-04-20 22:40       ` David Robinson
  2008-04-21 10:04         ` Charles Marcus
  2008-04-21  0:22       ` Ross Boylan
  1 sibling, 1 reply; 12+ messages in thread
From: David Robinson @ 2008-04-20 22:40 UTC (permalink / raw)
  To: LVM general discussion and development

> OT: this list seems a little on the dead side... is there a more active 
> LVM oriented list that you are aware of?

The list is active, but its quiet on weekends ;)

> Ok, so I guess the only question I have is - does it matter?

It doesn't really matter. Either method will work fine. I'd prefer to 
remove the partition, but that's only to keep things tidy - I don't like 
having unnecessary partitions.

> Is my following evaluation correct? :
> 
> It is much simpler - because I can do this without rebooting - to just do:
> 
> vgextend vg2 /dev/sdb2, then
> 
> lvextend -L+100G /dev/vg2/var, then
> 
> resize_reiserfs -f /dev/vg2/var
> 
> than it is to:
> 
> delete /dev/sdb2, reboot, then

You could modify the partition table in one step rather than two. Use 
fdisk to delete both partitions then create a new partition that spans 
the entire device (just make sure that you create the partition with the 
same start block). The end result should look something like:

    Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       58352   468712408+  8e  Linux LVM

> resize /dev/sdb1, reboot, then

You may not need to reboot at all... you could use "partprobe" or 
"blockdev --rereadpt", but check /proc/partitions to make sure that the 
kernel knows of the new partition table. I've seen instances where 
partprobe doesn't actually cause the partition table to be refreshed.

> run pvresize, *then*
> 
> run lvextend...
> 
> So, again - does it really matter? Is having my vg2 in one big LVM 
> partition 'better' than having it consist of two different partitions?

There's no difference, LVM doesn't care.

--Dave

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-20 16:42     ` Charles Marcus
  2008-04-20 22:40       ` David Robinson
@ 2008-04-21  0:22       ` Ross Boylan
  2008-04-21 10:06         ` Charles Marcus
  1 sibling, 1 reply; 12+ messages in thread
From: Ross Boylan @ 2008-04-21  0:22 UTC (permalink / raw)
  To: LVM general discussion and development


On Sun, 2008-04-20 at 12:42 -0400, Charles Marcus wrote:
> vgextend vg2 /dev/sdb2, then
> 
> lvextend -L+100G /dev/vg2/var, then
> 
> resize_reiserfs -f /dev/vg2/var
> 
In your first example you umount'd before resizing.  In this example you
don't.  reiser doesn't require taking the volume offline before
resizing, so I don't think you need umount in any case.
Ross

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-20 22:40       ` David Robinson
@ 2008-04-21 10:04         ` Charles Marcus
  0 siblings, 0 replies; 12+ messages in thread
From: Charles Marcus @ 2008-04-21 10:04 UTC (permalink / raw)
  To: LVM general discussion and development

On 4/20/2008, David Robinson (zxvdr.au@gmail.com) wrote:
>> OT: this list seems a little on the dead side... is there a more 
>> active LVM oriented list that you are aware of?

> The list is active, but its quiet on weekends ;)

Oh, right, I forget that some people actually have lives outside work, 
unlike me... ;)

> You could modify the partition table in one step rather than two. Use 
> fdisk to delete both partitions then create a new partition that 
> spans the entire device (just make sure that you create the partition 
> with the same start block). The end result should look something like:
> 
>    Device Boot      Start         End      Blocks   Id  System
> /dev/sdb1               1       58352   468712408+  8e  Linux LVM

I have read about doing this, but somehow it just gives me the shudders...

I'll have to play with it sometime in a VM...

>> resize /dev/sdb1, reboot, then

> You may not need to reboot at all... you could use "partprobe" or 
> "blockdev --rereadpt", but check /proc/partitions to make sure that 
> the kernel knows of the new partition table. I've seen instances 
> where partprobe doesn't actually cause the partition table to be 
> refreshed.

Thanks - have to read up on partprobe too...

Still feel like a newbie sometimes, even though I've been using Linux 
for almost two years now (came over from the windows world)...

>> So, again - does it really matter? Is having my vg2 in one big LVM 
>> partition 'better' than having it consist of two different partitions?

> There's no difference, LVM doesn't care.

Ok, thanks... thats what I'll do for now... I'm actually planning on 
replacing this server with a different one and rebuilding everything 
from scratch in a few months anyway, so I'll redo the partitions then...

For now, simple and safe is best... my main goal is to keep /var from 
filling up...

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-21  0:22       ` Ross Boylan
@ 2008-04-21 10:06         ` Charles Marcus
  0 siblings, 0 replies; 12+ messages in thread
From: Charles Marcus @ 2008-04-21 10:06 UTC (permalink / raw)
  To: LVM general discussion and development

On 4/20/2008, Ross Boylan (ross@biostat.ucsf.edu) wrote:
>> vgextend vg2 /dev/sdb2, then
>> 
>> lvextend -L+100G /dev/vg2/var, then
>> 
>> resize_reiserfs -f /dev/vg2/var

> In your first example you umount'd before resizing. In this example 
> you don't. reiser doesn't require taking the volume offline before 
> resizing, so I don't think you need umount in any case.

Right... although, if I'm not mistaken, you do have to umount if you are 
*shrinking*...

And I'm assuming thats what the -f is for when doing it on a live 
filesystem?

But I prefer to umount anyway... just feels safer to me...

-- 

Best regards,

Charles

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-19  0:18   ` dave
@ 2008-04-21 10:16     ` Bryn M. Reeves
  2008-04-21 12:51       ` Charles Marcus
  0 siblings, 1 reply; 12+ messages in thread
From: Bryn M. Reeves @ 2008-04-21 10:16 UTC (permalink / raw)
  To: LVM general discussion and development

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

dave@frop.net wrote:
> sounds fine to me.
> 
> I had never heard of the %FREE thing though. To fill out a vg I would just check how many extents are available and use that on the command line with -l, remember there are no spaces between -l and the number of extents given.

The %VG, %LV & %FREE suffices were introduced a while back:

Version 2.02.11 - 12th October 2006
===================================
[...]
  Add %VG, %LV and %FREE suffices to lvcreate/lvresize --extents arg.


Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFIDGl+6YSQoMYUY94RAmYvAKCSdjcxMRVbvZY0RCKEJZYClEyzdwCgrJ2m
kJj33ju8X2nYhJcG0yhBA1g=
=cdou
-----END PGP SIGNATURE-----

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

* Re: [linux-lvm] Adding PVs to a group
  2008-04-21 10:16     ` Bryn M. Reeves
@ 2008-04-21 12:51       ` Charles Marcus
  0 siblings, 0 replies; 12+ messages in thread
From: Charles Marcus @ 2008-04-21 12:51 UTC (permalink / raw)
  To: LVM general discussion and development

On 4/21/2008, Bryn M. Reeves (bmr@redhat.com) wrote:
> > I had never heard of the %FREE thing though. To fill out a vg I 
> would just check how many extents are available and use that on the 
> command line with -l, remember there are no spaces between -l and the 
> number of extents given.
> 
> The %VG, %LV & %FREE suffices were introduced a while back:
> 
> Version 2.02.11 - 12th October 2006
> ===================================
> [...]
>   Add %VG, %LV and %FREE suffices to lvcreate/lvresize --extents arg.

Cool... so to confirm, the correct syntax would be:

lvextend -l%FREE /dev/vg2/var

(no space between the 'l' and '%FREE')

?

Thanks again guys...

-- 

Best regards,

Charles

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

end of thread, other threads:[~2008-04-21 12:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18 21:45 [linux-lvm] Adding PVs to a group Charles Marcus
2008-04-18 21:51 ` Charles Marcus
2008-04-19  0:18   ` dave
2008-04-21 10:16     ` Bryn M. Reeves
2008-04-21 12:51       ` Charles Marcus
2008-04-19 17:57 ` Charles Marcus
2008-04-20  3:19   ` David Robinson
2008-04-20 16:42     ` Charles Marcus
2008-04-20 22:40       ` David Robinson
2008-04-21 10:04         ` Charles Marcus
2008-04-21  0:22       ` Ross Boylan
2008-04-21 10:06         ` Charles Marcus

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.