1 |
Am 08.09.2012 20:20, schrieb walt: |
2 |
> I've never expanded an lvm partition before, and I think I did it the |
3 |
> long way around just now: |
4 |
> |
5 |
> I divided my 1TB disk into 10 equal pv's when I bought it, and then |
6 |
> added four of those to a new vg (named wd0), leaving the other six |
7 |
> for future use. |
8 |
> |
9 |
> After a few months of filling up that partition I needed more room, |
10 |
> of course, so I used vgextend to add a fifth pv to the existing vg. |
11 |
> That worked fine, but now I had to extend the ext4 fs to fill all of |
12 |
> the added new space. |
13 |
> |
14 |
> While googling I saw some advice to use resize2fs for that, but |
15 |
> resize2fs said there is nothing to do on that fs and quit without |
16 |
> doing anything. |
17 |
> |
18 |
> After some fumbling around I used lvextend -r -L nnnnn /dev/wd0/wd0, |
19 |
> where nnnnn is the number of unused extents listed by pvdisplay. |
20 |
> |
21 |
> That (eventually) worked but each time I ran that command, only |
22 |
> roughly half of the empty extents were added instead of the whole |
23 |
> nnnnn of them. Took me about 10 iterations before all of the |
24 |
> extents were finally added to the filesystem :-/ |
25 |
> |
26 |
> So, did I use the wrong tools or in the wrong order, or what? |
27 |
> It should have been easier than that, I think. |
28 |
> |
29 |
|
30 |
Did you multiply the number of extents reported by pvdisplay with the |
31 |
extent size? lvextend's -L uses megabytes, if no unit is given. To |
32 |
specify extents, you should use "-l". You should also prefix the number |
33 |
with a "+" so that the number is relative to the current size, not the |
34 |
absolute size of the logical volume. |
35 |
|
36 |
Regards, |
37 |
Florian Philipp |