[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

reiserfs on all my SRM-alpha drives: how I did it

Because I have been happy with reiserfs on my Intel Linux machines, 
I have just converted all my ext2 filesystems to reiserfs filesystems on 
my first Alpha machine (after testing a single filesystem for a few days).  
All appears well.  My system is SRM based, and since aboot doesn't 
recognize reiserfs yet, I had to pull a few configuration tricks to get 
things like I want.  All partitions except the boot partition (sda1) were 
easily converted by copying contents to another drive, issuing a 
mkreiserfs on the empty partition, and copying the saved contents
back to the new partition.  The boot partition required some more work.
I thought others might be interested so I am posting my how-to below:
October 26, 2001

These are notes to myself on how to setup the boot process for
a Debian/Alpha computer using the SRM console.  

First, create the kernel image.  This is the normal process for
creating a kernel image.  Particular configuration options that go
into the "/usr/src/linux/.config" file that are unique to this machine


Actually build the kernel by issuing the command
"make dep;make clean;make boot"
from the /usr/src/linux area.  You will then have the following two
files of importance after the build (since we do not use modules for
this machine):

Second, and assuming a new v2.4.13 kernel, copy these essential files
to four places: 

1) archival:
cp /usr/src/linux/System.map /boot/System.map-2.4.13
cp /usr/src/linux/arch/alpha/boot/vmlinux.gz /boot/vmlinuz-2.4.13
ln -sf /boot/System.map-2.4.13 System.map
ln -sf /boot/vmlinuz-2.4.13 vmlinuz

2) 1st boot option (1.44 Mb floppy drive):

Put a new floppy diskette (1.44 Mb) into the floppy drive.

Format the drive by issuing the command "fdformat /dev/fd0"

Create an ext2 filesystem on the floppy drive "mke2fs /dev/fd0"

Copy an SRM-bootable image (in aboot Debian package) by 
"e2writeboot /dev/fd0 /boot/bootlx" 

Mount the floppy diskette as an ext2 filesystem
"mount /dev/fd0 /mnt/floppy"

Copy the kernel image to the floppy
"cp /boot/vmlinuz /mnt/floppy"

umount /mnt/floppy

You can now boot the machine from this kernel stored on the floppy by
issuing the sequence starting with "shutdown -h now".  Then push the
reset botton on the from panel.  While the machine is booting up, you
will see SRM messages "e2.e3.e4.e5.e6.e7".  At this point issue a
couple of control-Cs (^-C).  Then it will try and boot, and issue a
couple more control-Cs (^-C).  Note control-c is the "halt" key in SRM
lingo.  This key could be reconfigured to something else, but
control-c is fine.  You should now be at the SRM prompt that looks
like ">>" without the double quotes.  If you did not issue the
control-Cs, the SRM firmware would automatically start booting with
the default boot configuration which is the same as the "hard drive
direct-boot" configuration below.  

Some important SRM configuration parameters that have been set for
this machine (and given in the /proc/srm_environment) are:

bootdef_dev = dka0
boot_file = vmlinuz
bootos_flags = "root=/dev/sdb1 cycle=500000000"
auto_action = restart
boot_reset = on

Note: the "cycle=500000000" is a requirement that arose due to a
clock-timing problem in the 2.4.x kernels on the alpha that did not
exist in the 2.2.x kernels.  It is a workaround that will likely get
corrected and be unnecessary in a future kernel.

Note2: The SRM console still doesn't behave exactly like I would want
because I have to push the reset button to reboot.  I get the prompt ">>"
after a "shutdown -r now" or "shutdown -h now", but I cannot get a
reboot unless I hit the reset button.

To boot the floppy issue

boot dva0 -fi vmlinuz -fl "root=/dev/sdb1 cycle=500000000"

3) 2nd boot option (hard drive directly)

Previously, the 1st harddrive (lowest scsi ID or sda, which would get
you the c:\ drive in the dos/windows world) has been partitioned using
the BSD partition option of fdisk.  sda1 is 4-sector partition
(sectors 2-5 of the sda drive) that is an ext2 filesystem type because
aboot does not understand reiserfs, but does understand UFS, ext2,
iso9660, etc.  sda2 starts at sector 6 and goes to the end of the
drive and is presently a reiserfs partition.  sector 1 is left alone
(no filesystem placed) to make room for raw binary files for aboot and
the kernel.  The partition print from fdisk looks like this:

fdisk /dev/sda
Detected an OSF/1 disklabel on /dev/sda, entering disklabel mode.
To return to DOS partition table mode, use the 'r' command.

BSD disklabel command (m for help): p

2 partitions:
#       start       end      size     fstype   [fsize bsize   cpg]
  a:        2         5         4       ext2
  b:        6      1022      1017       ext2

BSD disklabel command (m for help):

The filesystems were made by issuing
mke2fs /dev/sda1
mkreiserfs /dev/sda2

The sda2 partition is used by the system as /usr3 (general user
area).  The sda1 partition is used to store kernels, boot
configuration, etc., and is not automounted in /etc/fstab to minimize
the possibility of corruption (not journeled as now all the other
partitions are with the reiserfs).

After having created the partitions and filesystems on /dev/sda, then
we must create the direct-boot information.

A filesystem-less boot (direct-boot) is created with (from the
/boot area):

swriteboot /dev/sda bootlx vmlinuz

The SRM system is configured by default to boot this image.  This
default configuration is also duplicated in the aboot configuration
(see next).

4) 3rd boot option (hard drive boot options)

Copy the new kernel image to the ext2 boot options area with the

mount -t ext2 /dev/sda1 /mnt/sda1
cp /usr/src/linux/arch/alpha/boot/vmlinux.gz /mnt/sda1/vmlinuz-2.4.13

Also included in the same area (/mnt/sda1) are other older kernel
images and the aboot configuration file in "/mnt/sda1/etc/aboot.conf".

Confirm the correct location of the aboot configuration file by
issuing the command

abootconf /dev/sda 1

It turns out that abootconf will only work for /dev/sda (as far as I
can tell) which forces aboot.conf to be located where it is.  Debian
by default puts it into /etc/aboot.conf and this would work if the
root filesystem were sda1.  We could do this if we always booted
from floppy or direct-boot from the hard drive.  But, if we want
reiserfs and "hard drive boot options", then we have to have the
little ext2 filesystem in sda1.  That is basically why it is set up
the way it is.

Now the contents of /mnt/sda1/etc/aboot.conf is
# aboot default configurations jdf 10/26/2001
# boot option descriptions:
# 0 boots a compressed kernel image "vmlinuz" from aboot
#   space just before the first partition.  This aboot 
#   space is created with the command (from /boot)
#   swriteboot /dev/sda bootlx vmlinuz
# 1 boots current kernel
# 2 boots current kernel in single-user mode
# 3 boots prior kernel
# 4 boots previous stable kernel
0:0/vmlinuz        ro root=/dev/sdb1 cycle=500000000
1:1/vmlinuz-2.4.13 ro root=/dev/sdb1 cycle=500000000
2:1/vmlinuz-2.4.13 ro root=/dev/sdb1 cycle=500000000 single
3:1/vmlinuz-2.4.12 ro root=/dev/sdb1 cycle=500000000
4:1/vmlinuz-2.2.19 ro root=/dev/sdb1 cycle=500000000

With this type of arrangement, you can optionally boot from the SRM
prompt (to get the prompt see above) by getting into the interactive
mode of aboot:

>>boot -fl i 

Then issue the options directly (see the aboot help menu) when it goes
into interactive mode)"

0 (same as hard drive direct boot)


1 (effectively the same, but now booting from the ext2 partition)


2 (same as boot 1, but single-user mode)


etc.  (older kernels, test kernels, etc.)


cd /usr/src/linux
make menuconfig
make dep;make clean;make boot
cp System.map /boot/System.map
cp ./arch/alpha/boot/vmlinux.gz /boot/vmlinuz
cd /boot
swriteboot /dev/sda bootlx vmlinuz

cp other kernel images to floppy and/or hard-drive options as desired
and described above.


SRM Firmware Howto (from Linux Howto web pages)
Alpha SRM Console for Alpha Microprossor Motherboards User's Guide
(from Compaq web pages)
man pages (from aboot Debian packages) on aboot.conf, swriteboot,
e2writeboot, aboot
reserifsprogs (Debian package and man pages)


Add CD-ROM as a boot option and create my own boot CDs.

James D. Freels, P.E._i, Ph.D.
Oak Ridge National Laboratory
freelsjd@ornl.gov - work
jdfreels@home.com - home

Reply to: