[TriLUG] Modify LVM

Mauricio Tavares via TriLUG trilug at trilug.org
Mon Jan 25 09:39:26 EST 2016


On Mon, Jan 25, 2016 at 7:49 AM, MvER - TrLUG via TriLUG
<trilug at trilug.org> wrote:
> With special thanks to Mauricio, Matt and Mauricio (a second  time)
>
> On 01/24/2016 09:02 PM, Mauricio Tavares wrote:
>>       What is the output for
>>
>> sudo pvs
>> sudo lvs
>
> mver at mver-RV415-RV515:~$ sudo pvs
> [sudo] password for mver:
>
>   PV         VG        Fmt  Attr PSize   PFree
>   /dev/sda5  ubuntu-vg lvm2 a--  698.39g 239.65g
>
      This is what I meant about ubuntu and sda2->sda5. The bottom
line is you have about 240GB of free space to play with. The question
is which logical volume (LV below) you want to fatten. From the next
command,

> mver at mver-RV415-RV515:~$ sudo lvs
>
>   LV        VG        Attr      LSize   Pool Origin Data%  Move Log
> Copy%  Convert
>   docs      ubuntu-vg -wi-ao---
> 100.00g
>   home      ubuntu-vg -wi-ao---
> 25.00g
>   root      ubuntu-vg -wi-ao---
> 26.00g
>   swap_1    ubuntu-vg -wi-ao---
> 7.75g
>   tbird     ubuntu-vg -wi-ao---
> 25.00g
>   win7vm    ubuntu-vg -wi-a----
> 250.00g
>   winsamdta ubuntu-vg -wi-ao---
> 25.00g
>
> mver at mver-RV415-RV515:~$
>

you know the name of the logical volumes (first column), the volume
group (second) and their current sizes. And from df you know how much
space they need. A while ago I posted on my blog about a similar issue
but in a Synology storage
(http://unixwars.blogspot.com/2013/06/resizing-shared-partition-in-synology.html).
Like in that blog, the commands you want to use are

lvextend
resize2fs

For instance, to add 1.5GB to home, you could do something like

sudo lvextend -L +1.5G /dev/ubuntu-vg/home
sudo resize2fs /dev/ubuntu-vg/home

The output of the commands should look like the example in the blog.

And that is pretty much it. The commands are that easy. The only hard
thing is to decide how much disk space to add, in case you want to
have some extra for another lv.

Stupid suggestion: I like to put the lvs used by the virtual clients
in another disk in its own physical volume and volume group. That
said, if you ever decide to do so it is not that hard to do either.

> --
> This message was sent to: raubvogel at gmail.com <raubvogel at gmail.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  : http://www.trilug.org/mailman/options/trilug/raubvogel%40gmail.com
> Welcome to TriLUG: http://trilug.org/welcome


More information about the TriLUG mailing list