Refracta Development, Scripts, etc.
Post a reply

install grub to partition

Sat Oct 13, 2012 7:41 pm

I got to thinking about this and got stuck on one thing.... WHY

I may have asked and got an answer before but I do not remember it.

Why would you want to install grub to a partition? What is the purpose of doing so? What would you accomplish by doing so that you couldn't accomlish some other way?

Re: install grub to partition

Sat Oct 13, 2012 9:06 pm

Because only one OS can take control of MBR. It is an issue for only some of us, who keep one "stable" but also multiple other OS's which might change often

Why should a new install, Debian or otherwise, particularly one which might be used only occasionally for special purposes or is intended for test, automatically take control of MBR without user choice nor permission ?

Master grub (or other bootloader) may also have been carefully customised, with at least a particular spash screen, maybe more e.g. custom menu entries for iso/squashfs boot... set in a user's everyday stable OS and not wanting to be trashed

It is also not compulsory to have grub-pc in mbr at all. Grub-pc can be chainloaded. Grub-legacy and extlinux are in Debian repos. Unofficial legacy versions with ext4 support exist (antiX)

Re: install grub to partition

Sat Oct 13, 2012 10:28 pm

I'm with meandean here.

Ok, so why not just don't install grub anywhere? ie choice is to install grub to MBR or not to install it anywhere.

Re: install grub to partition

Sun Oct 14, 2012 1:42 am

In the past i mainly did it for the reason to keep to OSes strictly seperated.
With grup-pc adding each and every OS it finds on its own it doesn't make sense anymore
(and i gave up on dual-boot too).

Re: install grub to partition

Sun Oct 14, 2012 2:19 am

Ok, so why not just don't install grub anywhere? ie choice is to install grub to MBR or not to install it anywhere.


Because a new system is relatively simple to chain from another bootloader anywhere, even a removable... syslinux, extlinux or legacy. I know only a minority find that useful however PBR is an available grub-pc option.

Re: install grub to partition

Sun Oct 14, 2012 3:00 am

As I told someone recently, if you already have a linux install with a working grub install then don't bother to install grub at all. Just boot back into the first install and update grub. Done. That is the safest and least messy way of handling it. Doing it this way keeps grub from duplicating the entries over and over also. The person had thought to get fancy and install grub to the partition to keep from messing up his main install and boot menu in case he decided he wanted to stick with his first install and wipe the second one. Needless to say he ended up at a grub prompt and no clue how to fix anything.

Even better, make your first partition a small partition that does nothing but holds the grub config files. Then it is completely separated from any install. No need to bother installing grub ever again.

I recently went back to my old way of doing it (since I have been playing with other distros) and that is similar to the above. I have the grub config files on sda1 which is where I keep my data already. This is how I use to do it with the old grub as well.

So I still can't really see a point to installing grub to a partition.


Now for my next question...

If an installer was just going to install grub without confusing the user would hd0 be a safe default? I wonder if hd0 is correctly interpreted to be the device that the bios recognizes as the proper bootable drive? What is a safe and foolproof method...is there one? I need to dig a box out of the closet with multiple hard drives and play with it I guess....probably wont though...

I also though that maybe running os-prober and if any linux is detected then just mount that partition and update grub. Not sure it is nice to do that without informing the user first though.

I also posted a couple grub install scripts at my forum....
I use one to reinstall grub from a live image and the other when I just want to move grub around. Not that useful but info nevertheless...

Re: install grub to partition

Sun Oct 14, 2012 3:04 am

dzz wrote:[Because a new system is relatively simple to chain from another bootloader anywhere...

But why chainload another bootloader when the current bootloader could just as easily be used to boot the new install?

Re: install grub to partition

Sun Oct 14, 2012 11:29 am

Right now, I have four hard drives in my main computer. I recently installed refracta to a partition, and I had some trouble figuring out which drive was first. Looking at the wires inside the box didn't help. I had to change the order in the bios. Seems like the bios and the grub or maybe grub and the kernel don't agree.

OK, this is my first time using an iPad, and, well, Let's just say that I prefer a real keypad.

Back on topic... Automatic stuff that can render a system unbootable is uncool. I'm not sure what the best solution is or what to do about putting grub in a partition. also not sure if I'm in the right thread. I want my mouse and keyboard!

Edit... Part of my problem might have been that I was installing from USB, and that changed the grub device numbers. Not sure.

Re: install grub to partition

Sun Oct 14, 2012 11:36 am

Out of curiosity and laziness, I ask, How do you chain load from syslinux?

Re: install grub to partition

Sun Oct 14, 2012 4:25 pm

Being a 70 year old idiot and getting a bit senile I expect I'm talking rubbish but:
As the mean one suggested no grub but have Antony's(Saline) grub doctor on the ISO so after installing run grub doctor.

I did say I'm an idiot didn't I, sorry if I talk gibberish
Post a reply