LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-06-2006, 03:21 PM   #46
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612

Same thing, remember the boot sector of the hard drive is not part of the partition -it only contains bootable code at first and the partition table at the last. This partition information then points to the starting sector of one or more partitions. When you create an extended partition not all the info will fit in the partition table. So another sector is set aside in which more info can be stored. The partition table in the first sector then points to this sector which details the rest of the extended partition info.
The BIOS just reads the first sector of whatever bootable device in question. Linux uses DOS-style partition tables located in the last 66 bytes of the first 512 byte sector. The first 446 bytes are the bootloader. Under DOS/WIN this is 16 bit code that just looks at the last 66 bytes(the partition table), figures out which partition is set 'active' or bootable and then reads the first sector of the *partition* into RAM and begins executing that code. Under Windows this would be IO.SYS or MSDOS.SYS as mentioned.
Under Linux, lilo or the GRUB Stage 1 are installed in the first 446 bytes. lilo installs completely in this space, but GRUB needs more space since it can do more, so the bootcode points to GRUB Stage2 which contains the GRUB shell/bootloader.
These are not the same thing:
dd if=/dev/hda of=MBR count=1 bs=512
dd if=/dev/hda1 of=MBR count=1 bs=512

Installing lilo only writes the first 446. using fdisk onls works with the bytes from 446-512 and any extended partition table. formatting tools work on the rest. (dd works anywhere)

If you put Linux as the first drive you'll lose that error. As said, it's not a problem -lilo is on hda and the bootmap is saved under /boot on hdb but lilo can deal with that. But I'd leave Windows on the primary drive, if possible.
 
Old 08-06-2006, 03:57 PM   #47
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
You could, and would, install lilo to the mbr. By gnashley's explanation, lilo only uses the first part of the bootable, just to tell where to go. Windows is happy, because it doesn't know lilo is there, so it thinks it's still king of the world. Linux knows it is king, so it doesn't care.

Think of the single drive w/2 os's as the same thing as your two harddrives. The same pricipal applies. Windows is on /dev/hda1, linux on /dev/hda2. Same thing as you have now, except differnt drive designations.

The rule of thumb is this:
  • Install Windows first, so it thinks it owns the world.
  • Install Slackware next
  • Install lilo on mbr of /dev/hda
Doing it in this order always keeps Windows happy, which is the difficult part. It doesn't matter where Slackware is, but it does matter where windows is. So always install Windows as /dev/hda1, Slackware where ever you want, and lilo to mbr of /dev/hda.

With this rule of thumb, you can have:
: /dev/hda1 XP
: /dev/hda2 Slackware
: /dev/hda3 swap (can be for both Slackware and XP. Look elsewhere for info on doing this. Search is your friend!!)
: /dev/hdaX for /usr, or whatever, even a fat32 partition to trade files between both os's.

The importtant bit is XP on /dev/hda1, and lilo on mbr of /dev/hda
 
Old 08-07-2006, 01:23 AM   #48
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Question

Ok, and will I be at a success if on a system with an already installed Windows, and a single hard drive, I install Slackware and install lilo to the root partition of Slackware? Will lilo be started at all and will it be able to load both Windows and Slackware? Or I will have again have no other alternative, but install lilo to the MBR of the hard drive?
When lilo is not in the mbr, but in the root partition of Slackware, BIOS will load the boot sector and start Windows I think, because there the Windows loader is, isn't it like that? According to me lilo will not be started at all, the system will boot straight into Windows. How will BIOS know to look for lilo in the root partition of Slackware and start the lilo bootloader there?
 
Old 08-07-2006, 01:53 AM   #49
cwwilson721
Senior Member
 
Registered: Dec 2004
Location: In my house.
Distribution: Ubuntu 10.10 64bit, Slackware 13.1 64-bit
Posts: 2,649
Blog Entries: 1

Rep: Reputation: 67
It won't. If you want a true dual boot, INSTALL TO THE MBR.

I know I said that three times.

Forget it. If you are TOO thick to follow instructions, you're on your own.

I give up.
 
Old 08-07-2006, 02:07 AM   #50
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Question

Ok, I am just asking, because I want to know. I am not quarrelling. I am just asking what will happen if on a system with a single hard drive and Windows already installed, I install Slackware Linux and install lilo to the Linux root partition? Because there are systems where lilo is installed to the root partition, and they work, isn't it like that?
How does BIOS on such system know that there is lilo in the linux root partition? I am just asking because I am curious to know.
 
Old 08-07-2006, 02:22 AM   #51
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by tramni1980
Ok, I am just asking, because I want to know. I am not quarrelling. I am just asking what will happen if on a system with a single hard drive and Windows already installed, I install Slackware Linux and install lilo to the Linux root partition? Because there are systems where lilo is installed to the root partition, and they work, isn't it like that?
How does BIOS on such system know that there is lilo in the linux root partition? I am just asking because I am curious to know.
If you keep LILO on the /boot partition of Slackware instead of the MBR, you need another boot loader in the MBR to point to Windows and the /boot partition to boot Slackware.

With the Windows default boot loader in the MBR, you cannot boot into Slackware or any other Linux without a boot floppy or boot CD.
 
Old 08-07-2006, 02:36 AM   #52
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Question

Thank you. It is clear to me now I think. So in order to have a dual booting system I have to install the boot loader in the mbr. So the implementations where lilo is in the /root partition, assume that in the mbr of the hard drive there is another bootloader, which is not the defailt Windows bootloader. Im I right?
What is still a bit misty to me, is the following: what is the sense of installing the lilo bootloader to the /root partition, since the other bootloader, which is in the MBR of the hard drive and is different from the default Windows bootloader, can be tuned to load Linux? If you do not feel like explaining that to me, I would be thankful is you suggest me some free literature, accessible via the internet, which will clarify this topic to me . What sense does chaining the bootloaders make, since one can place a single bootloader in the MBR of the hard drive, which will be able to load all the operating systems installed on the machine?
 
Old 08-07-2006, 02:52 AM   #53
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Quote:
Originally Posted by tramni1980
Thank you. It is clear to me now I think. So in order to have a dual booting system I have to install the boot loader in the mbr. So the implementations where lilo is in the /root partition, assume that in the mbr of the hard drive there is another bootloader, which is not the defailt Windows bootloader. Im I right?
What is still a bit misty to me, is the following: what is the sense of installing the lilo bootloader to the /root partition, since the other bootloader, which is in the MBR of the hard drive and is different from the default Windows bootloader, can be tuned to load Linux? If you do not feel like explaining that to me, I would be thankful is you suggest me some free literature, accessible via the internet, which will clarify this topic to me . What sense does chaining the bootloaders make, since one can place a single bootloader in the MBR of the hard drive, which will be able to load all the operating systems installed on the machine?
Nothing prevents you from installing a third-party boot loader (say like XOSL) in the MBR and then installing LILO in its own boot partition). This is one form of chain loading you can use.

This might actually work to your advantage since that boot loader can exist separate from the OS. And something like XOSL can easily be configured without having to boot into one OS or the other.

The only downside of using a third party boot loader is that it mostly won't be able to boot Linux natively so you would still have to install LILO in its own boot partition. Cannot do without LILO or GRUB either way to boot Linux. Makes it also a bit more complicated, but that way you avoid LILO in the MBR.

In any case where you you want to dual boot, you *need* a custom boot loader in the MBR or you would require a boot floppy or CD every time.
 
Old 08-07-2006, 03:00 AM   #54
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Smile

Ok, thank you very much indeed. Things are clear to me now.
I apologize for any dull questions.
 
Old 08-07-2006, 11:10 AM   #55
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
Quote:
Originally Posted by tramni1980
The only thing is that somewhat slowly starts the lilo prompt, there are about 10 seconds scratchy,rasping sounds and then the prompt appears. Probably the reason is that the boot sector and the map file are on different disks, what says the lilo warning. Have you got some idea how to adjust that?
Was this not when the computer was booting from the floppy drive? Your HDDs probably shouldn't be making noises like that (too much, anyway -- some generally older HDDs are pretty noisy).

Glad to hear things are working out for you now, but it was a rather strange issue - Windows boots fine when lilo is installed during Slackware installation, but not after rerunning lilo...

One more thing I wanted to mention, having mentioned it before but evidently becoming lost in the rest of it - you really shouldn't have to keep reinstalling slackware over and over again. For one thing, the setup program can skip the steps to actually install the software, you could just set up the partitions (which is actually just for configuring lilo... no changes are made to your system at that step), configure the network, font, etc. and you'd be done in about 5 minutes.

When you swapped HDDs and forgot to edit /etc/fstab you could have used a rescue disk to boot into your Slackware system and simply edit it then. Of course the steps to do this can be slightly complicated, but it's worth learning how to do this type of thing.
 
Old 08-07-2006, 12:14 PM   #56
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
That floppy that you made first with lilo on it is your perfect custom boot floppy.

I actually prefer to use GRUB and have windows NTLDR load that since GRUB is a lot more flexible. You don't even write to the MBR at all, just make an entry in the boot.ini file which points to GRUB Stage1 and you are set.
I have several patched versions of GRUB with installer programs for use under Windows or DOS here:
http://distro.ibiblio.org/pub/linux/...ects/AFX-GRUB/
 
Old 08-07-2006, 05:36 PM   #57
Slim Backwater
Member
 
Registered: Nov 2005
Distribution: Slackware 10.2 2.6.20
Posts: 68

Rep: Reputation: 15
Quote:
Originally Posted by tramni1980
Ok, I am just asking, because I want to know. I am not quarrelling. I am just asking what will happen if on a system with a single hard drive and Windows already installed, I install Slackware Linux and install lilo to the Linux root partition? Because there are systems where lilo is installed to the root partition, and they work, isn't it like that?
How does BIOS on such system know that there is lilo in the linux root partition? I am just asking because I am curious to know.
This would be something neat to try out. Single hard drive system, setup a windows partition (less than the full drive) and install Windows. Then boot the Slackware CD and install Slackware to another partition, and install LILO to the ROOT (Superblock) and reboot.

The the DOS/Windows MBR should boot whichever partition is marked active, which should still be the windows partition, so Windows should load (NO LILO). In a command prompt, fire up Windows FDISK and set the Slackware partition bootable and reboot; LILO should be loaded from the root of the slackware partition.

This is probably the only configuration where a Linux partition needs to be marked bootable.

Then I think there is a way to edit the Windows BOOT.INI to present a boot selection to boot Linux. A quick google hasn't given me a clear answer on this yet (The results so far indicate that you need to put something on the C: drive.)

._.

*Edit: They are saying that you have to get a copy of the LILO boot sector as a file onto the windows partition, and add an entry to the boot.ini to that file.

Last edited by Slim Backwater; 08-07-2006 at 06:04 PM.
 
Old 08-08-2006, 05:39 AM   #58
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I had a distro that used a DOS/WIN (.bat) batch script to run a w32 binary called grubinstall.exe which installs GRUB Stage1 and Stage2 to the same drive as NTLDR and places an entry in the boot.ini file for you. Basically, running this script under windows would turn your machine into a dula-boot machine in about 3-4 seconds, the safest, easiest way ever. It soen't really make any difference if it's just one disk or more than one. (My distro didn't even need you to create a separate partition for linux).
Anyway, a lot of the stuff I have used or may in fiuture can be found here:
Have a look around here:
http://distro.ibiblio.org/pub/linux/...RUB/Resources/
 
Old 08-09-2006, 10:23 PM   #59
Slim Backwater
Member
 
Registered: Nov 2005
Distribution: Slackware 10.2 2.6.20
Posts: 68

Rep: Reputation: 15
Quote:
Originally Posted by Slim Backwater
This would be something neat to try out. Single hard drive system, setup a windows partition (less than the full drive) and install Windows. Then boot the Slackware CD and install Slackware to another partition, and install LILO to the ROOT (Superblock) and reboot.

The the DOS/Windows MBR should boot whichever partition is marked active, which should still be the windows partition, so Windows should load (NO LILO). In a command prompt, fire up Windows FDISK and set the Slackware partition bootable and reboot; LILO should be loaded from the root of the slackware partition.

This is probably the only configuration where a Linux partition needs to be marked bootable.
Following up with myself, I got a chance to try this out today. Installed Windows 2000 onto a 10 Gig partition (/dev/hda1) then installed Slackware 10.2 to a 10GB hda2 and installed LILO to the superblock of the root partition. Leaving hda1 marked bootable, windows loaded; and when I marked hda2 bootable, lilo started up with Windows/Linux boot options.

I chose the simple LILO install and got both Windows and Linux boot options. I didn't actually try the Windows Option, but Slack booted just fine.

I'll try the Windows option and report back if it works fine too.

._.
 
Old 08-09-2006, 10:37 PM   #60
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
That's a really cool idea, Slim Backwater... I keep learning something new every day.
 
  


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
Another lilo problem jerryvb Slackware 13 05-09-2006 11:36 AM
Lilo vs Grub - PROBLEM with lilo nelsonnery Linux - Software 2 09-09-2004 11:09 AM
LILO problem ZeroCoolJr Slackware 8 12-09-2003 07:45 PM
LiLo Installation problem ?and (GNOME and KDE problem) hitesh_linux Linux - Software 1 01-01-2002 04:56 AM
Problem with Lilo not updating (yes I ran lilo after changing the conf) webguy Linux - General 2 06-24-2001 07:12 PM

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

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