How to revert to grub legacy

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
viking777

How to revert to grub legacy

Post by viking777 »

A lot of people, myself included, are having difficulty in understanding the 'logic' of grub2, personally I think that for the present grub legacy is a better bet. I am sure that will eventually change but it hasn't yet. The way I have been dealing with the situation is simply to install a distro that still uses grub legacy (Debian Stable in my case) to control the boot process (ie it is installed on the disk mbr) and to use that to chainload to all the newer grub2 distros (installed onto the partition boot record not the disk mbr). The grub2 distros can make as much of a mess as they like of my newer distro boot menus (and believe me they do!) because I don't have to read them, I have already chosen what I want to boot into from the comparatively sane and superior debian boot menu. That works for me, but I have always wanted to know how easy it is to get rid of grub2 from a distro that already has it and that is what I tried out today. Luckily the answer is that it is very easy. Most of the procedure is taken from the Ubuntu community Docs (https://help.ubuntu.com/community/Grub2 ... B%20Legacy) although they gloss over one very important step at the end which basically means that you cant boot. That is why I am repeating the tutorial here.

So this is how it goes. In a terminal:


Code: Select all

sudo cp /etc/default/grub /etc/default/grub.old


sudo cp -R /etc/grub.d /etc/grub.d.old


sudo cp -R /boot/grub /boot/grub.old
In case you regret what you have done later!

Code: Select all

sudo apt-get purge grub-pc
Once you have done this your computer is no longer bootable so don't switch it off (although you can always use a live cd to edit stuff if you need to)

Code: Select all

 sudo apt-get install grub 

Code: Select all

sudo update-grub

Code: Select all

sudo grub-install /dev/sdX
Usually this will be /dev/sda but if you have more than one drive it may not be. If, like me you want to install to a partition not the mbr then change it to /dev/sdxx
(eg /dev/sda6) that will install grub to partition sda6.

Up till now this has been exactly the same as the Ubuntu docs, but they now tell you to reboot DON'T!

The reason is that your new menu.lst file although created is not properly written (I think the reason is that it gets confused with grub2 notation, not sure but it certainly won't boot yet anyway), so,

Code: Select all

sudo gedit /boot/grub/menu.lst
If yours is like mine it will contain two entries one for the distro you are installing grub on and another to chainload grub2 again, both are wrong.

The newly created file looks a bit like this (I have altered mine a bit so it won't be identical):

title Linux Mint 8 Helena - Fluxbox CE, kernel 2.6.31-20-generic
uuid xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kernel /boot/vmlinuz-2.6.31-20-generic root=LABEL=spare3 ro nosplash
initrd /boot/initrd.img-2.6.31-20-generic


title Chainload into GRUB 2
uuid xxxxxxxxxxxxxxxxxxxxxxxxx
kernel /boot/grub/core.img

The lines in red are the errors so change 'uuid' to 'root' and the actual uuid number to the format (hdx,y) so it looks like this (of course it helps if you know the correct partition number for your machine!)

title Linux Mint 8 Helena - Fluxbox CE, kernel 2.6.31-20-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.31-20-generic root=LABEL=spare3 ro nosplash
initrd /boot/initrd.img-2.6.31-20-generic


title Chainload into GRUB 2
root (hd0,5)
kernel /boot/grub/core.img

Then you can boot, and you will actually have a choice of booting with grub legacy or grub2 although grub legacy will be in control of the boot process.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
linuxviolin
Level 8
Level 8
Posts: 2081
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: How to revert to grub legacy

Post by linuxviolin »

Well, Grub 2 works well sometimes :wink: but it is still under development and so far is not stable...

e.g.:
I've always wondered why many distros found it necessary to move to GRUB 2 as the primary bootloader supported. Despite of the fact that GRUB 2 does not have the security features of GRUB Legacy. Here's a quote I retieved from the GRUB 2 development mailing list:
There has been no issue with grub legacy for ages (probably due to
lack of any development whatsoever) but there were at least two
different bugs in Debian grub2 packages which would render a box
unbootable by just upgrading grub2.

The fact is that grub2 is usable for may things but is still under
development and so far is not stable, at least not at the level of
stability users expect from stable or even testing Debian packages.

I would gladly recommend grub2 rescue disk as a backup solution or
feature preview but grub2 as the primary bootloader is a pain in the
backside.
Why move to a new, but unstable system when the old system works quite well? Why not wait until the new system is at or near the same level – features-wise, with the system it is supposed to replace.
(quote from here, 1:39 pm February 11, 2010)
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
DataMan

Re: How to revert to grub legacy

Post by DataMan »

Another alternative (a bit more detailed than the above described) is to install a copy of Mint FluxBox. It uses GRUB 1x as the boot loader. Use that as your default boot and you're back to the earlier version.

From there, if you have the real estate, you could use the /boot to build a dedicated GRUB boot partition using 1x GRUB.

This is what I'm doing for dual booting to Mint 6 & 7 64 bit, Mint 6 FluxBox and Window 7 64 bit pro.

-DataMan
viking777

Re: How to revert to grub legacy

Post by viking777 »

DataMan wrote:Another alternative (a bit more detailed than the above described) is to install a copy of Mint FluxBox. It uses GRUB 1x as the boot loader. Use that as your default boot and you're back to the earlier version.

From there, if you have the real estate, you could use the /boot to build a dedicated GRUB boot partition using 1x GRUB.

This is what I'm doing for dual booting to Mint 6 & 7 64 bit, Mint 6 FluxBox and Window 7 64 bit pro.

-DataMan
I think your information must be a little out of date, I have two recently installed copies of Mint Fluxbox (about a week old) and they both use grub2. This is one of the reasons I wanted to learn how to revert, and also why I made the post, because nowadays everything is going with grub2 despite the fact that it is still not good enough for anything mainstream. If you look closely at my post you will see the title in my grub menu is:
title Linux Mint 8 Helena - Fluxbox CE, kernel 2.6.31-20-generic
It was Fluxbox CE that I used to practice on!
DataMan

Re: How to revert to grub legacy

Post by DataMan »

I'll have to check my versions when I get home from work. The version of Fluxbox that I'm using definitely is using GRUB1x but I may be one or more versions behind the current release level.

Thanks,

-DataMan
DataMan

Re: How to revert to grub legacy

Post by DataMan »

I checked and it is version 6 of FluxBox that I'm running, thus the GRUB1x.

-DataMan
breaker

Re: How to revert to grub legacy

Post by breaker »

Good edit on the wiki guide.

Alternately, you could probably install GRUB Legacy from a Live CD that has it and build a menu.lst that points directly to your newer (LM 8, Karmic) kernels, etc.

Don't forget GRUB Legacy partitions start with 0 and GRUB2 start with 1 (as far as GRUB devices are concerned).

I'm happy with grub2, but that's another story...
satcowboy

Re: How to revert to grub legacy

Post by satcowboy »

Thanks! I set up a grub password on my one machine that uses Grub 2, from a fresh Mint 8 install. It was several weeks before I noticed that an empty password would also work. From the Debian mailing list it looks like passwords may still be in work (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477092). And I find the new Grub confusing. I hosed up the Mint 8 machine trying to reinstall Grub Legacy (the Grub 2 menu pops up but doesn't boot anything). Hopefully this reversion procedure will work out.
Biker
Level 5
Level 5
Posts: 517
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: How to revert to grub legacy

Post by Biker »

I hated Grub (1) with a passion and always used LILO for my boot menus. However, since working with Grub2, I've grown to really like it. It provides more options than Grub, and it's much easier to append commands on an as needed basis. I still despise Grub (1), but Grub2 is pretty good. :)
Linux User #384279
Locked

Return to “Installation & Boot”