LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-21-2011, 05:22 AM   #1
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Should not the installer ask me about on which MBR (hard drive) it will install LILO?


Recently, this weekend, I installed Slackware-current to one of my friends.

He is one of the proud legal owners of HellOS by Bill, and his desire was to install Linux in a second hard drive, without touching the first hard drive. Following that he was to select which hard drive boots from the BIOS.

What I did was a full installation, with the 160G hard drive, dedicated just for Linux. All Classic, swap, root and the rest for home.

Because we talk about dedicated hard drives, I choosed to configure LILO with the SIMPLE option, and installing bootloader in MBR.

Surprise! I expected that LILO is installed in the MBR of hard drive for Linux, SDB. BUT it was installed in the SDA, which is HellOS's hard drive, and my friend was very upset ...

Of course, it was simple to fix things right, but here comes my proposal:

1. The installer/liloconfig to consider the MBR of the current hard drive, where is the root or boot partition, possibly to warn you if that hard drive is not currently bootable.
2. In case of multiple hard drives, to have a additional dialog where you select the MBR (hard drive) to install LILO.

There is the installer/liloconfig-generated /etc/lilo.conf.

Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
# Append any additional kernel parameters:
append=" vt.default_utf8=0"
boot = /dev/sda

# Boot BMP Image.
# Bitmap in BMP format: 640x480x8
  bitmap = /boot/slack.bmp
# Menu colors (foreground, background, shadow, highlighted
# foreground, highlighted background, highlighted shadow):
  bmp-colors = 255,0,255,0,255,0
# Location of the option table: location x, location y, number of
# columns, lines per column (max 15), "spill" (this is how many
# entries must be in the first column before the next begins to
# be used.  We don't specify it here, as there's just one column.
  bmp-table = 60,6,1,16
# Timer location x, timer location y, foreground color,
# background color, shadow color.
  bmp-timer = 65,27,0,255

# Standard menu.
# Or, you can comment out the bitmap menu above and 
# use a boot message with the standard menu:
#message = /boot/boot_message.txt

# Wait until the timeout to boot (if commented out, boot the
# first entry immediately):
prompt
# Timeout before the first entry boots.
# This is given in tenths of a second, so 600 for every minute:
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
# VESA framebuffer console @ 1024x768x64k
vga = 791
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# End LILO global section
# Windows bootable partition config begins                              
other = /dev/sda1
  label = Windows
  table = /dev/sda                                                    
# Windows bootable partition config ends

# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sdb2
  label = Linux
  read-only
# Linux bootable partition config ends
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-21-2011, 06:15 AM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
I don't really agree with you here. If you were to look at the liloconfig screen you will notice it actually says a MBR install wil be to :
Code:
3. The Master Boot Record of your first hard drive.
and it also says
Code:
Options 1 and 2 are the safest, but option 1 does require a little                             
extra work later (setting the partition bootable with fdisk).
so it warns you as well. As most people don't set up differing drives for the Bios to boot from, ( some machines won't even do this), I think the first drive is a sensible option. The alternative is bound to get people picking the wrong MBR, rebooting and wondering why the install has not worked! If you want to customize the setup you only need to go to the expert option and customize your own lilo.conf.
 
2 members found this post helpful.
Old 03-21-2011, 06:37 AM   #3
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,971

Rep: Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548Reputation: 1548
Quote:
Originally Posted by Darth Vader View Post
1. The installer/liloconfig to consider the MBR of the current hard drive, where is the root or boot partition, possibly to warn you if that hard drive is not currently bootable.
2. In case of multiple hard drives, to have a additional dialog where you select the MBR (hard drive) to install LILO.
Why the surprise? You picked simple, when you should have picked expert. If you had picked expert you would have been given a chance to change were to install the MBR.
 
Old 03-21-2011, 08:22 AM   #4
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
I've never liked the lilo.config options in the installer.

I wish it let me type in exactly what I want for the "boot=" option as well as the "root=" option.

This is mainly because I like to do what other linux distros do and have a /boot partition with the boot loader installed to the boot sector of the /boot partition. But the options available in the installer are MBR of first hard drive or boot sector of your root partition.

But on the other hand, selecting the boot record of the root partition is a safe bet being that I make an initrd image and re run lilo before rebooting anyway. Not to mention other preliminary configurations since I'm there as root anyway.

Last edited by lumak; 03-21-2011 at 08:24 AM.
 
Old 03-21-2011, 01:03 PM   #5
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
First, the point of this thread is not for me to cry on your shoulder about a 'failed' installation. Restoration of MBR, which has affected, and the desired configuration of Bootloader has been fixed at the first boot.

The idea is to talk about small improvements that could be done to the installer.

And I begin to think that using a hard-coded value for the MBR device is not the happiest solution. What happens when they choose on the BIOS, to boot the second hard drive?

My friend says that Windows 98, ME, XP, Vista and Seven are concerned only about your current hard drive. And the selection of the BIOS is currently used to install in parallel, XP and Seven.

BUT, Slackware installer is obsessed about the SDA, even if your current hard drive to boot is SDB.

Yeah, ancient systems not have hard disk boot selection, but I probably live in the Republic of Geeks, and here all have 'super-computers', then I can't understand that fine nuances.

So let's leave aside systems with similar age of my grandfather, to find a solution for this hard-coded SDA ...

For example, how we can find which harddrive is considered by BIOS as boot device? Windows can, but Linux can? If we resolve this problem, the SIMPLE method can use as MBR installation right the current boot device, like Windows. Of course, if there is only a single choice, the first harddrive, this method will point right to this device, even in a ol'good i586.

Last edited by Darth Vader; 03-21-2011 at 02:19 PM.
 
0 members found this post helpful.
Old 03-21-2011, 03:58 PM   #6
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
You and your friends understanding of the PC BIOS boot system is flawed, particularly in respect of MS Windows.

Microsoft uses an extremely simple and brain dead method to boot it's operating systems, in the MBR the code has only one purpose find the partition with the bootable flag set and load the boot sector of that partition and execute it.

Windows doesn't detect which disk is currently bootable it just accepts that the first disk as passed from the BIOS is the first disk even if it isn't due to the fact that it's boot loader can't comprehend a more complex situation.

See the lilo man page for information on booting Windows that is installed to a disk other than the first disk, and then ask why would Windows need you to do such a thing if it's so clever.

FYI The MBR you get with Windows 7 is the same as the one from MS-DOS 1.0 30 years ago.
 
3 members found this post helpful.
Old 03-21-2011, 04:35 PM   #7
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by wildwizard View Post
You and your friends understanding of the PC BIOS boot system is flawed, particularly in respect of MS Windows.

Microsoft uses an extremely simple and brain dead method to boot it's operating systems, in the MBR the code has only one purpose find the partition with the bootable flag set and load the boot sector of that partition and execute it.

Windows doesn't detect which disk is currently bootable it just accepts that the first disk as passed from the BIOS is the first disk even if it isn't due to the fact that it's boot loader can't comprehend a more complex situation.

See the lilo man page for information on booting Windows that is installed to a disk other than the first disk, and then ask why would Windows need you to do such a thing if it's so clever.

FYI The MBR you get with Windows 7 is the same as the one from MS-DOS 1.0 30 years ago.
First of all, thank you for your post. But your speech have a flaw ...

Me do not care how brilliant is the Windows MBR. It is probably a small crap. As bootloader, I believe that LILO is a million times higher.

BUT! Windows installer knows where to put his little crap. If you select from the BIOS the third hard drive as default boot(able), and you install Windows 7 in THIS hard drive, everything works perfectly, and the Windows installer does not touch other's hard drive as MBR ... i.e. first hard drive.

How we do this with liloconfig?

In other words, how we teach liloconfig to known the real boot hard drive, which is booted by BIOS?

Last edited by Darth Vader; 03-21-2011 at 04:53 PM.
 
Old 03-21-2011, 05:02 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
FYI I have a multi-boot Windows 7 / Slackwares on a single HDD and put the bootloader in a root Linux partition et voilą.

IMHO there is no point in using the SIMPLE option, unless you layout is very simple as well - let's say, only one system on only one hard disk.

So let the SIMPLE option stay as is, and choose EXPERT for any other case.

Only my two cents, of course.
 
Old 03-21-2011, 05:04 PM   #9
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
I stand corrected from my previous post. You can select whatever you want for the "boot =" option

1. Select "expert"
2. Select "Begin"
3. Extra boot options if you need them
4. Choice of UTF-8 fonts
5. Console resolution
6. Select MBR
7. Enter in whatever device link you want. It won't correct you. That being you can input /dev/sdx4 and it will accept it.
8. Wait time for boot
9. Returned to main menu, select "Linux"
10. Enter root partition device link... at the moment of this writing it unfortunately isn't showing my LUKS LVM links in the list... but that's not supported by the installer... I can input it anyway without complaint of the installer.
11. Returned to main menu, select "Install"

and you're done.

You just have to be an expert to know what to do

Note, selecting "Root" at step 6 will cause the "boot=" option to be the same thing as your root partition selected earlier in the installation.

So really, the only thing that the installer doesn't support is creating the initrd image... which is funny because Slackware recommends it but leaves it as an exercise for the user.

Last edited by lumak; 03-21-2011 at 05:06 PM.
 
Old 03-21-2011, 05:08 PM   #10
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by Didier Spaier View Post
IMHO there is no point in using the SIMPLE option, unless you layout is very simple as well - let's say, only one system on only one hard disk.
Well, that's exactly my study case!

Just a dedicated hard drive per operating system.
 
Old 03-21-2011, 05:12 PM   #11
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by lumak View Post
So really, the only thing that the installer doesn't support is creating the initrd image... which is funny because Slackware recommends it but leaves it as an exercise for the user.
Very good point! I will love to avoid the moving from fatty huge kernel which cause sometimes problems, to the generic kernel and his initrd right on first stage, the installation...
 
Old 03-21-2011, 05:17 PM   #12
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
But it's just as easy to 'chroot /mnt' after the installation anyway. Additionally, I use /etc/mkinitrd.conf and mkinitrd -F for doing the creation.. So it's not a big deal.
 
Old 03-21-2011, 05:21 PM   #13
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by lumak View Post
But it's just as easy to 'chroot /mnt' after the installation anyway. Additionally, I use /etc/mkinitrd.conf and mkinitrd -F for doing the creation.. So it's not a big deal.
Of course. But, it's human to be lazy, right?

Still, to be honest, in my case, because I use most times RAID devices, 'chroot /mnt' & Co. is a common case ... BUT, If I can avoid it, why not?

EDIT

Back to topic. How we teach the installer/liloconfig which one is the real boot hard drive from BIOS p.o.v.? We can do it?

Last edited by Darth Vader; 03-21-2011 at 05:38 PM.
 
Old 03-21-2011, 06:12 PM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Quote:
Originally Posted by Darth Vader View Post
Back to topic. How we teach the installer/liloconfig which one is the real boot hard drive from BIOS p.o.v.? We can do it?
Not sure we can (how to deal with several bootable partitions, for instance ?) but anyhow we shouldn't.
 
Old 03-22-2011, 05:34 AM   #15
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Original Poster
Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by Didier Spaier View Post
Not sure we can (how to deal with several bootable partitions, for instance ?)
We do not have to manage the partition bootable. Instead, we must find how many hard drives are present, and that is their boot order, in terms of BIOS.

And I found something very interesting, using the command lilo -t -v2 ...

Code:
LILO version 22.8 (test mode), Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 19-Feb-2007 and compiled at 14:44:48 on Feb 16 2010
Running Linux kernel 2.6.38-bigmem64 on i686

pf_hard_disk_scan: ndevs=4
  0800  0131C95C  /dev/sda
  0810  0AFBE019  /dev/sdb
  0820  28B52B97  /dev/sdc
  0830  000653BF  /dev/sdd
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = F
device codes (canonical) = F
RAID info:  nr=2, raid=2, active=2, working=2, failed=0, spare=0
Using BIOS device code 0x80 for RAID boot blocks
raid_setup returns offset = 00000000  ndisk = 2
 BIOS   VolumeID   Device
  80    0AFBE019    0810
  81    0131C95C    0800
  82    28B52B97    0820
  83    000653BF    0830
raid flags: at bsect_open  0x02
Reading boot sector from /dev/md0
map_create:  boot=0900  map=0900
mode = 0x03,  columns = 80,  rows = 25,  page = 0
Using MENU secondary loader
Calling map_insert_data
Secondary loader: 18 sectors (0x3600 dataend).
bios_boot = 0x80  bios_map = 0x80  map==boot = 1  map S/N: 00000000
Mapping message file /boot/boot_message.txt
Calling map_insert_file
Message: 1 sector.
BIOS data check was okay on the last boot

Boot image: /boot/vmlinuz-2.6.38-bigmem64
Setup length is 28 sectors.
Mapped 5630 sectors.
Mapping RAM disk /boot/initrd-2.6.38-bigmem64.gz
RAM disk: 7068 sectors.
Added LX2.6.38-BM64 *

Boot image: /boot/vmlinuz-generic-smp-2.6.37.4-smp
Setup length is 28 sectors.
Mapped 5498 sectors.
Mapping RAM disk /boot/initrd-2.6.37.4-smp.gz
RAM disk: 7068 sectors.
Added Linux-generic

Boot image: /boot/vmlinuz -> vmlinuz-huge-smp-2.6.37.4-smp
Setup length is 28 sectors.
Mapped 11169 sectors.
Mapping RAM disk /boot/initrd-2.6.37.4-smp.gz
RAM disk: 7068 sectors.
Added Linux-hugesmp

Boot other: /dev/sdd1, on /dev/sdd, loader CHAIN
Mapped 6 (4+1+1) sectors.
Added Windows

 BIOS   VolumeID   Device
  80    0AFBE019    0810
  81    0131C95C    0800
  82    28B52B97    0820
  83    000653BF    0830
do_md_install: MD_PARALLEL
  offset 00000000  /dev/sda
  offset 00000000  /dev/sdb
The map file has *NOT* been updated.
The boot record of  /dev/md0  has *NOT* been updated.
The Master boot record of  /dev/sda  has *NOT* been updated.
The Master boot record of  /dev/sdb  has *NOT* been updated.
What happens? I have four hard drives on the system and the first three are connected in a complicated system RAID0 and RAID5.

But the boot is on a RAID1, on the first two hard drives. Then, I selected the second hard disk to be booted from the BIOS. Basically, the boot order is:

Code:
 0  /dev/sdb
 1  /dev/sda
 2  /dev/sdc
 3  /dev/sdd
And here we go! First, Lilo mapped my hard drives as follow:

Code:
pf_hard_disk_scan: ndevs=4
  0800  0131C95C  /dev/sda
  0810  0AFBE019  /dev/sdb
  0820  28B52B97  /dev/sdc
  0830  000653BF  /dev/sdd
Then, Lilo determined their boot order:

Code:
 BIOS   VolumeID   Device
  80    0AFBE019    0810
  81    0131C95C    0800
  82    28B52B97    0820
  83    000653BF    0830
Voila! Looks like Lilo determined very accurate, the hard drives boot order!

How can we use this information?

For example, testing in verbose mode (2 or higher) with a template file and capturing and processing the relevant information from the output of LILO.

It is important that using the SIMPLE/LAZY way, LILO to be installed, in my boot order case, on the SDB? Of course, that if he reached the SDA's MBR, it will be ignored by the BIOS, in favor of SDB bootloader. And my new installation will not work, right?

Food for thought?

Last edited by Darth Vader; 03-22-2011 at 06:14 AM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i install grub onto hard drive after the mbr has been wiped baronobeefdip Linux - Software 7 02-26-2011 05:49 PM
lilo install: mbr of "first drive"? daweefolk Slackware - Installation 2 04-22-2010 07:35 PM
Install lilo and install cd on 2nd hard drive seanfc Linux - Hardware 0 07-04-2006 03:28 AM
Lilo and MBR of the second hard disk petarsabev Slackware 9 09-30-2003 11:35 PM
install LILO to the hard drive afterward? felecha Linux - Software 4 06-04-2001 09:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:37 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