[SOLVED] grub-setup is failing to write the primary boot loader to the MBR
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
grub-setup is failing to write the primary boot loader to the MBR
I am trying to install grub-pc's primary boot loader to the MBR and I am repeatedly failing even though I am using the right command syntax. For some weird reason, update-grub is creating repeated menu items pointing at the same installation.
Before I run grub-setup, I mounted the partition containing the /boot/grub directory. This was mounted on /mnt/sda1. The command was this:
Does anyone know why grub-setup is failing? I am tempted to use dd on the MBR but I have no idea how the primary boot loader is 'wired' to load the correct sequence of sectors from the HD and somehow it must know, but how?
I was suggesting to use the linux notation for device, but grub has changed that syntax across versions (distros did some changes too), so I'm not sure if that applies to you.
For some weird reason, update-grub is creating repeated menu items pointing at the same installation.
Is your system booting or is it dropping to a grub prompt.
If it is booting then are you having the same problem I'm experiencing? I added linuxmint to my grub menu & I now have 5 or 6 entries for linuxmint.
Why are you using "grub-setup" to install grub on the MBR?
Try;
Code:
sudo grub-install /dev/sda
It is a matter of philosophy. I don't agree that a bootloader is modified by any installed OS because of its central importance on a computer. For me it doesn't make sense that an installed OS, in the event of an error, impacts the bootability of an entire multiboot system: it simply doesn't make sense.
I cannot use the given command because that command assumes that I am linking grub with the currently loaded OS. I am attempting to install grub to an ext2 15MB partition.
I used an ext2 filesystem because the file system is used only by the bootloader, hence, a journalling file-system is not necessary. I think, the fact that it is ext2 may be the cause why grub-setup fails.
It is a matter of philosophy. I don't agree that a bootloader is modified by any installed OS because of its central importance on a computer. For me it doesn't make sense that an installed OS, in the event of an error, impacts the bootability of an entire multiboot system: it simply doesn't make sense.
I cannot use the given command because that command assumes that I am linking grub with the currently loaded OS. I am attempting to install grub to an ext2 15MB partition.
I used an ext2 filesystem because the file system is used only by the bootloader, hence, a journalling file-system is not necessary. I think, the fact that it is ext2 may be the cause why grub-setup fails.
Yes, you are probably right. Why won't you try a regular install with any Linux and just put the grub bootloader in the mbr when asked for it during the installation process? After install you can still change your bootloader sequence. That'what I do with my multiboot system and most of the time it works. Solaris is a tricky one (not a Linux) but I finally got that one too.
Take a look at the bottom of the page in the link below. The method for a standalone grub on a separate partition is basically the same except for Grub2, it should not be on a fat partition which should not be a problem as you state you already have an ext2 filesystem:
I don't agree that a bootloader is modified by any installed OS because of its central importance on a computer
Bootloaders are almost always modified by the OS but during installation (and sometimes during updates), you do have a choice, at least on Linux. Usually three options, install to mbr, install to partition or don't install a bootloader. However, it is obviously not necessary to modify the bootloader and that is the primary reason to have either a /boot partition or standalone grub partition so you are not dependent on the boot,grub files which are usually on the partition on which the primary OS is isntalled.
I enlarged the partition which contained the original bootloader so that it could fit a small (less than 1 GB) installation of Debian without a window manager or desktop. The installation created its own bootloader saving the primary bootloader to the MBR as I required.
I will not use this installation so that grub.cfg would not be changed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.