FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-04-2010, 06:19 PM
Stephen Powell
 
Default Re (2): Installing lilo in Squeeze after booting from the Lenny installer CD.

On Thu, 4 Feb 2010 13:14:26 -0500 (EST), peasthope@shaw.ca wrote:
> Stephen,
>
>> I'd try the Squeeze/Sid installer or the "daily build" installer ...
>
> Worked nicely. Wodim was able to burn the CD on
> the machine itself, in a drive connected with a
> USB-ATA adapter.
>
>> ... mount the
>> normal root file system somewhere, then do a chroot to that place in the
>> file system.
>
> Automated well in Rescue mode. "chroot" isn't
> stated but I don't know of any likely alternative.

I think you might have been somewhat confused by my suggestions.
I actually gave two completely different alternative recovery scenarios.

Alternative number 1:

Find a Debian installer CD which uses the exact same kernel version that
you are using, then at the boot prompt of the installer CD type

rescue root=/dev/hda1

(or whatever is the device name of your normal root partition). I haven't
tried something like this in a long time, but it used to work years ago.
The key is that your rescue CD needs to be running the same kernel
as is on the hard drive to use this method. Otherwise, it won't be able to load
its modules from /lib/modules on your hard drive.

Alternative number 2:

If you can't find an installer CD which uses the same kernel version that
you are using, then boot the installer, escape to a shell at the appropriate
time, mount your root file system somewhere, then issue a chroot command
to run a nested shell with your normal root file system treated as "/".
There are a number of variations on this method, and someone out there may
wish to elaborate. I can't test it right now because I'm currently away
from any i386-based Linux machines that I can test with.

These are not two successive steps in a two-step procedure, they are
two completely different alternatives. But apparently you managed
to get it working somehow. That is the important thing.

>> ... lilo.conf ... lilo ...
>
> All like clockwork. One remark and one question.
>
> lilo.conf defaulted boot=/dev/hda1 whereas I
> expected boot=/dev/hda. In any case, it works.

With boot=/dev/hda1, lilo will install itself in the boot sector
of the first partition on drive /dev/hda. To boot lilo installed
this way, you must have a functioning boot loader of some kind
installed in the master boot record which will "chainload" lilo.
The default bootloader from DOS/Windows will work in this case,
provided that /dev/hda1 is marked as the active partition.
This is a safer default. It prevents you from wiping out your
master boot record. But most people who install lilo want it installed
in the master boot record. I assume that you changed
it to say

boot=/dev/hda

> Many Web pages explain how to boot "single user"
> with "linux single" at the boot prompt. OK but
> I get a two line menu on the coffee picture;
> managed to interrupt automatic booting but
> couldn't get a prompt. What I really want is a
> single user case in menu. No mention in
> lilo.conf.man. Is it possible?

Read the man page for lilo.conf carefully. In order to get
a boot prompt you must have the options set right. The
way mine was set up by default, it boots the default menu
option within two seconds. To interrupt the process,
press the Shift key (by itself) as soon as you see the
word LILO appear on the screen. This will give you a
boot prompt. I.e.

boot:

At this point you type in the name of the system you want
to boot. (The default is usually called Linux.) If you
want to pass options to it, you can do that by typing,
for example,

Linux single

If you can't remember the name of the system you want to
boot, press the Tab key when the boot prompt is displayed
and it will type out the valid names (kind of like
completion in the shell). You will then get
another boot prompt and you can type in one of the names listed.
Typically, the backout system is called Linuxold, I think,
and will boot the previous kernel version, if there is
one. All of this description assumes that you have lilo
set up to use a pure text mode interface and that it is
installed in the master boot record. I'm worried that it
might not be, since you tell me that a coffee picture is
being displayed.

Now, is it possible to create a third menu item, called
Single, for example, that boots the current kernel in single-user
mode? Yes, it is possible. That's not what the designers
intended, but it is possible. Clone the entry for Linux,
change the name to Single, and put "single" in the append option
for that entry. Read the man page for details. I can
send you my lilo.conf file for comparison purposes, but
I don't have access to it right now.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2010, 01:06 AM
Stephen Powell
 
Default Re (2): Installing lilo in Squeeze after booting from the Lenny installer CD.

On Thu, 4 Feb 2010 14:19:06 -0500 (EST), Stephen Powell wrote:
> I can send you my lilo.conf file for comparison purposes, but
> I don't have access to it right now.

OK, I now have access to my lilo.conf file, and I will include it
inline in this e-mail for comparison purposes. Be careful not
to copy it verbatim, because it doesn't match your configuration.
But it should serve as an illustration. I have removed a lot of
comments to save space.

----------

# Allows the initial RAM file system to be loaded above the
# 16M line. Warning! The BIOS must have support for this
# for it to work! Not all BIOSes do!

large-memory

# Allows 32-bit logical block addressing to be used, which means
# that the kernel and the initial RAM file system can be read from
# locations beyond cylinder 1023. Warning! The BIOS must
# have support for this for it to work! Not all BIOSes do!

lba32

# Specifies where the boot-strap code will be written.
# /dev/hda means the master boot record of the first IDE disk .

boot=/dev/hda

# Specifies the device that should be mounted as root. (`/')
# /dev/hda2 means the second partition on the first IDE disk.

root=/dev/hda2

# Enable map compaction:
# Tries to merge read requests for adjacent sectors into a single
# read request. This drastically reduces load time and keeps the
# map smaller. Using `compact' is especially recommended when
# booting from a floppy disk. It is disabled by default
# because it doesn't always work.

compact

# Installs the specified file as the new boot sector
# You have the choice between: text, bmp, and menu
# Look in lilo.conf(5) manpage for details

install=text

# Specifies the location of the map file

map=/boot/map

# Specifies the number of deciseconds (0.1 seconds) LILO should
# wait before booting the first image.

delay=20

# Specifies the VGA text mode at boot time. (normal, extended, ask, <mode>)

vga=779

# Boot up Linux by default.

default=Linux

# Here's the current Linux image.

image=/boot/vmlinuz
label=Linux
read-only
# restricted
# alias=1
initrd=/boot/initrd.img

# Here's the previous Linux image.

image=/boot/vmlinuz.old
label=LinuxOLD
read-only
optional
# restricted
# alias=2
initrd=/boot/initrd.img.old

----------

Notes:

(1) "boot=/dev/hda" specifies to install lilo in the Master Boot Record (MBR)

(2) "root=/dev/hda2" specifies that the root partition is the second partition
on your system, from what you've told me, it sounds like this should be /dev/hda1.

(3) "install=text" requests a pure text-mode interface, which is its original historical
behavior

(4) "vga=779" specifies the start-up video mode. This is a 132-column by 50-row text video
mode that I like to use for virtual consoles 1-6. This mode is not supported by all
video BIOS / video chipset / monitor combinations and may not work for you. You
may prefer the traditional 80x25 default VGA boot-up mode, in which case specify
vga=normal. Lack of support for this option is what originally made me switch
from grub-pc back to lilo because I like it so much. If you do use it, you will also
have to make changes to /etc/default/console-setup. Set FONTFACE="", FONTSIZE="",
and FONT="lat1u-08.psf.gz". And make sure that the console-data package is installed.
If you try it and don't like it, make sure you backout the changes to /etc/lilo.conf
*and* /etc/default/console-setup *and* re-run lilo.

(5) Note that the symbolic links in my configuration have been changed from their default
values. I like to see the symbolic links in the /boot directory, not in the / directory.
I think that's where they belong. My symbolic links are

image=/boot/vmlinuz
initrd=/boot/initrd.img

for the current (Linux) image and

image=/boot/vmlinuz.old
initrd=/boot/initrd.img.old

for the previous (LinuxOLD) image.

If you want to do the same, then here's what you do. (1) Make the four changes indicated
above (i.e. add /boot to the front of each of these "assignment statements" in
/etc/lilo.conf. (2) From a shell prompt as root, issue commands similar to the
following:

cd /
rm vmlinuz
rm initrd.img
rm vmlinuz.old
rm initrd.img.old
cd boot
ln -s vmlinuz-2.6.32-trunk-686 vmlinuz
ln -s initrd.img-2.6.32-trunc-686 inird.img
ln -s vmlinuz-2.6.30-2-686 vmlinuz.old
ln -s initrd.img-2.6.30 initrd.img.old

Adjust these commands as necessary to match your current and previous kernel and
initial RAM filesystem image names. Note also the "optional" flag in the LinuxOLD
section, so that if these symbolic links do not exist lilo will issue a warning rather
than an error.

For successful installation of future kernels, you should also check your
/etc/kernel-img.conf file. Here's what mine looks like

----------

do_symlinks = yes
relative_links = yes
do_bootloader = yes
do_bootfloppy = no
do_initrd = yes
link_in_boot = yes

----------

Note particularly the "link_in_boot" option, which tells the kernel installation script
to maintain the symbolic links in /boot instead of in /.

After all these changes, re-run lilo.
Then shutdown and reboot to test it.

Hope this helps.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-05-2010, 02:01 PM
Stephen Powell
 
Default Re (2): Installing lilo in Squeeze after booting from the Lenny installer CD.

On Thu, 4 Feb 2010 21:06:11 -0500 (EST), Stephen Powell wrote:
> For successful installation of future kernels, you should also check your
> /etc/kernel-img.conf file. Here's what mine looks like
>
> ----------
>
> do_symlinks = yes
> relative_links = yes
> do_bootloader = yes
> do_bootfloppy = no
> do_initrd = yes
> link_in_boot = yes
>
> ----------
>
> Note particularly the "link_in_boot" option, which tells the kernel installation script
> to maintain the symbolic links in /boot instead of in /.
>
> After all these changes, re-run lilo.
> Then shutdown and reboot to test it.
>
> Hope this helps.

One thing I forgot to mention is that the symlink method used by the
kernel install scripts in conjunction with boot loaders that use them,
such as lilo (for the i386 architecture) and zipl (for the s390
architecture) only allows the two most recently installed kernels
to be bootable. Let's say that you install a 2.6.33 kernel in the
future. That means that "Linux" in your lilo boot menu will boot
the 2.6.33 kernel and "LinuxOLD" in your lilo boot menu will boot
the 2.6.32 kernel. The 2.6.30 kernel, though still installed, is no
longer bootable. If you want it to remain bootable, you will need
to set "do_symlinks=no" and "do_bootloader=no" in /etc/kernel-img.conf
and maintain your /etc/lilo.conf file and your symlinks by hand.
Then manually run lilo to update the boot menu.

Assuming that you are content with only being able to boot the
two most recently installed kernels, you should manually purge
old kernels as they roll off the boot menu, in order to save space.
For example, after installing the 2.6.33 kernel, you would issue

aptitude purge linux-image-2.6.30-2-686

to deinstall the old kernel, since it is no longer bootable.

Of course, an upgrade to an existing kernel (same package name,
different version number) replaces the current kernel. It does
not install a new kernel. Therefore, you would not purge the
old kernel under these conditions.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 11:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org