LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   NTLDR Dual Boot XP(RAID)/SuSE9.0 (https://www.linuxquestions.org/questions/linux-newbie-8/ntldr-dual-boot-xp-raid-suse9-0-a-134225/)

MrOuija 01-13-2004 12:27 AM

NTLDR Dual Boot XP(RAID)/SuSE9.0
 
Been working on this one for several hours now. I know how to modify the boot.ini file for the Windows XP (NTLDR) boot loader. However, I have been unsuccessful as to this point at trying to fish the boot sector information off of the hard disk that Linux (SuSE 9) is installed on. I've used the "dd if=/blah/ of=/blah.lin etc." command to try and fish out the first 512 boot sector bytes from the Linux drive per many various FAQs and walkthroughs about configuring Linux to boot from NTLDR, with no success. None of these walkthroughs regarding Linux/XP dualboot seem to mention the HDD configuration. The jist of my question is: How do I point NTLDR to another hard disk that contains my SuSE installation. Also, what exactly should a boot record look like in text format? All I seem to be getting is a bunch of binary data, which, when I try to load it from NTLDR says that it can't turn over to the O/S because a suitable boot sector blah blah not found blah blah reboot.

Config:
Drive 0 = IBM 40.0gb Drive SiiG Hardware RAID 0 C: WinXP
Drive 1 = IBM 40.0gb Drive Siig Hardware RAID 0 C: WinXP
File system: NTFS
Single partition


Drive 2 = Western Digital 40.0gb Drive
File system: reiserfs
/dev/hdd1 10mb swap
/dev/hdd2 65mb /boot
/dev/hdd3 39.9gb /

Any help would be greatly appreciated!
Matt

Demonbane 01-13-2004 12:59 AM

Have you tried "dd if=/dev/hdd2 of=blah.bin bs=512 count=1"? Is Grub installed in /boot or mbr of drive 2?
The bootsector file is suppose to be binary

MrOuija 01-13-2004 01:16 AM

Methinks Im close
 
Okay, I've gotten it to the point where the loader will actually *attempt* to turn control of the system over to LILO. However, all I get when LILO attempts to load is LI 01 01 01 01 01 01 etc. How should I go about making a good boot file and knowing for sure it's correctly laid out and such? Should I edit lilo.conf to write the boot sector to /dev/fd0, run lilo, and then use dd to attempt to fish the file off of a diskette? It seems to me, that somewhere along the way, the loader data is becoming corrupted.

Demonbane 01-13-2004 01:32 AM

LI 01 01 01 usually means that lilo cannot find the disk with your /boot partition, yeah try installing lilo onto a floppy disk(boot=/dev/fd0), and see if the the disk can boot your linux, if it does then extract the bootsector from the disk.

MrOuija 01-13-2004 01:40 AM

Same problem
 
I have the same message come up when I try to boot from the floppy as well? Does this mean the LILO data is somehow becoming corrupted while it's being written to the floppy disk? Is there something Im missing about putting LILO onto a disk? Don't you just point lilo.conf to /dev/fd0. save. and then run lilo at the prompt to execute the changes?

Demonbane 01-13-2004 02:06 AM

That probably means lilo cannot properly determine the location of your drive, most likely has to do with your raid array which is set to the boot device. Right now I can only offer 2 suggestions, since im not overly familiar with Lilo:

1. Try GRUB, I've had it working in most dire situations, like having multiple operating systems on multiple drives on different controllers, each with grub in their boot partition extracted and loaded by NTLDR. Try making a grub bootdisk first and see if that works.

2. Try using bootpart http://www.winimage.com/bootpart.htm to extract the bootsector, from my experience it works better then using dd in linux, for extracting bootsectors for NTLDR. Though it works the best in dos u can still run it under XP.

MrOuija 01-13-2004 02:56 AM

Reinstall
 
Im thinking Im going to reinstall the SuSE distro sometime tomorrow- as it seems to have installed with some errors with it anyways (modprobe file not found?) and thus many other things fail, namely hotplugging and network devices. Ill try installing grub, as you suggested and see if I can get that to work. Now, when I install grub where should I put it? On the root partition or in the boot sector of the boot partition? Or in the boot sector of the root partition? Also, why would RAID prevent NTLDR from turning control of the system over to LILO. It seems like it would be a one way street- it's not like there's any data on the RAID array that LILO would need anyways right? Shouldn't it just get forwarded to boot of this other HD and that's the end of the story.... this really shouldn't be so complicated =P

jschiwal 01-13-2004 11:56 PM

I have the same setup as you but I'm using Mandrake 9.2 and I'm using lilo. First I went into bios and disabled the RAID drive as a boot drive. Only linux would boot up then. ( Remember to edit lilo.conf and running lilo so the linux loader actually gets written to the drive that linux is on. ) Then I used the dd command to copy the linux loader to floppy. I went back into bios and changed it back, booting from the RAID drive into XP. I copied the file from floppy to the C: drive, and added the file to the boot.ini file. Then I was able to boot up windows, or select linux and the linux lilo menu would come up. Make sure to re-run lilo anytime you make a change, and recopy the file using the dd command.

I didn't have to indicate the linux drive location in boot.ini.

Using the BIOS setting, I was able to boot straight into the system I needed to work on.

On my system, the first non-raid drive is hda and not hdd. An ata-raid drive will show up as a scsi drive.

MrOuija 01-14-2004 02:28 AM

Let me see if I follow
 
So on your system, you are indeed running Windows XP on a RAID array. It is the boot drive of the system, NTLDR is doing the booting, and it successfully boots to a non-RAID 3rd HD that Linux is on? Which means, NTLDR can turn the system over to LILO regardless of if there is a RAID array or not correct?

Let me make sure everything else is correct;
I installed Linux on /dev/hdd which is partitioned into /dev/hdd1 (100mb FAT32), /dev/hdd2 (swap), and /dev/hdd3 (reiserfs) and I installed the bootloader to the boot sector of /dev/hdd3.

You then extract the bootsector information from /dev/hdd3 via:
dd if=/dev/hdd3 of=/home/username/linux.lin

Then this is written to a floppy using
mount /media/floppy
cp /home/username/linux.lin /media/floppy

I then reboot and load Windows, copy the linux.lin file from the floppy disk to the root partition of Windows (which is on the RAID array) open up the boot.ini file and add in:
C:\linux.lin="SuSE Linux 9.0 Professional"
Save and reboot, and it *should* load, correct?

Demonbane 01-14-2004 06:40 AM

yea, it should

MrOuija 01-14-2004 01:38 PM

BS or MBR
 
Can LILO/GRUB be fished out of the BS or does it need to be put on the MBR of the Linux installed HDD? Because if it has to be the MBR... I think I know the problem :-P

Demonbane 01-14-2004 01:57 PM

No, you can either install it to the partition bootsector or the MBR. if its in the partition bootsector then you need some way of loading it, like using a bootloader such as ntldr. If you install it to the MBR of your linux disk it has to be set to the first bootable device to load, though I havent tried loading a mbr sector with ntldr, it might work, dunno.
Did grub work for you?

MrOuija 01-14-2004 02:08 PM

Nope, not yet
 
Im just not convinced Im getting the data out of the drive correctly- When you reinstall linux, it should write a new bootsector correct? And the bootsector should be at the beginning of the root drive right?

jschiwal 01-17-2004 12:37 PM

The dd command should contain bs=512 count=1. Otherwise, you will be trying to copy the entire partition to floppy, when you just need the first 512 bytes.

My computer has the raid controller chip on the mother board, and so the raid drives and the normal ide drives are on different busses, so my linux is installed in hda.

When I was using a previous kernel, I was able to to use the promise drivers to access the raid drives, but I wasn't able to get linux to boot up when installed on a raid drive.

That's the part I do not understand, how does the initrd file, which contains the raid driver, get read in if it's on a raid drive?

Demonbane 01-17-2004 03:55 PM

The initrd contains the raid driver for the linux kernel, keep in mind that GRUB does not need the linux kernel to operate.


Quote:

Im just not convinced Im getting the data out of the drive correctly- When you reinstall linux, it should write a new bootsector correct? And the bootsector should be at the beginning of the root drive right?
Yeah depends on where you select to install during installation, however a reinstall of lilo/grub would write a new bootsector. Take my advice, go make a grub bootdisk, get into the grub console and check if grub can see your linux drive.

MrOuija 01-18-2004 01:27 PM

Bootsector DATA
 
When I look at the BS data that I've copied with the dd command with less, I can see LILO and GRUB in there- I don't think this is right; I don't think the bootloader is correctly writing itself (or overwriting itself) to the bootsector. If it's not being written correctly, it's not going to be extracted correctly which would explain my problem.

The SuSE 9 install disc can boot Linux, what commands is it using to do so? Any way to check?

djbello 01-20-2004 09:59 AM

Same Problem, different distro
 
MrOuija,

I have the same problem with Fedora Core 1. Due to conflicts with my ATI Radeon 9800 Pro, I had to figure out a way to get the system booting into init 3 mode (w/o X). Obviously, GRUB was the bootloader of choice because the LILO package wasn't even installed at all.

I used the rescue image from the original boot CD to boot into rescue mode, chroot'ed to make /mnt/sysimage the new root folder; then I looked for the LILO package on all three CDs and for sure found it on the last one, installed LILO package; finally I made a copy of a file called lilo.conf.anaconda, which was already prepared by the installation script on the fly through the installation process.

Now, here's what: I have a SATA Raid Volume that hold my Windows XP, and I have a regular ATA drive that is connected to the IDE port on the motherboard. The XP partition is NTFS only, and the IDE drive has the following partitions:

/dev/hda1 -> /boot (100megs, to stay below the 1024 cyl. limit)
/dev/hda2 -> / (30+gigs)
/dev/hda3 -> swap (1 gig)
/dev/hda4 -> extended partition
/dev/hda5 -> fat32 (~8 gigs)

Right. So, on my IDE drive I don't have a primary DOS partition. Okay? Because that would allow the XP installation to put boot.ini on to the IDE drive. That means that ntldr and boot.ini are, in fact, on the SATA Raid Volume in the NTFS partition.

This post made it clear that dd .... bs=512 count=1 is needed, so I extracted the LILO bootloader from the first bootsector of /dev/hda1. With the same lilo.conf that I used to write the loader to the first boot sector, I also created a boot sector on a floppy disk by typing:

lilo -b /dev/fd0

I'd say that at this point, both floppy disk and /dev/hda1 have a valid and exactly the same boot sector on it using LILO. By the way, the directive boot= in the lilo.conf determines the device/partition that holds the boot sector, so changing that directive to point to the floppy disk is wrong in my eyes. I also found that the directive 'linear' breaks the process of putting the bootsector on the drive, so I changed that to 'lba32' as well.

I put the floppy in the drive and the BIOS boots from the floppy; then a prompt appears, I hit enter, and voila: there's my Fedora (booting the kernel image off the /dev/hda1 partition, which is pretty fast).

Then, I use the file that I already copied to my C:\ drive (remember its NTFS on a SATA Raid), I choose "Linux" and the screen goes blank and it says:

LI (blinking cursor)

Long story short, my suggestion to MrOuija is to use a floppy disk ;-))) Anybody reading this post that knows what's going on with ntldr and that 512 bytes long file with the boot sector?

Thanks for any suggestions... ;-)

P.S.: Sorry for the long post and for sounding a bit fuzzy. It's kinda hard to explain what happened on your screen/PC to somebody else. Right ? ;-)

Demonbane 01-20-2004 11:17 AM

Try the bootpart program I mentioned in the previous post, it works better than extracting the raw bootsector with dd.

MrOuija 01-20-2004 02:28 PM

I have tried it
 
I've tried just about everything- with no success. Methinks that when the system tries to boot the .lin file from the RAID array- it loses the other half of striped data located on the second physical drive and takes a yit- In other words- Only half of LILO/GRUB/WTF is loading- causing errors, because the system has no clue how to read a RAID partition. This is why I tried moving the bootsector to a FAT32 partition on the Linux drive, again, with no luck. I think Im just going to be booting off the CD for a while :(

Demonbane 01-20-2004 07:09 PM

Does grub even recognise the drive, ie when u're in the grub console(using a grub bootdisk, no linux) does it recogise your harddisk configuration(does root (hd1,0) etc work). Tried installing grub into the mbr?

MrOuija 01-20-2004 10:36 PM

Can't
 
The MBR is striped across 2 hard drives- It can't write correctly to it, and thus- other information will be overwritten. Tried this once already.

JZL240I-U 01-21-2004 07:32 AM

Re: Can't
 
Quote:

Originally posted by MrOuija
The MBR is striped across 2 hard drives...
Really? Are your raid stripes smaller than 512 bytes?

Demonbane 01-21-2004 09:39 AM

If grub is able to recognise the raid volume, you can try install grub into the mbr of the linux drive, set in bios to boot from it then add appropriate entries to menu.lst to load windows.

MrOuija 01-21-2004 12:50 PM

No
 
They aren't, not now that I think about it. They're 64k.

DarkManZGZ 03-04-2004 02:52 AM

Hello
I have a similar problem. My setup is more common (no raid):
One hard disk 80 GB partitioned in:
hda1: 75 Gb FAT32
hda2: 4 Gb ext3 (Debian)
hda3: Swap

I have been using this setup for two years, booting with NTLDR on hda1 and adding the boot sector of hda2 (bootsect.lin) into boot.ini, and everything was ok. I use grub instead of lilo, i hate lilo :rolleyes:

Well, yesterday I resized hda1 to make a new10 gb partition, and linux fdisk changed the volume labels in this way:
hda1: 65 Gb FAT32
hda2: 10 Gb unformatted
hda3: 4 Gb ext3 (Debian)
hda4: swap.

I changed fstab, kernel 'root=' parameter and extracted the new bootsector with dd, but now I can't boot into linux. It hangs with no error, only a blinking cursor. If I chage ative partition to hda3, it doesn't boot either because hda3 it's over 2048 hard disk cylinder and 2 gb limit.

So now I can only boot using loadlin.

I can't understand why doesn't work now if it have been right for two years, doing the same process. I hope someone see the mystery.

Thanks.


All times are GMT -5. The time now is 01:55 PM.