This chapter describes how to restore a NetWinder disk using the `rescue' flash filesystem. This allows a NetWinder to boot completely from the flash memory, and then become an NFS server. You can then use a second computer on your network to connect to the NetWinder and install a new disk image.
Thanks go to Mike Montour (firstname.lastname@example.org) who first put together the
rescue filesystem and has been improving it ever since. San Mehat adapted
the filesystem so that it could be stored in flash memory. I've also
twiddled with it a bit and released my own version
(nettrom-2.0.4a+ralphs). Please note that the
described below only exists in the 2.0.4a+ralphs version!
First and foremost, this method requires a NetWinder with a rescue filesystem embedded in the firmware. The only sure-fire way to find out is to try and boot the rescue filesystem (see section XX below). If your machine boots as usual off the hard disk, you don't have rescue firmware installed. In that case, either upgrade the flash (see the Firmware-HOWTO at http://netwinder.org/~ralphs/howto/Firmware-HOWTO.html), or use one of the other installation methods.
The second requirement is to have another computer, preferably a unix machine, which can act as an NFS client. The diskimage tarball should be downloaded to this machine. This machine will then mount the NetWinder's hard disk and untar across the network to the NetWinder.
As with the other methods, a partition should be freed on the NetWinder disk (unless you plan to reinstall everything, in which case you can just format the partition, of course). Consult sections 2.2 and 4.3 for more information on how to free a partition.
The NetWinder will now be turned into an NFS server and be made to export the (empty) partition so that it can be mounted from the `other' computer. The first step is to reboot the NetWinder and to enter the firmware menu by pressing a key when prompted, `Press any key to abort autoboot'. Configure the NetWinder's IP address and netmask, and enable the rescue filesystem:
setenv netconfig_eth0 flash setenv eth0_ip 192.168.1.1/24 setenv rdconfig flash boot
Be sure to specify the NetWinder's actual IP address and netmask. The welcome message should then be displayed. If you do not see it, or if the system boots off the hard disk like it usually would, then your firmware lacks a rescue filesystem. In this case, you can either change the firmware, or use one of the other installation methods.
e2fsck commands can now be used
to format and verify partitions, respectively. The partition table itself
cannot be altered, unfortunately, since there is not enough room in the
rescue filesystem for the
fdisk program to be included.
The last step is to actually export the (empty) partition, and to start the
NFS daemons. Mike has set up a convenient script for doing this. For
reasons unknown, firmware versions with the
rescue suffix don't
include this script (perhaps San didn't think it was needed...) There is a
corrected version called
nettrom-2.0.4a+ralphs which does include
the script (and is otherwise identical). The following example shows how to
use the script.
startnfs 192.168.1.254 /dev/hda3
/dev/hda3 to be mounted on
then exported to the host 192.168.1.254. You should of course substitute
the IP address of your `other' computer in its place.
startnfs command fails, try rebooting and repeating the
startnfs process again. Usually it succeeds after a few tries. If you have
repeated problems, you can contact me for help (mostly because I'd like to
nail down exactly what the conditions are that lead to the problem).
The other computer will now mount the NetWinder's exported filesystem. I
suggest creating a mountpoint
/mnt/netwinder for this purpose.
Substitute the NetWinder's actual IP address into the following mount
mkdir /mnt/netwinder mount 192.168.1.1:/mnt/localdisk /mnt/netwinder
If this fails, try pinging the NetWinder to make sure the network connection
is working. If
ping works, but the mount fails, go back to the
NetWinder and ensure that the NFS service started without errors. On some
systems, you might have to add the flag
-t nfs to the mount
To verify that things are working, try doing
This should show an empty filesystem. The
df command should show
that /mnt/netwinder has sufficient space to hold the uncompressed disk image
(about 650 MB for build #12).
The image can be untarred directly to the NFS disk image now. Since the
uncompressed data must be transfered over the network, it could take quite
some time. Be patient... To monitor progress, you can switch to another
terminal and use the
cd /mnt/netwinder tar zxpf /path/to/YourImage.tar.gz
You will have to supply the full pathname for
YourImage. The image
could of course be located on another NFS (or otherwise) mounted volume, if
you wanted to.
Be sure to fixup the
etc/fstab file in the newly installed image
before shutting down, and adjust the firmware parameters upon reboot.
Please refer to sections 2.4 and 2.5 for the details on how to do this.
Note in the examples in section 2.x assume your new image to be located on
/dev/hda3; if you've used a different partition, you must adjust
the examples to suit.