Results 1 to 5 of 5

Thread: Every time new grub version is installed(update)-grub auto-installed in /dev/sda MBR

  1. #1
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Every time new grub version is installed(update)-grub auto-installed in /dev/sda MBR

    This is the second time. First time I wasn't sure, but now I think I am.

    Problem

    Every time when a new version of grub is installed through the update procedure (sudo apt-get update; sudo apt-get dist-upgrade) , then grub is auto-installed in the MBR of /dev/sda.

    What I expected

    I have another version of GRUB installed in /dev/sda, that relies in Ubuntu 13.04 (13.04 is installed in a partition of /dev/sdb). I expected that this version of GRUB will remain after a 14.04 system update. Ubuntu 14.04 is installed in a partition of /dev/sda.

    How to reproduce it

    I understand that this can be a bit difficult to reproduce, as is only happens when a new version of GRUB is available and installed through the system update procedure.
    Install another grub of another Linux distribution (in my case is Ubuntu 13.04) in MBR of /dev/sda and update the Trusty Tahr. If a GRUB update is available, probably in next reboot you will see this issue.

    Maybe after all this is not an issue, but a normal behavior that I didn't know about ?

    Any logs/or commands output/ you might want to examine, let me know.

    Thanks in advance.

  2. #2
    Join Date
    Apr 2008
    Beans
    10,989

    Re: Every time new grub version is installed(update)-grub auto-installed in /dev/sda

    When you installed Trusty you probably chose to install grub to /dev/sda, or if you used any installation method other than "Something else" the installer just automatically does that. So now every time update-grub is run grub-pc is once again restored to it's original location.

    To fix that run this command:

    Code:
    sudo dpkg-reconfigure grub-pc
    Then use the tab and enter keys to select OK on these 3 screens:

    Screenshot from 2013-11-23 10:05:57.png

    Screenshot from 2013-11-23 10:06:26.png

    Screenshot from 2013-11-23 10:08:02.png

    Then you'll see a screen similar to this:

    Screenshot from 2013-11-23 10:10:42.png

    Use the space bar to select or deselect the appropriate devices, then tab and enter to select OK. Then it should be fixed

  3. #3
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    8,288
    Distro
    Ubuntu Development Release

    Re: Every time new grub version is installed(update)-grub auto-installed in /dev/sda

    The Ubiquity installer defaults to installing Grub into the MBR of sda. I have been caught out by this. Also keep in mind that the last version of Linux to be installed will overwrite any existing MBR.

    I have two hard disks with multiple versions of Ubuntu so I frequently have to put my preferred Ubuntu back in charge of the MBR and the Grub boot menu. I do this by loading into my preferred Ubuntu and running

    Code:
    sudo update-grub
    Code:
    sudo grub-install /dev/sda
    or

    Code:
    sudo grub-install /dev/sdb
    Depending upon which hard disk has boot priority at the time and which disk the Ubuntu I am running is loaded on. And when I put in another install of Ubuntu I make sure at the partitioning screen that Grub is going to be installed into the MBR of the hard disk that I want it to.

    I also found out recently that Windows 8 will put its boot loader into the MBR of every hard disk. This is worse as the Microsoft Boot loader will never offer an option to boot into Linux.

    Regards.
    Last edited by grahammechanical; November 23rd, 2013 at 05:34 PM.
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  4. #4
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Every time new grub version is installed(update)-grub auto-installed in /dev/sda

    Quote Originally Posted by grahammechanical View Post

    I have two hard disks with multiple versions of Ubuntu so I frequently have to put my preferred Ubuntu back in charge of the MBR and the Grub boot menu. I do this by loading into my preferred Ubuntu and running

    Code:
    sudo update-grub
    Code:
    sudo grub-install /dev/sda
    or
    Code:
    sudo grub-install /dev/sdb
    Depending upon which hard disk has boot priority at the time and which disk the Ubuntu I am running is loaded on. And when I put in another install of Ubuntu I make sure at the partitioning screen that Grub is going to be installed into the MBR of the hard disk that I want it to.

    I also found out recently that Windows 8 will put its boot loader into the MBR of every hard disk. This is worse as the Microsoft Boot loader will never offer an option to boot into Linux.

    Regards.
    That is exactly what I did. Specifically I installed my preferred GRUB with this command
    Code:
    sudo grub-install --recheck /dev/sda
    Probably is what @kansasnoob says here.

    Quote Originally Posted by kansasnoob View Post
    When you installed Trusty you probably chose to install grub to /dev/sda, or if you used any installation method other than "Something else" the installer just automatically does that. So now every time update-grub is run grub-pc is once again restored to it's original location.
    Yes that is correct.
    Quote Originally Posted by kansasnoob View Post
    To fix that run this command:
    Code:
    sudo dpkg-reconfigure grub-pc
    ........
    Use the space bar to select or deselect the appropriate devices, then tab and enter to select OK. Then it should be fixed
    So I have to reconfigure grub and make it like.. unusable. I have to select to install it on some partition(number) rather to a disk. So next time that GRUB will be installed through the update procedure it will not replace my preferred GRUB.

    But I didn't know that it was an expected behavior.

    Thanks for the help.


  5. #5
    Join Date
    Aug 2009
    Location
    USA
    Beans
    3,991
    Distro
    Ubuntu Development Release

    Re: Every time new grub version is installed(update)-grub auto-installed in /dev/sda

    I don't think there is any way to prevent this from happening. Everytime I install a new ISO I have to turn my 1TB USB drive /dev/sdb off or else it will just hang during installation I believe even before it asks where I want to install.
    (I believe the need to turn off my USB drive started with Quantal or maybe before that, but it is a neccessity.)
    Then it installs on /dev/sda just fine.
    I have 6 Linux systems installed and when any of them get an update to grub, grub-install /dev/sda gets executed installing the grub on that partition.

    I then have to boot into the partition that I want it on and re-install it there. I believe that is a normal function of a grub update. One of the things it does is install grub on the partition it is being updated on.
    I installed Trusty, customized the grub menu, rebooted and everything looked good. So I went to Raring and installed my grub there and then came back to Trusty. So, what happens? Trusty gets a grub update to 2.00-20 and it gets installed on the Trusty partition again.
    This time I just left it there because I believe I know how to fix it if I need to if something should go seriously wrong on Trusty.

    It will do that every time. Or at least that has been my experience.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Intel Core2 Quad CPU Q9550 @ 2.84Ghz. 4.0GB DDR2 RAM, NVIDIA Geforce 9800 GT

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •