lilo config for dual hd-boot hd->ramdisk-boot?

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Alexis Huxle » Sun, 20 Oct 2002 18:14:34



Hi, I've got a 128 Mb flashdisk with hda1 partition of size 48Mb
(actually 50192Kb), of which 41Mb is used. I can directly boot this
partition with a standard lilo configuration. Oh, I have 64Mb of RAM,
but the OS, my small program, and no other servers require only 6Mb of
this.

Since it is a flashdisk, with limited rewrite capabilities, I would like
to load the whole of this hda1 partition into a ramdisk and use the
ramdisk as the root fs, that way I only ever read from the flashdisk.

I don't think I need to use initrd (since my kernel *already* has
everything it will need, I do not need to do a two-stage boot),  and I
don't think I need a compressed image of the root filesystem (since the
first partition, which, as explained above, I can also use directly as
the root filesystem, contains exactly what I want to load into RAM).

Ok, so my 2.2.19 kernel has ramdisk support compiled in - i.e. not just
as a module, and also loopback device and initrd, though I don't think I
need the last two of these.

My lilo.config has:

        boot=/dev/hda
        prompt
        timeout=30

        #  To use hda1 as root
        image=/path/to/the/kernel
                label=flash
                root=/dev/hda1

        #  To load hda1 into ram0 and use *that* as root fs
        image=/path/to/the/kernel
                label=ram
                append="root=/dev/ram0 start_ramdisk=0 ramdisk_size=50192 load_ramdisk=1"

Booting the 'flash' works fine, but booting 'ram' doesn't; the kernel
gets loaded correctly, but then it says "can't mount root filesystem on
01:00". I presume '01:00' means major 1 minor 0, which *is* ram0, so it
seems that the kernel knows what I want to be the root filesystem, it's
only that it failed to load the partition into memory before trying to
mount it.

I also tried adding 'prompt_ramdisk=1' just to see if it was even seeing
any of the ramdisk-related kernel parameters, and it did not prompt me
after loading the kernel, before attempting to load/mount the root
filesystem.

Can anybody offer any advice? Many thanks!

Alexis

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by H.Nestle » Fri, 01 Nov 2002 20:20:46


Hello!

Your configuration load not the ramdisk file initrd.gz at boot time.

You must lilo say, that you want boot from ramdisk. Lilo need the filename
of compressed root image for mapping this. No appends need. In kernel config
ramdisk must be enable at boot, not as module, with support for initrd.
Add the line "initrd" to your config.

image=/path/to/the/kernel
    label=ram
    initrd  = /path/to/the/initrd.gz
    root=/dev/ram0

At your bootling process you will see a secont loading and uncompress in
process "load initrd ......"

More documentation are in sources of lilo, install sources and read file
README

Henry Nestler
---------------------------------------
SSV SOFTWARE SYSTEMS GmbH
Heisterbergallee 72
D-30453 Hannover
http://www.ssv-embedded.de
Phone: +49(0)511/40 000-0
Fax:   +49(0)511/40 000-40

---------------------------------------


Quote:> Hi, I've got a 128 Mb flashdisk with hda1 partition of size 48Mb
> (actually 50192Kb), of which 41Mb is used. I can directly boot this
> partition with a standard lilo configuration. Oh, I have 64Mb of RAM,
> but the OS, my small program, and no other servers require only 6Mb of
> this.

> Since it is a flashdisk, with limited rewrite capabilities, I would like
> to load the whole of this hda1 partition into a ramdisk and use the
> ramdisk as the root fs, that way I only ever read from the flashdisk.

> I don't think I need to use initrd (since my kernel *already* has
> everything it will need, I do not need to do a two-stage boot),  and I
> don't think I need a compressed image of the root filesystem (since the
> first partition, which, as explained above, I can also use directly as
> the root filesystem, contains exactly what I want to load into RAM).

> Ok, so my 2.2.19 kernel has ramdisk support compiled in - i.e. not just
> as a module, and also loopback device and initrd, though I don't think I
> need the last two of these.

> My lilo.config has:

> boot=/dev/hda
> prompt
> timeout=30

> #  To use hda1 as root
> image=/path/to/the/kernel
> label=flash
> root=/dev/hda1

> #  To load hda1 into ram0 and use *that* as root fs
> image=/path/to/the/kernel
> label=ram
> append="root=/dev/ram0 start_ramdisk=0 ramdisk_size=50192 load_ramdisk=1"

> Booting the 'flash' works fine, but booting 'ram' doesn't; the kernel
> gets loaded correctly, but then it says "can't mount root filesystem on
> 01:00". I presume '01:00' means major 1 minor 0, which *is* ram0, so it
> seems that the kernel knows what I want to be the root filesystem, it's
> only that it failed to load the partition into memory before trying to
> mount it.

> I also tried adding 'prompt_ramdisk=1' just to see if it was even seeing
> any of the ramdisk-related kernel parameters, and it did not prompt me
> after loading the kernel, before attempting to load/mount the root
> filesystem.

> Can anybody offer any advice? Many thanks!

> Alexis


 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Alexis Huxle » Wed, 06 Nov 2002 00:49:33



> > #  To load hda1 into ram0 and use *that* as root fs
> > image=/path/to/the/kernel
> > label=ram
> > append="root=/dev/ram0 start_ramdisk=0 ramdisk_size=50192 load_ramdisk=1"

> Your configuration load not the ramdisk file initrd.gz at boot time.
> You must lilo say, that you want boot from ramdisk. Lilo need the filename
> of compressed root image for mapping this. No appends need. In kernel config
> ramdisk must be enable at boot, not as module, with support for initrd.
> Add the line "initrd" to your config.
> image=/path/to/the/kernel
>     label=ram
>     initrd  = /path/to/the/initrd.gz
>     root=/dev/ram0

Ok, but what I want to say then is:

        initrd = /dev/hda1

i.e. (1) it is not a file (it is a whole partition) (2) it is not
comoressed.

(At the moment I cannot repeat the experiment.)

Would that work?

Thanks!

Alexis

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Tauno Voipi » Wed, 06 Nov 2002 02:12:28




> > > #  To load hda1 into ram0 and use *that* as root fs
> > > image=/path/to/the/kernel
> > > label=ram
> > > append="root=/dev/ram0 start_ramdisk=0 ramdisk_size=50192
load_ramdisk=1"


> > Your configuration load not the ramdisk file initrd.gz at boot time.

> > You must lilo say, that you want boot from ramdisk. Lilo need the
filename
> > of compressed root image for mapping this. No appends need. In kernel
config
> > ramdisk must be enable at boot, not as module, with support for initrd.
> > Add the line "initrd" to your config.

> > image=/path/to/the/kernel
> >     label=ram
> >     initrd  = /path/to/the/initrd.gz
> >     root=/dev/ram0

> Ok, but what I want to say then is:

> initrd = /dev/hda1

> i.e. (1) it is not a file (it is a whole partition) (2) it is not
> comoressed.

> (At the moment I cannot repeat the experiment.)

> Would that work?

No. The initrd mechanism needs a gzipped drive image.

Are you saying that you would like to use /dev/hda1 as the root filesystem?

The mantra for that is

  root=/dev/hda1

HTH

Tauno Voipio

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Alexis Huxle » Wed, 06 Nov 2002 17:09:00



> > > > Since it is a flashdisk, with limited rewrite capabilities, I would like
> > > > to load the whole of this hda1 partition into a ramdisk and use the
> > > > ramdisk as the root fs, that way I only ever read from the flashdisk.

> > > > [snip]

> > > > My lilo.config has:

> > > >         boot=/dev/hda
> > > >         prompt
> > > >         timeout=30

> > > >         #  To use hda1 as root
> > > >         image=/path/to/the/kernel
> > > >                 label=flash
> > > >                 root=/dev/hda1

> > > >         #  To load hda1 into ram0 and use *that* as root fs
> > > >         image=/path/to/the/kernel
> > > >                 label=ram
> > > >                 append="root=/dev/ram0 start_ramdisk=0 ramdisk_size=50192 load_ramdisk=1"

> > > You must lilo say, that you want boot from ramdisk. Lilo need the filename
> > > of compressed root image for mapping this. No appends need. In kernel config
> > > ramdisk must be enable at boot, not as module, with support for initrd.
> > > Add the line "initrd" to your config.

> > > image=/path/to/the/kernel
> > >     label=ram
> > >     initrd  = /path/to/the/initrd.gz
> > >     root=/dev/ram0

> > Ok, but what I want to say then is:

> > initrd = /dev/hda1

> > i.e. (1) it is not a file (it is a whole partition) (2) it is not
> > comoressed.

> > (At the moment I cannot repeat the experiment.)

> > Would that work?

> No. The initrd mechanism needs a gzipped drive image.
> Are you saying that you would like to use /dev/hda1 as the root filesystem?
> The mantra for that is

>   root=/dev/hda1

I already have a lilo entry ("flash" above) to do exactly that,
so that is not a problem.

But what you say fits with what I said in my original post:

Quote:> > > > I don't think I need to use initrd (since my kernel *already* has
> > > > everything it will need, I do not need to do a two-stage boot),  and I

What I'm asking about is how to load the *whole* of a *real*
filesystem (i.e. not a fs image in a compressed or uncompressed file)
into a RAM disk - at boot time - and use *that RAM disk* as the
root filesystem.

The problem with this being that the kernel is not loading
hda1 into RAM disk before trying to boot the RAM disk which
gives me an error like:

        "no root file system found on <ram_device_major_minor>"

Any more suggestions would be much appreciated!

Regards

Alexis Huxley

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Tauno Voipi » Thu, 07 Nov 2002 01:57:16



Quote:

> What I'm asking about is how to load the *whole* of a *real*
> filesystem (i.e. not a fs image in a compressed or uncompressed file)
> into a RAM disk - at boot time - and use *that RAM disk* as the
> root filesystem.

> The problem with this being that the kernel is not loading
> hda1 into RAM disk before trying to boot the RAM disk which
> gives me an error like:

> "no root file system found on <ram_device_major_minor>"

> Any more suggestions would be much appreciated!

The initrd mechanism definitively needs a gzipped file system image. How
about creating an initrd image with a copy command in linuxrc to load the
hard disk partition into the RAM disk? You get the initial file system with
the initrd mechanism and the real contents from the hard disk.

HTH

Tauno Voipio

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Alexis Huxle » Thu, 07 Nov 2002 21:33:00


Quote:> > What I'm asking about is how to load the *whole* of a *real*
> > filesystem (i.e. not a fs image in a compressed or uncompressed file)
> > into a RAM disk - at boot time - and use *that RAM disk* as the
> > root filesystem.

> The initrd mechanism definitively needs a gzipped file system image. How
> about creating an initrd image with a copy command in linuxrc to load the
> hard disk partition into the RAM disk? You get the initial file system with
> the initrd mechanism and the real contents from the hard disk.

Yes! That sounds an excellent idea! I'm not in a position
to try it for a few days ... but I'll post a summary of
the results when I do. Many thanks!

Alexis

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Alexis Huxle » Fri, 29 Nov 2002 01:03:59


In <200211050809.JAA04...@te35.hq.eso.org> Alexis Huxley <Use-Author-Address-Header@[127.1]> writes:

> Since it is a flashdisk, with limited rewrite capabilities, I would like
> to load the whole of this hda1 partition into a ramdisk and use the
> ramdisk as the root fs, that way I only ever read from the flashdisk.

I've solved this. I have documented the procedure for internal purposes,
but Usenet seems as good a place to archive it - where someone else might
find it useful - as any, so it is included below.

A little preamble:

The procedure refers to something called 'VCM FEP' which is just
project nomenclature for an embedded PC running a single application.
This procedure documents the installation of that application, but it's
trivial to change this to install whatever you want.

Actually I used VmWare, and as such there is a gotcha to watch out for:
VmWare permits all sorts of ordering for bootable device searching;
which means that I didn't need to make a boot floppy at all. But for a
real PC it is probably *vital* to do so.

Finally, this document is (C) European Southern Observatory 2002, and
is distributed under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

Alexis

---------------------------------- cut here ----------------------------------
##################################################
#                                                #
#         VCM FEP OS Installation Guide          #
#                                                #
##################################################

Introduction
############

The purpose of this document is to guide you through
the installation of Debian 3.0 on a flashdisk-based
system in such a manner that:

1)  the flashdisk is read-only
2)  reading of the flashdisk is minimised.

Debian was chosen as the Linux distribution to use
because it has the finest package granularity,
consequently the smallest possible installation
of Debian is smaller than the smallest possible
installation of other major distributions.

The system will run a single application. The
installation of this is included as part of this
procedure, but could equally well be replaced
by the installation of another application.

The procedure can be used to create one single system
or to prepare a system which can be used for the
preparation of several flashdisks, which can then
be taken to a remote location and installed
without requiring the additional hardware needed
for development and preparation.

During the procedure two disks are required, which
will be split into four partitions. These partitions
will be used for the following purposes, and in
this document will be referred to by the following
nicknames:

1) large development area with network access
   ("development")
2) medium-sized production preparation area
   with no network access ("preparation")
3) small production area with no network access
   ("production")
4) software archive and home directories
   ("space")

The necessity of (1) and (3) is hopefully clear.

(2) is identical to (3) but has enough space for
the overheads required for the basic installation
and the transient overheads required by the package
management system.

(2) cannot be used as the production system because
the entire partition - regardless of how full or empty
it is - is to be copied to memory to act as a RAM disk,
and this would leave no RAM to act as system memory.

The purpose of (4) is to ensure that the OS is kept
separate from user data. This will ease upgrades.

Procedure overview
==================

In overview, the procedure is as follows:

1) make a minimal installation to form the basis for
   the "development" system
2) clone the "development" system to make the basis
   for the "preparation" system
3) build a better kernel
4) tune the "development" system by adding stuff
5) tune the "preparation" system by removing stuff
6) install the application
7) configure the preparation system ready for production
8) clone the "preparation" system to make the
   "production" system.

Prerequisites
=============

Prerequsite hardware
--------------------

VCM FEP with:

1) external SCSI harddisk (at least 4Gb)
2) internal IDE 128Mb flashdisk
3) external SCSI CD-ROM
4) external SCSI DAT (optional)
5) 128Mb RAM
6) US keyboard (preferred for Paranal)

or VmWare with:

1) virtual SCSI 4Gb harddisk (virtual device
   node SCSI 0:0)
2) virtual IDE 128Mb harddisk (virtual device
   node IDE 0:0)
   (FN=this virtual disk should be replaced by
   a flashdisk if the purpose is to prepare an
   installation on flashdisk)
3) physical IDE CD-ROM (virtual device node IDE
   0:1 using E: with raw access enabled)
   (FN=This should be a SCSI CD-ROM but it is
   not bootable if it is)
4) 128Mb RAM

Prerequisite software
---------------------

1) Debian 3.0 CDs #1-7 plus 'non-US' CD

Prerequisite information
------------------------

1) what is the hostname?
2) network configuration is hardcoded, from a DHCP
   server or from a BOOTP server?
3) If the network configuration is hardcoded then
   what are the host IP address, the netmask
   the gateway IP address, DNS server IP addresses?

BIOS setup
==========

For a normal PC the boot order should be:

1) floppy
2) SCSI CD-ROM
3) SCSI harddisk
4) IDE flashdisk

and note that a boot floppy will be required.

For VmWare the boot order should be:

1) floppy
2) CD-ROM
3) IDE flashdisk
4) SCSI harddisk

and no boot floppy is required.

The development system
######################

The Debian Installation program
===============================

Insert CD#1 in the drive and power on the system.
At the 'boot: ' prompt, enter 'bf24' and press
ENTER.

Eventually, this launches the Debian Installation
program.  The steps involved in the running of
this program are now covered individually.

Language Selection
------------------

At the 'Choose The Language' window, scroll down
to 'en' and press ENTER.

At the 'Choose Language Variant' window, scroll down
to 'English (United States)' (the default) and press
ENTER.

At the 'Release Notes' window, continue by pressing
ENTER.

Keyboard Configuration
----------------------

At the 'Debian GNU/Linux Installation Main Menu'
window, when prompted 'You must indicate what sort of
keyboard ...', select 'Next: Configure the Keyboard'
(the default) and press ENTER.  

At the 'Select a keyboard' menu, select the
appropriate keyboard type from the list and press
ENTER.

Disk Partitioning
-----------------

At the 'Debian GNU/Linux Installation Main Menu'
window, when prompted 'A swap partition is strongly
recommended ...', select 'Next: Partition
a Hard Disk' (the default) and press ENTER.

At the 'Select Disk Drive' window, when prompted
'Select the drive to partition ...', select '/dev/sda'
(the default) and press ENTER.

At the 'LILO Limitations' window, when prompted
'LILO, The LInux LOader, when installed ...', just
press ENTER to continue.

At the 'Note on addition space for the ReiserFS
Journal' window, when prompted 'NOTE: ...' just press
ENTER to continue.

The system may then prompt 'No partition table ...
Do you wish to start with a zero table [y/N] ?' type
'y' (without ENTER).

The 'cfdisk' program is started.

Create the following partitions in the following
order, setting the FS type as specified:

sda1    Linux           2000Mb          (development)
sda2    Linux swap       256Mb          (development swap)
sda3    Linux            400Mb          (production preparation)
sda4    Linux           <rest>            (archive & homes)

Select 'write' to write the new partition table to
the disk, type 'yes' and ENTER to confirm. Once the
partition has been written select 'Quit'.

In addition, press ALT-F2, at the 'Please press Enter
to activate this console' press ENTER, and then run:

        cfdisk /dev/hda

and create the following partitions on the flashdisk:

hda1    Linux             96Mb          (production)

Select 'write' to write the new partition table to
the disk, type 'yes' and ENTER to confirm. Once the
partition has been written select 'Quit'.

Changed partition tables, such as we now have, are not
correctly detected by the Debian Installation Program.
So at this point it is best to reboot:

        # sync
        # reboot

Swap Space
----------

Then repeat the initial stages of the Debian
Installation program (language and keyboard selection)
until you reach the 'Debian GNU/Linux Installation
Main Menu' window, and are prompted 'You have a swap
partition ...'. Select 'Next: Initialize and Activate
a Swap Partition' (the default) and press ENTER.

At the 'Scan for Bad Blocks?' window, when prompted
'Run a bad-block scan on /dev/sda2?', select 'No'
(the default) and press ENTER.

At the 'Are you Sure?' window, when prmpted 'You have
chosen to initialize /dev/sda2 ...', select 'Yes'
(the default) and press ENTER.

Root File System
----------------

At the 'Debian GNU/Linux Installation Main Menu'
window, when prompted 'There are Linux partitions
..', select 'Next: Initialize a Linux Partition'
(the default) and press ENTER.

At the 'Choose Filesystem Type' window, when prompted
'Ext2 is the traditional ....', select 'Ext2' (the
default) and press ENTER.

At the 'Select Partition' window, when prompted
'Please select the partition to initialise ...',
select '/dev/sda1' (the default) and press ENTER.

At the 'Scan for Bad Blocks?' window, when prompted
'The system can scan ...', select 'No' (the default)
and press ENTER.

At the 'Are you Sure?' window, when prompted 'You
have chosen to initialize /dev/sda1 ...', select 'Yes'
(the default) and press ENTER.

At the 'Mount as the Root Filesystem?' window, when
prompted 'You must mount your root ...', select 'Yes'
(the default) and press ENTER.

Installing Kernel and Modules
-----------------------------

At the 'Debian GNU/Linux Installation Main Menu'
window, when prompted 'You've mounted your root ...',
select 'Next: Install kernel and Driver Modules'
(the default) and press ENTER.

At ...

read more »

 
 
 

lilo config for dual hd-boot hd->ramdisk-boot?

Post by Padraig Brad » Fri, 29 Nov 2002 01:14:21




>>Since it is a flashdisk, with limited rewrite capabilities, I would like
>>to load the whole of this hda1 partition into a ramdisk and use the
>>ramdisk as the root fs, that way I only ever read from the flashdisk.

> I've solved this. I have documented the procedure for internal purposes,
> but Usenet seems as good a place to archive it - where someone else might
> find it useful - as any, so it is included below.

Thanks for the info but why is this necessary?
I've created a distro that never mounts root rw
at any stage. All I did was to make an ordinary ramdisk (well tmpfs)
and copy /dev/ to it (since permissions need to be changed
on these inodes for ttys etc). Then just have a link
from /dev/ to /tmp/dev/

What extra functionality does your method give?

thanks,
Pdraig.

 
 
 

1. dual-HD, dual-boot problem ... booting Win98 fails on hdb

I put one harddisk in my computer and installed Mandrake7.2.  I then
popped this disk out, popped a new disk in, and installed Windoze 98
on it. I then made this disk the slave (hdb) and put back in my
Mandrake disk as hda, and then booted into Linux (using grub).
Mandrake recognizes my /dev/hdb when I mount it automatically as
/mnt/win98. So, the problem I'm about to describe doesn't seem to be a
problem with the harddisk, slave setting, etc.

I then used DrakConf to change my grub configuration so that it
associated win98 with /dev/hdb1. I then tried rebooting, booting linux
through grub still works fine, but when I choose win98 through grub, I
got the following error:

Booting 'win98'
root(hd1,0)
Error: selected disk does not exist.

I assume that this error is related to the fact that when win98 was
installed on hdb, it was actually hda at the time.  Now it's confused
b/c it's hdb. ??  (said another way: I think the problem is confusion
over the fact that windows was originally installed when that disk was
hda, but now it's hdb.)

I recently read (somewhere on usenet) the following suggestion:

the "map" command under GRUB would trick this second drive (hd1) to
think
that it owned the first partiition, thereby allowing it to dual boot.

#################################
# /boot/grub/menu.lst - generated by Lizard

*** Linux lines cut out to save space

# for booting Windows 98

title  = win98
root  = (hd1,0)
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
###################################

So, I tried this, but not knowing anything about grub, I
think I used the grub command to install it incorrectly,
because when I tried to reboot, grub failed to work properly
at all, and I had to boot with my boot floppy.

So, how can I solve this? Is the grub map approach the
right direction? If so, how do I do it correctly (e.g.,
what do I need to type on the command line after editing
the menu.lst file?)

If not, is there another way. I had a similar problem a couple
of years ago, and someone suggested that I use a program
(which I don't remember the name of) that allowed me to
go in and (I believe) edit the master boot record on my
windows hard drive to tell it that it was now the hdb
drive. I did that successfully that time. Should I try
that again, and if so, what's the program called that
allows me to edit it?

Sent via Deja.com
http://www.deja.com/

2. RedHat 6.1 & Win95

3. Q: Install LILO on 2nd HD, remove 1st hd, boot from 2nd?

4. mount clntudp_create:RPC:Program not registered

5. Large HD+old BIOS+boot manager+need dual boot =???????

6. Misc. Errors

7. Large HD+ old BIOS+ +boot manager + need dual boot =???????

8. Patch for mod_dir.c

9. linux won't boot with dual HD config

10. Boot the 3rd HD from Boot Manager/LILO

11. /etc/lilo/config (was: Re: Booting from HD on a "pure" Linux machine)

12. Newbie: Pls advise installing Dual boot Dual HD Mandrake 7

13. Boot broken, no ramdisk or hd w/PCI video