Click to See Complete Forum and Search --> : bootloader dilema
saturn-vk
06-26-2003, 11:21 AM
hello happy penguin abusers.
first of all i'd like to point out that my track record with bootloaders leaves quite a lot to be desired. Up until now i've used loadlin and thus windows98's native bootloader.
that's the whole problem however. I am constantly downsizing my vfat partition, because I almost never use windows nowadays. but up until now i've also used loadlin. well today, when i downsized it again, something strange happened. i have three primary partitions on the hda. up until today hda1 was vfat and hda2 was ext3. well i usually use partition magic (yes i know, i'm going to start using parted next time), however it didn't even start, probably because of the 3 primary partitions. so i opened system management from win2k's control panel to see why it's complaining. well nothing out of the ordinary was there, so i rebooted.
that's when the problems started flying. turns out somehow hda1 was switched with hda2, so now ext3 is hda1, swap is hda2 and vfat is hda3. My MBR is wiped. I figured it out when i cfdisked through the slack install disk. I also tried installing lilo, which seemed straightforward. i made hda1 (ext3) to be boot this time. then i rebooted. However it started pumping this:
L 01 01 01 01 01 01 01 01 01 01 01.... and so on all over the screen.
So naturally, my first question is, how do I make it work.
And my second question is:
I know there's another bootloader called GRUB, a gnu project that is still supposed to be in alpha state(although a lot of people use it). How is it better than lilo, does it look better than lilo, and does it install easily?
Priority goes to my first question.
Thank you for your time.
JamminJoeyB
06-26-2003, 11:34 AM
You'll need to do a fdisk/mbr.
That should fix you 01 01 01 01 01 problem.
The you should be able to load lilo to the mbr.
saturn-vk
06-26-2003, 11:40 AM
should i install lilo in the mbr or the root partition this time?
btw, fdisk doesnt have such a command (are you thinking of the dos fdisk, in that case I cannot do it, because I cannot access the vfat partition without windows anymore).
mdwatts
06-26-2003, 11:43 AM
Originally posted by saturn-vk
should i install lilo in the mbr or the root partition this time?
I always advise anyone to install the Linux bootloader (Grub/Lilo) into a separate /boot (if available) or the root '/' partition. You will then need to set that as the active partition.
saturn-vk
06-26-2003, 11:50 AM
how do i set it as an active partition? and should i turn it off as a bootable partition?
mdwatts
06-26-2003, 11:52 AM
Originally posted by saturn-vk
how do i set it as an active partition? and should i turn it off as a bootable partition?
That should be the same.
In Partition Magic the active partition has a '*' beside it. (if I remember correctly)
<edit>
If you ever end up reinstalling all your operating systems, repartition the drive as follows.
/boot 20-30mb - primary
Fat32/NTFS ###gb Windows - primary
Extended
Fat32/NTFS ###gb - Windows programs/data etc. - logical
Linux '/' root etc. ###gb - logical
Linux swap ###mb - logical
Install the Linux bootloader in /boot and set that as active.
That way if you reinstall Windows, you don't have to worry about it overwriting the Linux bootloader in the mbr. You may need to reset the /boot partition as active if you reinstall Windows. It may switch the active to itself.
saturn-vk
06-26-2003, 11:56 AM
but i cannot use any windows or dos programs.
I'm asking for a way to fix the mbr and make it active through linux only.
mdwatts
06-26-2003, 12:00 PM
Boot into Linux, check /etc/lilo.conf to ensure boot is set for /dev/hda (mbr) and not hda1/hda2.
As root, run /sbin/lilo to write the changes.
Post the contents of /etc/lilo.conf if you need help.
saturn-vk
06-26-2003, 12:04 PM
well, unfortunately, it's set to this:
boot = /dev/hda1
so you mean to set it to exactly that?
boot = /dev/hda (mbr)
mdwatts
06-26-2003, 12:08 PM
hda1 will install Lilo into hda1 of which you will need to set that as the active partition. The default mbr that contains only a single boot record points to the active partition.
If you want to override this, change hda1 to hda which will install Lilo into the mbr and then the active partition does not apply anymore.
saturn-vk
06-26-2003, 12:16 PM
ok, so my lilo.conf looks like this:
append="vga=9 hdd=ide-scsi hdc=ide-scsi"
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 1200
change-rules
reset
image = /vmlinuz
root = /dev/hda1
label = Linux
read-only
other = /dev/hda3
label = DOS
table = /dev/hda
i've never done a lilo.conf before. is this how i'm supposed to add my kernel options? (at the top). and what is this "change-rules" and "reset"?
mdwatts
06-26-2003, 12:22 PM
I don't know what 'reset' and 'change-rules' mean. I only use Grub. Check the lilo.conf manpage (man lilo.conf) or try searching Google for Linux for i.e. 'lilo change-rules'.
That looks fine if you want Lilo installed into the mbr.
Now just run /sbin/lilo (as root).
saturn-vk
06-26-2003, 12:28 PM
that didn't work. i ran lilo and then rebooted, but it still prints half a screen full of 01 01 01 01 and so on?
what am I missing. is running /sbin/lilo really overwriting the mbr?
saturn-vk
06-26-2003, 12:31 PM
here's my partition table just in case.
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda1 Boot Primary Linux ext3 24939.05
Pri/Log Free Space 4203.12
hda2 Primary Linux swap 1003.49
hda3 Primary Win95 FAT32 (LBA) 11021.88
and an updated lilo.conf
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 120
image = /vmlinuz
root = /dev/hda1
label = Linux
append="hdd=ide-scsi hdc=ide-scsi"
read-only
vga=9
other = /dev/hda3
label = Windows
table = /dev/hda
mdwatts
06-26-2003, 12:40 PM
Is image = /vmlinuz the correct kernel image? Usually the kernel image is located in /boot.
Check the root directory for vmlinuz and then /boot. It could be named something like vmlinuz-#.#.# (version number).
You may need to add lba32.
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 120
lba32
saturn-vk
06-26-2003, 01:09 PM
yes, i do have /vmlinuz
i'll try wit lba32 now, hope that works. but what does that do exactly?
and is there another way to wipe the mbr without lilo (in case there's something wrong with it)
mdwatts
06-26-2003, 01:27 PM
Dos/Win bootdisk
fdisk /mbr
/sbin/lilo -u
Remember the lilo.conf manpage?
lba32 Generate 32-bit Logical Block Addresses instead of cylinder/head/sector addresses. If
the BIOS supports packet addressing, then packet calls will be used to access the
disk. This allows booting from any partition on disks with more than 1024 cylinders.
If the BIOS does not support packet addressing, then 'lba32' addresses are translated
to cylinder/head/sector ('geometric'), just as for 'linear'. All floppy disk refer_
ences are retained in C:H:S form. Use of 'lba32' is recommended on all post-1998 sys_
tems. Beginning with LILO version 22, 'lba32' is the default disk addressing scheme.
linear Generate 24-bit linear sector addresses instead of cylinder/head/sector (geometric)
addresses. Linear addresses are translated at run time to geometric addresses, and are
limited to cylinders <= 1023. When using `linear' with large disks, /sbin/lilo may
generate references to inaccessible disk cylinders. 'lba32' avoids many of these pit_
falls with its use of packet addressing, but requires a recent BIOS (post-1998).
If lba32 does not work, replace that with linear.
saturn-vk
06-26-2003, 04:18 PM
well i wiped it with lilo -u and then ran lilo again, but it still outputs 01's (which according to the manual mean "invalid disk command")
btw, when i first wiped the win2k mbr, because of the resized and switched partitions, and then ran liloconfig thru the slackware setup, I chose "root" instead of "mbr" for the choices of where to put the boot record. So if lilo looks in the superblock of the bootable partition first, does it ignore mbr altogether? if so, how can i wipe the superblock? Now liloconfig said that option should not be used with xfs, which i think is a journaling fs. Now im not using that, but ext3 is also a journaling fs. Does it apply to me?
mdwatts
06-26-2003, 04:29 PM
The boot sequence checks the mbr first for the default boot record or a bootloader such as Lilo/Grub.
See if you can uninstall with
/sbin/lilo -u /dev/hda
/sbin/lilo -u /dev/hda1
Did you try 'linear' instead of 'lba32'?
saturn-vk
06-26-2003, 04:36 PM
when i tried linear, it spit out this huge error about how my hd had more than 1024 cylinders or something, here's the error:
root@sat:/home/saturn_vk# lilo
Warning: LINEAR is deprecated in favor of LBA32: LINEAR specifies 24-bit
disk addresses below the 1024 cylinder limit; LBA32 specifies 32-bit disk
addresses not subject to cylinder limits on systems with EDD bios extensions;
use LINEAR only if you are aware of its limitations.
Warning: Unable to determine video adapter in use in the present system.
Added Linux *
Warning: device 0x0303 exceeds 1024 cylinder limit.
Use of the 'lba32' option may help on newer (EDD BIOS) systems.
Warning: LINEAR may generate cylinder# above 1023 at boot-time.
Fatal: Sector address 58878225 too large for LINEAR (try LBA32 instead).
btw, now I cannot use lilo -u (with or with linear set), this is what i get:
Fatal: Timestamp in boot sector of /dev/hda differs from date of /boot/boot.0300
Try using the -U option if you know what you're doing.
saturn-vk
06-26-2003, 07:29 PM
Originally posted by mdwatts
That should be the same.
In Partition Magic the active partition has a '*' beside it. (if I remember correctly)
<edit>
If you ever end up reinstalling all your operating systems, repartition the drive as follows.
/boot 20-30mb - primary
Fat32/NTFS ###gb Windows - primary
Extended
Fat32/NTFS ###gb - Windows programs/data etc. - logical
Linux '/' root etc. ###gb - logical
Linux swap ###mb - logical
Install the Linux bootloader in /boot and set that as active.
That way if you reinstall Windows, you don't have to worry about it overwriting the Linux bootloader in the mbr. You may need to reset the /boot partition as active if you reinstall Windows. It may switch the active to itself.
well, i decided to scrape the entire partition table and make a new one. so can you explain to me a few things.
first of all, this boot partition, is it only supposed to hold the /boot directory, if so, why 20 megs, the boot dir is only ~3 on my system.
second, is it a good idea to have more than one primary partition (like i'm having now), is that the root of my problem?
third- if i make boot and maybe a 5gb fat partition, will windows (for those just-in-case moments and maybe a game or two) install correctly, i mean, where's it going to put it's mbr? if lilo resides on hda1(the boot partition), then when windows is installed, where's it going to put itself (and i thought windows can only see one active partition at a time). and if the bios looks for the mbr first, wouldn't a boot partition be pointless?
mdwatts
06-27-2003, 02:16 AM
There is a minimum partition size you can create though I'm not sure what it is. Can you not spare 20mb for the boot partition.
Create as I previously suggested.
/boot 20-30mb - primary
Fat32/NTFS ###gb Windows - primary
Extended
Fat32/NTFS ###gb - Windows programs/data etc. - logical
Linux '/' root etc. ###gb - logical
Linux swap ###mb - logical
Install the Linux bootloader in /boot, configure for dual/multi boot and set /boot as the active partition.
That is all you need to do.
saturn-vk
06-27-2003, 04:35 PM
well, actually i was more curious of exactly what that boot partition is.
is it the /boot directory that usually resides in the boot partition? and I just mount it as /boot? and do I install lilo in the superblock of that said boot partition?
mdwatts
06-27-2003, 05:17 PM
You create a separate 20mb partition and then during install, select to have /boot installed into that partition. The Linux bootloader is then installed into the /boot partition and set as active.
/boot 20-30mb - primary
Fat32/NTFS ###gb Windows - primary
Extended
Fat32/NTFS ###gb - Windows programs/data etc. - logical
Linux '/' root etc. ###gb - logical
Linux swap ###mb - logical