[HELP] Expanding LVM partition in Ubuntu server![HTML-MAIL]

Robert Heller heller at deepsoft.com
Sun Oct 25 22:20:34 UTC 2015


It is hard to read your HTML message (can you turn OFF HTML?), but it looks 
like you had a 10GB logical volume that you installed on, then increased that 
logical volume to almost 100GB.  Short of reinstalled the VM from scratch, 
what I *think* you can do is this:

log into the VM and using sudo change partition 2's extents to be from 257MB 
to 96.6GB, then create a new partition in the new available space:

sudo parted /dev/xvda resize 2 257MB 96.6GB
sudo parted /dev/xvda mkpart logical 10.7GB 96.6GB
(this assumes the new partition number create is 6)
sudo parted /dev/xvda set 6 lvm on

(Be sure you have a complete backup before doing ANYTHING!)

Once you have done that and checked it, you should be able to use pvcreate on
/dev/xvda6, then vgextend to add this new physical volume to the volume group,
then you can go from there (eg lvresize, resize2fs, etc.).

At Sun, 25 Oct 2015 18:57:26 +0200 "Ubuntu user technical support,  not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> 
> <html>
>   <head>
> 
>     <meta http-equiv="content-type" content="text/html; charset=utf-8">
>   </head>
>   <body text="#000000" bgcolor="#FFFFFF">
>     <div style="" class="markdown-here-wrapper"
>       data-md-url="Thunderbird">
>       <h2 style="margin: 1.3em 0px 1em; padding: 0px; font-weight:
>         bold;font-size: 1.4em; border-bottom: 1px solid rgb(238, 238,
>         238);" id="hi-">Hi!</h2>
>       <p style="margin: 0px 0px 1.2em ! important;">Need some help with
>         expanding a lvm partition. I use xen as a hypervisor and i’ve
>         expanded a partition from xen.</p>
>       <p style="margin: 0px 0px 1.2em ! important;">In ubuntu I see:</p>
>       <pre style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;"><code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block ! important;">Model: Xen Virtual Block Device (xvd)
> Disk /dev/xvda: 96.6GB
> Sector size (logical/physical): 512B/512B
> Partition Table: msdos
> 
> Number  Start   End     Size    Type      File system  Flags
>  1      1049kB  256MB   255MB   primary   ext2
>  2      257MB   10.7GB  10.5GB  extended
>  5      257MB   10.7GB  10.5GB  logical                lvm
> </code></pre>
>       <p style="margin: 0px 0px 1.2em ! important;">Now i can’t find a
>         way to expand vg and lv to match my entire remaining space. How
>         can I do it? I can’t find anything that can help me on the
>         internet and man page regarding <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;">fdisk</code>,
>         <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;">parted</code>
>         and <code style="font-size: 0.85em; font-family: Consolas,Inconsolata,Courier,monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;">lvm</code>,
>         is there any other way? </p>
>       <h4 style="margin: 1.3em 0px 1em; padding: 0px; font-weight:
>         bold;font-size: 1.2em;" id="thanks">Thanks</h4>
>       <div
> title="MDH:IyMgSGkhPGJyPjxicj5OZWVkIHNvbWUgaGVscCB3aXRoIGV4cGFuZGluZyBhIGx2bSBwYXJ0aXRpb24uIEkgdXNlIHhlbiBhcyBhIGh5cGVydmlzb3IgYW5kIGkndmUgZXhwYW5kZWQgYSBwYXJ0aXRp
> b24gZnJvbSB4ZW4uPGJyPjxicj5JbiB1YnVudHUgSSBzZWU6PGJyPjxicj7CoMKgwqAgTW9kZWw6
> IFhlb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div>
>     </div>
>   </body>
> </html>
> 
> 
> MIME-Version: 1.0
> 

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                                                                          




More information about the ubuntu-users mailing list