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: "Harold A. Giménez Ch." <harold.gimenez@xxxxxxxxx>
Subject: Re: [Xen-users] Resizing DomUs
From: "Todd Deshane" <deshantm@xxxxxxxxx>
Date: Tue, 4 Nov 2008 12:30:22 -0500
Cc: Xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 04 Nov 2008 09:31:02 -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:reply-to :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=T5jvu5zF02M1D+AOUIsQEyuUDHX08LEIjBywKWxBafQ=; b=fXOsWL6TgnRX2ujJFXrdUunj/g+u9zwXkIoUpUqBWFrIxdvC6HpWN+9v+FIVwaLS9u eEztlJTERcCQOsDtOkrC4kC8L9wYm2In38qk1gdPr3g20GcWBU0EiEbosPZWGifOjRUp 6kqcwMWHJ0I0U1MNGdSnXqFETA8ohxDg7lxWQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references; b=G1QoVETmP+sALuaSYRv5torSPiHc19UEvU9tOBy3G2nvL2D5wYFHA4CIlDzQcIjS5T Xe13Wy8eoF16vM1eBU1zrrvvPPas+TNVsrrcy8dczKDzbh0ArJkXGL4KRA22k8VY9hfp l3WpFHVOD3L6Me6cxBUn8j8djvitn8SB7Rs9E=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <c807ef1a0811031950q42fb031ahc8dce4d0478d241c@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>
Reply-to: deshantm@xxxxxxxxx
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
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>