Bug#250938: grub: mkbimage fails

John Goerzen John Goerzen <jgoerzen@complete.org>, 250938@bugs.debian.org
Tue, 25 May 2004 16:41:31 -0500


Package: grub
Version: 0.94+cvs20040511-1
Severity: normal

Here is output from a call to mkbimage.  Besides the fact that it fails
to actually do anything, it also doesn't return an error exit status,
which means that scripts calling mkbimage think it succeeded!

mkbimage -f /home/jgoerzen/no-backup/foo/boot -t hd -s ext2 -d \
  /home/jgoerzen/no-backup/foo

Disk /home/jgoerzen/no-backup/foo/hd.image: cannot get geometry

Disk /home/jgoerzen/no-backup/foo/hd.image: 22 cylinders, 16 heads, 63 sectors/track
 /home/jgoerzen/no-backup/foo/hd.image: unrecognized partition
Old situation:
No partitions found
New situation:
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/home/jgoerzen/no-backup/foo/hd.image1   *      0+     21      22-     11056+  83  Linux
/home/jgoerzen/no-backup/foo/hd.image2          0       -       0          0    0  Empty
/home/jgoerzen/no-backup/foo/hd.image3          0       -       0          0    0  Empty
/home/jgoerzen/no-backup/foo/hd.image4          0       -       0          0    0  Empty
Successfully wrote the new partition table

Re-reading the partition table ...

Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2768 inodes, 11056 blocks
552 blocks (4.99%) reserved for the super user
First data block=1
2 block groups
8192 blocks per group, 8192 fragments per group
1384 inodes per group
Superblock backups stored on blocks: 
	8193

Writing inode tables: 0/21/2done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


    GNU GRUB  version 0.94  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]
grub> geometry (hd0) 22 16 63
drive 0x80: C/H/S = 22/16/63, The number of sectors = 22176, /home/jgoerzen/no-backup/foo/hd.image
   Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... failed

Error 22: No such partition
grub> geometry  -w  (hd0) 22 16 63

Error 11: Unrecognized device string
grub> -------------------WHAT'S NEXT?-------------------------------------

If you have created an image aimed to a floppy, then something like:

dd if=<type>.image of=/dev/fd0[u<size>] bs=512

will be more than enough... if you have formated the floppy correctly
using `superformat' to be found in `fdutils' package.

For El Torito floppy emulation :

mkisofs -b <image> -c boot.catalog -o raw.iso <dir>

And for El Torito Hard Disk emulation:

mkisofs -b <image> -hard-disk-boot -c boot.catalog -o raw.iso <dir> 

Enjoy!
Preparing run-time rd
Running: mkdir -p /home/jgoerzen/no-backup/foo/image/opt/dfsruntime/runtimerd/etc
Running: mkdir -p /home/jgoerzen/no-backup/foo/image/opt/dfsruntime/runtimerd/var
Running: mkdir -p /home/jgoerzen/no-backup/foo/image/opt/dfsruntime/runtimerd/var/lib
Preparing ISO image
Running: mkisofs -b boot/hd.image -hard-disk-boot -c boot/boot.catalog -R -o /home/jgoerzen/no-backup/foo/image.iso /home/jgoerzen/no-backup/foo/image

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.4
Locale: LANG=C, LC_CTYPE=en_US

Versions of packages grub depends on:
ii  libc6                       2.3.2.ds1-12 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-3        Shared libraries for terminal hand

-- no debconf information