View Full Version : Editing GRUB in LN3
I have been struggling with a GRUB edit I need to do. It is a long saga - I'll try to give the nub of it, but if I have left out important information and someone is able and willing to help, but needs more info, then I'll happily write a book on it. ;-(
I have the following setup: a box with LN3 on the primary IDE slave, which has been installed in more or less the configuration in which it now is ever since I finally persuaded my husband of some 19 years that computers don't bite. (About a year ago.) He actually _likes_ his computer and regards any change, however small, as detrimental.
Because he needs to run a Windows only programme for a University course which he is doing (it is crucial to the course) I have installed XP on the primary IDE master and now want to edit GRUB. (I can boot from either disk if I change the boot order in the BIOS - i.e. both work.)
I am failing dismally. According to grub> (the command at the command line) itself, hd0,0 is a FAT partition - i.e. Windows. (There is a total of one FAT partitions in this house) and hd1,0 is reiserfs, i.e. Linux, i.e. LN3.
So far so good. Now we come to the tricky bit. GRUB (the file) says that LN3 is on hd0,0 and refuses to let me edit this. I can do so (to hd1,0), but when I run grub-update it returns it to hd0,0. It then happily boots from GRUB. If I choose Auftakt (the Windows program that I am trying so hard to get going when I am not in the house to change the BIOS) it starts to boot - and I then get an error message (which varies according to exactly where Windows is according to what I have said in the GRUB file). I have tried every combination I can think of, map and rootnoverify included. All that changes is which error message I get. Windows will determinedly not boot.
I understand that Windows needs to be in the first partition of the master HDD - but it is. GRUB (as opposed to grub>) thinks that that is where LN3 is...
Help! :-(
Lisi
This is my Libranet GRUB chainloader stanza to boot Win XP:
title Windows on /dev/hda1
rootnoverify (hd0,0)
makeactive
chainloader +1
Edit your GRUB manually in the section below
### END DEBIAN AUTOMAGIC KERNELS LIST
Save and reboot.
if you still have a problem please post your /boot/grub/menu.lst
BTW Windows does not need to be on the first partition of the primary drive. GRUB can boot it from any other partition.
Today 23:48:09
Thanks for the reply, Leon.
I have just run a close approximation of your Windows stanza. I also tried to reinstate timeout - grub-update has started rewriting the stanzas in the AUTOMAGIC bit of GRUB in very odd ways - things appear and disappear. In addition to not being able to change the location details of LN3, I now can't add timeout back in - grub-update just deletes it again.
This version of GRUB (based on yours) didnt even try to boot. Some of the other methods started booting and then hung with an error message.
I am beginning to think that the only sane thing to do is to find a method of reinstating my husband's emails (he is using Firefox where I use KMail and my one attempt so far failed) and then reinstall LN3 with Windows in situ. Hopefully LN3 will then find it - and add it to the boot loader.
I'll just have to pray that that will work and that it won't immediately overwrite Windows.
Hereunder the results of using grub> and tab (including my mistakes - it's after midnight here), followed by the current version of menu.lst. I reiterate that none of teh changes in the commented out section at the beginning were mine - they were all perpetrated by grub-update. And note that the two do not agree on where to find LN3.
TIA
Lisi
------------------------------------------------------------
grub> r
Possible commands are: read reboot root rootnoverify
grub> root (hd
Possible disks are: hd0 hd1
grub> root (hd1,
Possible partitions are:
Partition num: 0, Filesystem type is reiserfs, partition type 0x93
Partition num: 1, Filesystem type unknown, partition type 0x82
grub> root (hd1,1)
Filesystem type unknown, partition type 0x82
grub> root (hd1,0)
Filesystem type is reiserfs, partition type 0x93
grub> root (hd1,
Possible partitions are:
Partition num: 0, Filesystem type is reiserfs, partition type 0x93
Partition num: 1, Filesystem type unknown, partition type 0x82
grub> root (hd1,1)
Filesystem type unknown, partition type 0x82
grub> root (hd1,0)
Filesystem type is reiserfs, partition type 0x93
grub> root (hd
Possible disks are: hd0 hd1
grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type is fat, partition type 0xc
Partition num: 4, Filesystem type unknown, partition type 0xe
grub> root (hd0,0)
Filesystem type is fat, partition type 0xc
-------------------------------------------------------------------------------------
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default optons below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hdb1 ro
## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single user mode) single
# altoptions=(single user mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## ## End Default Options ##
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Libranet GNU/Linux, kernel 2.6.11-ln.std
root (hd0,0)
kernel /boot/vmlinuz-2.6.11-ln.std root=/dev/hdb1 ro
initrd /boot/initrd.img
savedefault
boot
title Libranet GNU/Linux, kernel 2.6.11-ln.std (single user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.11-ln.std root=/dev/hdb1 ro single
initrd /boot/initrd.img
savedefault
boot
title Memory tester memtest86
root (hd0,0)
kernel /boot/memtest86.bin
savedefault
boot
title Memory tester memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
title Auftakt
rootnoverify (hd0,0)
# savedefault
# unhide (hd1,0)
# hide (hd0,0)
# rootnoverify (hd1,0)
# hide (hd0,0)
# map (hd1,1)(hd0,0)
# map (hd0,0)(hd1,1)
# rootnoverify (hd0,0)
makeactive
chainloader +1
boot
Copy and save this into your /boot/GRUB/menu.lst. Do NOT run grub-update; just edit menu.lst.
If your win XP is installed on the first partition of your master drive, its GRUB identification is hd0,0: 0=1 in Grubese
title Auftakt
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd0,0)
makeactive
chainloader +1
I believe lisa said in the first post that Linux was on the first slave (hd1) and that Windows was installed on the first master (hd0 - where it likes to be) therefore there should be no need to swap drive identities. If ~/grub/menu.list as not been editied, then the dual booting example there should be an adequate guid.
jorj
Sorry, not lisa but lisi.
jorj
Sorry, not lisa but lisi. Also, I meant if ~/grub/menu.list~ has not been edited, it has a dual boot example with Windows on hd0,0 and Linux on hd0,1. In lisi's case Linux is on hd1,0 assuming no separate boot partition.
jorj
uteck
02-19-2007, 10:03 AM
It looks like the XP line is pointing to the Linux drive (hd0,0). Change, rootnoverify (hd0,0) to rootnoverify (hd1,0)
Lisi mentioned something about changing the BIOS boot sequence. The question is: in which MBR is GRUB? Let us call "case A" if GRUB is in the slave MBR, and the BIOS is set to seek a bootable partition in the slave.
Case B is GRUB is in the MBR of the master, and the BIOS is set to seek a bootable partition in the master, i.e. the normal or default setting.
Without knowing which case applies, all I can suggest is adding menu.lst stanzas as I recommend as well as "jorj's" and try both.
I repeat: do NOT run any GRUB command after editing /boot/grub.menu.lst.
castaway
02-21-2007, 03:22 AM
I see several possible problems:
1) Although your bios may let you "move" your disks around so that the slave is treated as if it were the master, in theory allowing its master boot record (MBR) to provide the booting directions for the system, I have found that many of the smarter operating systems (and programs) are able to see around this ploy. They still regard the "true" MBR of the "true master hard drive" as the operating MBR. So effectively the slave, supposedly acting as master is, in the program's eyes, still the slave. They are reversed only in the eyes of the system bios!
2) I have found grub to be unreliable. Old versions had to be hand tweeked -- and as a newbie I was constantly frustrated by it. The latest version -- at least the one available 3 months ago in sid --cannot handle high partition numbers, neither will it work reliably with SATA disks.
I suggest you dump the whole grub mess and accomplish the task in an easier manner.
1) Get yourself a GOOD boot manager that installs on the MBR. Google for an old version of OSL2000, version 8.76 or earlier. (The newest version is encumbered by the inability to work with SATA, and its new serial number protection features require it to be installed in WinXP. It is no longer installed directly from DOS!)
2) Set your bios to boot in the standard manner. The master drive, the one jumpered as master (with WinXP in the first primary partition) will be the Master drive. Your slave drive, which is jumpered as slave (with Libranet) will be the slave (NONBOOTING) drive.
3) Remove all drives.
4) Install the drive with WinXP, jumpered as a Master, into the computer. Cable it as master.
5) Extract OSL2000 in WinXP and installed it. It will be extracted into a file on C: (which should be the drive that WinXP) is installed on. However, the program itself will be installed onto the MBR. The MBR portion of OSL2000 is self suffient and does NOT use any of the files on the hard drive. (For future use, open the C: folder for OSL2000 and copy the files "dosinst.exe", "setup.dat" and "debug.log" to a bootable DOS floppy. From then on you will use only the floppy to install the program to your MASTER hard drive whenever you need it.)
6) Remove the master drive with WinXP and install the slave drive with Libranet 3.0 (It, of course, will need to be rejumpered as Master. DO NOT TOUCH THE SETUP BIOS!!!)
7) Start Libranet. I assume it is booting from grub files which partially reside on the MBR. Once in Libranet 3.0, run "grub-install /dev/hda1", assuming Libranet is in the first primary partition on the disk. (Adjust the "dev" notation to whatever "fdisk" says is the location of your Libranet partition.) This will install the grub boot files onto the root partition; Libranet will then no longer boot via the MBR of its hard drive. (The version of grub in Libranet 2.8 didn't have grub-install.)
8) Remove the drive with Libranet, and change the drive's jumper to slave. Now reinstall the hard drive with WinXP (which should be jumpered as master). Cable it as master. Install the Libranet drive. Cable it as slave.
9) Reboot. When the OSL2000 menu comes up, hit <F3>. Using the <Down arrow> and <Space> select "Show all partitions" with the space bar, and choose the <Reset> button with the <Enter> key. Your boot menu should now show Libranet as a possible boot choice. Select it with <Down arrow>, and hit <Enter>.
P.S.: If you can't find an old copy of OSL2000, let me know.
Re:
"7) Start Libranet. I assume it is booting from grub files which partially reside on the MBR. Once in Libranet 3.0, run "grub-install /dev/hda1", assuming Libranet is in the first primary partition on the disk. (Adjust the "dev" notation to whatever "fdisk" says is the location of your Libranet partition.) This will install the grub boot files onto the root partition; Libranet will then no longer boot via the MBR of its hard drive. (The version of grub in Libranet 2.8 didn't have grub-install.)"
FYI Libranet installs a copy of GRUB in the superblock, i.e. the beginning of whatever partition contains Libranet, by default.
/sbin/grub-install exists in Lib 2.8
If you have enough room on your primary drive, i.e. where you have installed Lib 3.0, you can install Win XP. GRUB will chainload XP installed in other than the first primary partition.
I have used GRUB since Caldera Open Linux 2.4. It works just fine for me, but as was pointed out it cannot always overcome system BIOS quirks even with "hide" and "map" options.
[snip]
I suggest you dump the whole grub mess and accomplish the task in an easier manner.
1) Get yourself a GOOD boot manager that installs on the MBR. Google for an old version of OSL2000, version 8.76 or earlier. (The newest version is encumbered by the inability to work with SATA, and its new serial number protection features require it to be installed in WinXP. It is no longer installed directly from DOS!)
2) Set your bios to boot in the standard manner. The master drive, the one jumpered as master (with WinXP in the first primary partition) will be the Master drive. Your slave drive, which is jumpered as slave (with Libranet) will be the slave (NONBOOTING) drive.
3) Remove all drives.
4) Install the drive with WinXP, jumpered as a Master, into the computer. Cable it as master.
5) Extract OSL2000 in WinXP and installed it. It will be extracted into a file on C: (which should be the drive that WinXP) is installed on. However, the program itself will be installed onto the MBR. The MBR portion of OSL2000 is self suffient and does NOT use any of the files on the hard drive. (For future use, open the C: folder for OSL2000 and copy the files "dosinst.exe", "setup.dat" and "debug.log" to a bootable DOS floppy. From then on you will use only the floppy to install the program to your MASTER hard drive whenever you need it.)
6) Remove the master drive with WinXP and install the slave drive with Libranet 3.0 (It, of course, will need to be rejumpered as Master. DO NOT TOUCH THE SETUP BIOS!!!)
7) Start Libranet. I assume it is booting from grub files which partially reside on the MBR. Once in Libranet 3.0, run "grub-install /dev/hda1", assuming Libranet is in the first primary partition on the disk. (Adjust the "dev" notation to whatever "fdisk" says is the location of your Libranet partition.) This will install the grub boot files onto the root partition; Libranet will then no longer boot via the MBR of its hard drive. (The version of grub in Libranet 2.8 didn't have grub-install.)
8) Remove the drive with Libranet, and change the drive's jumper to slave. Now reinstall the hard drive with WinXP (which should be jumpered as master). Cable it as master. Install the Libranet drive. Cable it as slave.
9) Reboot. When the OSL2000 menu comes up, hit <F3>. Using the <Down arrow> and <Space> select "Show all partitions" with the space bar, and choose the <Reset> button with the <Enter> key. Your boot menu should now show Libranet as a possible boot choice. Select it with <Down arrow>, and hit <Enter>.
P.S.: If you can't find an old copy of OSL2000, let me know.
Thanks for that, Leon. I'm very grateful for all the help and advice I have received, but the other bits haven't worked (sorry guys :-( ).
Castaway, your explanation seems to me to fit the observable facts pretty well.
I found OSL2000 8.46 and have downloaded it onto my (LN3) machine. I assume that I can copy the zipped file to a floppy or burn it to a CD? And then copy to the Windows HDD (on my husband's machine) and extract from Windows XP? I am less than totally enthusiastic at the idea of connecting the Windows drive to the net.
Or should I extract here (i.e. on this machine) and copy the files to a floppy and create a boot disk?
I am running out of time for sucking and seeing - my poor husband is already very behind with the work for his University course. Or I would just suck it and see!
Lisi
Sorry, not lisa but lisi.
jorj
Thanks for both noticing and caring. :-) People usually do neither.
Lisi (pronounced like the word easy, but with an L at the beginning.)
Well, after being married for 57 years and raising three daughters, I know young ladies want you to get their name correctly.
jorj
uteck
02-22-2007, 12:50 PM
I just set up a new system that is having the same problem. 2 drives XP and Kubuntu. Kubuntu did not add the XP partition, and manually adding it I only get "Starting up ..." which it should not show.
This stanza is from my home machine wich works # This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdc1
title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
chainloader +1
and I tried title Windows XP
rootnoverify [hd1,0)
makeactive
chainloader +1
I think grub installed on on the wrong drive since I get the same mesage when I boot linux. I'll try using the ms disk to fix the mbr on the second drive and see if that works.
bluesdog
02-22-2007, 04:34 PM
I've set up a few two-disk Linux/XP dual-booters, always with Linux on the master and xp on the slave
I manually edit /boot/grub/menu.lst, adding the following stanza either before or after the automagic section:
title micro$oft windows xp
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
castaway
02-23-2007, 01:50 AM
Lisi --
If you downloaded OSL2000 in Libranet, copy OSL to a floppy. Then copy OSL to WinXP, extract there, and install it there. I have had no trouble accessing Libranet from on a slave drive while using OSL2000.
I prefer to use a stand alone boot manager unassociated with an operating system. I feel I have more control. I do not let Linux or Windows control the boot menu.
And although Leon was able to use grub-install with Libranet 2.8, it never worked for me -- I had to go through the old "dd" incantation to install grub on my Libranet root partition.
uteck
02-26-2007, 01:04 PM
Well, I think I figuredout my problem. The drive with XP died after I installed it. Scavenged parts, go figure.
uteck
02-26-2007, 03:59 PM
Well, I think I figuredout my problem. The drive with XP died after I installed it. Scavenged parts, go figure.
After further testing, the drive is fine. It seems to have been something with the Master/Slave setup. Switching both disks to Cable Select seems to have fixed it, and now things boot normaly. I think this is the first time I have had CS work. Not sure way XP did not like booting from the slave. Even removing the master did not get it to boot.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.