bugGNU GRUB - Bugs: bug #46828, grub-install wrote to the wrong...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #46828: grub-install wrote to the wrong drive

Submitted by:  Bob B <tenbob>
Submitted on:  Wed 06 Jan 2016 03:16:48 AM UTC  
 
Category:  Disk & Partition Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Invalid Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed Release: 
Release:  2.02~beta1 Reproducibility:  Every Time
Planned Release:  None

Wed 06 Jan 2016 07:20:20 AM UTC, comment #1: 

> 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.


It is perfectly valid.

As far as I can tell documentation explains what default is and how to change it. If you have suggestions how documentation can be improved please send patches to grub-devel.

Closing as not a bug, sorry.

Andrei Borzenkov <arvidjaar>
Project Member
Wed 06 Jan 2016 03:16:48 AM UTC, original submission:  

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.

Bob B <tenbob>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by tenbob (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-06 arvidjaar StatusNone => Invalid
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.6