/tmp = EXT3, the VM images gives EXT4-fs error

Bug #747068 reported by Edgar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Expired
Medium
Unassigned

Bug Description

((Ok, this is the first time every I file a bug, so give me also feedback when I report wrong..))

First of all, I want to build a system for production in wich I can build (very) fast new VM's.
I installed Ubuntu Server 10.04.2 64Bit as host OS with the following partitions:

/Boot [Prim] 1GB (EXT4)
/ [Prim] 25GB (EXT4)
swap [Prim] 25GB (swap)
---extended---
/tmp [Logical] 25GB (EXT4)
/var/log [Logical] 10GB (EXT4)
lvm [Logical] 1,5TB (lvm)

When I use VMBuilder and build to a RAW logica volume (lvm), it takes more than 12 minutes!
Then I tried to change the /tmp partition (of the HOST) to EXT3 and it did take less than 4 minutes!!!!

The only problem now is that the VM gives the following error on startup:
EXT4-fs error (device sda1): ext4_mb_generate_buddy:
EXT4-fs group 2: 3431 blocks in bitmap, 3597 in gd

Any ideas?
Maybe first any ideas for a workaround?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 747068] [NEW] /tmp = EXT3, the VM images gives EXT4-fs error

> ((Ok, this is the first time every I file a bug, so give me also
> feedback when I report wrong..))

Thanks for taking the time to report this bug.

> First of all, I want to build a system for production in wich I can build (very) fast new VM's.
> I installed Ubuntu Server 10.04.2 64Bit as host OS with the following partitions:
>
> /Boot [Prim] 1GB (EXT4)
> / [Prim] 25GB (EXT4)
> swap [Prim] 25GB (swap)
> ---extended---
> /tmp [Logical] 25GB (EXT4)
> /var/log [Logical] 10GB (EXT4)
> lvm [Logical] 1,5TB (lvm)
>
> When I use VMBuilder and build to a RAW logica volume (lvm), it takes more than 12 minutes!

I'd recommend building a single pristine image (where time to build doesn't matter), and
snapshot or copy that when you need a new image and make the few changes you need to.

Maybe that was your plan all along, but since you mention the time it took to make the
first image, I wasn't sure.

> Then I tried to change the /tmp partition (of the HOST) to EXT3 and it did take less than 4 minutes!!!!

Interesting.

Are you using a local archive mirror? It's possible that if you switch back
to ext4 now it'll go much faster.

> The only problem now is that the VM gives the following error on startup:
> EXT4-fs error (device sda1): ext4_mb_generate_buddy:
> EXT4-fs group 2: 3431 blocks in bitmap, 3597 in gd
>
> Any ideas?

Is sda1 your tmpfs? If so, edit your fstab to mark it as ext3.

> Maybe first any ideas for a workaround?

Actually long-term for most image building we recommend switching to live-build. If you try that, and your host has enough memory (more than 4G), then building out of a tmpfs can make for very fast, 2-4 minute, image builds. Please feel free to ask for help on irc on freenode#ubuntu-server or on the ubuntu-server mailing list.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Please give us the full command line and any configuration files which you used to run vmbuilder, so I can try to reproduce the ext4 booting error.

Actually I'm wondering whether this is a duplicate of bug 578199. Would you mind testing by doing:

   cd /tmp
   wget https://code.launchpad.net/~brightbox/vmbuilder/exclude-first-cylinder/+merge/42530/+preview-diff/+files/preview.diff
   cd /usr/lib/python2.6/dist-packages
   patch -p0 < /tmp/preview.diff

then re-building your VM?

Changed in vm-builder (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
Edgar (edgar-nl) wrote :

> Actually I'm wondering whether this is a duplicate of bug 578199.

I did the patch, but same result... :-(

> I'd recommend building a single pristine image (where time to build doesn't matter), and snapshot or copy that when you need a new image and make the few changes you need to.

It's an idea for some VMs, but we also want to build a lot of 'disposable' VMs completly 'new' with complete diffrent build scripts and parameters...

> Interesting... ( /tmp [EXT4] -> [EXT3] )

See also: https://wiki.ubuntu.com/LucidLynx/ReleaseNotes#Performance regressions with ext4 under certain workloads

> Are you using a local archive mirror?
> It's possible that if you switch back to ext4 now it'll go much faster.

I have in our network an "apt-mirror" server.
Another machine, but is own Gigabit connection...

> Is sda1 your tmpfs?
> If so, edit your fstab to mark it as ext3.

I have my tmpfs on default. (not filled in)

> Please give us the full command line and any configuration files which you used to run vmbuilder, so I can try to reproduce the ext4 booting error.

## BuidVmRaw.sh ##

lvcreate -L 10G -n "$VAR_HostName" vg-1;
vmbuilder kvm ubuntu \
        --config="defaultVM.cfg" \
        -o \
        --hostname="$VAR_HostName" \
        --raw="/dev/vg-1/$VAR_HostName"
        --firstboot="$VAR_firstBoot" \
        --firstlogin="$VAR_firstLogin" \
        --ssh-user-key="/home/locadm/.ssh/authorized_keys" \
        --verbose;

## defaultVM.cfg ##

[DEFAULT]
arch = amd64
cpus = 1
mem = 512
name = 'Local Administrator'
user = locadm
pass = default
timezone = Europe/Amsterdam
domain = company.lan

[ubuntu]
mirror = http://archive.ubuntu.company.lan/ubuntu
security-mirror = http://security.ubuntu.company.lan/ubuntu
suite = lucid
flavour = virtual
addpkg = acpid, cron, htop, nano, pciutils, wget

[kvm]
libvirt = qemu:///system
bridge = br0
virtio_net = true

## ##

I also noticed that the "--firstboot" and the "--firstlogin" don't work,
but first the big EXT4-fs error...

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for vm-builder (Ubuntu) because there has been no activity for 60 days.]

Changed in vm-builder (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.