[SOLVED] How to convert a GRUB2 entry back into GRUB1 format?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
How to convert a GRUB2 entry back into GRUB1 format?
Hi there most respected/excellent linux uplines:
Only a small - but slightly annoying/niggling problem that I have which I'm sure one of youse will be able to answer in a few seconds offof the top of your head :-) - of course I've googled it, but no luck so far:
I need to ask how to backwardsconvert a GRUB2 entry into GRUB1 - ie back into the "old" GRUB - so that the appropriate OS will boot up OK.
All the googled results go the other way - ie how to convert 1>2 - with mkgrub, osprober etc etc - but there doesn't seem to be anything about going the other (archaic = me :-) ) way.
I've just installed Ubuntu12.04 64bit desktop - to give it a try out, and quite impressive it is too! - onto a 60G partition on a 1TB whirlygig drive and it naturally wrote a GRUB2 loader into the MBR at the front of that hdd/sdd.
(AAMOI 60G is my "standard" OSpartition size.)
The Ubuntu12 installer recognized that the two "automatic" winDoze7 partitions and an 800G NTFS "dump"/storage partition were already there and complained about the lack of a dedicated swap partition - but with 2G of RAM I wouldn't expect that to be a problem.
However I would perhaps have expected it to have done an LVMtype install (as FC14 does) with a logical swap sub-partition - and I'm also slightly worried about the lack of a "root" password - possibly more "hackable"??.
But then I re-plugged-in my whizzy 90G OCZ solidstatedrive with two OS partitions on it - Fedora14 (25-ishG) from which I write this, and XPsp3 (60-ishG).
I had unplugged this ssd because I didn't want to have its "old" GRUB (exFC14) overwritten by the Ub12 installer - I prefer GRUB1 - it's much more "configurable"/user-friendly - as too, it seems to me, is FC14 compared to the newer/later Fedoras.
So then I tried to write/copy/convert the GRUB2 entry on the 1TB whirlygig Seagate into the ssdrive's GRUB1 MBR (from "root" in FC14) as follows:
The full GRUB2 entry, which boots up 7 and Ubuntu12.04 just fine, on the 1TB whirlygig Seagate (when it's the only hdd/sdd) is:
> menuentry 'Ubuntu, with Linux 3.2.0-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
> recordfail
> gfxmode $linux_gfx_mode
> insmod gzio
> insmod part_msdos
> insmod ext2
> set root='(hd0,msdos3)'
> search --no-floppy --fs-uuid --set=root 62ce83f3-8da6-4cfe-bf5c-f41a9d22c39f
> linux /boot/vmlinuz-3.2.0-25-generic root=UUID=62ce83f3-8da6-4cfe-bf5c-f41a9d22c39f ro quiet splash $vt_handoff
> initrd /boot/initrd.img-3.2.0-25-generic
Which seems OK - and I'm sure I have had that sort of conversion working before at some stage.
But when selecting that entry in GRUB1 it just comes up with:
> Error17: Cannot mount selected partion
> Press any key to continue...
and back to the GRUB menu.
So: I seem to remember that there is some way to either:
(1) tell it to chainload the 1TB whirlygig's GRUB2'd MBR into the 90G ssd's GRUB/MBR to getat/bootup the Ubuntu12 OSpartition
or
(2) to write/execute? something like:
> load(hd1) (hd0)
> (hd0) (hd1)
or
(3) do I have to tell it that it's an msdos partiton or something like that? - which it isn't - it's ext2or4 I'm pretty sure.
Any ideas please anybody? :-[ :-)
T verymuch IA
PaulW
AMD 64x2 2.8G(=2.6true??) CPU
Asus M2N-MX SE-Plus m/b
2G DDR RAM
90G OCZ ssd with FC14 and XPSP3 - XP seems much better for audio - none of the pops and clicks that 7 always produces
ITB Seagate sdd with 2x win7 partitions, 800Gstorage/"dump" partiton, and Ubuntu12.04
EN8500GT vidcard
MAudio MA-192 soundcard - has been very good for 3 years or so - a lovely sounding card, but I now think that the Asus Xonar STX in another SATA3 box that I've just buit (purely for for curiosity) is slightly better - maybe a few db better S/N ratio
Probably the simplest thing to do is to go to the site below and read the instructions for the bootinfoscript, download it and run it and post the output (results.txt file) here. It would be a good idea to save this for future reference as it has a lot of detailed information about drives/partitions and boot files. Have both drives plugged in when you run it:
You indicate that the entry in Ubuntu Grub2 which boots Ubuntu has this entry:
Quote:
set root='(hd0,msdos3)'
Just below that you indicate the entry in the Grub Legacy you tried is:
Quote:
root (hd1,3)
If Ubuntu is on (hd0,msdos3) that would mean sda3. The difference between Grub Legacy and Grub2 is that partitions are numbered from zero in Grub Legacy and numbered from one in Grub2. Both Grubs number drives from zero. You could edit the Fedora 14 grub.conf file and change than line to: root (hd0,2) and see if it boots.
The entry I use to boot Ubuntu 11.04 on sda5 with Grub2, booting from Grub Legacy is:
Quote:
title Ubuntu-11.04
root (hd0,4)
kernel /boot/grub/core.img
#savedefault
#boot
You would need to verify there is an actual core.img file in the /boot/grub directory of Ubuntu and it should be there. The last two lines which are commented out (#savedefault, #boot) probably aren't necessary.
Solved - Converting GRUB2 entry back into GRUB1 format
Thanx very much for that yancek
Now working fine! - quad-booting all OK just as I was wanting - 2 x linuxes, 2 x winDoze.
As you suggested bootinfoscript-061 was the solution!
After I spent an hour or so figuring out how to run/extract a .tar.gz in FC14 - no rpm available for an idiot like me .
The answer to that being not to muck around with the su -, sudo, and cd xyz bizzos but to just simply log on as root (which one can do by deleting out a line in/etc/pam.d/somethingorother) and extract/run it.
bootinfoscript's Results.txt told me that it was actually hd1,2 where the Ubuntu12.04 OS was - I'd forgotten that I'd made the linux "try-it-out" 60G partition before I'd filled up the rest of the drive with the NTFS dump/storage area.
So it was (hd1,2) and not hd1,3) as I was trying to use.
It seems that the order in which partitions are made defines their numbering - something I've just had made clear to me! And to be a bit more careful of all the various labelling/numbering conventions
GRUB(1) didn't like me calling it sdb3 - gave me "Error11:Unrecognised device string" - so that (sdb....) is obviously a GRUB2 numbering convention.
I've done this rather lengthy "Solved" post in case anyone else winds up with the same prob I was having. And have attached the first lot of the results for this reason.
That bootinfoscript might also be useful for figuring out why a win7 copypartition (that I've done using an image copy - for safety/backup) won't boot up by itself - only offof a Hiren's BootCD - "Boot off hard drive" from there = fine .
In spite of all the bootrec /fixboot /fixmbr rebuildbcd etc etc.
Thanx again
Cheers
PaulW
Resutls.txt first part:
Quote:
Boot Info Script 0.61 [1 April 2012]
============================= Boot Info Summary: ===============================
=> Grub Legacy0.97 is installed in the MBR of /dev/sda and looks at sector
138354087 on boot drive #1 for the stage2 file. A stage2 file is at this
location on /dev/sda. Stage2 looks on partition #2 for
/boot/grub/grub.conf..
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos3)/boot/grub on this drive.
File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files: /boot.ini /bootmgr /Boot/BCD /ntldr /NTDETECT.COM
File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files: /Windows/System32/winload.exe
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.