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] Resizing DomUs

To: deshantm@xxxxxxxxx
Subject: Re: [Xen-users] Resizing DomUs
From: "Harold A. Giménez Ch." <harold.gimenez@xxxxxxxxx>
Date: Tue, 4 Nov 2008 17:04:46 -0500
Cc: Xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 04 Nov 2008 14:05:31 -0800
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:references; bh=yMdU26A3SKxjwHjMRXGzbqH2nkvK4lEOT6BtItGd9l8=; b=BJmxos9LipMLOARftWTJIp2UiOk3oSnblJSfhTcRpvbU1B72ESBhsB4lerS4Bcp13G R6xC7/T2SuqdUDt4KjPsy+V0VCgABjpFyI/SJOqhQxl4Auy1IRYhR1TIjmsDFLU5/XSb DsKpWK0hi2xAS06gfiA4ihC5RXU7GkmrNX720=
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:references; b=Wsl24/q0ffulT7Qc5ags8INg+Fvhnhq4ljqkbhOuUUmkh1yWipVk7ALU6A/oVJVsxo SvyWEl1MbZ1jOiUpVloQpUkFg+xw85eqlVE4nKu4j72DyR7+JKDItOgA1UtJvp0V9F+y 0bpKT/wQkbvI5FCGg/0N44VAytTJ9xcOfR6aE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1e16a9ed0811040930o61ba9266kf0c41f0168f03033@xxxxxxxxxxxxxx>
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: <c807ef1a0811031950q42fb031ahc8dce4d0478d241c@xxxxxxxxxxxxxx> <1e16a9ed0811040930o61ba9266kf0c41f0168f03033@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Reiner, John, Todd, and others,

Thanks for all the info. It is invaluable.

I still have not achieved my goal, but I'd like to battle with this for a bit. I think you have provided enough information to play around with. I'll post back further questions if I have any.

Thanks again,

-Harold

On Tue, Nov 4, 2008 at 12:30 PM, Todd Deshane <deshantm@xxxxxxxxx> wrote:
On Mon, Nov 3, 2008 at 10:50 PM, Harold A. Giménez Ch.
<harold.gimenez@xxxxxxxxx> wrote:
> Hi group,
>
> I'm sure this has been discussed numerous times, but I would like some
> pointers on troubleshooting the resizing of a DomU built on an image file
> (not LVM).
>
> To add another 20GB, I tried running the following, as root:
>
> dd if=/dev/zero bs=1M count=20480 >> img_file.img
> 20480+0 records in
> 20480+0 records out
> 21474836480 bytes (21 GB) copied, 1578.68 s, 13.6 MB/s
> /sbin/resize2fs img_file.img
> resize2fs 1.40.4 (31-Dec-2007)
> /sbin/resize2fs: Bad magic number in super-block while trying to open
> img_file.img
> Couldn't find valid filesystem superblock.
>
> Also, this command fails:
> /sbin/e2fsck -f img_file.img
>
> I have several DomUs running and are very stable. However, the e2fsck fails
> on all of them. What am I doing wrong?
>

Based on the discussion below, I now understand your original problem and,
if only for the sake of the community, I'll explain the disk image file in a
general sense.

You are working with a disk image file, which contains partitions on it. If they
were in fact ext3 partitions, you would need to make them available to the
system with a the kpartx command (I usually pass it -av then the disk image).
Then they would show up in /dev/mapper/<something like diskimage-name1
diskimage-name2, etc. for each partition that kpartx detected). Then you
could work with those partitions a bit, but to work with them like they are
more like a block device, it would be better to use the losetup command.
losetup will associate the disk image file with a loop device (/dev/loopN,
where N is the next available loop). You can then run fdisk, parted,
and other disk-related commands on the /dev/loopN device.
Making the loop partitions available and working with them would be the
same ideas as above, run kpartx -av on the /dev/loopN device and then
look in /dev/mapper for the loopNpX device nodes.

Note that if you had been working with a partition image (also sometimes
referred to as a file system image) then you intuition of working with it
as a file system/partitition would have worked if it was a ext3 partition
or similar.

The answers below seem good and are more specific to the problem
at hand and when working with LVM partitions etc.

Hope that helps.
( Examples can be found all over the internet and in the Running Xen book ;) )

Cheers,
Todd

--
Todd Deshane
http://todddeshane.net
http://runningxen.com

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>