Ask Your Question
0

diskimage-builder produces a non-bootable RHEL 6.7 QCOW2-image

asked 2015-09-21 12:17:33 -0500

holger-king gravatar image

updated 2015-09-21 12:20:28 -0500

Dear OpenStack community,

when using diskimage-builder (DIB) to create a custom Red Hat Enterprise Linux (RHEL) 6 QCOW2 image we get a non-bootable result although the disk image building process ends successfully. The log of the disk image building run can be found here!

The host where the image is built runs on RHEL 7.1 using:

  • dib-utils 0.0.9-1
  • sfdisk 2.23.2

We set the following environment variables to allow a proper execution and connection setup with our RHEL Satellite environment for package updates during the diskimage-builder run:

  • export DIB_RHSM_USER=<user>
  • export DIB_RHSM_PASSWORD=<password>
  • export DIB_SAT_URL=https://<host>.xx.xxxxx.xxx/XMLRPC
  • export DIB_SAT_KEY=<key_1>,<key_2>
  • export DIB_RHN_CHANNELS=""
  • export DIB_REG_TYPE=rhn
  • export DIB_RELEASE=6.7-20150706.0
  • export DIB_CLOUD_IMAGES=file:///root
  • export DIB_IMAGE_SIZE=5
  • export TMP_DIR=$HOME/oso

The command we use to start the image creation:

diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm rhel <custom_dib_element> -o RHEL-x86_64-openshift-origin-broker >/tmp/dib_rhel.log 2>&1

The problem seem to be the partition table writing respectively the bootloader handling. We found the following interesting informations in our log file:

dib-run-parts Mon Sep 21 18:29:08 CEST 2015 Running /root/oso/image.c8DfiJSU/hooks/block-device.d/10-partition
Checking that no-one is using this disk right now ...
BLKRRPART: Invalid argument
OK

sfdisk: Disk /dev/loop2: cannot get geometry

sfdisk:  /dev/loop2: unrecognized partition table type

sfdisk: No partitions found

sfdisk: Warning: The partition table looks like it was made
  for C/H/S=*/181/40 (instead of 652/255/63).
For this listing I'll assume that geometry.

sfdisk:                 start: (c,h,s) expected (0,51,9) found (0,32,33)

sfdisk:                 end: (c,h,s) expected (1023,180,40) found (652,180,40)

Warning: partition 1 does not end at a cylinder boundary
end of partition 1 has impossible value for cylinders: 652 (should be in 0-651)
BLKRRPART: Invalid argument
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
dib-run-parts Mon Sep 21 18:29:08 CEST 2015 10-partition completed

Disk /dev/loop2: 652 cylinders, 255 heads, 63 sectors/track
Old situation:
New situation:
Units: sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/loop2p1   *      2048  10485759   10483712  83  Linux
/dev/loop2p2             0         -          0   0  Empty
/dev/loop2p3             0         -          0   0  Empty
/dev/loop2p4             0         -          0   0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...

IMAGE_BLOCK_DEVICE=/dev/loop2p1

...

dib-run-parts Mon Sep 21 18:29:32 CEST 2015 Running /root/oso/image.c8DfiJSU/hooks/cleanup.d/51-bootloader
+ set -eu
+ set -o pipefail
+ '[' -n /root/oso/image.c8DfiJSU/mnt ']'
+ source /root/oso/diskimage-builder/bin/../lib/img-functions
+ '[' -d /root/oso/image.c8DfiJSU/mnt/boot/extlinux ']'
+ CONF=/root/oso/image.c8DfiJSU/mnt/boot/extlinux/extlinux.conf
+ select_boot_kernel_initrd /root/oso/image.c8DfiJSU/mnt
+ TARGET_ROOT=/root/oso/image.c8DfiJSU/mnt
+ BOOTDIR=/root/oso/image.c8DfiJSU/mnt/boot
+ '[' -n '' -a -n '' ']'
+ '[' -f /root ...
(more)
edit retag flag offensive close merge delete

Comments

Can anybody help us?

holger-king gravatar imageholger-king ( 2015-09-28 13:19:26 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-07-14 02:26:24 -0500

Wan Deng Ren gravatar image

updated 2016-07-14 02:30:26 -0500

extlinux doesn`t support boot 64bit ext4 filesystem. See http://osdir.com/ml/commits.gnome/2016-06/msg01047.html (http://osdir.com/ml/commits.gnome/201...) for more information.

So, you should modify /etc/mke2fs.conf in the diskimage-builder host to delete "64bit" attribute of ext4 "fs_type".

Then, you can build a new bootable image using diskimage-builder.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-09-21 12:17:33 -0500

Seen: 499 times

Last updated: Jul 14 '16