LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Install lilo on external drive (/dev/sda), then boot as INTERNAL (/dev/hda)? (http://www.linuxquestions.org/questions/slackware-14/install-lilo-on-external-drive-dev-sda-then-boot-as-internal-dev-hda-577791/)

slackware-elf 08-17-2007 09: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, so...now 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.

Thanks!

Bill

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

Code:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hda2
message = /boot/boot_message.txt
prompt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
# 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
  read-only
#


cor67393 08-17-2007 09: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:
Code:

#lilo -b /dev/sda -C /path/to/lilo.conf.on.the.sda.drive
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 02: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:

Code:

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-2.6.17.13
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.

Bill

cor67393 08-18-2007 04:51 PM

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

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 06:41 PM.