Section 5: Booting
1. What is a boot prompt, and how can I get to it ?
Sun *SPARC based machines have a OpenBoot PROM which takes
control of the computer when you turn it on. This is sort of similar to the
BIOS in a PC computer, except that the Sun boot PROMs have a
built in Forth interpreter which lets you do quite a number of things
with the computer without/before booting an operating system, such as
listening to the network, looking at the scsi bus, testing memory, setting the
default boot device and setting other parameters.
In order to get to the OpenBoot PROM command line (we'll call it the
boot prompt (ok) from here), you need to hold down the Stop
key (or L1 key on older type 4 keyboards) and
simultaneously press the A key. This will bring you to the
prompt (usually ok but see the next question). If there is
an operating system running on the system, will this be suspended if
you use this key combination. To resume where you were type go
.
Normally you would hold Stop-A while the machine is checking
it's memory before boot time, or by typing halt from the SILO
boot prompt if SILO is already installed.
If you want to see or change a number of settings, you can also use the program
eeprom from a running system. It is included with Solaris, but
Jakub Jelinek has also made a Linux version of it, included in his
prtconf package. This package can be obtained from the Red Hat
distribution source, or alternatively from
ftp://ftp.auxio.org/pub/linux/SOURCES.
2. Why can't I see "ok" at the boot prompt ?
Older Sun machines default to the > prompt. You can change
this to the new command mode by typing the letter n,
which will give the ok prompt. If you want to make this
permanent type:
ok setenv sunmon-compat? false
3. How can I see all the PROM parameters ?
From the ok prompt, type printenv,
or use eeprom from a shell.
4. What other commands are available at the boot prompt ?
The
OpenBoot Command reference at docs.sun.com
provides detailed information. Here's a small list of handy commands:
help Display command line help
banner Display power-on banner
module-info Display CPU speed (OpenBoot 2.x)
.speed Display CPU and bus speeds (OpenBoot 3.x)
.version Display version of the Boot PROM
.enet-addr Display ethernet address
watch-net Monitor network connection
test-net Test the onboard network interface
devalias Display all current device aliases
probe-scsi Identify the devices attached to the onboard SCSI bus
probe-scsi-all Identify the devices attached to all SCSI busses
show-disks Display device paths of installed SCSI disks
show-displays Display device paths of installed display devices
show-sbus Display a list of probed SBus devices
Examples for commands such as boot and setenv can be found
throughout this FAQ.
5. How can I boot directly from the floppy/CD-ROM/Tape Drive ?
At the boot prompt (ok) you can type the command
boot, followed by the device that you want to boot from.
Examples:
ok boot floppy Boot from the floppy disk
ok boot fd(0,0,0) Boot from the floppy disk
ok boot cdrom Boot from the CD-ROM
ok boot sd(0,6,2) Boot from the CD-ROM
ok boot tape Boot from the tape device
ok boot sd(0,4,0) Boot from the tape device
ok boot disk Boot from the hard drive
ok boot disk2 Boot from the hard drive with SCSI ID: 2
ok boot sd(0,2,0) Boot from the hard drive with SCSI ID: 2
ok boot sd(0,1,3) Boot from the 4th partition of SCSI ID: 1
Some older proms do not understand some of the "short" device
aliases (i.e. cdrom), and you will need to use the longer
explicit form.
6. How can I eject my floppy disk or CD ?
Besides running the command eject floppy, or eject
cdrom from a shell, you can also run this from the boot prompt
(ok).
7. How can I set it to automatically boot from a different device ?
At the boot prompt (ok) you can type:
ok setenv boot-from disk2 to boot from SCSI ID: 2 by default
ok setenv boot-from sd(0,2,0) to boot from SCSI ID: 2 by default
ok setenv boot-from disk3:a to boot from SCSI ID: 3 partition 0 or a
8. How can I unset a PROM parameter ?
Use set-default followed by the variable name:
At the boot prompt (ok) you can type for example:
ok set-default boot-file
With the command printenv you can also see what all the default
settings are for what parameter.
9. How can I install UltraLinux software from the network ?
The basic idea is this:
- Add an entry for the new machine to the ARP/RARP cache.
- Set up a TFTP server where the bootimage can be transferred from.
- Set up a file server where you can install the software from
(NFS, FTP etc).
- Boot the machine and install the software.
Most distributions allow the client to boot via either an NFS mounted root,
or a network-loaded ramdisk where the root filesystem is being loaded in
memory.
Be sure that server and client are allowed access to the services
that are needed when your system is using tcp-wrappers. See also the manual
page for hosts_access(5).
10. How do I set up RARP so I can boot my Sun via the network ?
This will depend on what type of machine you want to set up as a RARP
server. First of all you will need to obtain the hardware ethernet address,
which you can find on your screen when your start the machine. An example:
SPARCSTATION 5, No Keyboard
ROM Rev. 2.15 Pilot, 64 MB memory installed, Serial #1234567.
Ethernet address 8:0:20:1f:cd:8e, Host ID: 12345a9b.
So we now know that 8:0:20:1f:cd:8e is our hardware ethernet
address.
Under Solaris, you will need to make sure that the hardware ethernet address
for the UltraLinux machine is in the ethers database (either
/etc/ethers or via NIS/NIS+), and that it is listed in the hosts
database. If so, simply start the RARP daemon:
# /usr/sbin/in.rarpd -a
If you want to use a machine running Linux you will need to populate the
kernel's RARP table.
You might need to use the `arp` command in addition to the `rarp` command.
Linux used to use a single rarp/arp cache in which case you used the
`arp` command, but now it uses separate commands so just a `rarp` should
be sufficient.
# /sbin/rarp -s phoenix 08:00:20:1f:cd:8e
# /sbin/arp -s 137.82.51.3 08:00:20:1f:cd:8e
You might also need to use the hardware address with or without the padded
0's. For example if the hardware address is:
8:0:20:1a:15:9e you might also want to try
08:00:20:1a:15:9e
Also ensure yourself that the machine is listed in the /etc/hosts file.
11. ARP/RARP do not seem to be working on my boot server?
If you have no support for RARP in your Linux kernel, you will either
have to compile it in, or build it as a loadable kernel module which is
called rarp.o. If you use a Linux distribution on your server,
you can try
# modprobe rarp
The RARP kernel-module is included with most distributions by default.
12. My ethernet address is shown as "ff:ff:ff:ff.." and my machine can't boot from the network.
You probably have a hardware problem and will need to replace the NVRAM.
For more information visit Mark Henderson's
SUN NVRAM/hostid FAQ.
13. I have a dead/corrupted/password protected NVRAM chip.
Please see the previous question.
14. How do I set up a tftp server to boot from ?
Under SunOS/Solaris you need to uncomment the line in your /etc/inetd.conf
file that refers to tftpboot. It should look like
tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
If necessary, restart the inetd process. You can change
/tftpboot to a directory where you want to put the UltraLinux
bootimage.
Under Linux, tftp does not need the "-s" options.
The line in /etc/inetd.conf should look something like this:
tftp dgram udp wait root /usr/sbin/tcpd in.tftpd
After this, you will probably have to create a directory /tftpboot on your
server, where you can place the boot image and a required symbolic link.
(See the next question)
15. What boot image will the client ask from the network ?
When the client tries to boot from the network, it will ask for a file with
a special name that the boot image should have. The file name is determined
by the IP address of the client, and by it's architecture on non-sun4u based
systems.
This is normally done by placing the appropriate boot image in the
directory /tftpboot on the server, and then create a symbolic link with
the special file name that points to the boot image.
To find the name for the link you will have to convert the four numbers
between the dots of the decimal IP-address into hexadecimal. You should then
put the hexadecimal figures together.
Besides calculating the numbers by hand or using a battery feeded calculator,
you have several ways of converting the IP address:
addr, which is included in the Bind (the name server)
package, the program bc, the converter from the package
ghex, and of course from the OpenBoot PROM of your machine.
An example of converting the IP address 172.28.230.104:
172 = AC
28 = 1C
230 = E6
104 = 68
With the addr utility:
$ addr -p 172.28.230.104
Input: "172.28.230.104"
Network: [af2 len4] ac 1c e6 68
Presentation: "172.28.230.104"
From the OpenBoot PROM:
ok d# 172 .
ac
ok d# 28 .
1c
ok d# 230 .
e6
ok d# 104 .
68
When put together, this will result into AC1CE668, what will
become the name of the symbolic link.
If the architecture of the client is not sun4u (UltraSPARC),
you will have to add the systems' architecture name to the symbolic link,
where our example would become AC1CE668.SUN4M for a
SPARCstation 5 (sun4m).
Finally, you will have to decide what file to point the symbolic link to.
Most distributions support two ways of booting from the network:
- Booting a kernel with an NFS-mounted root filesystem.
- Booting from a network-loaded ramdisk (mostly called tftpboot.img).
Bootimages can be found in respectively images for Red Hat
and Mandrake, and dists/<release>/main/disks-sparc/sun4xx
for Debian.
Distribution |
sun4cdm |
sun4dm-pci |
sun4u |
Red Hat |
images/tftp32.img |
images/tftp32.img |
images/tftp64.img |
Mandrake |
images/tftprd32.img |
images/tftprd32.img |
images/tftprd64.img |
Debian |
sun4cdm/tftpboot.img |
sun4dm-pci/tftpboot.img |
sun4u/tftpboot.img |
Copy the appropriate bootfile for the clients' architecture to /tftpboot on the
server, and create the symbolic link. For the example client above, the following
would be needed on the server for a Red Hat system:
# cp /mnt/cdrom/images/tftp32.img /tftpboot
# cd /tftpboot
# ln -s tftpboot.img AC1CE668.SUN4M
You will also need to ensure that the directory with the Linux installation
software or filesystem tree is being exported via NFS and that your UltraLinux
machine will be able to mount it.
16. Is there an easy way to set up the network boot image structure ?
Yes, you can use the tftptool utility, written in Python,
that comes with the Red Hat distribution. It will ask you for information
about your client, and then installs the appropriate image and creates a
symbolic link with the special name for your client. The tftptool is located
in the utils directory of the Red Hat distribution as of version 6.1. You
can also download this tool via one of the many
Red Hat mirrors.
17. Running a tftp boot server doesn't seem to work ?
First go to /tmp on your TFTP server, and try to get the bootimage via localhost:
$ tftp localhost
tftp> get AC1CE668.SUN4M
Received 1905590 bytes in 8.3 seconds
If this works, you might want to check for obvious reasons why it does not work,
such as a firewall, wrong or bad cabling etc..
Older tftp daemons for Linux only accepted requests for absolute
filenames (i.e. it had to start with a '/') which isn't what the Sun requests.
If the method above does not work, please upgrade your tftp server software to
a more recent version.
18. By using what commands can I boot UltraLinux from the network ?
From the boot prompt (ok), type the following for an NFS mounted root:
ok boot net linux nfsroot=nfs.server.ip.address:/exported/path
and the following for the network-loaded ramdisk:
ok boot net
Where nfs.server.ip.address is the IP address of the machine that
is providing the RARP and tftpboot services, and exporting the directory
/exported/path (or whatever you called it). When no arguments for
the exported path are given, the Linux kernel will expect the NFS root path to be
/tftpboot/<client.ip.address>/.
19. My Sun doesn't seem to understand the 'boot net' command.
Older Sun's default to the 'old command mode' when you are in the boot
prom. If you get the prompt > instead of ok then type
n to get the new prompt.
20. Booting over the network responds: "receive failed: The file just loaded does not appear to be executable".
Upon booting, Sun machines look for a file with the name which is the
hexadecimal representation of their IP address, followed by the machine
architecture if . So if your IP address is 137.82.51.4 then it will try to load
the file called 89523304.SUN4M (see the question above for information
on what file the client asks for on the network.) If you are unsure
what it is trying to load try looking at wat is happening on the network.
Please see "Booting over the network still doesn't work".
21. Booting over the network responds: "is not executable", or: "not in correct format!".
Nowadays, if you have compiled the kernel sources under Solaris or Linux, the
newly built kernel will be in the ELF (Executable and Linking Format) binary
format. The PROM however will only boot the image served from the network if
the image is in a.out (Assembler Output) binary format, which is the original
executable format for UNIX.
To convert the format from ELF into a.out you can use the program
elftoaout.
Besides with several distributions, you can find the elftoaout utility at
ftp://ultra.linux.cz/OS/Linux/Sparc/local/elftoaout
or
ftp://ftp.auxio.org/pub/vger/Sparc/tools
If you are unsure of what type of file you have, use the command file
on the kernel image.
Be certain that if the kernel is compressed (vmlinuz name) you uncompress
it first before using the elftoaout program. It might be necessary to add a .gz
suffix to the filename. Again, be sure what type of file you have by using the
file command.
Another thing to try: (this is untested, and may not even be relevant
any more!)
If you build an UltraLinux kernel on a SunOS system then you will find that a
SLC will refuse to net-boot it directly. It will say "not executable" or
something like that.
Just change the 4th byte of the file to a control-g (ascii 7) to fix
it. You can use emacs and ^Q^G to insert the control-g
22. Booting over the network still doesn't work...
The easiest way to debug network problems is to look at what is
happening on the network. There is a program snoop that will display
traffic on the network. Something like: (as root)
# snoop dragon
where dragon is your UltraLinux machine. If you have a machine
running Solaris this command is part of the operating system.
There is also a program called tcpdump that could prove useful.
It is available via ftp.ee.lbl.gov,
and is also included in many distributions.
23. How can I connect a machine for an installation via a serial cable ?
Essentially, if there is no keyboard plugged in when the Sun has booted,
it will use the serial interface (port A), By default it is set to 9600bps
8,n,1 You can force the serial console from the boot
(ok) prompt:
ok setenv input-device ttya
ok setenv output-device ttya
On the other (PC?) side running any terminal emulator will work
(kermit, minicom, seyon)
24. When using a serial console, the installation stops after booting from the network ?
Try the argument "serial":
ok boot net linux serial nfsroot=nfs.server.ip.address:/exported/path
for an NFS-mounted root filesystem, or:
ok boot net serial
if you are booting from a network-loaded ramdisk (eg. tftpboot.img).
25. Why does the system respond "Inconsistent console" when using a serial console ?
You might want to check the NULL-modem cable from the console to the machine.
26. Why can't my sparc64 boot from floppy ?
Due to a bug in the firmware of some Ultra based machines, booting
from the floppy drive does not work yet. In this case, you should boot
from either the CD-rom drive, of from the network.
27. Why can't my Ultra5/10 boot when I have more than 512 MB of memory installed ?
Linux does not support more than 512 MB of memory in the 2.2.x kernels on
Ultra5 and 10 machines.
If you have more than 512 MB of physical memory installed, you really should
use a 2.4.x kernel (or remove memory boards).
28. Why does the system respond "Wrong label" when I reboot it after installation ?
The system needs a Sun disklabel to find it's partition information.
This information is stored in the first block of the drive.
If your bootdrive doesn't contain such a disklabel, you will have to
create it using fdisk. Within fdisk, you have the command
s, which can be used to build a new Sun disklabel for your
drive.
29. Why does the system respond "Could not find /vmlinux.." when I reboot it after installation ?
Older machines can only boot properly when the boot image and configuration
file are located within the first GB, and sometimes within the first 2 GB
of it's boot disk.
It is generally a good idea to create a separate /boot partition
under the 1GB border where the boot images and configurationfiles can be
placed.
/etc/silo.conf should also be located under the this border, so
either create the root directory under the 1 GB border, or put silo.conf
in the /boot directory, and create a symbolic link from
/boot/silo.conf to /etc/silo.conf. This does not apply
to sparc64, since they can read far beyond this limit.
30. Fdisk dies with a segfault during partitioning.
You need to zero the first 5k of the disk (e.g. with dd), if the disk
doesn't contain a Sun disklabel. fdisk could not recover from random
bits in the disklabel area, but if there were a load of zeros it would
get it and create a label. Newer versions of fdisk will complain about
the lack of a Sun disklabel, and will create a disklabel for you.
31. Why does the system respond "Bad Magic Number in Disk Label" after replacing a (boot) HDD ?
You will have to run fdisk under Linux or
format under SunOS first. This will write out a magic
number as part of the partition table.
Use one of the methods to boot as described above to be able to run fdisk or
format.
32. The PROM refuses to recognize my disk.
Possible solution (given in the Sun hardware reference) is to disable
"synchronous negotiation initiation" from the disk
(by closing a jumper).
Apparently the PROM gets confused if the disk initiates the negotiation.
33. The kernel is panicking, or refuses to boot.
Make sure that you have don't have IPX packets enabled in the kernel
configuration.
Disable 802/IPX protocols from your kernel, if you have those
enabled. This would mean taking away the loadable kernel module from
/lib/modules or building a new kernel if they are compiled in.
34. Why does the system respond "the file just loaded doesn't appear to be executable" after installing SILO ?
The SPARC machines do not really have the concept of a Master Boot
Record like on a PC. You can boot from any sector of the disk with a SPARC.
When you install SILO on /dev/sda (block 0), you must request the PROM to boot
from a partition that starts at 0. The default installation FAQs advises users
to create /dev/sda1 starting from block 1. Therefore the partition on boot
line must be the partition that spans the whole disk (i.e. from block 0) and
not /dev/sda1. If your "whole disk" partition is /dev/sda3 you can
boot with "boot /sbus/esp/sd@3,0:c" (assuming target 3 for sda) on v2
PROMs. I believe it would be "boot sd(0,0,2)" on v0 proms.
35. Do I need to run silo every time I change my silo.conf ?
No. SILO understands ext2 filesystems and can therefore read the file
silo.conf itself during startup to find out where the kernel you want to boot
is. This is different than LILO which does not know how to read filesystems
and must hardcode physical disk offsets into the map loader. That is why LILO
must always be reinstalled when lilo.conf changes.
36. SILO doesn't time out before booting the kernel.
When you need to press enter, or enter a kernel-label each time to get
the machine to boot, you can try the following at the boot prompt
(ok):
ok setenv boot-file linux
ok setenv auto-boot? true
This will set the default bootimage to be "linux".
37. I've changed silo.conf, rebooted, and the system now responds: "boot: ..wrong syntax..".
These are messages from SILO to say that you've done something wrong in
silo.conf. SILO mostly tells you what to do in such a case.
If you're not succeeding, you can still boot from disk with the following
command at the boot prompt (ok):
ok boot disk /boot/kernel_name
or one of the other boot-methods described above.
38. I'm still having lots of problems with SILO.
Best advice is to get the latest version of SILO and try that.
You can get it via anonymous FTP from
ftp://ultra.linux.cz/OS/Linux/Sparc/local/silo.
39. Why does my machine only boot properly when I hard-boot it ?
Older PROMS do not reset the machine on soft boots. You can also
type reset at the boot prompt (ok)
instead of turning off the machine.
You might also want to do the following command at the boot
(ok) prompt:
ok setenv sunmon-compat? false
This will cause old proms to come up in the new command mode, and will allow
the kernel to call the "reset" command properly for automatic
reboots.
|