Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Lilo / Dodgy boot sequence
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Fri Jan 01, 2010 10:36 am    Post subject: [solved] Lilo / Dodgy boot sequence Reply with quote

Happy new year everybody !

1/ On a machine, I get 3 hard drives : A (IDE) B (SATA) C (SATA)
2/ The Gentoo LiveDVD "sees" A as sda ; B as sdb ; C as sdc
3/ Installed Gentoo on sdc with root as sdc5
4/ I get XP as sdc1
5/ I stricly followed the handebook for lilo.conf, particularily :
Code:
boot=/dev/sdc
...
label=Gentoo-Linux-64
...
root=/dev/sdc5
...
other=/dev/sdc1
label=Windows-XP-32


When I boot, the lilo's menu is correctly displayed, however :

1/ When choosing the gentoo's option, lilo fails to find a filesystem to boot as sdc5
2/ From the preceeding traces I managed to catch, my hard disk C seems to be taken as sdb 8O

I remade my lilo.conf, keeping sdc for boot but changing sdc5 for sdb5 as gentoo's root and sdc1 for sdb1 as XP's partition

1/ Rebooting, choosing Gentoo from lilo's menu, gentoo starts booting correctly however :
- Cannot manage to mount sdc5 because of a wrong superblock. (I can mount it without trouble with the LiveDVD)
2/ Choosing XP from the lilo's menu displays the menu of hard disk B boot manager (BSD boot manager) 8O

I almost certainly messed something around but what ?


Last edited by aCOSwt on Sun Jan 03, 2010 11:52 am; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7078
Location: Saint Amant, Acadiana

PostPosted: Fri Jan 01, 2010 10:47 am    Post subject: Reply with quote

Things like this happen when you mess around with boot order in BIOS setup. Say, you set your rig to boot from disk B. In this case disk B becomes sda and other two drives sdb an sdc.
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Fri Jan 01, 2010 11:03 am    Post subject: Reply with quote

Jaglover wrote:
Things like this happen when you mess around with boot order in BIOS setup. Say, you set your rig to boot from disk B. In this case disk B becomes sda and other two drives sdb an sdc.

Thanks Jaglover. It is actually the case in this system.
My boot order is C.
(As A and B are bootable but I do not want my system to boot on them)

What should I do then ?
The only idea I get would be to :

1/ restore A, B, C boot order in BIOS,
2/ Copy the same MBR to sda sdb and sdc.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7078
Location: Saint Amant, Acadiana

PostPosted: Fri Jan 01, 2010 12:24 pm    Post subject: Reply with quote

Restore boot order A-B-C, yes. Then you have to install Lilo to A.
You need to understand BIOS boots the drive it thinks is the first. By setting it boot from C you actually make it first drive. If you want to keep Lilo on C then you have to reconfigure everything to reflect new drive order - meaning C is now sda for good.
Some operating systems (BSD for instance) my not query BIOS, these will still use the physical drive order for naming, complicating the whole thing further.
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 848
Location: PL

PostPosted: Fri Jan 01, 2010 1:04 pm    Post subject: Reply with quote

or you could try using grub2 and it's UUID mapping features in this situation.

at least switching fstab to UUID might be a reasonable option to do in such a setup.
_________________
~amd64
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Fri Jan 01, 2010 2:48 pm    Post subject: Reply with quote

Jaglover wrote:
Some operating systems (BSD for instance) my not query BIOS, these will still use the physical drive order for naming, complicating the whole thing further.

Indeed ! :evil:
BTW, I restored the boot order to A,B,C and implemented lilo on A.
Nothing changes, "C" is still seen as sdb by lilo.
I do not exactly understand :
- why the LiveDVD "sees" "C" as sdc
- why, seeing C as sdb, lilo boots the XP partition on "A" when I select the XP choice


Last edited by aCOSwt on Fri Jan 01, 2010 2:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Fri Jan 01, 2010 2:52 pm    Post subject: Reply with quote

yoshi314 wrote:
or you could try using grub2 and it's UUID mapping features in this situation.

I...
am coming from grub2... :oops:
As I had found it a bit heavy for what I need and wanted to give lilo a try.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7078
Location: Saint Amant, Acadiana

PostPosted: Fri Jan 01, 2010 3:38 pm    Post subject: Reply with quote

Quote:
- why the LiveDVD "sees" "C" as sdc

LiveCD kernel is using libata for IDE drives, thus A is sda, not hda as it would be with IDE drivers. This makes it total three sdX drives despite one of them is IDE.
Quote:
- why, seeing C as sdb, lilo boots the XP partition on "A" when I select the XP choice

It has been long time since I used Lilo, I certainly do not remember how it names IDE devices. It is possible for Lilo your drives are hda, sda, sdb.
You may try another solution, GAG. GAG, when installed to the first BIOS drive can chainload almost everything, like Lilo, GRUB or ntloader from another drive or partition. It does not require separate partition as GRUB does.

http://gag.sourceforge.net/index.html
Back to top
View user's profile Send private message
saellaven
Guru
Guru


Joined: 23 Jul 2006
Posts: 496

PostPosted: Sat Jan 02, 2010 3:34 am    Post subject: Reply with quote

I haven't had to do it since the 90s, but you can use the disk= options to order your drives so they're consistent

in the global portion of your lilo.conf, try something like

Code:

disk=/dev/sda
    biox=0x80
disk=/dev/sdb
    bios=0x82
disk=/dev/sdc
    bios=0x81
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Sat Jan 02, 2010 3:46 pm    Post subject: Reply with quote

saellaven wrote:
I haven't had to do it since the 90s...
:D
Hmm... In 1990... Hmm... Ha ! Yess ! I was dualbooting Xenix and NT beta...
I did not know lilo but... I had a single disk... :lol:

Thanks for your advice saellaven, I tried this, even with the static-BIOS-codes option... unfortunately ! :evil:
I am going to try Jaglover suggestion about GAG...
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sat Jan 02, 2010 4:08 pm    Post subject: Reply with quote

Jaglover wrote:
It has been long time since I used Lilo, I certainly do not remember how it names IDE devices. It is possible for Lilo your drives are hda, sda, sdb.
Lilo will see it as sda if you have the proper serial ata/pata drivers installed and don't have the old ide drivers installed. If you have both, I believe the ide drivers take precedence.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7078
Location: Saint Amant, Acadiana

PostPosted: Sat Jan 02, 2010 7:12 pm    Post subject: Reply with quote

Lilo loads before kernel. In fact Lilo is supposed to load kernel. How can drivers compiled into kernel affect Lilo? :roll:
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sat Jan 02, 2010 8:05 pm    Post subject: Reply with quote

It very much affects the lilo command that is run for setup which I thought you were speaking of when you mentioned lilo seeing the drives as hda, sda, sdb.

Also, we're talking about how root is found (not boot). If the kernel that is booted doesn't have the proper drivers installed, root will not be enumerated as it was when lilo was ran (e.g. /dev/sdc5) and instead will be enumerated as an ide device (e.g. /dev/hda5). This very much affects lilo! Lilo will try to have the kernel load root as /dev/sdc5 which doesn't exist because the drivers aren't installed or aren't taking precedence. To get around this temporarily, you can pass the root=/dev/hda5 when you boot your kernel from the lilo command line.


Last edited by Nerevar on Sat Jan 02, 2010 8:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7078
Location: Saint Amant, Acadiana

PostPosted: Sat Jan 02, 2010 8:28 pm    Post subject: Reply with quote

Nerevar wrote:
Also, we're talking about how root is found (not boot). If the kernel that is booted doesn't have the proper drivers installed, root will not be enumerated as it was when lilo was ran (e.g. /dev/sdc5) and instead will be enumerated as an ide device (e.g. /dev/hda5). This very much affects lilo! Lilo will try to load root as /dev/sdc5 which doesn't exist because the drivers aren't installed or aren't taking precedence. To get around this, you can pass the root=/dev/hda5 when you boot your kernel from the lilo command line.

I do not think Lilo loads root. root=device is passed to kernel, kernel loads it, has nothing to do with boot loader.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sat Jan 02, 2010 8:33 pm    Post subject: Reply with quote

Jaglover wrote:
I do not think Lilo loads root. root=device is passed to kernel, kernel loads it, has nothing to do with boot loader.

I just updated my response with that verbiage before reading your above post.

I use lilo exclusively. I know the drivers very much affect how it finds root. I have been burned on more than one occasion. :)
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Sun Jan 03, 2010 11:48 am    Post subject: Reply with quote

Thanks to all contributions here + luck + whiter hairs... :lol:
I managed to find my way in this crazy mess !
Just in case it can help anybody in a similar situation...

1/ Irrespective of any boot order, BIOS presents my 3 disks in the following order :
1-sda-(SATA we will call A for later use)
On which I get :
sda1 : Vista
sda2 : FAT32
sda3,4,5... FreeBSD
And a BSD Boot manager.
2-sdb-(SATA we will call B for later use)
On which I get :
sdb1 : XP
sdb5,6,7... : Gentoo64
3-sdc-(IDE we will call C for later use)
On which I get :
sdc1 : XP
sdc2,3,4... FreeBSD
Maybe I should add that I asked the bios to present SATA drives as IDE (I had the choice to present them as AHCI)

2/ For some obscure reason (I still wonder about the reasons for this incoherence, Gentoo LiveDVD 10.1 sees the disks as
C->sda
A->sdb
B->sdc

3/ Installing Gentoo on B (sdc5 and onwards) and considering 1/ and yoshi314 suggestion,
The fstab must reflect BIOS's reality : =>
Gentoo's partitions must refer to /dev/sdb

4/ Configuring lilo, one must :
- instruct lilo to install the boot manager on disk B, aka sdc under the installation environment :
boot=/dev/sdc
- as saellaven suggested, instruct lilo regarding the actual BIOS mappings of disk B at boot :
disk=/dev/sdc
bios=0x81
(ignore the frightening "largely obsolete" mention of lilo's manual regarding this instruction... :twisted:)
- set to /dev/sdb5 the root statement associated with the Gentoo's entry

5/ Runing /sbin/lilo, rebooting, everything should go fine.
One should not forget to amend its lilo.conf in the newly booted environment, in case of future lilo's needs i.e :
- Replace the boot instruction with /dev/sdb which is the actual reference of disk B
- Remove the now meaningless disk / bios instructions.

6/ Dual booting an MS something
In my case, I wanted to enable a dual boot with XP on sdb1.
- An extra other section is needed with : other=sdb1
But without any extra configuration, MS things (At least up to XP) seem to boot necessarily form the first hard disk.
(In my case, this declaration alone leads to presenting disk A's boot manager... :evil:
- the solution consists in instructing chain loader to swap the device code actually associated, in order to make disk B appear as first hard disk, v.g :
Add the master-boot statement as a global option.

Well, lilo is finally a nice peace of code. No need to build Megs of software to simply fill an hard disk sector is there ?
The only tricky thing is finally this curious swap made by Gentoo's LiveDVD 10.1 for which I do not think the use of libata is enough as an explanation.

Once again thank you everybody for not having left me alone with this problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum