LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-14-2007, 02:33 PM   #1
gamewolf
Member
 
Registered: Jun 2007
Distribution: Debian Sid, Slackware 13.37
Posts: 204

Rep: Reputation: 16
Booting into Linux


Ok, when I am starting my computer, I can press F12 and it will give me a list of partitions I can boot into. If I choose the Linux one, it displays Grub and I can click my kernel, but it says it cannot find it. I booted into Windows and I edited the boot.ini so I can boot into linux. When I restart my computer and try and boot, it works. How can I boot into Linux the first from pressing F12?

Thanks.
 
Old 12-14-2007, 02:47 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I would have thought that F12 would give a choice of devices to boot (eg hard drives, floppy, CD, etc.) Once you select a hard drive, it then goes to the MBR looking for boot code. Only then are you dealing with GRUB or the Windows loader.

It is not totally clear from your post what is working and what is not. Can you boot into Linux?
 
Old 12-14-2007, 03:00 PM   #3
gamewolf
Member
 
Registered: Jun 2007
Distribution: Debian Sid, Slackware 13.37
Posts: 204

Original Poster
Rep: Reputation: 16
I can boot into Linux only if I edit the boot.ini file and boot using the NT Bootloader. If I use the F12 Method, it goes to grub but can't find the kernel.
 
Old 12-14-2007, 06:18 PM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Don't you get it? It is so obvious.

It appears that you have installed the Linux while Windows was the No.1 boot disk and has put Linux in a non-first disk.

It works if you boot to Windows first, so that the 1st disk has been taken up as per Bios data, and from there boot up the non-first disk.

When you choose F12 a disk to boot first you gave the 1st disk status to the Linux disk and the Bios data is altered. Since Linux wasn't installed originally to boot from that position it is only natural that it should fail.

Using F12 is to select a disk to boot is to duplicate a boot loader's function. It is like calling a taxi to drive round the block before leaping into your own limousine and then tell the chauffeur where you want to go.
 
Old 12-14-2007, 06:57 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by saikee View Post
Using F12 is to select a disk to boot is to duplicate a boot loader's function. It is like calling a taxi to drive round the block before leaping into your own limousine and then tell the chauffeur where you want to go.
You certainly come up with some marvelous ways of describing things....
I am inferring that there are two hard drives. One has the Windows loader and there is code that works with boot.ini to boot Linux. The other drive has Grub installed, but with an incorrect configuration.

Solution: Boot into Linux, and re-install GRUB (I would have GRUB also boot Windows, but there are other options) In any case, there's not reason to have to go thru the extra step of selecting the drive in the BIOS menu (F12)
 
Old 12-14-2007, 07:22 PM   #6
gamewolf
Member
 
Registered: Jun 2007
Distribution: Debian Sid, Slackware 13.37
Posts: 204

Original Poster
Rep: Reputation: 16
The reason why I want to do this is because I want to return my boot.ini file back to the normal one and access the linux partition when I want (as I don't regularly boot into linux). So I will reconfigure grub and see what I can do. Thanks for all the help.
 
Old 12-14-2007, 07:31 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Could get messy depending on what order the disks are seen as. Before you start, boot into Linux and post the (full) output of these commands run (as root) from a terminal
Code:
fdisk -l
egrep -v "^#|^\s*$" /boot/grub/menu.lst
 
Old 12-14-2007, 07:44 PM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
pixellany,

You do know I am trying to open up a sausage factory. I have been helping users who got themselves into booting trouble by fiddling the Bios booting order. After the problem has been solved I normally asked the user to chop off the hand that was responsible for fiddling with the Bios and sent it to me. I am thinking of making use the meat I collected.

I am a simple guy. If I employ a chauffeur to drive me around I wouldn't call a taxi, would I? It is like treating the chauffeur without any respect.

It is the same with a boot loader. If it is its job to switch the disks for me to boot why I should use F12 key? Good job a boot loader has no feeling.

Last edited by saikee; 12-14-2007 at 07:51 PM.
 
Old 12-15-2007, 10:39 AM   #9
gamewolf
Member
 
Registered: Jun 2007
Distribution: Debian Sid, Slackware 13.37
Posts: 204

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by syg00 View Post
Could get messy depending on what order the disks are seen as. Before you start, boot into Linux and post the (full) output of these commands run (as root) from a terminal
Code:
fdisk -l
egrep -v "^#|^\s*$" /boot/grub/menu.lst
Here you go:

Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 * 6 18846 151340332+ 7 HPFS/NTFS
/dev/sda3 18847 19452 4867695 db CP/M / CTOS / ...

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 7550 60645343+ 7 HPFS/NTFS
/dev/sdb2 7551 8766 9767520 83 Linux
/dev/sdb3 8767 9729 7735297+ f W95 Ext'd (LBA)
/dev/sdb5 8767 9729 7735266 82 Linux swap / Solaris
debian:/home/gamewolf# egrep
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
debian:/home/gamewolf# egrep -v "^#|^\s*$" /boot/grub/menu.lst
default 0
timeout 5
color cyan/blue white/blue
title Debian GNU/Linux, kernel 2.6.18-5-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sdb2 ro
initrd /boot/initrd.img-2.6.18-5-686
savedefault
title Debian GNU/Linux, kernel 2.6.18-5-686 (single-user mode)
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-5-686 root=/dev/sdb2 ro single
initrd /boot/initrd.img-2.6.18-5-686
savedefault
title Debian GNU/Linux, kernel 2.6.18-4-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/sdb2 ro
initrd /boot/initrd.img-2.6.18-4-686
savedefault
title Debian GNU/Linux, kernel 2.6.18-4-686 (single-user mode)
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/sdb2 ro single
initrd /boot/initrd.img-2.6.18-4-686
savedefault
title Other operating systems:
root
title Windows XP Media Center Edition
root (hd0,1)
savedefault
chainloader +1
 
Old 12-15-2007, 11:25 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I rest my case.

The OP has to make a decision to select one of the following

(1) To boot to MS Windows and use NTLDR to dual boot Linux.

(2) To boot to Linux and use its Grub to dual boot Windows.

(3) Screw the bootloaders and select the disk to boot with F12 key (should only boot one system, two systems is possiblt but defeating the object).

Last edited by saikee; 12-15-2007 at 11:31 AM.
 
Old 12-15-2007, 03:19 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by gamewolf View Post
If I choose the Linux one, it displays Grub and I can click my kernel, but it says it cannot find it.
Simple answer is probably to change all the (hd1,1) to (hd0,1) in menu.lst
You might also find the sda/sdb names trade places as well - don't know as I (and the other respondants obviously) have never tried this. If so, all the root params on the kernel lines will need fixing. Not to mention /etc/fstab.

And of course after all that, you'll no longer be able to boot Linux from your Windoze boot.ini.

Or you could leave it all alone. Your choice.
 
Old 12-15-2007, 03:38 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
From my own experience the sda and sdb will not trade places. They are hardware dependent just like the old hda, hdb hdc and hdd of the IDE channel because Sata connection points are also numbered by the mobo and scanned in a predetermined fashion.

Pulling the sda out however will force sdb to become sda though.
 
Old 12-15-2007, 05:49 PM   #13
gamewolf
Member
 
Registered: Jun 2007
Distribution: Debian Sid, Slackware 13.37
Posts: 204

Original Poster
Rep: Reputation: 16
Ok, I tried it, and it worked! Thanks! I have Debian on an external and if I take it to another computer, I want to be able to access it without edited the boot.ini file.

Thanks for everything.
 
Old 12-16-2007, 07:18 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Bet it fails intermittently - you can't guarantee that it will be seen as /dev/sdb all the time. Might be better off using LABEL or UUID - but to use that for the root (in menu.lst) requires support in the initrd.

Nothing is ever as simple as it first seems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting error in puppy linux while booting it from fedora why ? senthilarumugam LinuxQuestions.org Member Intro 1 02-22-2007 02:43 PM
LXer: Dual-booting Windows and Linux the easy way (Linux.com videos) LXer Syndicated Linux News 0 07-21-2006 05:21 PM
LXer: Dual booting Linux and AIX Linux in a clustering environment LXer Syndicated Linux News 0 05-16-2006 06:21 AM
booting Linux from an image that lost booting capabilities tgr Linux - Software 1 03-05-2006 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration