[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #46828] grub-install wrote to the wrong drive
From: |
Bob B |
Subject: |
[bug #46828] grub-install wrote to the wrong drive |
Date: |
Wed, 06 Jan 2016 03:16:49 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0 |
URL:
<http://savannah.gnu.org/bugs/?46828>
Summary: grub-install wrote to the wrong drive
Project: GNU GRUB
Submitted by: tenbob
Submitted on: Wed 06 Jan 2016 03:16:48 AM GMT
Category: Disk & Partition
Severity: Major
Priority: 5 - Normal
Item Group: Software Error
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release:
Release: 2.02~beta1
Reproducibility: Every Time
Planned Release: None
_______________________________________________________
Details:
I just hit an annoying problem with grub-install. I was using a Linux PC to
prepare a bootable USB flash drive. In the manual for grub-install the
instructions state "The usage is basically very simple. You only need to
specify one argument to the program, namely, where to install the boot
loader."
On my computer /dev/sda was the main hard disk. And /dev/sdb was the USB stick
that I wanted to configure. It had a single MSDOS partition formatted with
FAT32. I ran "sudo grub-install /dev/sdb" as per the instructions.
It ran without error. When I examined the USB stick I found it contained the
stage 1 loader (MBR) but was missing the other GRUB files which were meant to
be in /boot/grub. Where were they? Well it turned out they had been written to
/boot/grub on the OTHER disk. ie the main hard disk of my computer. So
grub-install wrote the MBR to the USB stick (/dev/sdb) and the other grub
files to a COMPLETELY DIFFERENT DISK (/dev/sda).
Well, thanks a bunch. It's taken me the most of the day to restore my PC so it
boots properly again.
After a lot more research I am beginning to think this behaviour might be by
design. Apparently, you are meant to mount the USB stick within the filesystem
and pass the mount point to grub-install via the --boot-directory parameter.
If so, this needs to be explained properly in the manual. It is completely
misleading to say that grub-install needs only one argument.
The most likely use-case is when you are using a working computer to make
changes to a second drive that you're configuring. It's quite unlikely that
you would want to change the bootloader on the same computer that you're
using. And it's completely inconceivable that you would want to write the MBR
on to one device and write the other GRUB files on to a completely different
device. In fact it's something that should be trapped and prevented in the
program.
Please correct me if I have misunderstood how this is meant to work. My
version number is grub-install (GRUB) 2.02~beta2-9ubuntu1.7.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46828>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #46828] grub-install wrote to the wrong drive,
Bob B <=