-   Slackware (
-   -   Install lilo on external drive (/dev/sda), then boot as INTERNAL (/dev/hda)? (

slackware-elf 08-17-2007 10:08 AM

Install lilo on external drive (/dev/sda), then boot as INTERNAL (/dev/hda)?
Hi! I have an unusual situation in that I'm trying to install Slackware 12 on an old Thinkpad T21 that can't boot from USB and has no internal CDROM drive. (When the original CDRW broke, I got an external.) And the new Slackware 12 doesn't allow floppy drive boots anymore.

My current hard drive is a Slack 11, so I copied the Slack 12 setup boot image and ramdisk, booted up as "setup", and successfully installed Slack 12 to my _new_ drive, connected via USB. My problem is: when I put the new Slack 12 drive into my laptop, it won't boot.

I think I know why: my lilo.conf has boot lines pointing to /dev/sda2 (my bootable partition). When I put the drive into the laptop, it becomes /dev/hda. But I can't then reboot with an external media and rerun lilo, what?

My root partition on the Slack 11 drive happens to be /dev/hda1, not /dev/hda2, so I even tried unmounting /dev/hda2 with the Slack 11 drive inside, then linking /dev/hda2 to /dev/sda2, pivot_root'ing to /dev/sda2, and running lilo, so lilo would install a /dev/hda2 boot to /dev/sda2. It didn't work.

So is there a way to tell lilo, "I want you to install a boot loader that will boot to /dev/hda2, but I want you to put it on /dev/sda2 for now"?

Thanks very much for any help.

I'm thinking it may be the "-b" option, but I'd like to double check before hosing my drive.



Here's the current /etc/lilo.conf on the Slack12 drive:


# LILO configuration file
# generated by 'liloconfig'
# Start LILO global section
boot = /dev/hda2
message = /boot/boot_message.txt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
# VESA framebuffer console @ 800x600x256
vga = 771
# 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
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda2
  label = Slack12

cor67393 08-17-2007 10:21 AM

I did that last week. If I remember correctly, edit your lilo.conf so that it seems that it is already inside the computer, so all references are to hda instead of sda. Then, run lilo with the b and C flags:

#lilo -b /dev/sda -C /path/to/
The -b flag tells lilo to install into the MBR of the sda device. The -C flag tells it to use a config file from a different location. It will install into the MBR with a config file with references to hda instead of sda. Put the new drive in your laptop and it should boot.

slackware-elf 08-18-2007 03:12 PM

The dreaded "99"s
Thanks for the quick help!

Well, I tried the command. This time, when I booted, I got a screen of "99"s. I used the lilo.conf shown above, with one important difference: "boot = /dev/hda" instead of /dev/hda2. I wanted to boot from the MBR. But I just got those 9's.

Here are the errors I got when I ran lilo:


root@strawberry 14:13 ~ $ lilo -v -b /dev/sda -C /digory/etc/lilo.conf
LILO version 22.7.1, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2005 John Coffman
Released 17-Sep-2005 and compiled at 00:33:53 on Aug  8 2006.

Ignoring entry 'boot'
Warning: LBA32 addressing assumed
Reading boot sector from /dev/sda
Warning: Kernel & BIOS return differing head/sector geometries for device 0x80
    Kernel: 65535 cylinders, 16 heads, 63 sectors
      BIOS: 1023 cylinders, 240 heads, 63 sectors
Warning: /dev/sda is not on the first disk
Using MENU secondary loader
Calling map_insert_data
Warning: The boot sector and map file are on different disks.
Mapping message file /boot/boot_message.txt
Calling map_insert_file

Boot image: /boot/vmlinuz -> vmlinuz-generic-
Added Slack12 *

Writing boot sector.
/boot/boot.0800 exists - no boot sector backup copy made.

Thanks again for your help, and anyone else who might have a thought.


cor67393 08-18-2007 05:51 PM

I can't help you with the 99's I'm afraid, but you could chroot before running lilo:

root# /usr/bin/chroot /digory /usr/bin/bash
This will chroot you to /digory, so it will look like /digory has become your root / . To exit, just type exit ;). Running lilo can be done without -C because all files will seem to be in their proper location. I think you should be more worried about the different info from the kernel/bios, but I don't know how to sort those out.

All times are GMT -5. The time now is 02:45 AM.