NetBSD/cobalt Restore CD HOWTO
|
This document attempts to explain how to create a
NetBSD Restore CD for Cobalt Qube/Raq devices. It was
originally written by Alex Pelts (
|
|
Introduction
What is a Cobalt Qube/Raq and what is a Restore CD?
Hardware and Software Requirements
Steps to create a new Restore CD
- Download Required Parts
- Mount Original Restore CD Image
- Creating Directory Structure
- Final Fixes
- Creating your new Restore CD
Next Steps
Credits
Introduction
Disclaimer (top)
The author does not accept any liability for your use of this document. It is possible that your use of this document will render your computer useless, damage your hardware, software, break your window or your relationship with a loved one. Use the contents of this document at your own risk. This document is just the authors opinion on how to use hardware and software mentioned herein.
You have been warned.
Copyright Information (top)
This document is copyrighted (c) 2005 Alex Pelts and distributed under the terms of the OpenContent License (OPL). The full text of the license can be found at http://www.opencontent.org/opl.shtml .
What is a Cobalt Qube/Raq and what is a Restore CD?
What is a Cobalt Qube/Raq? (top)
The Cobalt Qube/Raq is a server appliance. To put it simply, they are just computers without keyboard and monitor and without the ability to attach one. There are several versions of Qubes and Raqs in existence, older MIPS based and newer AMD-K6 based. This document covers only MIPS based server appliances. Further in the document both appliances will be referred to as "Qube". There are differences between the Qube and the Raq but for the purpose of this document they are irrelevant.
What is a Restore CD? (top)
Because the Qube does not have an easy way to attach a monitor, a keyboard and most importantly a CDROM drive, there is no easy way to install a new operating system on it. This is where the Restore CD comes in. The Qube has the ability to boot an operating system over the network. A Restore CD provides the environment allowing the Qube to boot an operating system and perform an unattended install of the operating system onto hard drive. An original Linux Restore CD was provided with the device. ISO image of this CD can still be downloaded from Sun's web site.
Based on the original Cobalt Restore CD, Dennis Chernoivanov created a NetBSD Restore CD for versions 1.6 and 1.6.1. He then published the scripts he used to create CD. This document describes how to use a Restore CD for version 1.6.1 to create a CD for any version of NetBSD.
Hardware and Software Requirements
Hardware Requirements (top)
To create and use a Restore CD you will need following hardware :
- MIPS based Cube or Raq with at least 1GB hard drive installed.
- x86 based PC or Laptop with NetBSD supported Ethernet adapter and CDROM drive.
- Crossover Ethernet cable or hub with two straight cables.
- RS232 Serial cable could be very helpful to diagnose problems.
- CD Recorder to create your final CD.
Software Requirements (top)
To create a Restore CD you will need following software :
- Unix-like operating system. Filesystem must be capable of containing device nodes so any windows filesystem will not do. Any of the following should work - NetBSD, FreeBSD, Linux, etc. Only NetBSD was actually tested so your mileage may vary.
- You need to have the ability to mount CD images. On Linux you can use loopback devices. On NetBSD vnode pseudo disk devices provide the same functionality.
- The mkisofs command is needed to create the new image of Restore CD.
- Use ftp(1) or wget to retrieve new installation sets and the image of the original NetBSD Restore CD.
- Other unix tools like tar , cp , etc. These usually come with your OS.
Steps to create a new Restore CD
Download Required Parts (top)
You will need to download the image of the original NetBSD Restore CD. It is located on the NetBSD ftp site . You will also need to download NetBSD installation sets for port-cobalt as well as pre-built GENERIC kernel. You can use the ftp client but I prefer to use wget and fetch the whole directory. For instance, to download 1.6.2 sets you need to execute the following command:
wget -r --retr-symlinks -nH --cut-dirs=3 ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-1.6.2/cobalt
This command will retrieve the entire installation set into the current directory creating the correct directory structure ready to put on your new Restore CD. Don't forget to replace the version number in the command with the desired version.
Mount Original Restore CD Image (top)
Now you need to mount the original Restore CD image to access its content. You can burn it onto a blank CD and mount the CD or you can mount the image itself. To mount the image on NetBSD you need to first configure a vnode disk using the vnconfig(8) utility. After that you will need to mount your image. The following commands will do the trick:
# vnconfig /dev/vnd0 ./image.iso # mount -t cd9660 /dev/vnd0a /mnt/
Of course you most likely need to be root to mount the filesystem. Now you can verify your mount by going to the /mnt/ directory and examining the contents of the image.
Creating Directory Structure (top)
You will need to create a directory structure to form
your new Restore CD. Most of the structure is created by
copying files from the original CD. You need to be root for
this operation because you will need to copy not only
regular files but device files as well. You can use
tar(1) or cpio(1) to copy the whole CD
filesystem in to a directory. Lets take tar(1) for
example. First create a directory that will be the root
directory of the new CD. Lets call it
cobaltcd.
Now go into this directory and execute the following
command:
( cd /mnt ; tar -cpf - * ) | ( tar vxpf - )
This command will copy all files from the CD image
into the current directory, preserving permissions and
device nodes. Now you need to clean out old files that you
are going to replace. The only files that need to be
replaced are old install sets. They are located in the
following directory
cobaltcd/nfsroot/cobalt
. Before deleting them, you probably want to save the boot
loader unless you compiled your own. The boot loader is
located in the file
cobaltcd/nfsroot/cobalt/binary/kernel/boot.gz
. You want to copy this file in to some temporary place.
Now you can delete the whole
cobaltcd/nfsroot/cobalt
directory. In its place will go new the installation sets
that you downloaded earlier. If you used the
wget
command detailed in this document you should have a nice
directory structure ready to copy inside of the
cobaltcd/nfsroot
directory. If you used the ftp client you should recreate
directory structure found on the NetBSD ftp site at the
location pointed to by the
wget
command above. You can also keep the original structure
from the Restore CD and replace only the files. After the
files are moved or copied into the correct place you are
almost ready to create your new image.
Final Fixes (top)
Before making your image you will need to perform a
few fixes on the installation scripts and create some
files. One must-fix script is
install-core.sh
. It is located in the
cobaltcd/nfsroot/install/scripts
directory. You will need to adjust the invocation of the
MAKEDEV script if you want to create a Restore CD for
NetBSD 2.0 or later. Here are the lines you will have to
change:
253 # ./MAKEDEV all 254 # Invoke known script from restore filesystem. Fix for 2.0 255 /dev/MAKEDEV all
The reason for this fix is that parameters for
mknod(8), invoked from the MAKEDEV script, have
changed. If you do not fix the
install-core.sh
script you will create an installation that will not boot
correctly and your new CD will be useless. The fix is
recommended for versions below 2.0 as well. It will ensure
that you won't run into problems lateron.
You need to copy the file
boot.gz
that you saved earlier back into it's original place. While
you will be able to boot without this file, it will involve
some manual labor.
You may also want to edit the information file to
display any additional information, as well as modify the
installation scripts to your liking. One possible
modification can include checking for some file in the
/tmp
directory before running the install. Using this file, you
can interrupt the installation and drop into a terminal,
effectively making the Restore CD into a regular recovery
CD.
One final step could be recreating various checksum files in the directory where the boot loader is located. This step is completely optional as the install script does not verify any checksums.
Creating your new Restore CD (top)
Now when everything is ready it is time to create
your new Restore CD image. You will need the
mkisofs
utility to make this image. You have to cd to the directory
containing
cobaltcd
and execute the following command:
$ mkisofs -o image.iso -b i386/installation/floppy/boot-big.fs -c boot.catalog \
-l -J -r -L cobaltcd
This command will take some time to execute and after
it is finished you will have a file
image.iso
which is your new Restore CD image.
You can burn this image onto a CD using any software that can record ISO images. On UNIX you can use cdrecord , on Windows use Nero Burning Rom or any other ISO image compatible software.
Congratulations! Enjoy your custom NetBSD Restore CD.
Next Steps
How to Use Your CD (top)
Now when you have your Restore CD what should you do next? There are instruction on how to use this CD posted to port-cobalt@NetBSD.org .
Troubleshooting (top)
To debug any problems with the Restore CD you will need a serial cable. Attach this cable to your Qube's serial port and to your computer. Now you can run a terminal program and monitor the installation progress. If your Qube is old and does not have serial port there is not much you can do. About the only thing is to extract hard disk from Qube, attach it to a PC. Examine the failed install and try to figure out what went wrong.
Credits
Author (top)
This document was written and contributed to the
NetBSD Project by Alex Pelts (
<alexp@broadcom.com>
).
Other credits (top)
Thanks to Dennis Chernoivanov for creating the original NetBSD Restore CD upon which this work is based. Also thanks to numerous people from the port-cobalt mailing list, who helped me to test this CD.
Document revision history (top)
- 2005-03-11 -- original version announced on the port-cobalt mailing list.
- 2005-03-13 -- original import into NetBSD's htdocs CVS module with minor english and grammer fixes. All other changes can be seen from the cvsweb interface.
![[NetBSD Logo]](../../images/NetBSD-headerlogo.png)