LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   26 months trying to get triple boot to work. Linux remains the holdout (https://www.linuxquestions.org/questions/linux-newbie-8/26-months-trying-to-get-triple-boot-to-work-linux-remains-the-holdout-875266/)

Engineeringtech 04-15-2011 09:00 PM

26 months trying to get triple boot to work. Linux remains the holdout
 
I need skilled installation help. I tried to find answers at the Ubuntu and Fedora forums, but either they couldn't figure it out, or I am too inexperienced to understand.

It's embarrassing to admit I have been trying to add Linux to my formerly new, (and still unused) desktop for TWENTY SIX MONTHS. I built the machine in March of '09 to learn CAD and get a better job. I wanted DOS 6.22 to run some old engineering apps I still use in my work, Windows XP for my CAD software, and Linux for virus safe browsing and email.

I built the box in two days. All new hardware, including a SCSI raid card and SCSI drives. (RAID for data security). I setup the array, partitioned it for DOS, Windows, and Linux, and was able to get DOS and XP to both boot with NT Loader. I installed Fedora, but it didn't detect my other installations, and wouldn't boot. My friend (who worked in IT) helped me get it booting, with Grub" chainloaded off NTLoader. The OS's worked fine, but I fought with hardware, driver and application issues for the next FOURTEEN months, all the while unable to get any useful work out of the $2000 computer. I never even got the CAD apps installed.

Then the SCSI RAID card failed. I didn't have the money for another,SCSI card so I ditched the expensive SCSI drives, bought three SATA drives, and spent the next SEVEN months trying unsuccessfully to get the "Fake RAID" working. I even got the motherboard replaced, and repeated the whole process. But that didn't heip.

At this point, my experienced IT friend told me I just needed another hardware RAID card - a SATA RAID card. I sunk another $160 in the RAID card, and spent another 2 unsuccessful months trying to get it to work.

Fast growing weary of trying to get the RAID working with the triple boot, I decided to just implement the triple boot on a single SATA drive. I followed the same procedure for partitioning and installation,which I had used on the SCSI array. But no matter what distribution of Linux I tried (Fedora or Ubuntu), it didn't detect my other OS's. I tried to chainload Linux off NTLoader, but it appears that GRUB is not being properly installed, no matter what I do. Neither Grub Legacy, or Grub 2 are putting a "bootsector" on the Linux install partition, (or in the MBR when I've directed it to install there.) I tried to get it booting with "SuperGrub" and that did not work either.

All told, I reformatted and reinstalled Ubuntu or Fedora a total of 10 times, using either the Live CD's and Alternate Install CD's. I Never got any error messages from the installers. The Ubuntu and Fedora user groups tried to help, but I never got a resolution, and I overstayed my welcome.

So I just have some simple questions for now:

Does the Ubuntu or Fedora installer require that Grub go on a primary partition? (My Linux partition is a logical partition.)

Does the Linux partition have to be marked "bootable" for Grub to install properly?

Why doesn't the installer detect my other OS's?

Could there be some other problem I am overlooking? Like the size of the hard drive (500 GB)? Or the order of the partitions?

Could this be a compatibility issue with my Gigabyte GA-EP45-UD3P motherboard?

Thanks for listening.

peterson.julia 04-15-2011 10:13 PM

Does the Ubuntu or Fedora installer require that Grub go on a primary partition? (My Linux partition is a logical partition.)

Don't know. It shouldnt be a issue.

Does the Linux partition have to be marked "bootable" for Grub to install properly?
YES

Why doesn't the installer detect my other OS's?
It wont tell you that it has detected the other OS's it will automatically find it.

Could there be some other problem I am overlooking? Like the size of the hard drive (500 GB)? Or the order of the partitions?
Take a look in your bios setup maybe something over there...

Could this be a compatibility issue with my Gigabyte GA-EP45-UD3P motherboard?
I don't think so. Ubuntu runs on everything

Are you able to run the OS/Ubuntu just from CD? If yes then I would try disconnecting all HDD leave one blank where you can play with settings and try to install it. If it wont work then disconnect from PC other PCI cards/modems/etc. and run the install....

Larry Webb 04-15-2011 10:16 PM

No linux or grub do not require a primary partition.

No grub does not need to be marked bootable

I can not answer that, especially after 2 m/bs and a couple of different hds.

Take your ubuntu and as live cd in terminal run sudo fdisk -l (small -L) and post results.

I will ask does your m/b bios detect your sata drives?

EDDY1 04-15-2011 11:08 PM

Quote:

Why doesn't the installer detect my other OS's?
It wont tell you that it has detected the other OS's it will automatically find it.
Usually it does, but I've had it not detect other OS

sudo update-grub
The following solution worked for me in debian squeeze & Ubuntu 10.10
If update-grub doesn't work
Boot into either OS, Debian or Ubuntu
mount root partition for other OS
then run either
update-grub
or
sudo update-grub
it should detect them.

stress_junkie 04-15-2011 11:11 PM

IMO you have made things unnecessarily hard on yourself by using fake RAID. That complicates installation and kernel updates.

You should have set your sights lower in order to reduce the number of new issues that you have to learn in order to make a Linux installation work.

If you get rid of the fake RAID you should be able to reinstall your MS-DOS and MS Windows in one day and install Linux in a second day. It really isn't that difficult on a simple hardware platform.

Phorize 04-15-2011 11:23 PM

Quote:

Originally Posted by Engineeringtech (Post 4325998)
So I just have some simple questions for now:

Does the Ubuntu or Fedora installer require that Grub go on a primary partition? (My Linux partition is a logical partition.)

Does the Linux partition have to be marked "bootable" for Grub to install properly?


Have you read the grub manual? It answers most of what you need to know including on where grub installs to.

http://www.gnu.org/software/grub/man...S-installation

I recommend using a the most simple partition set up you think that you can use and start there. You might also want to look at lilo; it's as old as the hills but is dead simple and works.

sunnydrake 04-16-2011 02:07 AM

Huh SCSI? old days:)
First proper ways to handle bootloaders chain is to install windows then tweak bootloader for dos and then install linux grub. Becuse linux grub can boot NT loader nativly.
FakeRaid is ok(i have same config) as long as dmraid support your chipset(intel software raid supported). i need to mentions that usual installs without dmraid preloaded will not detect windows partitions so you need to boot livecd and configure dmraid before you run install.

your questions:
1)dosen't matter, grub not need separate partition, it will auto rewrite mbr and if no special partition created can boot kernel from root partition(but still some restrictions apply).
2) bios will seek first "active partiton" on specifyed disk or raid array to boot this apply to all bootloaders.
3) read at top.
4) ... not much tech info to detect possible problems.
5) i don't think so.
And last all your problems lie in one thing you don't have experiance or people with it(who willing to help) near you. You spend your money not efficient but gain good practical experiance(if you finish what you stated).

arizonagroovejet 04-16-2011 11:25 AM

26 months? Seriously? Bloody hell...

I don't know about all this SCIS RAID stuff but as for triple boot, well that just sounds overly complicated. Could you not just dual boot Windows XP and Linux then run DOS 6.2 in a virtual machine using VirtualBox? VirtualBox is even available for Windows and Linux so you could even have the same DOS virtual machine available from within Linux and Windows.

Dual booting XP and Linux is easy. The trick is to install Windows XP first then install Linux. The Linux installer will see the XP install and add a GRUB option for it. (If you install XP second it will just wipe GRUB out and leave the machine only booting XP.)

Engineeringtech 04-17-2011 06:50 AM

Thanks. Please give me time to digest this...
 
Thanks for all your replies. Been offline for a couple days doing some repairs to THIS computer (not the target of my posting). Give me a couple days to digest your responses.

JC

Engineeringtech 04-17-2011 11:59 PM

1 Attachment(s)
Ok, thanks again. I've made a quick read of these replies.. The SCSI and Fake RAID are both gone. Only a single drive now. (The guys at the Ubuntu forum instructed me on the removal of the "RAID metadata" too.) The DOS and Windows XP dual boots just fine from NTLoader. I really don't want to start over. I just want to add Linux.

I have a "results.txt" file generated by a script they also gave me. Can anyone here interpret it, and find out what happened to the Grub installation?

micok 04-18-2011 12:09 AM

Triple boot is not too difficult, but is it really necessary?
 
I think you'll find the answers in the GNU GRUB Manual 1.99~rc1.(from www.GNU.ORG) I had a triple boot desktop for a couple of years. Linux, Windows 2000 and a stripped down Windows 98 i.e. just the command prompt. Linux for all internet access, Win 2K for Nero 6 and couple of old favorites and W98 command prompt for QB 4.5. Win 2K on the 1st partition of the first drive and Linux on the 2nd partition of the 1st drive, and Win98 command prompt on the only partition on the 2nd drive. Remember Windows/DOS need special consideration because they don't like being in other than the first partition on a drive and if there is more than one version hiding or swapping partitions will be necessary. This configuration worked but did occasionally swap the drive order in the BIOS setup.
To install this extravaganza I reordered drives 1 and 2 in the BIOS setup, installed Win98 command prompt, reset the drive order, installed Win 2K then Linux. Grub did not see the OS on the 2nd disk but a manual edit of /boot/grub/grub.conf fixed the problem.
I don't know what DOS programs you need to run but what about DOSbox in Linux. Doom 2 and Quake 1 do OK in that environment. A complex boot configuration is likely to be problematic. Avoid it if you can.

micok

EDDY1 04-18-2011 12:32 AM

You can use Ubuntu 10.10 cd to mount ubuntu & reinstall grub ubuntu should see the other os.
https://help.ubuntu.com/community/Gr...ing%20GRUB%202

Engineeringtech 04-19-2011 12:53 PM

Dosbox
 
I don't care to use DOSBox. Emulation has all sorts of issues with hardware and software. Nor do I want to destroy my DOS and Windows setup, on the off chance I will get Linux. My system dual boots DOS6.22 and XP just fine right now, using NTLoader. All I want to do is ADD Ubuntu to the mix. Everybody keeps telling me that's hard... Why?

The process I used to get the triple boot onto the SCSI RAID array wasn't difficult at all. All that's different now, is I have a single SATA drive instead of a SCSI RAID array. I've run the Ubuntu installer 10 times. Each time, it installed to my Linux partition without any error messages, but apparently failed to put a boot sector at the root of that partition. If the boot sector were there, I could chainload it off NTLoader, and get into linux just as I did with the SCSI array.

As for reinstalling GRUB, I have done that multiple times. It doesn't matter if I direct it to the MBR or the Linux partition. Linux doesn't boot, and apparently it's because GRUB is not writing a bootsector. Actually, I'm not certain if the GRUB reinstall process is supposed to place a new bootsector. To do this, it would have to locate the Kernel, and write boot code pointing to the kernel. Is it supposed to do that?

bonixavier 04-19-2011 01:23 PM

On the installation, choose manual partitioning and choose Ubuntu's partition as the destination of the boot-loader. At the bottom of the options. Then you can chainload.
http://karuppuswamy.com/wordpress/wp...creenshot5.png

EDDY1 04-19-2011 01:49 PM

Post output of
Quote:

fdisk -l

Engineeringtech 04-19-2011 04:35 PM

Thanks for the replies.

"choose manual partitioning and choose Ubuntu's partition as the destination of the boot-loader. At the bottom of the options. Then you can chainload."

That is what I have done. Doesn't work. No bootsector gets placed in the Ubuntu partition.

"Post output of fdisk -l"

I'll do this when I get back to the machine. Please look at the results.txt file I attached above. I believe it contains the same information.

EDDY1 04-19-2011 05:04 PM

Quote:

I'll do this when I get back to the machine. Please look at the results.txt file I attached above. I believe it contains the same information.
I just looked at boot info script wins didn't understand so had to switch computers.

I think that someone else should comment on this 1
The reason being that I'm a newbie myself I could be wrong, but grub has to be placed within 1st 128gig.
You would need resize or reposition ubuntu, which can be done.
But like I said wait for comfirmation from the more experienced help here.

EDDY1 04-19-2011 05:22 PM

http://ircanswers.com/ubuntu1/359285...xplained-about

sunnydrake 04-19-2011 07:47 PM

Partition Boot Start End Size Id System

/dev/sda1 * 63 1,026,143 1,026,081 6 FAT16
/dev/sda2 1,026,205 976,770,143 975,743,939 f W95 Ext d (LBA)
/dev/sda5 1,026,207 205,837,631 204,811,425 b W95 FAT32
/dev/sda6 205,837,695 222,223,679 16,385,985 b W95 FAT32
/dev/sda7 222,223,743 422,114,111 199,890,369 83 Linux
/dev/sda8 422,114,175 431,246,591 9,132,417 82 Linux swap / Solaris
/dev/sda9 431,246,655 956,301,695 525,055,041 7 HPFS/NTFS
/dev/sda10 956,301,759 976,770,143 20,468,385 af HFS

first thing before messing around is to make backups
to backup your mbr (save it on your removable device!)
sudo dd if=/dev/sda of=~/mbr.img bs=512 count=63
to restore
sudo dd of=/dev/sda if=(path to mbr.img) bs=512 count=63

then as EDDY said boot livecd with ubuntu and install of grub (not need to install whole system again!) sudo grub-install /dev/sda - if all ok tune configuration in grub.conf, if fails post output of grub-install etc..

you can always run gparted, shrink from start /dev/sda2 create new linux partition there /boot and out kernel images on it (copy /boot from sda7) then handtune grub)

Engineeringtech 04-20-2011 11:54 PM

Output of "fdisk -l"
 
1 Attachment(s)
Ok, I booted from the live CD, and ran "fdisk -l" from a terminal window. Attached is a screen capture of the output. Nothing different here from the "results.txt" output I previoulsy posted on this page. Still hoping someone can tell me why GRUB won't install properly. (I've formatted and reformatted. Tried both Ubuntu and Fedora. Allowed GRUB to install to the MBR, and also tried to put it in the Linux install partition. Heck, I even tried to put Grub on a floppy. None of these things got me a linux bootsector. I also used a Super Grub disk to see if it could boot my machine. That didn't work either. I can't see anything unusual about my drive partitioning.

Sunnydrake, are you saying I CANNOT put Grub on the Linux install partition? Why not? Is EDDY1 right about GRUB having to be in the first 128 GB? I realize the preferred installation of Grub is to the MBR, but I've tried that many times and all it does is screw up my DOS and Windows boot. For that reason, I'd rather let NTLoader chainload Linux.

JC

EDDY1 04-21-2011 02:15 AM

Quote:

Sunnydrake, are you saying I CANNOT put Grub on the Linux install partition? Why not? Is EDDY1 right about GRUB having to be in the first 128 GB? I realize the preferred installation of Grub is to the MBR, but I've tried that many times and all it does is screw up my DOS and Windows boot. For that reason, I'd rather let NTLoader chainload Linux.
For me the easiest solution would be to use gparted live
remove existing linux install on sda7 & sda8
move sda6 to the right, then sda5 to the right.
Now you have 2 options
1. Install linux to empty space within logial partition sda2
or
2. Resize logical sda2 from the left closing empty space within thereby creating empty space for a new primary to install ubuntu to which will be within 128G.

EDDY1 04-21-2011 02:19 AM

http://www.bleepingcomputer.com/tuto...torial152.html

yancek 04-21-2011 07:27 PM

You indicate that you currently boot with the xp bootloader and can boot xp and DOS. When you boot, do you get an entry for either Fedora (do you still have Fedora?) or Ubuntu on your windows menu? Do you just see the options for xp and DOS?

If you look at your bootinfo script, it does show windows in the mbr and the proper xp boot files in sda1. It also shows all the necessary boot files for Ubuntu Grub in sda7. It also shows the kernel and initrd files there.

In your initial post, you said that Fedora didn't detect other installations and would not boot. So you installed Fedora with Grub to the mbr and got what?? no boot menu, black screen. I guess it's irrelevant as you don't seem to have Fedora. Fedora is almost always good at detecting a windows install but rarely Linux so this is surprising.

When you installed Ubuntu with Grub in the mbr, what happened? Got a boot menu? black screen? blinking cursor?

If when you boot from xp, you do not get an entry for Ubuntu, you might take a look at the bootsect.lnx file and compare it to whatever was in the instructions to create that file to boot Ubuntu. Did you or your friend create this file while Fedora was installed or Ubuntu? Might make a difference if it was Fedora and is now Ubuntu, different Grub bootloader but don't know that is the problem? If you do see an Ubuntu entry, that's a different problem.

If you don't see an Ubuntu entry when booting from xp, you could take a look at the link below, The first part of it is in reference to the Lilo bootloader. Ignore that part and start reading about half way down the page in the paragraph with the dd commands in bold. Read through it a few times. If you don't think you understand it, stop and don't do anything. If you make a mistake with the dd command, you can really mess things up.

http://jaeger.morpheus.net/linux/ntldr.php

I had a link to another site that I though was better on booting Linux from xp but, can't seem to find it?

Found it. The site below seems a little more clear to me. Again, read it all before starting anything and if you don't feel you understand, stop! You will need to make some simple modifications, change the partition name in the command to your Ubuntu for one.

http://www.linux.com/archive/feature/113945
If you see an Ubuntu entry on your xp boot menu, what happens exactly when you select it.

Engineeringtech 04-22-2011 10:10 AM

Quote:

Originally Posted by EDDY1 (Post 4331282)
...... thereby creating empty space for a new primary to install ubuntu to which will be within 128G.

So you're saying Ubuntu HAS to be installed within the first 128GB? Or the grub boot loader / bootsector has to be within the first 128GB?

I don't know about re-ordering my partitions... Won't that screw up my DOS and Windows booting from NTLoader? If I had a high confidence Grub would pick up the OS's and all me to boot them, I would do that. However, I haven't had any luck with Ubuntu finding the other OS's. Very important to me that I don't damage DOS and Windows to get Linux.

Engineeringtech 04-22-2011 11:01 AM

Quote:

Originally Posted by yancek (Post 4332121)
You indicate that you currently boot with the xp bootloader and can boot xp and DOS. When you boot, do you get an entry for either Fedora (do you still have Fedora?) or Ubuntu on your windows menu? Do you just see the options for xp and DOS?

If you look at your bootinfo script, it does show windows in the mbr and the proper xp boot files in sda1. It also shows all the necessary boot files for Ubuntu Grub in sda7. It also shows the kernel and initrd files there.

Since I have had no luck with Grub booting my system, I've been trying to chainload Linux from Windows NTloader. The process, widely described on the internet, involves DD'ing the Grub bootcode (first 512 bytes of the install partition) to a file named "bootsect.lnx" and referencing it in Window's "boot.ini". But my DD output is EMPTY. My conclusion is that Grub is not placing bootcode in the root of SDA7. That's what I'm trying to correct.

Quote:

Originally Posted by yancek (Post 4332121)
...you said that Fedora didn't detect other installations and would not boot. So you installed Fedora with Grub to the mbr and got what?? no boot menu, black screen. I guess it's irrelevant as you don't seem to have Fedora. Fedora is almost always good at detecting a windows install...

Please understand I have reformatted SDA7 and reinstalled Linux many (10) times. I've tried Ubuntu 9.04, 10.04, 10.10 and Fedora 14. None of these installations, whether from a "live CD", or Ubuntu's "Alternate install CD", generated any error messages OR resulted in a bootable Linux installation. In each case, the installer TOLD me it had not detected any other OS's, and gave me the choice to place Grub to the MBR or another location. When I allowed the installer (whether Ubuntu or Fedora) to place GRUB in the MBR, the ONLY result was I could no longer boot DOS, or Windows. I did not get a Linux boot.

I don't like looking at a black screen with a flashing "_" cursor, so after I repaired the MBR the 2nd or 3rd time, I decided I wouldn't put Grub2 (or Grub Legacy) in the MBR again, unless I knew for certain it had detected my other OS's. So I've been trying to install GRUB to SDA7 (or a floppy), and chainload from NTLOADER. A lot of people tell me I'm making a mistake in using NTLOADER, but at least I have DOS and Windows working. If Grub is not doing the job for me, I want to fix what's wrong with that, not screw up DOS and Windows. Also, I don't want to do any more reformats and re-installs if I can avoid it. This was a new drive when I got started, and I'm afraid I will wear it out!

The last major work I did was to reformat SDA7, and reinstall Ubuntu 10.10. So yes, Fedora is gone.

JC

EDDY1 04-22-2011 12:52 PM

Quote:

I don't know about re-ordering my partitions... Won't that screw up my DOS and Windows booting from NTLoader? If I had a high confidence Grub would pick up the OS's and all me to boot them, I would do that. However, I haven't had any luck with Ubuntu finding the other OS's. Very important to me that I don't damage DOS and Windows to get Linux.
Look at this it i quite simple.
http://www.bleepingcomputer.com/tuto...52.html#livecd

yancek 04-22-2011 01:03 PM

Please understand! Nowhere in my last post do I suggest or recommend you use Grub! Both links I posted were on booting Linux from xp.

The questions I asked about Grub might give someone information which could help to resolve the situation. Since you didn't bother to answer them, not much can be done.

You didn't respond to what specifically happened when you tried to install Grub to the mbr, whether you got a menu or whatever after any of the installs. You also didn't bother to indicate what you get when you boot xp or DOS, do you see any entry for Ubuntu?

Additionally, if you run the dd commmand referenced in the links above from your Ubuntu CD and open the bootsect.lnx file and it is empty, there isn't much point in copying it to sda1 where your windows boot files are. Have no idea why dd wouldn't copy it.

sunnydrake 04-22-2011 02:31 PM

ahhh okay going a little deeper.. scarth my head and put some info i have (it may be not 100% correct)
MBR
(some systems have different methods(not MBR))
MBR or master boot record is a place from first sector of hdd to first partition. It's size about 31kb+ and have list of partitions and their sizes inside(that's why you need to backup mbr!). GRUB installs (as any os loader) in this GAP not into partion.
Second part of grub "main"
But there is "main" part of grub that is bigger then 31kb it usually reside on separate logical partion or /(linux root). Filesystem does not matter as grub lineread data directly(dunno maybe you can place it on FAT32 too, but it's better to keep on linux fs to avoid defragmentators).
Size limits.. grub uses BIOS calls to access second part, on older systems it can be 32Gb or 128GB, so second part must be placed within this limits.

I strongly suggest to place grub at top chain of os loaders, but as dirty example you can backup mbr(as i described),install grub there, grab it via dd, and restore old W$.. then use "magic" with NTloader to boot second part from /dev/sda2 FAT32 partiotion(find in google how: grub fat32). This is not solution but can do job for you. As time passes and you became more confident in grub use it.

Engineeringtech 04-22-2011 10:42 PM

Quote:

Originally Posted by yancek (Post 4332810)
.......The questions I asked about Grub might give someone information which could help to resolve the situation. Since you didn't bother to answer them, not much can be done.

You didn't respond to what specifically happened when you tried to install Grub to the mbr, whether you got a menu or whatever after any of the installs. You also didn't bother to indicate what you get when you boot xp or DOS, do you see any entry for Ubuntu?

Additionally, if you run the dd commmand referenced in the links above from your Ubuntu CD and open the bootsect.lnx file and it is empty, there isn't much point in copying it to sda1 where your windows boot files are. Have no idea why dd wouldn't copy it.

Sorry, but I DID tell everyone here what happened on the MULTIPLE occasions I allowed the installer to put Grub in the MBR. I wound up with a black boot screen with a "-" prompt. No Grub boot menu.

Now prior to installing Grub to the MBR, my dual boot worked just fine. Windows NTLDR displayed my boot.ini boot menu, and I could boot into DOS or Windows. I'm quite aware that an empty bootsect.lnx file will not boot Linux. Nor did I KNOWINGLY COPY an empty file to SDA1. I simply "DD" the first 512 bytes of the Linux install partition directly to an output file "bootsect.lnx" ON SDA1. (Not being familiar with Linux, I don't know how to examine those bytes before doing the transfer.)

I know next to nothing about Linux, but it's my belief that GRUB is not placing a bootsector on my machine. And that is what I've been asking for help with. But it seems to me the Linux community gets defensive and doesn't believe me whenever I say anything they perceive as negative about Grub. I'm not trying to insult your favorite OS, or Grub . I just want to find and correct the problem, and start using Linux. So if you have any useful advice to me about troubleshooting this problem, I'd appreciate it.

Engineeringtech 04-22-2011 10:58 PM

Quote:

Originally Posted by sunnydrake (Post 4332869)
..MBR or master boot record is a place from first sector of hdd to first partition. It's size about 31kb+ and have list of partitions and their sizes inside(that's why you need to backup mbr!). GRUB installs (as any os loader) in this GAP not into partion. Second part of grub "main" But there is "main" part of grub that is bigger then 31kb it usually reside on separate logical partion or /(linux root). Filesystem does not matter as grub lineread data directly(dunno maybe you can place it on FAT32 too, but it's better to keep on linux fs to avoid defragmentators).
Size limits.. grub uses BIOS calls to access second part, on older systems it can be 32Gb or 128GB, so second part must be placed within this limits.

I strongly suggest to place grub at top chain of os loaders, but as dirty example you can backup mbr(as i described),install grub there, grab it via dd, and restore old W$.. then use "magic" with NTloader to boot second part from /dev/sda2 FAT32 partiotion(find in google how: grub fat32). This is not solution but can do job for you. As time passes and you became more confident in grub use it.

Thanks for your answer Sunnydrake. I already had a very general understanding of the MBR, and how Linux boots. But I appreciate your taking the time to explain. My motherboard was new in 2009. Can I assume the BIOS can access 128GB? Is there anything in the fdisk -l output I posted to indicate that the second part of Grub you describe is outside of the reach of the BIOS?

If I understand you correctly, you suggest I backup my MBR, install GRUB to the MBR, move it elsewhere with DD, and reinstall the MBR from the backup. As I explained previously, I have on at least three occasions allowed Grub to be placed in the MBR, but never even got a boot menu. So I don't know what this would do for me.

I'm still not hearing any ideas on why the Grub install process is not creating a bootsector, whether in the MBR or the Linux partition). The installer has also told me I have the option of installing Grub to a floppy. But on the one occasion I directed the installer to put Grub on a floppy (/dev/fd0), the drive never ran. There's got to be some reason why Grub is not installing properly. It seems useless to keep trying to put Grub in the MBR, if all it is doing is damaging my Windows and DOS boot.

EDDY1 04-22-2011 11:47 PM

@ENGINEERINGTECH there are many ways to accomplish your goal, you're being given good advice although they're all good solutions. I think that you should examine the different solutions & think of which would be easier for you to understand & carryout.
As to why grub is giving you a hard time it may just be that everything is in a Logical partition.
Keep in mind that you can have upto 4 primary partitions and you have only used 2.
If you create a space between sda1 & sda2 you can get a successful install & recovery all os'es
http://www.bleepingcomputer.com/tuto...52.html#livecd

Erik_FL 04-23-2011 12:19 AM

I have a few suggestions that should make installing grub easier. First, use the Legacy version of GRUB 0.97. The current GRUB 2 version is quite complicated. Second, create a GRUB boot floppy or CD-ROM to install GRUB.

GRUB has two different things that you "install". The files for GRUB can be placed in any partition, Primary or Logical. The boot sector for GRUB must be "installed" to the Master Boot Record or a Primary partition (not Logical). I recommend creating a Primary partition for the GRUB boot loader and Linux. Then install GRUB (files and boot sector) to the Primary partition.

Your problem with booting Linux is most likely because you are trying to install the GRUB boot sector into a Logical partition. Although you can install the GRUB files to a Logical partition, you then have to install the GRUB boot sector to the MBR. Boot loaders should only be installed into Primary partitions even though GRUB supports some exceptions to that rule.

To install GRUB you first need to make sure that you have the required files. You need a folder called "/boot/grub" containing the GRUB files.

Code:

ex2fs_stage1_5
fat_stage1_5
ffs_stage1_5
jfs_stage1_5
minix_stage1_5
reiserfs_stage1_5
stage1
stage2
stage2_eltorito
ufs2_stage1_5
vstafs_stage1_5
xfs_stage1_5

You only need the "stage1_5" files for the file-system where GRUB is located. It doesn't hurt to just copy all all the files. They are very small.

Create a "menu.lst" file in the "/boot/grub" folder with the correct information to load Linux.

Here's an example "menu.lst" loading Linux from the third Primary partition on the first hard disk.

Code:

default 0
timeout 5

title Linux
root (hd0,2)
kernel /boot/vmlinuz vga=791 root=/dev/sda3 ro vt.default_utf8=0
initrd /boot/initrd.gz

After all the files are present in "/boot/grub" then you can install GRUB (write the boot sector). First, boot GRUB from a floppy or CD and press the "C" key to get into command mode. Or, you can run GRUB from Linux by typing in "grub" at the command prompt in Linux.

Here are the two commands to install GRUB to the third Primary partition of the first hard disk. The GRUB boot block is also written to the third Primary partition.

root (hd0,2)
setup (hd0,2)


The first command "root" says that the GRUB files are located in the third partition. The second command "setup" says where to install the GRUB boot sector.

After installing GRUB you can create a boot sector file to use with "NTLDR" and "BOOT.INI".

dd if=/dev/sda3 of=/tmp/bootsect.lnx bs=512 count=1

You can replace "/tmp/bootsect.lnx" with the path and file name that you want to use for storing the boot sector file.

In your Windows XP "BOOT.INI" file you need to add a menu entry under the "[operating systems]" section.

Code:

[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP"
C:\BOOTSECT.LNX="Linux"

You must put the boot sector file (for example BOOTSECT.LNX") in the root directory containing the "NTLDR" and "BOOT.INI" files for Windows. You may need to copy the file somewhere else such as a thumb drive if Linux can't write to your NTFS partition.

You can download an ISO image of a Legacy GRUB boot CD from my web site here.

http://personalpages.bellsouth.net/e/r/erikfl/bootcd/

Download the file "bootcd.bin" and rename it to "bootcd.iso". Use CD burning software to write the ISO image to a CD. The CD will boot to a GRUB menu.

First, copy the required GRUB files. You can find them on the CD. Rename the files to lower-case if they do not end up being lower case! You can boot Linux from the CD if you have no other Linux. It is Slackware Linux.

To use the Linux on the CD, log in as root with no password.

Create some mount points and mount both your hard disk and the CD.

For example:

mkdir /mnt/hd
mkdir /mnt/cd
mount /dev/sda3 /mnt/hd
mount /dev/hdc /mnt/cd
mkdir /mnt/hd/boot/grub
cp /mnt/cd/*stage* /mnt/hd/boot/grub
cp /mnt/cd/*STAGE* /mnt/hd/boot/grub
umount /mnt/hd
umount /mnt/cd

You can shut off or restart the computer. Then, boot the CD again and press "C" to get a GRUB command prompt. Set up GRUB.

root (hd0,2)
setup (hd0,2)


GRUB command mode has a lot of useful commands. One that is really helpful is the "find" command.

find /boot/vmlinuz

That will display all the GRUB device names for partitions where the file "/boot/vmlinuz" was found. If you've only got one copy of Linux installed, that should print the device name to use in place of "(hd0,2)" when your Linux is not in the third partition of the first hard disk. You can also type in "root", "kernel" and "initrd" commands to load some Linux not listed in the "menu.lst" file. After typing the commands, use the "boot" command to actually boot the Linux that you loaded.

sunnydrake 04-23-2011 01:54 AM

that depends on where you actually installed grub itself(as many noted you not posted specific info).
Sorry it's hard to read fdisk output for me just run gparted on linuxlivecd to view actual partition sizes and see if linux partition(if you installed grub on it) out of 128Gb boundary.

Yes you can restore mbr via backup or from windows install disk in recovery console(winXP +) (as i remember fdisk /fixmbr) but restore backup is better as if you made custum tune to mbr it can be wiped to something default.

if you not booted to grub menu (and grub command line (it's more advanced then NTloader and reliable that's why it must be placed at top)) this probably means second stage load failed which have something to do with file placing. As i read GRUB2 manual i noted some info that grub can be installed to usb flash device this could be a good testing platform without harm for you.

If you saw - at disk load time maybe grub bootsector is installed in mbr but can't find second stage files.

Floppy drive never run? Maybe you not put it as boot option in bios? Usually newer bios support device boot option choice via F8 or F9(in some occasions F11) at boot time.

EDIT: if you use debian or ubuntu linux low-level disk operations require root(Admin) access just add "sudo " before command
EDIT2: usefull links installing grub2 on usb flash http://grub.enbug.org/Manual#head-14...5900940adc36ff

Engineeringtech 04-23-2011 11:33 AM

Erik FL,

Thank you. Very detailed answer! It's going to take me a while to digest all of this. I didn't know Grub couldn't be placed on a logical partition. When I had the SCSI array, I installed Ubuntu 9.04 to a logical partition and it worked fine (until the SCSI hardware failed for unrelated reasons).

JC

Engineeringtech 04-23-2011 11:59 AM

Quote:

Originally Posted by sunnydrake (Post 4333357)
.......

If you saw - at disk load time maybe grub bootsector is installed in mbr but can't find second stage files.

Floppy drive never run? Maybe you not put it as boot option in bios? Usually newer bios support device boot option choice via F8 or F9(in some occasions F11) at boot time.

Thanks for your reply Sunnydrake. If the bootsector WAS installed in the MBR, and couldn't find the second stage files, I have no idea how to fix that. Because of my repeated difficulties with Grub I'm going to give priority to finding an answer which doesn't require me to install Grub to the MBR, and depend on Grub booting all three OS's. I'm tired of resurrecting DOS and Windows, after failed Grub installs to the MBR. However, I'm going to mull over Erik's approach.

The floppy is designated as a boot option. Can you think of any other reason why directing Grub to /dev/fd0 would not work?

I'm pre-occupied with other things this weekend, and won't be able to get back to this till Monday or Tuesday.

Erik_FL 04-23-2011 04:09 PM

Quote:

Originally Posted by Engineeringtech (Post 4333704)
Because of my repeated difficulties with Grub I'm going to give priority to finding an answer which doesn't require me to install Grub to the MBR, and depend on Grub booting all three OS's.

To do that, you need to install GRUB's boot sector into a Primary partition. I recommend using your Linux partition. Then just copy the Linux partition's boot sector into the needed file for Windows and add that file to your "BOOT.INI" menu.

How you install GRUB's boot sector to the Linux partition depends on which version of GRUB you use. For GRUB 2 you have to edit a configuration file. For Legacy GRUB you use the "setup" command to specify where to write the boot sector. Ubuntu will install GRUB 2 by default, and you may have to choose advanced installation options in order to install to a partition boot sector rather than the MBR.

If you prefer to copy the GRUB boot sector to a file with Windows, you can use a program called "DSKPROBE" that comes with the Windows XP Service Pack 2 Support Tools. Open the disk device rather than a drive letter for read-only. Windows doesn't assign drive letters to Linux partitions. Read sector 0 (the MBR) and select the option to view the partition table. Select the Linux partition to display the information. Then click the button to "Go" to the first sector of the Linux partition. Set the display mode back to bytes. You should see "GRUB" somewhere in the ASCII text that is displayed. Use the option to save sectors to a file. It's easier if you save the file as the default extension and rename it after saving it. The file should be 512 bytes (one sector). The Linux "dd" command is a bit easier to use since it's just one command instead of multiple steps.

yancek 04-23-2011 04:40 PM

In your post (#25) you indicate that you believe your dd output for the bootsect.lnx file is empty and assume that Ubuntu Grub is not installing to the partition.

In post 29, you indicate that you don't know how to examine the file so that you don't actually know if the command is working.
I have Ubuntu 10.10 installed on a partition on my computer. Ubuntu Grub is on the partition, not the mbr. When I run the dd command suggested in the link I provided, this is the output I get:

Code:

[root@localhost user]# dd if=/dev/sda7 of=bootsect.lnx count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.724e-05 s, 13.7 MB/s

To view the file, I use the following which is not really readable but note the last part "GRUB GeomHardDiskRead Error". You should have something very similar which tells you the dd command was successful. If you don't see anything, something went wrong. Have no idea what it would be. If you see something similar to the output below, then you need to copy it to the root of your DOS partition, sda1. If that still doesn't work, you at least know that Grub is on the partition where it should be and the problem lies elsewhere.

[root@localhost user]# cat bootsect.lnx
�c��K������u���t|1�؎м ��d|<�t��R��'t��}��|�tH�A��U�ZRr=��U�u7��t21�D@�D��D�f�\|f�f�`|f�\
�����}��f�ƈd�@f�D��������@�����f�f�`|f �uNf�\|f1�f�4��1�f�t;}7���0����Z�ƻp��1۸�r��`���1��������a�&Z|��}���}�4��}�.�▒��GRUB GeomHard DiskRead Error
����<u��U�

markush 04-23-2011 05:08 PM

Hello together,

I think the problem is quite clear. Look at the post #20, in the attachment there is shown that the extended partition on the disk is not a Linux-extended partition (id = 5) but a win98 one (id = f)

You should install Windows XP and Dos on primary partitions and then you are free to create an extended paritition for as many Linux-system as you want.

I can't even understand that it should be possible to create an extended Win98 partition on a 500GB drive.

Also I don't believe that grub can act on an old Windows extended partition.

Do the Following:
partition 1: primary Windwos XP 100GB
partition 2: primary Dos 200MB
partition 3: primary Fat16 for filesharing between Dos and Windows 200MB
partition 4: extended Linux (id = 5) the rest of the disk.
And then create logical partitions for Linux

Markus

RockDoctor 04-23-2011 05:17 PM

My advice (which probably isn't worth much more than you're paying for it), is to go with the 2nd option offered by Eddy1 in post #21, with grub installed into the mbr.

markush 04-24-2011 03:30 AM

For further reading I suggest the following link: http://rute.2038bug.com/node22.html....00000000000000

One other point: it is not possible to install Windows on a Linux-extended partition!

Markus

EDDY1 04-24-2011 03:52 AM

@ markush
That book is always good reading.
Obviosly when I was reading it I really didn't get a real understanding of it.
Now I can actually grasp what it's saying.

sunnydrake 04-24-2011 04:01 AM

a little working demo:
/dev/sdd - my flash stick
i decided to make my flash drive as grub booted device.
first at least one partition must be marked as bootable
Quote:

sunnydrake@main:~$ sudo fdisk -l /dev/sdd

Disk /dev/sdd: 8074 MB, 8074035200 bytes
249 heads, 62 sectors/track, 1021 cylinders
Units = cylinders of 15438 * 512 = 7904256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00053385

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 1021 7881068 c W95 FAT32 (LBA)
now put grub on it
Quote:

sunnydrake@main:~$ sudo grub-install /dev/sdd --root-directory=/media/5EF9-F1D1/
Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Installing GRUB to /dev/sdd as (hd2)...
Unknown partition table signature
Installation finished. No error reported.
This is the contents of the device map /media/5EF9-F1D1//boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdd
okay virtually we have grub now it's time to check it.
sudo dd if=/dev/sdd bs=512 count=2
so if we see grub messages in garbage it's in mbr!
next stage how to try it without reboot :) qemu - like vmware or virtualpc for W$ users
sudo qemu -hda /dev/sdd
and here we got grub with command line boot but i'd like to find actual partitions to boot so ill add
my raid hdd to qemu
sudo qemu -hda /dev/sdd -hdb /dev/mapper/nvidia_behfbfea
we can use "uuid" to view drives (or you can use find /boot/grub/stage1 to find grub'ed partitions)
note find in grub takes exactly filename with full path and wihout wildcards :(
my flash is (hd0,0) my linux / is (hd1,0)
we set boot to: root (hd1,0)
add kernel&initrd options(on your system filenames can be different mine is ubuntu):
kernel /vmlinuz
initrd /initrd.img
and :
boot
of course this reqire a little more tweaks to be usable but it explains process

Engineeringtech 04-25-2011 09:04 AM

Erik_FL, Sunnydrake, and others.......

Thanks to everyone. I'm OK on the copying of blocks to files using the Linux command "DD". Have done it a dozen or more times, after each Linux installation or re-installation of Grub. But the file is always empty! At least when I view it with a text editor from DOS. That's why I don't think Grub is depositing a bootsector. (I don't know how to examine the bootsector without DD'ing the block into a file and examining it with a text editor.

I think it was Sunnydrake who first suggested to me that Linux could not put the Grub bootsector on an extended (logical) partition. Maybe that is the reason. (Some others, here and elsewhere have suggested otherwise however.) At any rate, I'm getting a lot of advice in the forum, and having a lot of trouble digesting it all. Plus I've been having health problems and working OT to boot, so I have had no time in front of the target machine to try anything. I don't even have a printer to print out this stuff. So please bear with me for a few days everyone.

Thanks again!

oops... forgot. I created all my partitions with a partitioning tool (Partition Commander 11 Pro). I don't know what the difference is between a Windows and Linux extended partition. All I know is DOS installed just fine to my primary partition, and Windows installed just fine to the first logical partition of my extended partition. This is all standard stuff for the installation of Microsoft OS's running from DOS to Windows 98.

yancek 04-25-2011 01:46 PM

Quote:

I don't know how to examine the bootsector without DD'ing the block into a file and examining it with a text editor.
See the bottom of post 37. The output doesn't mean anything to me except the Grub part at the end but, it does show there is output. Use the cat command from your Ubuntu CD instead of a DOS text editor. It's an option and I don't really know if it will make any difference but it isn't going to hurt anything.

Quote:

I think it was Sunnydrake who first suggested to me that Linux could not put the Grub bootsector on an extended (logical) partition.
Not sure what he meant by that? There should be no problem booting Linux from a logical partition with Grub in the mbr. I have several distributions with which I do that. I've also booted Linux on a logical partition using the windows 7 bootloader.

I'd suggest using the cat command from your Ubuntu CD to see if you get output, if you do and you copy it to the root (C:\) of your DOS partition and it still doesn't work, it's some other problem.

markush 04-25-2011 01:49 PM

Hello,

Linux has no problems with logical partitions, but they have to be Linux partitions. As I wrote, this will never work with a Win98-logical parition.

Markus

Engineeringtech 04-25-2011 04:09 PM

Quote:

Originally Posted by markush (Post 4335892)
Hello,

Linux has no problems with logical partitions, but they have to be Linux partitions. As I wrote, this will never work with a Win98-logical parition.

Markus

The logical partition I installed Linux on is formatted XT4. Doesn't that make it a Linux partition? I created the partitions with Partition Commmander. Booted from the CD, divided up the drive and formatted for DOS, Windows, Windows swap, Linux (XT4), Linux Swap, an NTFS partition for my data, and an HFS partition to play around with if I ever get this system working. (I have a Mac emulator.)

Sunnydrake has said the partition I install the Grub Bootsector to, must be a primary partition.

markush 04-25-2011 04:19 PM

Grub can handle extended partitions without a problem, grub has as well no problems with a 500GB Harddisk. But you cannot create Linux-partitions with Windows-programs. In my opinion your partitiontable is completely messed up.

You cannot mix Operatingsystems which are about 13 years and older (Win 98 and dos) on the same harddisk with modern Software like a recent Linux-system.

You can have one extended partition on your disk. This can be a Win98 parition, but then you cannot use Linux on it. That is the reason for all your problems.

Note that Win98 cannot deal with such big disks like yours (several hundred GB).

Best you can do: use dd (you wrote you can use it) and copy your Win-XP system to another partition. And then install everything completely new. Windows XP on partition 1 (primary), the rest Linux (an extended partition but created with the Linux-install-CD). Then use Virtualbox and install the old Win98 and Dos machines as virtual machines.

This is what I would do.

Markus

Erik_FL 04-25-2011 05:19 PM

We have to be careful about using the term "booting" to refer to Linux, since Linux is not actually "booted". Linux is "loaded" by a boot loader such as GRUB or LILO. Linux can indeed be "loaded" from a Logical partition.

Booting is what actually reads in and starts the boot loader program (GRUB or LILO).

I said that boot loaders "should not" be installed to Logical partitions. Some boot loaders (GRUB & LILO) can be installed to a Logical partition. The standard for partitioning PC hard disks does not support "booting" from a logical partition. Boot loaders "should" only be installed to Primary partitions.

The MBR is intended to contain some standard default multiple partition booting software. If a boot loader is installed to a Logical partition, then the standard MBR software cannot "boot" it. The MBR has to be written with some non-standard software, or some other boot loader has to chain to the Logical partition.

My suggestion was that if there are problems booting, it is best to stick to the intended way of installing a boot loader. Install it to a Primary partition, and leave the MBR with the default software. Set the "active" Boot flag for a partition to make it the default "boot" partition. Among other things this makes it easy to test each boot loader separately by changing the "active" Boot flags.

markush 04-25-2011 05:39 PM

1 Attachment(s)
Hello Erik_FL,

I'll append the screenshot of the paritiontable which the OP provided in post #20.

On which primary partition do you want to install a bootloader?

This partitiontable cannot be correct. /dev/sda5 is shown as a 102GB FAT32 partition. FAT32-partitions have a maximumsize of 32GB.

I don't think that we can find a simple solution here.... especially since the OP works on this problem for a long time without finding a solution.

In my opinion it would be the best, we look what the OP wants to achieve (running Linux, Dos and Windows on one and the same machine) and consider how this can be done, independently of the current setup which (well, I say it is my opinion) is completey messed up.

Markus

Erik_FL 04-25-2011 08:02 PM

Quote:

Originally Posted by markush (Post 4336109)
Hello Erik_FL,

I'll append the screenshot of the paritiontable which the OP provided in post #20.

On which primary partition do you want to install a bootloader?

This partitiontable cannot be correct. /dev/sda5 is shown as a 102GB FAT32 partition. FAT32-partitions have a maximumsize of 32GB.

I don't think that we can find a simple solution here.... especially since the OP works on this problem for a long time without finding a solution.

In my opinion it would be the best, we look what the OP wants to achieve (running Linux, Dos and Windows on one and the same machine) and consider how this can be done, independently of the current setup which (well, I say it is my opinion) is completey messed up.

Markus

Markus

I agree with you. There is no simple solution, especially if this will be booting Linux from a fake RAID controller.

I would recommend creating a third Primary partition (sda3) for installing the Linux boot loader. To do that existing partitions have to be re-sized or re-created. That still doesn't solve the problems relating to fake RAID.

My other suggestion would be to avoid trying to boot Linux from a fake RAID controller. It adds a lot of complications.

I wonder what fake RAID controller or chip this computer uses? I've only been able to make fake RAID work well with GRUB Legacy and manually installing the boot loader. Until recently I've also had to create a custom "initrd" image and use "dmraid" to boot Linux from fake RAID.

The FAT32 partition size limit is actually 127 GB. Windows XP and later won't create FAT32 partitions over 32 GB but that is not the maximum size supported by FAT32. Windows 98 and earlier can create 100 GB FAT32 partitions. I also think that the partition size in the screen capture is around 50 GB. The block count has to be divided by 2 to get kilobytes. Each block is 512 bytes (1/2 kilobyte).

It seems that GRUB does not boot far enough to display a menu. Either the installer for GRUB is confused about where to write the boot sector, or the boot sector software has the wrong BIOS drive ID. I've had both of those problems trying to boot from fake RAID controllers. To get around those problems I use a GRUB boot floppy or CD and manually install GRUB in "native" mode. I don't know how to do that with GRUB 2 if it is possible.

I suggest trying a simpler Linux installation to an empty hard disk. Back up the existing partitions and start with an empty disk. Try to install and boot Linux by itself. If that won't work then multi-booting has nothing to do with the problem.


All times are GMT -5. The time now is 10:00 PM.