WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] RE: how to expand a xen image?

To: "henry ritzlmayr" <xen-list@xxxxxx>
Subject: Re: [Xen-users] RE: how to expand a xen image?
From: Heiko <rupertt@xxxxxxxxx>
Date: Wed, 3 Sep 2008 08:41:49 +0200
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 02 Sep 2008 23:42:24 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=uYBeARet5l63jxluZ/6NCfAt6IE1AFMrHOwVqaf/tpQ=; b=gRTSwRW5QHBM0Z7s7J3ollmhG/NsUYWW+f0ZFcUNSZr63zRv8tbhYuPV+y6q3o8BRS sdkH2LiFNiKDkQE9uWHBKzCPd6GBdHreZ40ZMD3HnkriiZhcbNwxlQ+vX7ZcoNHN7sVn D94mH+wKi8Jw45cItpjFQyAWuUCft8AleST8g=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=BZuXsZz16C5R+0HCflRLPP7fgSDnds/rq2udGTJCzEXHDZ4o/FQdcDcPBExsF4Wbp3 O/t7jwnux6xXjoxEtCilQ0ylu54NVjFcGFtcbglgz5TJJnz0mmNvkWkLm4RrdKKONvWX L5p33fzGSyL4DAwrpyQco6tE0gae3n7khkc1g=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1220421478.3139.3.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <48BD44AD.8080909@xxxxxxxxxxxxxx> <1220366296.1930.19.camel@xxxxxxxxxxxxxxxxxxxxx> <157.894826452498$1220368488@xxxxxxxxxxxxxx> <1220421478.3139.3.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, Sep 3, 2008 at 7:57 AM, henry ritzlmayr <xen-list@xxxxxx> wrote:
> Am Dienstag, den 02.09.2008, 11:12 -0400 schrieb Dustin Henning:
>>       I'm not especially familiar with dd, but couldn't it be used for
>> this?  It seems I recall something about skipping blocks before writing, so
>> if you skip enough blocks to go to the end of the file and then write enough
>> blocks to extend it as much as you want, wouldn't this make the single disk
>> that much bigger the next time it is mounted to a domU?  Obviously it would
>> be wise to back-up the image first, and this would probably be an offline
>> operation, but it seems to me it might be better (or at least easier to
>> manage) than having two physical volumes (unless you want to use two real
>> disks or something).
>>       Dustin
>
> If you like it within one file:
>
> dd if=/dev/zero bs=1G count=5 >> imagefile
>
> adds five gigs to your imagefile.
>
Hello,

I did it a couple of time the following way:

shut down the VM,

dd if=/dev/zero of=/VM/myxen_back_grow.img bs=1M conv=notrunc
count=5000 seek=10240
count is the size that you wanna add(here 5GB more)


losetup /dev/loop4 /VM/myxen_back.img
kpartx -av /dev/loop4 (do I really need this in the first run? you
could use it to mount the partition and backup data or something)

fdisk /dev/loop4
now delete the old partition and create a new one, fill it up the whole space.
save

than remove the kpartx with "kpartx -d /dev/loop4", also delete the
loopback "losetup -d /dev/loop4"

and remap the loopback and kpartx like in the beginning.

now you can/should do a "e2fsck -f /dev/mapper/loop4p1" after that
do a "resize2fs /dev/mapper/loop4p1" and check the partition again.

now delete the kpartx and loopback and boot into the VM, it should now
be bigger.


greetings
> cheers
> Henry
>
>
>> -----Original Message-----
>> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
>> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Thomas Hager
>> Sent: Tuesday, September 02, 2008 10:38
>> To: xen-users@xxxxxxxxxxxxxxxxxxx
>> Subject: Re: [Xen-users] how to expand a xen image?
>>
>> On Tue, 2008-09-02 at 15:50 +0200, Eric Doutreleau wrote:
>> > Hi
>> hi,
>>
>> > Is there a simple way to expand  the image in order to expand the lvm?
>> kinda:
>>
>> add another image file as /dev/hdb to your domU, create a physical volume on
>> the new disc and extend your volume group with vgextend.
>>
>> hth,
>> tom.
>>
>
>
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
>

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users