Skip to contentSkip to conversation

lvextend

linux-lvm Terry Rigby 3 participants 4 messages Jun 23, 2005

lore
Share & tools
lore
#0 lore raw

I am trying to add a full hard drive to my LV by following the directions at TLDP.org. It says there to use lvextend -L +XXG where XX is the size in GB you want to add to the LV. Is there a more simple way to just add a whole hard drive ie: /dev/hde

It seems like a pain to have to manually figure out the size of the hard drive then add it using lvextend -L +200GB for a 200GB hard drive especially since we all know its not actually 200GB.

Thanks for your response.

Terry Rigby

#1 lore raw

you could do "pvdisplay /dev/hde" to find the number of extents... then use "lvextend -l" instead of -L ...

-dean

Quoted 19 lines · Terry Rigby

I am trying to add a full hard drive to my LV by following the directions at TLDP.org. It says there to use lvextend -L +XXG where XX is the size in GB you want to add to the LV. Is there a more simple way to just add a whole hard drive ie: /dev/hde

It seems like a pain to have to manually figure out the size of the hard drive then add it using lvextend -L +200GB for a 200GB hard drive especially since we all know its not actually 200GB.

Thanks for your response.

Terry Rigby

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw
In reply to Terry Rigby
Quoted 8 lines · Terry Rigby

I am trying to add a full hard drive to my LV by following the directions at TLDP.org. It says there to use lvextend -L +XXG where XX is the size in GB you want to add to the LV. Is there a more simple way to just add a whole hard drive ie: /dev/hde

It seems like a pain to have to manually figure out the size of the hard drive then add it using lvextend -L +200GB for a 200GB hard drive especially since we all know its not actually 200GB.

You could increase the LV by using the remaining free physical extents (PE).

To check how many PE's are available after extending the VG run vgdisplay and check "Free PE / Size". The first value will give you the total number of PE's available.

Then extend your LV using the -l switch to specify PE's rather than having to determine a size using the -L switch.

For example "lvextend -l +25 /dev/volGroup00/myLVM" will extend myLVM by 25 PE's.

Of course you then need to extend to file system to be able to use this extra space :)

--Sean

#3 lore raw

thx Sean, I had just stumbled upon that as well. another alternative seems to be pvdislplay /dev/hde |grep "PV Size" and then use that size in GB using lvextend -L +XXG /path/to/lv

Terry Rigby

Quoted 34 lines · Sean Boyd
Quoted 8 lines · Terry Rigby

I am trying to add a full hard drive to my LV by following the directions at TLDP.org. It says there to use lvextend -L +XXG where XX is the size in GB you want to add to the LV. Is there a more simple way to just add a whole hard drive ie: /dev/hde

It seems like a pain to have to manually figure out the size of the hard drive then add it using lvextend -L +200GB for a 200GB hard drive especially since we all know its not actually 200GB.

You could increase the LV by using the remaining free physical extents (PE).

To check how many PE's are available after extending the VG run vgdisplay and check "Free PE / Size". The first value will give you the total number of PE's available.

Then extend your LV using the -l switch to specify PE's rather than having to determine a size using the -L switch.

For example "lvextend -l +25 /dev/volGroup00/myLVM" will extend myLVM by 25 PE's.

Of course you then need to extend to file system to be able to use this extra space :)

--Sean

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/