[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Resizing DomUs


  • To: "Harold A. Giménez Ch." <harold.gimenez@xxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.