Should not the installer ask me about on which MBR (hard drive) it will install LILO?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
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.
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.
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.
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.
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.
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.
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.
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...
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.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.