/usr/sbin/grub-install: error: will not proceed with blocklists.

Bug #1444496 reported by Thomas Bechtold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
High
Thomas Bechtold

Bug Description

I'm trying to create a Ubuntu 12.04 image with this command:

sudo DIB_RELEASE=precise disk-image-create -x --offline --no-tmpfs vm ubuntu

but get the following error:

Creating config file /etc/default/grub with new version
Generating grub configuration file ...
done
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
++ which grub-install
+ GRUBNAME=/usr/sbin/grub-install
+ '[' -z /usr/sbin/grub-install ']'
+ '[' -z /usr/sbin/grub-install ']'
++ /usr/sbin/grub-install --version
++ grep 0.97
++ wc -l
+ '[' 0 -ne 0 ']'
+ echo 'Installing GRUB2...'
Installing GRUB2...
+ GRUB_OPTS=
+ [[ ! '' == *--target* ]]
++ /usr/sbin/grub-install --version
+ [[ /usr/sbin/grub-install (GRUB) 2.02~beta2-9ubuntu1 =~ 2\. ]]
+ '[' -d /sys/firmware/efi ']'
+ [[ amd64 =~ ppc ]]
+ /usr/sbin/grub-install '--modules=biosdisk part_msdos' /dev/loop2
Installing for i386-pc platform.
/usr/sbin/grub-install: warning: File system `ext2' doesn't support embedding.
/usr/sbin/grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-install: error: will not proceed with blocklists.
++ check_break after-error run_in_target bash
++ echo ''
++ egrep -e '(,|^)after-error(,|$)' -q
+ trap_cleanup
+ exitval=1
+ cleanup
+ unmount_image
+ sync
+ unmount_dir /tmp/image.A7GhFhsh/mnt
+ local pattern=/tmp/image.A7GhFhsh/mnt mnts=
+ '[' -n /tmp/image.A7GhFhsh/mnt ']'
++ awk '{print $2}'
++ grep '^/tmp/image.A7GhFhsh/mnt'
++ sort -r
+ mnts='/tmp/image.A7GhFhsh/mnt/tmp/in_target.d
/tmp/image.A7GhFhsh/mnt/sys
/tmp/image.A7GhFhsh/mnt/proc
/tmp/image.A7GhFhsh/mnt/dev/pts
/tmp/image.A7GhFhsh/mnt/dev
/tmp/image.A7GhFhsh/mnt'
+ '[' -n '/tmp/image.A7GhFhsh/mnt/tmp/in_target.d
/tmp/image.A7GhFhsh/mnt/sys
/tmp/image.A7GhFhsh/mnt/proc
/tmp/image.A7GhFhsh/mnt/dev/pts
/tmp/image.A7GhFhsh/mnt/dev
/tmp/image.A7GhFhsh/mnt' ']'
+ sudo umount -fl /tmp/image.A7GhFhsh/mnt/tmp/in_target.d /tmp/image.A7GhFhsh/mnt/sys /tmp/image.A7GhFhsh/mnt/proc /tmp/image.A7GhFhsh/mnt/dev/pts /tmp/image.A7GhFhsh/mnt/dev /tmp/image.A7GhFhsh/mnt
+ '[' -n 'detach_loopback /dev/loop2' ']'
+ detach_loopback /dev/loop2
+ local loopdev=/dev/loop2
++ echo /dev/loop2
++ sed 's/\/dev\///g'
+ loopdev_name=loop2
++ sudo dmsetup ls
++ grep loop2
++ awk '{ print $1 }'
+ mapper_name=
+ '[' '' ']'
++ seq 10 -1 1
+ for try in '$(seq 10 -1 1)'
+ sudo losetup /dev/loop2
/dev/loop2: [65025]:2884682 (/tmp/image.u11pQq5W/image.raw)
+ sudo losetup -d /dev/loop2
+ return 0
+ cleanup_dirs
+ sudo rm -rf /tmp/image.A7GhFhsh/built
+ sudo rm -rf /tmp/image.A7GhFhsh/mnt
+ sudo umount -f /tmp/image.A7GhFhsh /tmp/image.u11pQq5W
umount: /tmp/image.A7GhFhsh: not mounted
umount: /tmp/image.u11pQq5W: not mounted
+ true
+ rm -rf --one-file-system /tmp/image.A7GhFhsh /tmp/image.u11pQq5W
+ exit 1

Revision history for this message
Thomas Bechtold (toabctl) wrote :

So the problems seems to be the "vm" element. Without that, I can build an image.

Revision history for this message
Thomas Bechtold (toabctl) wrote :

But the image is not bootable.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Thomas. Can you please include the exact commandline you used, any elements not in the diskimage-builder tree, and what OS you're trying to create the image from? I just tried this on Ubuntu 14.04 (creating an Ubuntu 12.04 image) and it worked fine, and was bootable:

DIB_RELEASE=precise bin/disk-image-create -x ubuntu vm

Thanks!

Changed in diskimage-builder:
status: New → Incomplete
importance: Undecided → High
assignee: nobody → Thomas Bechtold (toabctl)
Revision history for this message
Thomas Bechtold (toabctl) wrote :

Hi Clint,

sudo DIB_RELEASE=precise disk-image-create -x --offline --no-tmpfs vm ubuntu

I'm running this on a openSUSE Tumbleweed host. I don't use any special elements. Basically the steps to reproduce are:

#!/bin/bash
virtualenv dib-test
source dib-test/bin/activate
pip install diskimage-builder
sudo DIB_RELEASE=precise disk-image-create -x --offline --no-tmpfs vm ubuntu

description: updated
Revision history for this message
Thomas Bechtold (toabctl) wrote :

So the problem seems that no partition table was created:

+ sudo sfdisk /dev/loop0
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

Adding the "--force" flag leads to:

+ SFDISK_DEBUG=all
+ sudo sfdisk --force /dev/loop0
This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.

line 1: unsupported command
++ check_break after-block-device bash

I'm using util-linux 2.26.1 and seems that there were some changes in sfdisk.

Revision history for this message
Ben Kero (ben-kero) wrote :

I spent all day today confirming this issue. :)

Simply downgrading to util-linux 2.25 will fix it. I experienced this running Archlinux.

A bug with more info is available here: https://bugs.archlinux.org/task/44349

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/174272

Changed in diskimage-builder:
status: Incomplete → In Progress
Revision history for this message
Thomas Bechtold (toabctl) wrote :

Just for the record: The patch proposed creates this parition schema:

openSUSE Tumbleweed with util-linux 2.26.1:

basilikum:~ # fdisk /dev/loop0

Welcome to fdisk (util-linux 2.26.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /dev/loop0: 1.6 GiB, 1675427840 bytes, 3272320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x96ef5726

Device Boot Start End Sectors Size Id Type
/dev/loop0p1 * 16065 3272319 3256255 1.6G 83 Linux

Ubuntu 14.04.2 with util-linux 2.20.1-5.1ubuntu20.4 :

$ sudo fdisk /dev/loop0

Command (m for help): p

Disk /dev/loop0: 1675 MB, 1675821056 bytes
189 heads, 49 sectors/track, 353 cylinders, total 3273088 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

      Device Boot Start End Blocks Id System
/dev/loop0p1 * 16065 3273087 1628511+ 83 Linux

Revision history for this message
Thomas Bechtold (toabctl) wrote :

And another output:

openSUSE Tumbleweed with util-linux 2.26.1:

# sfdisk -u S --dump /dev/loop0
label: dos
label-id: 0xaf4cdd43
device: /dev/loop0
unit: sectors

/dev/loop0p1 : start= 16065, size= 3256255, type=83, bootable

Ubuntu 14.04.2 with util-linux 2.20.1-5.1ubuntu20.4 :

$ sudo sfdisk -u S --dump /dev/loop0
[sudo] password for tom:
# partition table of /dev/loop0
unit: sectors

/dev/loop0p1 : start= 16065, size= 3257023, Id=83, bootable
/dev/loop0p2 : start= 0, size= 0, Id= 0
/dev/loop0p3 : start= 0, size= 0, Id= 0
/dev/loop0p4 : start= 0, size= 0, Id= 0

Revision history for this message
Thomas Bechtold (toabctl) wrote :

@Ben Kero (ben-kero) : Does the proposed fix work for you?

Revision history for this message
gcmalloc (gcmalloc) wrote :

I had the same issue today, and the patch worked for me.
on my version of fsdisk, the -u option is deprecated though.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on diskimage-builder (master)

Change abandoned by Thomas Bechtold (<email address hidden>) on branch: master
Review: https://review.openstack.org/174272
Reason: I think it's fixed with util-linux 2.26.2 so I'm no longer interested in working on this.

Revision history for this message
Gregory Haynes (greghaynes) wrote :

This has been fixed with an update to the vm element

Changed in diskimage-builder:
status: In Progress → Fix Released
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.