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

Re: [Xen-users] Resizing DomUs


  • To: deshantm@xxxxxxxxx
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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

 


Rackspace

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