qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss] Increasing ext3 image file partition


From: jb-gnumlists
Subject: Re: [Qemu-discuss] Increasing ext3 image file partition
Date: Sat, 11 Aug 2012 23:36:01 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0

On 11-08-2012 14:11, Jerzy Grzegorek wrote:
Dnia 11-08-2012 o godz. 4:46 address@hidden napisaƂ(a):
On 11-08-2012 00:32, Jerzy Grzegorek wrote:

Hi,

I've 128M disk.img with one ext3 partition on it, created by qemu-img
create disk.img 128M command. Now, I'd like to increase this partition
to 256M. I ran

qemu-img resize disk.img +128M

and next

parted disk.img

(parted) resize 1 32K 256M

and ...

Error: /File system has/ an /incompatible feature/ enabled...

Any idea how to resolve this?

Jurek


Yes, boot a virtual machine connected to the 256M disk image as a
second virtual hard drive (or boot your usual virtual machine from
a live CD such as the gparted live CD iso).  Then from inside the
virtual machine, use basic ext3 tools (such as tune2fs) to examine
the partition, find out which option is in the way and turn it off,
then resize the partition as you originally wanted.

Thanks for your clarification.
It works but I had to use debugfs because tune2fs doesn't support ext_attr 
option.
Other solution is (Ubuntu):
qemu-img resize disk.img +128M
sudo losetup /dev/loop0 disk.img
sudo losetup -o 32256 /dev/loop1 /dev/loop0
sudo e2fsck -f -y /dev/loop1
sudo debugfs -R "feature" /dev/loop1
sudo debugfs -w -R "feature -ext_attr -resize_inode -dir_index large_file" 
/dev/loop1
sudo e2fsck -f -y /dev/loop1
sudo losetup -d /dev/loop1
sudo losetup -d /dev/loop0
parted disk.img
(parted) unit b
(parted) resize 1 32256 263208959
(parted) q
sudo losetup /dev/loop0 disk.img
sudo losetup -o 32256 /dev/loop1 /dev/loop0
sudo e2fsck -f -y /dev/loop1
sudo debugfs -w -R "feature ext_attr resize_inode dir_index -large_file" 
/dev/loop1
sudo e2fsck -f -y /dev/loop1
sudo losetup -d /dev/loop1
sudo losetup -d /dev/loop0
Hmm, are you saying that resize2fs refuses to resize partitions with
any of the ext_attr, dir_index or resize_inode flags or with the
large_file flag not set?  Or could you just not figure out which one
so you reversed them all?

If resize2fs refuses to resize file systems with harmless flags, this
should be reported through your distribution bug tracker to the
ext2fs-tools maintainer.

If GNU parted refuses to resize partitions that can be handled by the
standalone file system tools, this should similar be reported as a
parted bug.

But before reporting either type of bug, you should figure out if the
refusal is in the basic resize2fs tool or in parted and only report
it to one of the two projects, so the other project isn't mislead
into making unmaintainable "workarounds" for the other projects bugs
(given that both projects are very actively maintained and should be
able to fix their own bugs just as fast as the other project can
code a workaround).

P.S.

For other users: loop-mounting only works for raw disk images, not
for any of the advanced formats such as qcow2.  Those need either a
virtual machine or a special tool to make them look like disks to an
OS.



Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com
Transformervej 29, 2730 Herlev, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



reply via email to

[Prev in Thread] Current Thread [Next in Thread]