This chapter explains the various ways that the rescue partition can be used to recover a NetWinder back to its factory state. Keep in mind that this is normaly a `last resort' measure for fixing your system; often you can more easily repair the damage in other ways. The rescue partition can be used as an emergency boot device, which allows you to go and fix stuff on the main partition.
All recent NetWinder machines include a small (10 MB) rescue partition, that
contains enough software to reformat the NetWinder's internal hard disk, and
then to reinstall the normal software load. Naturally, an image of all the
files on the hard disk is also necessary; for OfficeServer this image is
included on the CDROM in the rescue
folder.
In the most common scenario, the OfficeServer CDROM is placed into a PC that has network access, so that the NetWinder can retrieve the data from the CDROM via the network. It is necessary for the PC to have enabled file sharing, and a `shared folder' for the CDROM has to be created.
The NetWinder rescue partition is then booted, and networking is configured so that the PC can be reached. There are a series of scripts to guide you through the process of formatting and then mounting the NetWinder hard disk. Then, the drive image is retrieved from the CDROM on the PC and installed on the NetWinder hard disk. (There is also the option to fetch the drive image via FTP).
The following sections describe the process in greater detail.
When you need to use the NetWinder's rescue partition, here are the steps to access it. You'll need to connect a keyboard and monitor to the NetWinder to carry out this rescue process.
setenv kerndev /dev/hda4 setenv rootdev /dev/hda4 boot
That will do it, the NetWinder will now boot from the rescue partition. In
short time, a shell prompt will appear, along with a message telling you to
run netconfig
to configure the network.
The netconfig
script will allow you to set up a network interface.
It will ask a number of questions about your network, such as the IP address
and netmask to be used. Some options, like DNS servers and gateways, are
not required if your rescue computer is on the same subnet.
The netconfig
script will ask you which interface to use.
Normally, the OfficeServer uses eth1
(the 10/100-base-T port) for
its internal gateway. So that is generally the one you would select. Then
give an IP address and a netmask. The script will try to compute the
broadcast address for you.
If you normally operate using DHCP, you'll have to `guess' a free IP address
to be used during this rescue boot. Go to some other computer on your
network, check out what it's IP address is, and then add one or two to the
number. You can use ping
or other tools to verify that the address
is free for use. Then enter the free address into the NetWinder's script.
It is a good idea to test the network connection once it's been configured.
From the NetWinder you can try to ping
another machine on your
network. DNS name resolution might not work, but numeric IP's should. Note
that the rescue partition shell does not support job control, which means
you cannot abort a ping
with CTRL-C
. Instead, you have to
use ping -c 5 aa.bb.cc.dd
which tells ping to only try 5 times.
At this point, there are five possible options for re-imaging the NetWinder's hard disk. Three of them are quite common:
mountsmb
is used if the rescue image is going to be loaded
from a Windows 95/98/NT computer on your network,mountnfs
is used if the rescue image is going to be loaded
via NFS from a unix system on your network, andftprescue
is used if the rescue image will be downloaded by
FTP from an FTP server.In some cases, instead of connecting from the NetWinder to a rescue server, you'll want to turn the NetWinder into a server so that other computers can connect to it. If this seems like the same thing to you, then don't worry about it, and ignore the following options:
nfsserver
turns your NetWinder into an NFS server, with the
root filesystem exported to the whole network,smbserver
similary turns the NetWinder into a Samba server,
so that other (Windows) clients can connect to it.These options are described further in the following sections. There are a
few more helpful scripts that are used, wipefs
which erases the
hard disk, and mountfs
which mounts the partitions in preparation
for the untarring of the disk image.
mountsmb
This is the option that most people will use. It requires that you have a computer running Windows on your network. You place the OfficeServer CD-ROM into this machine and allow the CD to be shared across the network. Click on `My Computer', then right-click on the CD-ROM icon. A menu will appear, select `Properties' and then click on the `Sharing' tab. Turn on sharing and give it a name, for example, `CDROM'.
On the NetWinder, you should now run the mountsmb
script. It will
ask for the name of the Windows computer (if you don't know what it is, then
go to the Windows machine, right-click on `Network Neighborhood' and then
click the `Identification' tab). Next, you'll be prompted for the name of
the share (`CDROM' in the example above). Finally, you should enter the
username (which matches the name you used to log into Windows). The
NetWinder will then try to establish the connection to the Windows
machine.
If the connection fails, you'll have to check your settings carefully and
try again. Make sure the network cables are plugged in and that you can
ping
the Windows computer from your NetWinder, and vice-versa. Try
entering the computer name and share name in uppercase, as some Windows
systems seem to want it that way. If your DNS server is dodgy or
nonexistant, then you'll need to use the IP address of the Windows machine
in place of its name.
Once the mount is successful, then the contents of the CDROM should be
visible on the NetWinder. To verify, type ls -l /mnt/rescue
. You
should see a directory called `recovery' (or `Recovery') and inside that
directory, the OfficeServer disk image. You can now skip down to the
Actual installation
section to complete the process.
mountnfs
If you have other computers on your network that run a Linux or some other
UNIX-like operating system, then this option is the one to use. Place the
CDROM into the drive and then do whatever is necessary to mount and share
the CD to the network. For Linux, this would mean mounting the disk
(mount /dev/cdrom /mnt/cdrom
) and then editing the
/etc/exports
file to allow the /mnt/cdrom
directory to be
shared. And then the NFS service would need to be restarted.
On the NetWinder, the mountnfs
script will prompt you for the IP
address (or name) of the rescue server, and the name of the share (e.g.
/mnt/cdrom
). It will then try to mount the volume so that it can
be accessed on the NetWinder as /mnt/rescue
.
If the mount fails, check the network cables, IP addresses, and the settings on your server. Try mounting the server from elsewhere on your network, to see if it is correctly configured. Often you have to restart both NFS and portmap services on the server. Try ping tests to verify that the NetWinder can talk to the server.
Once the mount is successful, then the contents of the CDROM should be
visible on the NetWinder. To verify, type ls -l /mnt/rescue
. You
should see a directory called `recovery' (or `Recovery') and inside that
directory, the OfficeServer disk image. You can now skip down to the
Actual installation
section to complete the process.
ftprescue
To be written.
nfsserver
To be written.
smbserver
To be written.
At this point, the new disk image you want
to install should be mounted under /mnt/rescue
somewhere, and you
should know the exact path and filename. Since the CDROM's have the old DOS
limitations on filenames, you may find that the image is called something
strange, like os-1_0_2~.gz
when really it should be something more
meaningful like os-1.0-2.tar.gz
. In the following examples, just
substitute the actual filename for the examples listed.
You can now proceed to erase the hda1
and hda3
partitions
and then to transfer, via the network, the new disk image on to the empty
partitions. Two scripts are provided to facilitate this process:
wipefs
is used to clear the two disk partitions, and
mountfs
sets the partitions up so they can be accessed from
/mnt/hdroot
.
Note: there is a bit of a bug in the early versions of the rescue
system. If you type cat /proc/version
and it reports linux version
2.2.9-3, then you will likely have trouble with formatting the two
partitions. The format command (mke2fs
) will fail randomly with
a `memory violation' error. If this happens to you, your options are to
replace the kernel with a newer version (2.2.12), or to repeat the command
until it suceeds, or to use rm -rf
to delete all the files instead
of mke2fs
.
After you've used wipefs
and mountfs
, the new disk image
can be installed directly. Just to keep you on your toes, we did not
include a script for doing this. You have to type the commands yourself:
cd /mnt/hdroot tar zxvpf /mnt/rescue/recovery/os-1.0-2.tar.gz
Adjust the pathname on the tar
command as necessary to reflect the
actual path and filename where the new image is located. It is critical to
use the `p' option so that permissions will be set correctly on the files.
The `v' option can be omitted if you don't want to see the names of the
files scrolling by.
It should take about 15 minutes to copy all the data across. Once it's
done, you should wait a little longer (30 seconds or so) to let the data be
flushed to disk. Then, type exit
, wait until the message appears
that its safe to shutdown. Then press the reset button to reboot. At this
point, the new image will be loaded and hopefully all will be well.