LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Can't boot Ubuntu from Slackware with lilo (https://www.linuxquestions.org/questions/slackware-14/cant-boot-ubuntu-from-slackware-with-lilo-713194/)

Linux.tar.gz 03-20-2009 02:14 PM

Can't boot Ubuntu from Slackware with lilo
 
I installed Ubuntu Studio without grub.

Then i added this to my lilo.conf :

image = /mnt/hd/sda5/boot/vmlinuz-2.6.27-7-generic
root = /dev/sda5
label = UbuntuStudio
initrd = /mnt/hd/sda5/boot/initrd.img-2.6.27-7-generic
read-only

It worked fine until i updated Ubuntu.
Now i can't boot neither new or old kernel...
I only get a can't find /root error message, and a shell.

A detail : my first hd is IDE, so Slack recognize it as hda, and Ubu, sda.
Putting root = /dev/sdb5 gives me Fatal: Illegal 'root=' specification: /dev/sdb5

But it worked anyway with root = /dev/sda5 .

Any idea ?

Kelean 03-20-2009 02:40 PM

Look at your /ect/fstab file. See it your ubuntu partition is listed correctly. Also check lilo to see if it was changed durning the update.

Erik_FL 03-20-2009 04:02 PM

Quote:

Originally Posted by Linux.tar.gz (Post 3482406)
I installed Ubuntu Studio without grub.

Then i added this to my lilo.conf :

image = /mnt/hd/sda5/boot/vmlinuz-2.6.27-7-generic
root = /dev/sda5
label = UbuntuStudio
initrd = /mnt/hd/sda5/boot/initrd.img-2.6.27-7-generic
read-only

It worked fine until i updated Ubuntu.
Now i can't boot neither new or old kernel...
I only get a can't find /root error message, and a shell.

A detail : my first hd is IDE, so Slack recognize it as hda, and Ubu, sda.
Putting root = /dev/sdb5 gives me Fatal: Illegal 'root=' specification: /dev/sdb5

But it worked anyway with root = /dev/sda5 .

Any idea ?

In order to sort this out you have to keep in mind the different contexts in which LILO will execute and LILO boot parameters will be used.

- BIOS boot time (lilo menu)
- LILO configuration (Slack is booted)
- Ubuntu boot time (Ubuntu is booted)

At BIOS boot time when lilo displays the boot menu, it uses BIOS disk drive ID's such as 0x80, 0x81, etc. to refer to drives and it uses the sector addresses of files to load the files. The device names in Linux are no longer used by lilo after "lilo" has been installed / updated using the "lilo" configuration command.

The "image" and "initrd" options are evaluated when lilo is configured using the "lilo" command in Slack. After you make ANY changes to "lilo.conf" you have to run the "lilo" command and that essentially parses the configuration and writes it to the boot sector for lilo. The "image" and "initrd" information is converted to a hard disk ID 0x80, 0x81, 0x82, etc and sector addresses on the disks. The names of devices are only important for the "lilo" configuration command and are not used by "lilo" when it actually loads the files.

So you want "image" and "initrd" to use the device names as Slack knows them NOT Ubuntu. That allows the "lilo" configuration command to figure out the corresponding drive ID and sector addresses for each file.

The "root" option is passed to the Linux kernel (Ubuntu) and must be from the perspective of Ubuntu device naming for the root device. The "root" option is not used by "lilo" at all. It is just stored along with other kernel parameters (text) passed to the kernel. Ubuntu is the kernel in this case so "root" must be the correct information for Ubuntu. Ubuntu will use the root device name plus the "read-only" option for mounting the root device AFTER the Ubuntu kernel has initialized.

If the root device driver in Ubuntu is a module then you have to make sure that the "initrd" image file loads that module and any other required modules. The standard "initrd" image for Ubuntu probably loads the required driver unless you have an unusual hard disk controller card/chip. The "initrd" image does things from the standpoint of Ubuntu and not Slack and must be built using Ubuntu.

Here is my suggestion for a possible solution.

Code:

image = /mnt/hd/hda5/boot/vmlinuz-2.6.27-7-generic
  root = /dev/sda5
  label = UbuntuStudio
  initrd = /mnt/hd/hda5/boot/initrd.img-2.6.27-7-generic
  read-only

After you change that in "lilo.conf" don't forget to use the "lilo" command. If you copied the boot block to a file for Windows then update the copy of the boot block as well.

To clarify how this whole process works here is basically what happens.

=========== Slack
You edit the "lilo.conf" file using Slack
You run the "lilo" command in Slack
The "lilo" command converts devices/files to disk ID/sector
The "lilo" command writes the "lilo" boot sectors
=========== BIOS
You start up the computer
Lilo loads and displays the menu
Lilo uses the disk drive ID and sector information to load the Ubuntu kernel into memory.
Lilo uses the disk drive ID and sector information to load the initrd image (RAM disk filesystem) into memory.
=========== Ubuntu Kernel
Lilo starts the Ubuntu kernel specifying the kernel parameters provided, including information for "root=" and the RAM disk filesystem.
Ubuntu mounts and runs the init script for the "initrd" filesystem image.
The "initrd" script loads required modules and does other things to make the root device accessible.
The "initrd" script mounts the root device (read-only) and then starts the Ubuntu "init" task that completes the initialization of the system.

It IS important which operating system you use to run the "lilo" command because device names used in "image" and "initrd" must be for that operating system (not the one ultimately being booted). You may need a different "lilo.conf" depending on which operating system will update the lilo configuration with "lilo".

ajlewis2 03-20-2009 04:03 PM

I read something similar here. It seems that Ubuntu made some changes that affected this person while using grub.
http://www.linuxquestions.org/questi...ptions-689878/

It's something about a change in inode size. Since you only did an upgrade, maybe this is not your problem.

Erik_FL 03-20-2009 04:17 PM

Quote:

Originally Posted by ajlewis2 (Post 3482512)
I read something similar here. It seems that Ubuntu made some changes that affected this person while using grub.
http://www.linuxquestions.org/questi...ptions-689878/

It's something about a change in inode size. Since you only did an upgrade, maybe this is not your problem.

I have run into the inode size issue with Ubuntu and Slackware. The old default size for inodes in ext2/ext3 was 128 bytes. Both Slackware and Ubuntu now default to using a 256-byte inode. The "grub" included with Slackware packages has been patched to support 256-byte inodes and so has the "lilo" included with Slackware.

If one downloads "lilo" or "grub" from somewhere else one has to be sure that they support the 256-bit inodes or format the partitions using 128-byte inodes.

I have found that many programs such as Paragon Hard Disk Backup and the ext2ifs driver for Windows do not support the 256-byte inodes. I always format partitions using 128-byte inodes. That is a little bit difficult since it has to be done before using the Slackware "setup" program.

mke2fs -j -I 128 /dev/hda2

The "/dev/hda2" has to be replaced with the correct Linux device name for the partition. The "-j" option enables journalling (ext3 filesystem) and it can be omitted to format using no journal (ext2). The "-I" option specifies the size of inodes.

One can verify the inode size using this command.

tune2fs -l /dev/hda2

After formatting the partition then Slackware can be installed using the normal "setup" command. Just make sure not to reformat the partition during "setup". Use the existing partition as is.

I'm not sure exactly how to get a command prompt in Ubuntu setup but it should be possible to do the same thing. It may be easier just to create and format the Ubuntu partition using Slackware and then install Ubuntu to the existing partition.

MannyNix 03-20-2009 04:51 PM

Last time I was brave enough to try fedora and ubunu got into something similar. I searched this forums and came across something that helped. I don't remember at the moment how to get that info, but here's a copy from that old lilo.conf. Notice the UUID was what fixed it for me.
Good luck

Code:

# Ubuntu
image = /mnt/ubuntu/boot/vmlinuz-2.6.27-7-generic
#  initrd = /mnt/fedora/boot/initrd-2.6.25-14.fc9.i686.img
  initrd = /mnt/ubuntu/boot/initrd.img-2.6.27-7-generic
 # root = /dev/hda9
  root = "UUID=473fcc12-22a2-41b3-b25d-92b66cb26a99"
  label = Ubuntu
  read-only


Erik_FL 03-20-2009 06:03 PM

Quote:

Originally Posted by MannyNix (Post 3482551)
Last time I was brave enough to try fedora and ubunu got into something similar. I searched this forums and came across something that helped. I don't remember at the moment how to get that info, but here's a copy from that old lilo.conf. Notice the UUID was what fixed it for me.
Good luck

Code:

# Ubuntu
image = /mnt/ubuntu/boot/vmlinuz-2.6.27-7-generic
#  initrd = /mnt/fedora/boot/initrd-2.6.25-14.fc9.i686.img
  initrd = /mnt/ubuntu/boot/initrd.img-2.6.27-7-generic
 # root = /dev/hda9
  root = "UUID=473fcc12-22a2-41b3-b25d-92b66cb26a99"
  label = Ubuntu
  read-only


That's a very good suggestion. I think that one can use either the UUID or a device name. If the device name doesn't work then the UUID might be the best solution. I'm not exactly sure how to find out the UUID but I'm sure there is a way.

bgeddy 03-20-2009 07:53 PM

Quote:

I'm not exactly sure how to find out the UUID but I'm sure there is a way.
As root run blkid to find out UUID's.

disturbed1 03-20-2009 07:55 PM

Quote:

Originally Posted by Erik_FL (Post 3482590)
I'm not exactly sure how to find out the UUID but I'm sure there is a way.


ls -l /dev/disk/by-uuid/

Linux.tar.gz 03-21-2009 04:12 AM

Thanks all for your help and suggestions.
It appears Ubuntu can boot again, due to some magic, because i came back to my initial setup after many tweaks.
I remember i used to launch lilo twice with an old machine... Maybe i have to do the same here.

Thanks again.

onebuck 03-21-2009 08:25 AM

Hi,

Quote:

Originally Posted by Erik_FL (Post 3482511)
In order to sort this out you have to keep in mind the different contexts in which LILO will execute and LILO boot parameters will be used.

- BIOS boot time (lilo menu)
- LILO configuration (Slack is booted)
- Ubuntu boot time (Ubuntu is booted)

At BIOS boot time when lilo displays the boot menu, it uses BIOS disk drive ID's such as 0x80, 0x81, etc. to refer to drives and it uses the sector addresses of files to load the files. The device names in Linux are no longer used by lilo after "lilo" has been installed / updated using the "lilo" configuration command.

I'm not going to get into a semantics or a 'pissing' contest but your definitions are not correct. BIOS does boot the system but will load the 'IPL' bootloader. If that bootloader happens to be 'lilo' then the information from the 'lilo.conf' file was used to create the 'IPL' at creation. If you wish to use the BIOS system device configurations then you can do so but not necessary with 'Linux'. Just remember that BIOS >IPL > SPL! Some fall into the M$ trap. This is GNU/Linux an we can use the system not the system using us. :)

Quote:

Originally Posted by Erik_FL (Post 3482511)
The "image" and "initrd" options are evaluated when lilo is configured using the "lilo" command in Slack. After you make ANY changes to "lilo.conf" you have to run the "lilo" command and that essentially parses the configuration and writes it to the boot sector for lilo. The "image" and "initrd" information is converted to a hard disk ID 0x80, 0x81, 0x82, etc and sector addresses on the disks. The names of devices are only important for the "lilo" configuration command and are not used by "lilo" when it actually loads the files.

I'm sorry but your definitions are not complete. Once the information is passed via the IPL > SPL then devices are handled by the kernel. The initrd is nothing more than a temporary filesystem that is utilized by the kernel.
A user will create the 'initrd' to reflect the installed system.

Code:

excerpt from SlackwareŽ 12.2
'/boot/README.initrd';

1.  What is an initrd?

Initrd stands for "initial ramdisk".  An initial ramdisk is a very small
Linux filesystem that is loaded into RAM and mounted as the kernel boots,
and before the main root filesystem is mounted
.

2.  Why do I need an initrd?

The usual reason to use an initrd is because you need to load kernel
modules before mounting the root partition.  Usually these modules are
required to support the filesystem used by the root partition (ext3,
reiserfs, xfs), or perhaps the controller that the hard drive is attached
to (SCSI, RAID, etc).
  Essentially, there are so many different options
available in modern Linux kernels that it isn't practical to try to ship
many different kernels to try to cover everyone's needs.  It's a lot more
flexible to ship a generic kernel and a set of kernel modules for it.

Code:


       
Quote:

       
       
               
       
       

                       

                       
                               

                                        Originally Posted by Erik_FL
                                        (Post 3482511)
                               

                               
So you want "image" and "initrd" to use the device names as Slack knows them NOT Ubuntu.  That allows the "lilo" configuration command to figure out the corresponding drive ID and sector addresses for each file.

The "root" option is passed to the Linux kernel (Ubuntu) and must be from the perspective of Ubuntu device naming for the root device.  The "root" option is not used by "lilo" at all.  It is just stored along with other kernel parameters (text) passed to the kernel.  Ubuntu is the kernel in this case so "root" must be the correct information for Ubuntu.  Ubuntu will use the root device name plus the "read-only" option for mounting the root device AFTER the Ubuntu kernel has initialized.

If the root device driver in Ubuntu is a module then you have to make sure that the "initrd" image file loads that module and any other required modules.  The standard "initrd" image for Ubuntu probably loads the required driver unless you have an unusual hard disk controller card/chip.  The "initrd" image does things from the standpoint of Ubuntu and not Slack and must be built using Ubuntu.

Here is my suggestion for a possible solution.


       
Code:

       
image = /mnt/hd/hda5/boot/vmlinuz-2.6.27-7-generic
  root = /dev/sda5
  label = UbuntuStudio
  initrd = /mnt/hd/hda5/boot/initrd.img-2.6.27-7-generic
  read-only


After you change that in "lilo.conf" don't forget to use the "lilo" command.  If you copied the boot block to a file for Windows then update the copy of the boot block as well.

To clarify how this whole process works here is basically what happens.

=========== Slack
You edit the "lilo.conf" file using Slack
You run the "lilo" command in Slack
The "lilo" command converts devices/files to disk ID/sector
The "lilo" command writes the "lilo" boot sectors
=========== BIOS
You start up the computer
Lilo loads and displays the menu
Lilo uses the disk drive ID and sector information to load the Ubuntu kernel into memory.
Lilo uses the disk drive ID and sector information to load the initrd image (RAM disk filesystem) into memory.
=========== Ubuntu Kernel
Lilo starts the Ubuntu kernel specifying the kernel parameters provided, including information for "root=" and the RAM disk filesystem.
Ubuntu mounts and runs the init script for the "initrd" filesystem image.
The "initrd" script loads required modules and does other things to make the root device accessible.
The "initrd" script mounts the root device (read-only) and then starts the Ubuntu "init" task that completes the initialization of the system.

It IS important which operating system you use to run the "lilo" command because device names used in "image" and "initrd" must be for that operating system (not the one ultimately being booted).  You may need a different "lilo.conf" depending on which operating system will update the lilo configuration with "lilo".

                       
                       

               


Your above definition or explanation should be corrected.

The idea is that the kernel will utilize the 'initrd' ( a temporary filesystem) that a user creates to load the filesystem along with required modules to support the actions. Any modules that are not defined directly but are need with a directed module will be loaded. The kernel does the actions not the 'initrd'.

As for lilo it will utilize the 'lilo.conf' file to create IPL that could be written to the 'MBR' or the superblock. This will depend on how someone wants to control their system. A bootloader of some sort must be used as the IPL to pass control to the SPL. That SPL could be grub, lilo or io.sys that will depend on configuration of the original bootloader. Chainloading anyone?

Again don't take offense but your definitions need polish. :)


All times are GMT -5. The time now is 06:54 AM.