On Mon, Nov 3, 2008 at 10:50 PM, Harold A. Giménez Ch.
> 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
> 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
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
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 ;) )
Xen-users mailing list