grub-install wrapper inconsistencies

Bug #604417 reported by bcbc
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lupin (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: lupin-support

When wubi is not installed to the same partition as Windows, the grub-install command acts differently. It appears that the wrapper to grub-install that has been provided with lupin-support doesn't recognize a wubi install if the partition is different. Since the grub-install wrapper is invisible to a user and not documented (in any form available to wubi users that I am aware of), this can result in problems.

My tests were performed on the same wubi 10.04 install (root.disk) on two separate machines. On one it was installed on the same partition as windows xp. On the other it was installed on an external usb drive. This is a summary of what I found.

Same partition as windows:
grub-install /dev/sda # appears to work, but doesn't (MBR unchanged)
grub-install /dev/sda2 # recreates the wubildr file on windows partition
grub-install --root-directory=/mnt/ /dev/sda # appears to work but doesn't

Different partition than windows:
grub-install /dev/sdb # works (grub in MBR points to partition #256)
grub-install /dev/sda2 # does not work (had to mount this separately, since it's not in /host)
grub-install /dev/sdb8 # does not work (this is the actual wubi partition)
grub-install --root-directory=/mnt/ /dev/sdb # works

Here is some terminal output showing the above. I haven't included the --root-directory commands but I've done this test a number of times.

Wubi installed to same partition as windows
====================================
bcbc@ubuntu:~$ grub-install -v
error: cannot open `/dev/sda' while attempting to get disk size.
loop: can't open device /dev/loop0: Permission denied
grub-install (GNU GRUB 1.98-1ubuntu6)
bcbc@ubuntu:~$

bcbc@ubuntu:~$ ls -l /host/wubildr
-rwxrwxrwx 1 root root 88171 2010-07-06 11:15 /host/wubildr
bcbc@ubuntu:~$ sudo grub-install /dev/sda2
[sudo] password for bcbc:
Installation finished. No error reported.
bcbc@ubuntu:~$ ls -l /host/wubildr
-rwxrwxrwx 1 root root 88171 2010-07-11 17:02 /host/wubildr
bcbc@ubuntu:~$

bcbc@ubuntu:~$ sudo grub-install /dev/sda
Installation finished. No error reported.
bcbc@ubuntu:~$ cd Downloads/
bcbc@ubuntu:~/Downloads$ ls
boot_info_script055.sh RESULTS2.txt RESULTS4.txt wubi-notes.txt
RESULTS1.txt RESULTS3.txt RESULTS.txt wubi-notes2.txt
bcbc@ubuntu:~/Downloads$ sudo bash boot_info_script055.sh
Identifying MBRs...
Computing Partition Table of /dev/sda...
Searching sda1 for information...
Searching sda2 for information...
Searching sda2/Wubi for information...
Searching sda3 for information...
Searching sda5 for information...
Searching sda6 for information...
Finished. The results are in the file RESULTS5.txt located in /home/bcbc/Downloads
bcbc@ubuntu:~/Downloads$ less RESULTS5.txt
 => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
    partition #5 for /boot/grub.
(No change)

Wubi installed to different partition (on external usb drive)
==========================================
bcbc@ubuntu:~$ grub-install -v
loop: can't open device /dev/loop0: Permission denied
grub-install (GNU GRUB 1.98-1ubuntu6)
bcbc@ubuntu:~$

bcbc@ubuntu:~$ ls /host/
Pictures Ubuntu Forums - [wubi] Wubi help_files
Recycled Ubuntu Forums - [wubi] Wubi help.html
System Volume Information wubi-move-to-partition
ubuntu wubi notes.txt
bcbc@ubuntu:~$ sudo mount | grep 'sda2'
[sudo] password for bcbc:
bcbc@ubuntu:~$ sudo mount /dev/sda2 /mnt
bcbc@ubuntu:~$ ls -l /mnt/wubildr
-rwxrwxrwx 1 root root 80467 2010-04-26 20:38 /mnt/wubildr
bcbc@ubuntu:~$ sudo grub-install /dev/sda2
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
bcbc@ubuntu:~$
bcbc@ubuntu:~$ sudo grub-install /dev/sdb8
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
bcbc@ubuntu:~$

bcbc@ubuntu:~$ sudo grub-install /dev/sdb
Installation finished. No error reported.
bcbc@ubuntu:~$ cd Downloads/
bcbc@ubuntu:~/Downloads$ sudo bash boot_info_script055.sh
Identifying MBRs...
Computing Partition Table of /dev/sda...
Computing Partition Table of /dev/sdb...
Searching sda1 for information...
Searching sda2 for information...
Searching sda3 for information...
Searching sda4 for information...
Searching sda5 for information...
Searching sda6 for information...
Searching sdb1 for information...
Searching sdb2 for information...
Searching sdb5 for information...
Searching sdb6 for information...
Searching sdb7 for information...
Searching sdb8 for information...
Searching sdb8/Wubi for information...
Searching sdb9 for information...
Searching sdb10 for information...
Searching sdb11 for information...
Searching sdb3 for information...
Finished. The results are in the file RESULTS4.txt located in /home/bcbc/Downloads
bcbc@ubuntu:~/Downloads$ less RESULTS4.txt
=> Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
    partition #256 for /boot/grub.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: lupin-support 0.29
ProcVersionSignature: Ubuntu 2.6.32-23.37-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-23-generic i686
Architecture: i386
Date: Sun Jul 11 17:17:23 2010
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: lupin

Revision history for this message
bcbc (bcbc) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 604417] [NEW] grub-install wrapper inconsistencies

Thanks for your report. In the buggy situation, could you please run:

  sudo sh -x /usr/bin/grub-mkimage --test

... and post the output to this bug?

Revision history for this message
bcbc (bcbc) wrote :
Download full text (4.5 KiB)

bcbc@ubuntu:~$ sudo sh -x /usr/bin/grub-mkimage --test
/usr/bin/grub-mkimage: 1: Syntax error: "(" unexpected
bcbc@ubuntu:~$

bcbc@ubuntu:~$ sudo sh -x /usr/share/lupin-support/grub-mkimage --test
+ prefix=
+ test_only=false
+ test_only=:
+ grub-probe --target=device /boot
+ GRUB_DEVICE_BOOT=/dev/loop0
+ losetup /dev/loop0
+ sed -e s/^[^(]*(\([^)]\+\)).*/\1/
+ loop_file=/host/ubuntu/disks/root.disk
+ [ x/host/ubuntu/disks/root.disk = x ]
+ [ ! -f /host/ubuntu/disks/root.disk ]
+ mtpt=/host/ubuntu/disks
+ [ -n /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ / = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /proc = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev/pts = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /host = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ / = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/fs/fuse/connections = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/kernel/debug = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/kernel/security = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev/shm = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /var/run = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /var/lock = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /lib/init/rw = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /proc/sys/fs/binfmt_misc = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /home/bcbc/.gvfs = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/E25A-9F70 = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/741025fa-5a23-45e4-9901-fe420f6ae5bd = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/b5b01acf-f9d8-484e-bb39-d9aa01abf4c2 = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/LucidHome = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/42c8c3ea-184d-4992-97d2-913b17d9ad4a = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/9599c96c-ad09-486b-94b5-14ec3e89e1d6 = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /media/Titan = /host/ubuntu/disks ]
+ read DEV MTPT FSTYPE OPTS REST
+ mtpt=/host/ubuntu
+ [ -z ]
+ [ -n /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ / = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /proc = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev/pts = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /host = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ / = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/fs/fuse/connections = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/kernel/debug = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /sys/kernel/security = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /dev/shm = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS REST
+ [ /var/run = /host/ubuntu ]
+ read DEV MTPT FSTYPE OPTS ...

Read more...

Revision history for this message
BuM (bumaw) wrote :

Distributor ID: Ubuntu
Description: Ubuntu maverick (development branch)
Release: 10.10
Codename: maverick

root@bum-laptop:/home/bum# grub-install -v
grub-install (GRUB) 1.98+20100804-4ubuntu6

root@bum-laptop:/home/bum# sudo sh -x /usr/bin/grub-mkimage --test
/usr/bin/grub-mkimage: 1: Syntax error: "(" unexpected

root@bum-laptop:/home/bum# grub-install --no-floppy --root-directory=/mnt/sdb1/ /dev/sdb
/usr/sbin/grub-setup: warn: warn: The area of deposition is extremely small. Core.img file will not fit in it ..
/usr/sbin/grub-setup: warn: 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-setup: error: for sure if they are required to block list, use the parameter - force.

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm going to make this a duplicate of bug 610898, since that has all my musings on the subject.

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.