Grub/ Grub2/ Lilo - canīt install any of them properly!
I usually install grub straight away after an install but this time it hasnīt worked for some reason after installing 13.1 on a new lappy.
I have tried grub, grub2 (from sbo) and lilo; nothing I install into MBR will boot my slackware installation, I have to use the boot USB stick every time. grub-legacy would be my preferred one so iīll ask for help specifically with that. This is what iīm doing so far - Code:
root@poppy:/boot/grub# cat /etc/fstab Checking /boot/grub, I see that no menu.lst has been created. Code:
root@poppy:/boot/grub# ls So I tried Code:
grubconfig Code:
Cheers spoov |
Looks like your mixing grub legacy and grub2?
grub legacy uses a menu.lst while grub2 uses a grub.cfg assuming you have grub installed, not grub2 (they will conflict) First, make a menu.lst for /boot/grub title Slackware root (hd0,0) kernel initrd open term, become root, do grub root (hd0,0) setup (hd0) quit should report success or failure |
Yeah I tried grub2 first but couldnīt get it to work, so removepkg-ed it and installed grub instead. I thought it might cause problems but hoped that everything was over-writable so wouldnīt be too much of a problem.
Anyway i did as you suggest, this is the output - Code:
grub> root (hd0,0) |
I get the grub menu, but when i select ĻSlackwareĻ I get
Code:
Error 1: Filename must be either an absolute pathname or blocklist Code:
root (hd0,0) |
no, you gotta fill it in
kernel /boot/name-of-kernel ro root=/dev/sda1 initrd /boot/name-of-initrd |
ah i see. Problem is I don't have an initrd in my boot partition. -
Code:
spoovy@poppy:/boot$ ls |
the dont put the initrd parameter
wait, why do you have different kernels? you have every kernel LOL what is your machine 486 or 686? smp or no? if its new lappy either use vmlinuz-huge-smp-2.6.33.4-smp or vmlinuz-generic-smp-2.6.33.4-smp the diff is with the generic kernel it is smaller but has less features and you need an initrd with the generic one the huge-smp doesnt need an initrd what does "ls -al" report about vmlinuz? vmlinuz should be a symlink to your running kernel if it's vmlinuz-huge-smp-2.6.33.4-smp then thats ok so, it would be title Slackware root (hd0,0) kernel /boot/vmlinuz ro root=/dev/sda1 |
I tried that setup, but still no luck. I get "File not found". It's finding /boot partition ok but can't seem to find the kernel. I tried
Code:
root (hd0,0) This is uname -a, from within the Slackware installation we are talking about - Code:
Linux poppy 2.6.33.4-smp #2 SMP Wed May 12 22:47:36 CDT 2010 i686 Genuine Intel(R) CPU 575 @ 2.00GHz GenuineIntel GNU/Linux Symlink in /boot seems to be ok - Code:
bash-4.1$ ls -lA | grep vmli |
oh
what partition is /boot on? and what partition is root / on? |
my fstab is posted in my op. /boot is sda1, / is sda2.
I have just read a little about smp. I understand that this is for symmetric processing therefore for multi-core processors. This machine is a single-core processor. Would that mean that I am running the wrong kernel? It works, once it's booted. |
I'm a bit confused because you are looking at "poppy" Linux with "uname" but apparently trying to install Slackware for booting. It is the version and kernel of the Slackware system that is important for booting Slackware, not the version of Linux you are using to install/configure GRUB.
SMP - Symetric-Multiprocessing (supports multiple CPUs in one OS) root - Means different things in different situations. Location of GRUB's files when installing GRUB (use "root" command) Location of kernel and initrd files in a "menu.lst" entry (use "root" command) Location of Linux OS files and root file system in a menu.lst entry ("root=" of "kernel" command) I've had the least problems installing GRUB when I use a GRUB boot CD or floppy and install GRUB from the native GRUB command line. That means boot only GRUB and press C to get the GRUB command line. Then enter GRUB commands to install GRUB. You can find instructions for that in the GRUB "info" pages or I can create an ISO image for you. If you look in the "/boot/grub" directory you should see the files required for GRUB. GRUB legacy requires these files to support all types of booting. Code:
iso9660_stage1_5 ufs2_stage1_5 Code:
title Linux Code:
rm vmlinuz Boot from a grub floppy disk or CD, or make sure that the "device.map" file has the correct information for the Linux system that you are using to install GRUB (not what you are going to boot with grub). IMPORTANT: DO NOT change the BIOS default boot disk or device boot order after configuring and installing GRUB. The DOS drive ID's (hd0), (hd1), etc. are defined based on the BIOS configuration. To install GRUB you specify two important locations.
For example, these GRUB commands will install GRUB to boot from the MBR (Master Boot Record) of the first hard disk, and load the GRUB files from the first partition on the first hard disk. Code:
root (hd0,0) Code:
root (hd0,0) Code:
root (hd0,2) Here is how I usually install GRUB.
I use GRUB legacy because it is very simple and flexible. LILO is nearly as flexible except for the need to re-run "lilo" after configuration changes. There is a difference between the environment when GRUB is being run from Linux versus when it is booting a system (native mode). When you type an identifier such as (hd0) GRUB has to convert that into a device identifier. On Linux that is done using "device.map" or by looking at information about devices in the kernel. From native booting mode, the BIOS is given a device ID and that is mapped to a disk by the BIOS. (hd0) BIOS device ID 80 (hex) (hd1) BIOS device ID 81 (hex) (hd2) BIOS device ID 82 (hex) (hd3) BIOS device ID 83 (hex) In some cases GRUB running on Linux cannot correctly determine the correct drive mapping or cannot access the boot sectors for installing GRUB. In that case you have to install GRUB from native mode by booting a GRUB floppy or CD to enter commands. Press "C" during the grub boot menu in order to enter GRUB commands. If you change BIOS settings after you install GRUB then the BIOS device ID's may change. Even when the assignment for the first BIOS device ID (80) does not change, a BIOS may change assignments of IDs to other disks. Many people are confused about boot sectors. There are basically 5 boot sectors on the first hard disk.
The BIOS only knows about hard disks (drive ID 80..83), not partitions. The BIOS always loads and runs the Master Boot Record sector of the first hard disk (80 hex). The standard boot sector software in the Master Boot Record looks for the Primary Partition marked as "active" (the "boot" partition). It loads and runs the boot sector for the "active" boot partition. The boot sector software in each Primary partition usually loads and starts the boot loader who's files are in that same Primary partition. If you "setup" GRUB to start from the Master Boot Record then the only way to start other boot loaders is by chaining to them. The "active" partition is ignored since the GRUB boot sector replaces the standard MBR software. There is very little advantage to installing GRUB to the MBR and it can cause problems for other operating systems. If you "setup" GRUB to start from a partition boot sector then you can use the "active" boot flag in the partition table to choose which boot loader starts up first. That can be GRUB if you want. Usually you "setup" GRUB to start from the partition that contains GRUB's files. The only time that you really must install grub to the Master Boot Record is when you need five different boot loaders and the other four are installed to the Primary partition boot sectors. Some people feel that installing GRUB to the MBR is easier than installing GRUB to the Linux partition's boot sector. I have found the reverse to be true as modifying the MBR has a tendency to break Windows booting and un-installing GRUB from the MBR prevents booting other operating systems. My suggestion is to install GRUB to a Linux partition's boot sector and then mark that partition as "active" for boot if you want GRUB to start first. If you have no other operating systems then you may have to format the disk or write the standard boot code into the MBR first. You should at least be able to get GRUB to start up and press "C" for command mode. At that point you can manually enter commands to boot the kernel even when "menu.lst" is incorrect. When you boot a kernel (and associated initrd) the kernel file and initrd file do not have to be in the same place as the root file system used by Linux. You specify the location of the root file system in the kernel parameters using "root=". You can put all your kernel and initrd files in the same place if you want. I find it less confusing to put the kernel and initrd files for each Linux system in that Linux system's root partition. You only need one working copy of GRUB and there is no reason to have GRUB chain to a different version of GRUB. It's less confusing if you don't install a GRUB for each Linux OS. In fact you can even create a separate, small Primary partition just for GRUB. Depending on your needs, you can also put all the kernel and initrd files in the same small partition with GRUB. That may be helpful for encrypted file systems, for example. To install GRUB successfully you need to know where you will put the GRUB files "/boot/grub" and also how you will start GRUB. Your choices for starting GRUB are basically the MBR versus a Linux Primary partition's boot sector. To boot Linux successfully you need to know where the kernel/initrd files are located "/boot". You will also need to know the root device where that kernel's Linux OS is installed. The disk containing the kernel/initrd files is specified by the "root" command of the "menu.lst" entry. Both the kernel and initrd must be in the same partition. The root device for the OS files is specified by the "root=" kernel parameter in the "kernel" command for the menu.lst entry. If you use a name such as "vmlinuz" or "initrd" that may be a symbolic link, make sure that the link goes to the correct files. If you build your own kernel you can also remove the symbolic links and create actual files called "vmlinuz" and "initrd". Each Linux OS can have its own "vmlinux" symbolic link located in its "/boot" directory of its root partition. The "root" menu option specifies the partition for those two files. |
Quote:
FYI its the same installation. I am currently booting into it using the boot usb stick I created at install time. I am trying to set up grub so I don't need the usb stick. I will read through the rest of your post in a bit = thanks! |
I believe that the problem booting is due to specifying a "boot"
directory name when in fact, the directory name should not be specified. Code:
title Linux You could also solve the problem by creating an extra symbolic link. Code:
cd /boot Then you can use either "kernel /vmlinuz" or "kernel /boot/vmlinuz" in "menu.lst". |
You might try one or more of the utilities found here: http://www.supergrubdisk.org/
They can often be helpful in rescuing a GRUB installation. |
EricFl is right
I never use a /boot partition...never really understood why anyone does.. but I think thats the issue |
Quote:
Except for my painful experience installing Linux on fake hardware RAID I wouldn't have learned a lot about GRUB booting. I have to say that the painful experience was with Slackware 10. At that time Slackware was the only distro that I could figure out how to boot from my RAID. Today, Slackware is much easier to install on fake hardware RAID. Slackware has made exceptional progress in adding flexibility and support for unusual boot requirements. |
Well, I tried removing the /boot section of the menu.lst line as suggested. Completely forked it up. Kernel panic ensued, and it also somehow stopped my USB boot stick from working so I can't get into my slack installation at all.
I dug out an old super grub disk from somewhere and that can't boot it either. I'm in puppy linux at the moment trying to get back into slackware to sort something out - i will try to put in the extra simlink as you suggest. I hate Grub with a passion, I have as little to do with it as possible, and i'm remembering why again. Additional - I created the simlink, tried to boot again, still kernel panic. Error message says something about not syncing - unable to find init. |
Quote:
|
Finally!
Code:
root (hd0,0) Thanks very much for your help guys, very much appreciated!! |
No doubt!
now, I suggest you make or get a compatible slackware livecd/usb to fix anything if it ever gets messy again. Better than using Puppy or some other non-slack distro! That's why I made the MiniSC and MiniSCR, runs just like Slax their slackware -current but I have one that has both the slackware 2.6.33.4-smp kernel and a 2.6.35.6 kernel too. the latest one only has 2.6.35.7-smp kernel MiniSCR (R= rescue) (best for persistent usb) http://multidistro.com/NFLUXNEW/SQ4/...os/miniscr.zip see here http://linux.softpedia.com/get/Syste...ue-60734.shtml Quote:
http://www.salixos.org/wiki/index.php/Download and i can easily show you how to make your own installable/persistent hdd/usb rescue cd with desktop,etc or just remaster one Good luck on your adventures in Slackware! |
I also think that the separate boot-partition might be the issue. I recently installed Slackware 13.1 and created a separate boot-partition (for information, the reason for this is that on older PCs, but maybe not anymore, be BIOS (?) couldn't handle boot partitions larger than X mb so it was recommended to create a boot-partition which was smaller than 1 GB/1024MB).
I couldn't get it to boot, so I tried installing with everything on the same partition, and then it worked. For my installation I had lilo as boot manager though as that was the default. |
A Salix USB would make a handy backup certainly, i'll give that a go.
You are probably right that the boot partition is the problem, but I normally use one as I normally encrypt mobile devices. I only didn't bother this time as I was in a hurry and there doesn't seem to be an easy way to encrypt with the Slackware installer - I intend to reinstall Slackware on this lappy soon but using encrypted LVM. Hopefully it will be easier next time now I know more about how grub works and I will definately have a Salix USB rescue installation! Thanks again. |
Eric Fl Thank you for the excellent 'Howto'/description of Grub! It is by far the best I have read on the very confusing complex subject.
|
+1 ^
It should be a wiki article if it isn't already. |
Grub2 uses grub-mkconfig to generate a configuration file for you. It appears to work fairly well, although I've written a /etc/grub.d/09_slackware_linux file (based off the 10_linux file that comes with the grub2 slackbuild) that attempts to match the way Slackware does things versus (I guess) Debian's way.
I've got a mix of SATA and SCSI drives, a root partition on lvm, a separate /boot ext2 partition and a Windows XP drive. grub-mkconfig managed to find everything and provided valid menu entries. (Well, the 10_linux menu generator script appears to believe that you would use an available initrd with any kernel that has the same version number.) |
Quote:
|
Just a brief remark: You need some code in the MBR, since (as EricFL pointed out) the BIOS loads that code first. THis MBR-code then starts GRUB proper. If necessary GRUB can put that code in the MBR.
Reason I mention this: If you build your own machine or buy a new disk and have no OS running yet you have to install this code once -- in this case by GRUB. |
All times are GMT -5. The time now is 03:41 AM. |