FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 09-08-2012, 06:20 PM
walt
 
Default Puzzling lvm2 behavior?

I've never expanded an lvm partition before, and I think I did it the
long way around just now:

I divided my 1TB disk into 10 equal pv's when I bought it, and then
added four of those to a new vg (named wd0), leaving the other six
for future use.

After a few months of filling up that partition I needed more room,
of course, so I used vgextend to add a fifth pv to the existing vg.
That worked fine, but now I had to extend the ext4 fs to fill all of
the added new space.

While googling I saw some advice to use resize2fs for that, but
resize2fs said there is nothing to do on that fs and quit without
doing anything.

After some fumbling around I used lvextend -r -L nnnnn /dev/wd0/wd0,
where nnnnn is the number of unused extents listed by pvdisplay.

That (eventually) worked but each time I ran that command, only
roughly half of the empty extents were added instead of the whole
nnnnn of them. Took me about 10 iterations before all of the
extents were finally added to the filesystem :-/

So, did I use the wrong tools or in the wrong order, or what?
It should have been easier than that, I think.
 
Old 09-08-2012, 07:01 PM
Samurai
 
Default Puzzling lvm2 behavior?

I do have 3 2tb drives with lvm2 on them recently I did resize some partitions (i didn't resize the vg - one drive one vg here) but I use lvresize -L ±nnG vg/lv to add exactly nn GB to desired lv an than online grow with resize2fs /dev/vg/lv



I did this more than once and never encountered any problem.

S

walt <w41ter@gmail.com> wrote:
I've never expanded an lvm partition before, and I think I did it the
long way around just now:

I divided my 1TB disk into 10 equal pv's when I bought it, and then
added four of those to a new vg (named wd0), leaving the other six
for future use.

After a few months of filling up that partition I needed more room,
of course, so I used vgextend to add a fifth pv to the existing vg.
That worked fine, but now I had to extend the ext4 fs to fill all of
the added new space.

While googling I saw some advice to use resize2fs for that, but
resize2fs said there is nothing to do on that fs and quit without
doing anything.

After some fumbling around I used lvextend -r -L nnnnn /dev/wd0/wd0,
where nnnnn is the number of unused extents listed by pvdisplay.

That (eventually) worked but each time I ran
that command, only
roughly half of the empty extents were added instead of the whole
nnnnn of them. Took me about 10 iterations before all of the
extents were finally added to the filesystem :-/

So, did I use the wrong tools or in the wrong order, or what?
It should have been easier than that, I think.




--

Sent from my Android phone with K-9 Mail. Please excuse my brevity.
 
Old 09-08-2012, 07:10 PM
Florian Philipp
 
Default Puzzling lvm2 behavior?

Am 08.09.2012 20:20, schrieb walt:
> I've never expanded an lvm partition before, and I think I did it the
> long way around just now:
>
> I divided my 1TB disk into 10 equal pv's when I bought it, and then
> added four of those to a new vg (named wd0), leaving the other six
> for future use.
>
> After a few months of filling up that partition I needed more room,
> of course, so I used vgextend to add a fifth pv to the existing vg.
> That worked fine, but now I had to extend the ext4 fs to fill all of
> the added new space.
>
> While googling I saw some advice to use resize2fs for that, but
> resize2fs said there is nothing to do on that fs and quit without
> doing anything.
>
> After some fumbling around I used lvextend -r -L nnnnn /dev/wd0/wd0,
> where nnnnn is the number of unused extents listed by pvdisplay.
>
> That (eventually) worked but each time I ran that command, only
> roughly half of the empty extents were added instead of the whole
> nnnnn of them. Took me about 10 iterations before all of the
> extents were finally added to the filesystem :-/
>
> So, did I use the wrong tools or in the wrong order, or what?
> It should have been easier than that, I think.
>

Did you multiply the number of extents reported by pvdisplay with the
extent size? lvextend's -L uses megabytes, if no unit is given. To
specify extents, you should use "-l". You should also prefix the number
with a "+" so that the number is relative to the current size, not the
absolute size of the logical volume.

Regards,
Florian Philipp
 

Thread Tools




All times are GMT. The time now is 11:52 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org