LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Have to change boot order in BIOS to boot ubuntu/winxp (https://www.linuxquestions.org/questions/linux-software-2/have-to-change-boot-order-in-bios-to-boot-ubuntu-winxp-430162/)

Minn3h 03-30-2006 06:58 PM

Have to change boot order in BIOS to boot ubuntu/winxp
 
Order of events:
-For a year or so dual-booted winxp and ubuntu with no problems using grub
-Decided to mess with things, did a LOT of screwing with partitions and bootloaders/the MBR
-Somehow all partitions are still intact, I recovered and have windows booting using the windows bootloader
-Spent a really long time trying to get grub properly reinstalled on the ubuntu partition
-Finally realized I could boot ubuntu if I changed a bit in my menu.list and device.map and made the linux hdd the boot hdd in my BIOS
-So now I can boot both by changing that one thing in my BIOS, but would really rather be able to boot both from windows bootloader (I won't use GRUB anymore, just take this for granted please)

Now for the pertinent (I believe) and gory details:
/dev/hda1 ntfs winxp
/dev/hdb1 ext3 ubuntu

menu.lst (all comments removed):
Code:

default 0
timeout 10
title                Ubuntu, kernel 2.6.12-10-amd64-generic Default
root                (hd0,0)
kernel                /boot/vmlinuz root=/dev/hdb1 ro quiet splash
initrd                /boot/initrd.img
savedefault
boot

When I switch the boot order back to windows then linux, I change to "root (hd1,0)" in menu.lst and switch the numbers in device.map also to reflect the linux harddrive becoming hd1 and winxp becoming hd0 according to GRUB. When I do this and try to boot from the windows bootloader I just get "GRUB _" with the underscore/cursor blinking and everything else frozen.

My boot.ini file has this line for booting Ubuntu:
Code:

C:\ubuntu.bin="Ubuntu"
And used this command to make ubuntu.bin:
Code:

sudo dd if=/dev/hdb1 of=/media/hda1/ubuntu.bin bs=512 count=1
So, what is the problem? :P
(Sorry if this is not really a software question, I was unsure)

-Minn3h

bigrigdriver 03-31-2006 01:43 PM

The only other place I can think of to look for a cause of this problem is /etc/fstab: specifically, a discrepancy in the naming of partitions in fstab and menu.lst.

If fstab has partitions for Ubuntu on hda, and menu.lst says hdb, problem solved. Edit fstab to agree with menu.lst.

Minn3h 03-31-2006 04:09 PM

Code:

proc            /proc          proc    defaults        0      0
/dev/hdb1      /              ext3    defaults,errors=remount-ro 0      1
/dev/hda1      /media/hda1    ntfs    umask=0222      0      0
/dev/hda2      /media/hda2    ntfs    umask=0222      0      0
/dev/hdd5      /media/hdd5    ntfs    umask=0222      0      0
/dev/hdb5      none            swap    sw              0      0
/dev/hdc        /media/cdrom0  udf,iso9660 user,noauto 0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0      0
/dev/hdb3      /media/hdb3    ext3    defaults        0      0

Seems to be in order?

syg00 03-31-2006 04:14 PM

Yuck !!!
However, if you insist on doing it this way, try
Code:

sudo dd if=/dev/hdb of=/media/hda1/ubuntu.bin bs=512 count=1
Current Ubuntu is 2.6.12 - NTFS write is at best "iffy" at this kernel level. Given the file size isn't ever going to change you might get away with it.

Minn3h 03-31-2006 05:11 PM

Oops, I guess I oversimplified my explanation too much. That wasn't exactly the dd comand I used. I've never bothered with trying to write to ntfs partitions in linux. I did of=/home/ubuntu.bin or something and copied it over once I rebooted in windows or some such method.

It shouldn't make a difference whether I do if=/dev/hdb1 or if=/dev/hdb does it?

syg00 03-31-2006 06:39 PM

Quote:

Originally Posted by Minn3h
It shouldn't make a difference whether I do if=/dev/hdb1 or if=/dev/hdb does it?

Makes all the difference in the world. The first partition does not align to the (physical) first sector of the drive.
Try what I suggested - migrating it via some other means; a fat{32} partition, or floppy/CD maybe.

Minn3h 03-31-2006 07:17 PM

Well, I tried dd if=/dev/hdb of=/home/ubuntu.bin bs=512 count=1 (instead of if=/dev/hdb1) and then replaced my old ubuntu.bin with it. When I got to the windows bootloader this time and choose "Ubuntu" the screen went black for a second or so and then went back to the windows bootloader. This as opposed to having "GRUB _" printed on my screen before the change. (And yes I modified my menu.lst and device.map to reflect that hdb became hd1 again instead of hd0)

Is this new result meaningful?

syg00 04-01-2006 05:17 PM

Sorry, I wasn't thinking - that was never going to work. Grub needs to be installed to a partition rather than the MBR, and then the boot sector record copied as you intimated before.
For the hard-disks to be recognised correctly, you probably need the Windows disk as BIOS boot disk, and grub to be reinstalled (to the root partition) from an bootable CD. Ubuntu have a live CD, but I've never used it - I always have a Knoppix CD handy.


All times are GMT -5. The time now is 04:34 AM.