Bug#696615: grub2: no possibility to install from usb media

2012-12-24 Thread Cyril Brulebois
Control: tag -1 confirmed

Hi Gert,

Gert Schulte g...@trash-mail.com (24/12/2012):
 Dear Maintainer,
 
 Installing from usb with mini.iso in expert mode and normal user mode. Grub2
 wants to install in /dev/sda, which is the MBR of the install media and 
 luckily
 fails. (Last year it did even overwrite the install media).
 There is no option to select any different installation location for grub 
 which
 leads to non-bootable systems for many users.
 
 I had to chroot into my fresh installation to install grub2.
 
 Sorry, this did always happen the last months with several mini.iso on several
 systems but I did not get to report it.
 
 Please have the install choose the right MBR (e.g. the HD you installed the
 system on) and have an option to choose a different location for expert modus
 and for normal user modus if installation fails.
 
 Thanks

I must say I've been trying to reproduce some issues with grub-install
vs. MBR lately, and I think there are basically two of them: one with
non-sensical strings, which Wouter has been trying to diagnose, and
finally worked around:
  http://packages.qa.debian.org/g/grub-installer/news/20121216T164729Z.html

and the one where the wrong /dev/sdFOO gets chosen.

I've just tried the following, instead of using some mini.iso (or any
official iso) in a CD-Rom drive:
 - convert it to a VDI image:
 VBoxManage convertfromraw dest/netboot/gtk/mini.iso 
dest/netboot/gtk/mini.vdi
 - attach the resulting VDI image to SATA port 0 in virtualbox.
 - use guided partitioning, everything in a single partition, into
   /dev/sdb (SATA port 1)
 - enjoy the attempted “grub-install /dev/sda” call.

I'll be trying to fix that before rc1.

Thanks for the reminder/bug report.

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#696615: grub2: no possibility to install from usb media

2012-12-24 Thread Cyril Brulebois
Cyril Brulebois k...@debian.org (24/12/2012):
 I've just tried the following, instead of using some mini.iso (or any
 official iso) in a CD-Rom drive:
  - convert it to a VDI image:
  VBoxManage convertfromraw dest/netboot/gtk/mini.iso 
 dest/netboot/gtk/mini.vdi
  - attach the resulting VDI image to SATA port 0 in virtualbox.
  - use guided partitioning, everything in a single partition, into
/dev/sdb (SATA port 1)
  - enjoy the attempted “grub-install /dev/sda” call.
 
 I'll be trying to fix that before rc1.

Here's what happens in grub-installer, with comments inline:
| # Try to avoid using (hd0) as a boot device name.  Something which can be
| # turned into a stable by-id name is better.
| default_bootdev_os=$($chroot $ROOT grub-mkdevicemap --no-floppy -m - | head 
-n1 | cut -f2)

Notice the head -n1 here. If you're booting from /dev/sda, that's what
you get, no matter what.

For reference, here's what it looks like for two disks:
  (hd0) /dev/disk/by-id/ata-VBOX_HARDDISK_id1-id2
  (hd1) /dev/disk/by-id/ata-VBOX_HARDDISK_id3-id4

| if [ $default_bootdev_os ]; then
| default_bootdev=$($chroot $ROOT readlink -f $default_bootdev_os)

That one turns the former top line into:
  /dev/sda

| else
| default_bootdev=(hd0)
| fi
| 
| # Set a sensible default boot device, so that we aren't installing GRUB to
| # installation media which may be removed later.  The disk containing /cdrom
| # is very unlikely to be a sensible default.  If we had to fall back to
| # (hd0), then we can't tell exactly which disk that is, but if /cdrom seems
| # to be a USB stick then (hd0) may not be safe.  If we hit either of those
| # checks, then try the disk containing /boot instead.
| # The same goes for /hd-media, so avoid installing there as well.
| cdsrc=$(mount | grep on /cdrom  | cut -d' ' -f1)
| cdfs=$(mount | grep on /cdrom  | cut -d' ' -f5)
| hdsrc=$(mount | grep on /hd-media  | cut -d' ' -f1)

Unfortunately, that kind of filtering can't really work for the boot
from USB case, since no /dev/sda shows up in mount's output (or in
/proc/mounts). All we have about it is presumably:
  rootfs / rw 0 0

which isn't exactly sufficient. Otherwise, we could just insert some
“grep -v $foo” before the head/cut pair in the first line I quoted.

Another way I see would be:
 1. use /etc/fstab in /target to see whether there's a /boot there,
and fall back to / if needed.
 2. use readlink on /dev/disk/by-uuid/$UUID to get the appropriate
partition (say /dev/sdb1 for a full disk installation in my case),
and get back to the actual disk (/dev/sdb).
 3. use that as the default.

Let's see whether a big red man pops up tonight with a clever(er) idea.

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#696615: grub2: no possibility to install from usb media

2012-12-23 Thread Gert Schulte
Package: debian-installer-7.0-netboot-amd64
Version: 20121114
Severity: normal
Tags: ipv6

Dear Maintainer,

Installing from usb with mini.iso in expert mode and normal user mode. Grub2
wants to install in /dev/sda, which is the MBR of the install media and luckily
fails. (Last year it did even overwrite the install media).
There is no option to select any different installation location for grub which
leads to non-bootable systems for many users.

I had to chroot into my fresh installation to install grub2.

Sorry, this did always happen the last months with several mini.iso on several
systems but I did not get to report it.

Please have the install choose the right MBR (e.g. the HD you installed the
system on) and have an option to choose a different location for expert modus
and for normal user modus if installation fails.

Thanks



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org