home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga GigaPD 3
/
Amiga_GigaPD_v3_3of3.iso
/
netbsd
/
docs
/
netbsd.install.744
< prev
next >
Wrap
Text File
|
1993-06-25
|
38KB
|
1,017 lines
How To Get NetBSD Going on Your Amiga - A Beginner's Guide
----------------------------------------------------------
v0.05 (Draft) 1 Feb 1994 - kernel version vmunix.744
This is a short note I wrote to help other people installing NetBSD
for the first time: I am no expert, I am a beginner too, and hopefully
this will be beneficial to the simplicity of this note. I would
appreciate any comments by e-mail to dcc@dcs.ed.ac.uk, or by post to
12 West Savile Tr, Edinburgh, SCOTLAND EH9 3DZ.
Additions to this note by Alan Bair <abair@amcu-tx.sps.mot.com>
Please note that NetBSD for the Amiga is under continual development,
and any documentation inevitably goes out of date as soon as it is
written - so don't take this as absolute truth!
1. What is NetBSD?
NetBSD is a copyrighted but freely distributable version of the BSD
variant of the Unix operating system - in layman's terms, it's Unix.
When it runs on an Amiga, it takes over the entire machine, turning it
into a Unix workstation. You cannot run AmigaOS (Workbench) at the
same time.
2. What kind of Amiga do I need?
You will need an Amiga with:
a. An MMU (i.e. 68020+68851, 68030 (not EC), or 68040 (not EC/LC))
and FPU (i.e. 68881/68882, or built into 68040 as above)
In particular, this rules out standard A1200's and A4000/030's, and
most A1200 accelerator cards. Currently, all 68040-based Amiga systems
(A4000, PPI, Fusion, etc.) have full MMU and FPU.
b. A supported hard disk controller
Currently, supported controllers include the A3000 builtin, A2091, PPI
Zeus and GVP Series II. Support for other controllers is being worked
on; in particular, someone should be supporting the A1200/A4000
builtin IDE fairly soon. You CAN currently use an A4000/040 provided
you have a supported SCSI controller (i.e. on a Zorro card) and enough
disk space for NetBSD on the SCSI side. The AmigaOS support stuff can
be kept on your IDE drive(s).
c. Enough memory
4Mb of FastRAM is a minimum, and at least 8Mb is strongly recommended.
You will need at least 1Mb of ChipRAM due to the way the kernel is
loaded.
People are already running NetBSD successfully on a wide variety of
Amigas; the traditional A3000's, A4000's with SCSI add-ons, and
heavily expanded A2000's and even A500's. I used to have an A1000
setup which would run it :-)
3. How much disk space will it take?
A lot. As much as you can spare and then some :-) Realistically, you
need around 100Mb to install a useable system, before you do anything
with it. Read the rest of this note to help you decide what your
requirements will be.
Many people purchase another hard disk specifically for NetBSD -
naturally, you should get the largest one you can justify ;-), but it
should be at least 200Mb in size.
4. How can I find out more?
a. Join the NetBSD mailing list - send an e-mail message to
majordomo@cbmuucp.commodore.com with the *body* (not subject line)
"subscribe netbsd-amiga". Note that NetBSD is not a Commodore product
and is in no way associated with any of their companies.
b. Subscribe to the Usenet News group comp.unix.amiga
Installing NetBSD
-----------------
Installation is best done in two phases:
1. Obtain the AmigaDOS bootstrap tools and root filesystem image
and install and test them
2. Set up partitions and install the system software and
applications you need
Before describing these procedures, I will briefly discuss the Amiga's
RDB hard disk paritioning mechanism and the Unix file system.
Before you install anything, read through the entire procedure
carefully and think about how you want to divide up your disk space.
The Unix File System
--------------------
Unlike most operating systems, in which the file system is a
collection of separate devices with a tree of directories on each,
Unix views the file system as one big tree - like all good computer
trees, it is upside down, with the root at the top. Distinct trees of
files (e.g. different disks or partitions, or even file systems from
another computer on a network) are plugged in at various points in
the tree (this action is called "mounting").
When choosing how to partition your system, remember that Unix file
systems have soft links - this allows directories or even individual
files to be placed elsewhere in the file system (e.g. in another
partition) with a link pointing to the real location. So accurate
partitioning isn't as crucial as with other operating systems. In the
final event you can always back up your files, repartition and
reinstall once you have used NetBSD for a while and get to know your
needs better.
The Amiga RDB System
--------------------
The Rigid Disk Block (RDB) is the mechanism the Amiga uses to store
information about hard disk partitions. The first cylinder of any hard
disk (or similar device on a SCSI bus) is reserved for this
information. When you partition a disk (with HDToolBox, FaastPrep,
etc.) the partitioning program will write this data on the disk - when
the computer boots under AmigaOS, it reads this to determine what the
partitions of the disk are, what filing systems they have, whether or
not it should mount them automatically, and whether they can be used
to boot the system.
NetBSD also uses the RDB information to locate its partitions on the
hard disk(s); however, it ignores the AmigaOS partition names, and
instead uses the DosType designator to identify the different BSD
partitions.
The DosType is a four byte field; the AmigaOS filing system types are
given by the characters "DOS" followed by a number (currently from 0
to 3, e.g. OFS is 0, FFS is 1, DCFFS is 3). In hexadecimal, the code
for FFS is "0x444F5301".
NetBSD partitions use this field to identify the partition name; the
root partition is named ASCII "BSDR", i.e. 0x42534452, swap is "BSDS"
(0x42534453) and other partitions are "BSDD", "BSDE" etc. (0x42534444,
0x42534445 etc.)
NetBSD Partition Types
----------------------
You will need these at various points in the installation procedure.
When entering them into a partitioning program like HDToolBox, use the
hex versions.
Purpose ASCII Type Hex Type NetBSD Device*
------- ---------- -------- -------------
Root Partition BSDR 0x42534452 /dev/sd?a
(One only)
Swap Partition BSDS 0x42534453 /dev/sd?b
(One only)
Data Partitions BSDD 0x42534444 /dev/sd?d
(Max. 5 per disk) BSDE 0x42534445 /dev/sd?e
BSDF 0x42534446 /dev/sd?f
BSDG 0x42534447 /dev/sd?g
BSDH 0x42534448 /dev/sd?h
* The ? in the device name is the SCSI id of the disk the partition
is on, e.g. the swap partition on drive 6 is /dev/sd6b. There are
two /dev nodes for each partition, e.g. /dev/sd1d and /dev/rsd1d.
The latter should be used when high-level formatting with the mkfs
command.
Phase I - Installing Root and Booting NetBSD
--------------------------------------------
*******************************************************************
* It is STRONGLY recommended that you back up all your hard disks *
* before attempting to install NetBSD *
*******************************************************************
You will need to obtain the relevant files from ftp.eunet.ch or one of
the mirror sites. At eunet the files are in directory
"pub/NetBSD-Amiga", the kernel binaries are in
"pub/NetBSD-Amiga/kernel", and some tools are in
"pub/NetBSD-Amiga/contrib/ados". Some of the utilities you may already
have, and some may be available from other places which do not carry
NetBSD. All filenames will henceforth assume the NetBSD-Amiga directory.
Also check "pub/NetBSD-Amiga/incoming" for recent updates.
Disk space: You'll need about 15-20Mb as a minimum on the AmigaDOS side
for tools and bits and pieces; temporary space to unpack stuff is
virtually essential as well (unless you have loads and loads of RAM).
You will need to make two of the NetBSD hard disk partitions; one for
the rootfs (10Mb for the 720 version, 8Mb for the old version), and one
for the swap (at least twice the size of your FastRAM).
The swap partition serves two purposes - it acts as backing store for
the virtual memory system, and it is also used for the /tmp directory
(which stores temporary files like the T: directory in AmigaOS). If
you have a lot of programs running simultaneously you will need more
virtual memory; if it runs out you will have problems. It is
recommended that the size of the swap partition is (a) at least twice
the RAM size and (b) at least 32Mb.
Before doing this part of the installation, read the rest of this note
and decide what you want your final disk partitions to look like.
In the rest of this note, commands to by typed in to the computer
appear like this:
dir
Where output is also shown, a prompt will also be shown with the
commands: if it ends in "$", it is a NetBSD shell prompt; a ">"
indicates the AmigaOS shell:
1.SYS:NetBSD> dir ; AmigaOS
root(6)$ ls ! NetBSD
Software you will need:
1. gzip (GNUzip) - this is the GNU file compression utility. available
from Aminet and elsewhere. All the NetBSD stuff is compressed with it.
2. filetodev - this (dangerous toy) writes blocks of data to a disk
"in the raw". You will use to lay down the rootfs image. It is
provided with BFFS in the file "contrib/ados/bffs11.lzh". (Once you
have NetBSD up and running, BFFS allows you to read files in NetBSD
partitions while using AmigaDOS).
An alternative to this is DCP which allows you to specify partitions
rather than block numbers. It is in the file dcp1.1.lha. There is also
the streamtodev program which again allows the use of partition names.
It is in the file device-streams.tar.gz.
3. loadbsd - this AmigaOS program boots NetBSD. Get the newest version
in NetBSD-Amiga/bin (currently named "loadbsd")
4. A kernel image, from the subdirectory "kernel". The current version
is "vmunix.744". Earlier kernels had distinct versions for use with
the 68040, e.g. "vmunix.713-040". If you will be using the current,
shared library binaries you will need kernel version vmunix.720 or
later.
5. A root file system image. The latest one, dated 18-Dec-93, which is
20480 blocks (10Mb) when unpacked, is called "rootfs_720.gz". This
image contains the vmunix.720 kernel. The old version, dated 13-Jun-93,
which is 16448 blocks (about 8Mb) when unpacked, is called
"rootfs.gz".
You should get the latest version you can irrespective of what kernel
you will be using.
You will also need a suitable AmigaDOS hard disk partitioning utility;
it is recommended that you use Commodore's own HDToolBox, as certain
3rd party products (notably GVP's "FaastPrep") will not allow you to
make the settings you need.
Doing the installation:
1. Download and unpack the files mentioned above and have them ready
to use on your Amiga. e.g. to unpack rootfs.gz, "gzip -d rootfs.gz".
The AmigaOS utilities will be packed with things like LhA. Note the
size in blocks of the rootfs you have downloaded - this can be
calculated by getting the size in bytes of the unpacked version from
the AmigaOS "list" command and dividing by 512:
size in blocks = size in bytes / 512
The 720 rootfs is 20480 blocks in size, and the old one was 16448
blocks; wherever you see the number 20480, substitute the size you
have calculated.
2. Start up HDToolBox - if you have a GVP or other non-Commmodore
controller, you will need to start it from the shell (CLI) and give it
the name of the device driver (e.g. for GVP II "hdtoolbox gvpscsi.device")
Note the SCSI unit numbers of the various devices (disks, tapes,
etc.). NetBSD assumes disks will be devices 0-3 and 6, and tapes (if
any) 4 & 5. If your system doesn't fit into this, it is suggested that
you change it (AmigaDOS won't care). If you just have one hard disk to
be used with NetBSD, make it unit 6 if possible (some people have
reported problems when using other unit numbers). The unit number of a
SCSI device can usually be changed using a set of 3 jumpers found on
the device, or in the case of pre-boxed units by a dial on the back.
You need to know the number of blocks per cylinder for the drive on
which you will make the root partition. You can find this out from the
drive type editor in HDToolBox:
- From the main screen, select the drive in question
- Click "Change Drive Type"
- Click to select the type matching the drive
- Click on "Edit Old Drive Type" or if none are listed, click on
"Define new drive type", "Read Configuration From Drive" then
"CONTINUE" to get the selected drives characteristics.
- Note the number of heads and blocks per track
- Click "Quit" etc. to get out of this mode
The number of blocks per cylinder is the number of heads multiplied by
the number of blocks per track.
Note: This drive "geometry" is imaginary; most hard disks put a
variable number of blocks on a track depending on its radius, and SCSI
devices talk in block numbers, but AmigaDOS likes to have cylinder,
head and block. Therefore you can have different geometries for
different drives of the same type depending on how they were first
partitioned, what controller you have, etc. DO NOT trust values from a
leaflet that came with the drive, find out from HDToolBox.
3. You will create the BSD partitions on the respective disks using
the following procedure - instructions refer to the HDToolBox supplied
with AmigaOS 2.04; other versions or other RDB editors may be slightly
different:
- Select the drive by clicking on it
- Click on "Partition Drive" (HDToolBox partition mode)
- Click on "Advanced Options" to turn them on
- Click on "New Partition"
- Click on the empty space where the partition will go
- Grab the arrow under the partition and adjust the size
- Grab the partition box (black rectangle) and move it if need be
- Change the "Bootable?" option to "No"
- Click in the device name box (marked "CHANGE_ME") and alter it
to something sensible (NetBSD doesn't care)
- Click on "Change File System for Partition" (HDToolBox File
System Menu). You will find the default setup (usually FFS)
- Click on "Custom File System"
- Change "Blocks Reserved" and "PreAlloc" to 0
- Change "Auto mount this partition?" to "No"
- Change "Use Custom boot code?" to "No"
- The "Identifier" or "DosType" box will show something like
0x444F5301 (FFS). Change this to the BSD partition identifier
(e.g. for the Root Partition, 0x42534452, "BSDR")
- Click "OK" to return to partition mode
- Note the "Start Cylinder", "End Cylinder" and "Total Cylinder"
numbers for the partition, and note the SCSI device number
(usually 0 to 6) of the disk it is on
- If all partitions for this drive are done, click "Ok" to return
to the main screen. Click "Save Changes to Drive". If you are
overwriting old partitions you will get a warning - if you're
not sure what you've done is right, think again, but if you are,
click "Continue".
4. Create a partition for the rootfs using the method above; it should
be exactly or just over the size of the rootfs you downloaded (i.e.
Total Cylinders * Blocks Per Cylinder >= 20480 Blocks for 720 version)
any extra space will be wasted for the moment, but once you have NetBSD
running it is possible to rebuild the rootfs, so if you want to leave a
bigger space for it, that's OK. The partition type should be 0x42534452
(ASCII "BSDR").
5. Create a swap partition - this will be used as swap space for
NetBSD's virtual memory, and for scratch space (the /tmp directory).
It should be at least TWICE the size of the Amiga's RAM. The partition
type should be 0x42534453 ("BSDS"). NetBSD only uses swap space when
running (no permanent files are stored on it), so you can use it as
scratch space for AmigaDOS in between NetBSD sessions (e.g. as swap
space for GigaMem) if you like.
6. You are now finished with HDToolBox - if you have overwritten old
partitions, it will force you to reboot when you quit.
7. Now we will put the rootfs image in the partition we reserved for
it.
********************************************************************
* You are reminded again of the advice to back up the rest of your *
* system. This stage is highly dangerous and one mistake could *
* trash the contents of your hard disk(s)! *
********************************************************************
We need to know which block number the partition starts at, which
we calculate as:
Start Block = Start Cylinder * Blocks Per Cylinder
using the values for the drive you noted in stage 2, and the cylinder
numbers for the partition from stage 3. If you forgot to note this, go
back into HDToolBox and check the values.
Calculate the size in blocks, using:
Size = (End Cylinder - Start Cylinder + 1) * Blocks Per Cylinder
This size should be at least as large as the rootfs image (20480 or
more blocks). If it isn't, go back to stage 4 and make it bigger.
Ensure that the image is uncompressed, e.g. that you have an AmigaDOS
file "rootfs_720" of size 10485760 and not "rootfs_720.gz".
We will use the filetodev program to write the image to the disk; it
takes 6 parameters:
- the start block number
- the image size (i.e. 20480 or whatever, not the partition size)
- the name of the file (e.g. "rootfs_720")
- the AmigaDOS device name for your controller
(e.g. "gvpscsi.device")
- the device number of the disk
- the number of buffers to use (e.g. 1000)
Example: I have an A3000, and I am placing my NetBSD partitions on a
Maxtor 7345SR which is unit 6 (using the built-in SCSI controller).
Geometry for the Maxtor, from HDToolBox:
Unit = 6
Cylinders = 3518
Heads = 1 (not true in reality; see stage 2)
Blocks Per Track = 192
I calculate Blocks Per Cylinder = 1 * 192 = 192
The BSDR partition:
Start Cylinder = 3408
End Cylinder = 3517
Total Cylinders = 110
Start block: 3408 * 192 = 654336
I check the size: (3517 - 3408 + 1) * 192 = 21120 (bigger than 20480)
I use the following command:
filetodev 654336 20480 rootfs_720 scsi.device 6 1000
Note: If filetodev scares the willies out of you (I have trashed my
AmigaDOS system partition more than once with it), some kindly person
(Chris Hooper) has written a slightly less dangerous tool, called
"dcp". Another possiblity is devtostream, written by Chris Hopps.
Get one of them from the ftp site and use it instead if you like.
8. If there are any patches you know are *definitely* required to run
the kernel you have on your system, you may as well apply them at this
stage. See the section below on how to use binpatch.
e.g. if you are using an A4000, you need kernel version vmunix.720 or
later, which has a flag to tell it you are using an A4000 (it's
actually very difficult for the kernel to determine automagically
which Amiga you have), and you need to patch it thus:
binpatch -s _a4000_flag -r 1 vmunix.720
9. You are now ready to test NetBSD in single user mode. Use the
versions of loadbsd and vmunix that you got (ensure that they have
been decompressed first), e.g.
loadbsd vmunix.714
If all goes well, the Amiga will go through a soft reboot, and you
should see a plain screen with something like:
(C) ....... Regents of the University of California
..... godzilla.eunet.ch....
AMIGA A3000 (68030, 68882 25MHz FPU)
....
sd6: Maxtor 7345 rev. 9.60
....
root device /dev/sd6a
...
root(1)$ _
NetBSD is running in single user mode, and the prompt is from the
shell (bash). Try a few simple commands (e.g. "ls -l"). When bored,
use the command "reboot".
If it doesn't work, look for suggestions below, and ask for help on the
News and mailing list forums.
Problems With Booting NetBSD
----------------------------
Getting the kernel to boot into single-user mode is 90% of the battle
in getting NetBSD to work. A few common problems are:
1. NetBSD boots but hangs shortly after recognising the hard disk
types. This can be caused by NetBSD turning on drive sync and/or
trying to do DMA to non-DMAable areas. Obtain the program "binpatch"
from the ftp site (see below).
a. Drive sync - there is a table (an array of bytes) in the kernel
which tells it not to enable synchronous transfers for individual SCSI
devices; it is called "_inhibit_sync". The bytes are set to 1 to
inhibit sync, 0 to allow sync. To turn off sync for drives 0-3:
1.SYS:NetBSD> binpatch -s _inhibit_sync -r 0x01010101 vmunix.714
0x1426c: 0 (0x0)
for drives 4-7, calculate the address of the next word, using the base
address of _inhibit_sync returned by binpatch, e.g. 0x1426c + 4 =
0x14270 (hexadecimal):
1.SYS:NetBSD> binpatch -a 0x14270 -r 0x01010101 vmunix.714
However, if a drive is already set to synchronous mode by AmigaDOS, it
may lock up the SCSI bus if sync is not enabled in NetBSD. To patch
the value for a single drive, calculate the address of it's byte flag
(base address of _inhibit_sync + unit number) and patch it, e.g. drive 6
1.SYS:NetBSD> binpatch -a 0x14272 -b -r 0 vmunix.714
b. DMA - on some systems you might have a DMA SCSI controller, but
have some FastRAM to which it cannot do DMA transfers, e.g. an
accelerated A2000 with 32-bit FastRAM and a Zorro-II controller. If
NetBSD tries to DMA directly to the 32-bit RAM it will crash. To turn
off SCSI DMA, simply:
1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
Note: the system will run much slower with DMA off, so only do it if
you have to!
2. The message "no suitable root" - this means the kernel couldn't
find the root partition. You may have installed it incorrectly, like
setting the "DOSType" hex value for "BSDR", but this message can also
appear if there are drive sync problems, etc. Check your installation
and apply the treatment above.
3. The monitor goes crazy - some kernels may be set up to use default
screen modes your monitor can't handle; try the following patch:
1.SYS:NetBSD> binpatch -s _ite_default_height -r 200 vmunix.714
How to Use "binpatch"
---------------------
The binpatch program allows you to change constants (statics) in the
NetBSD kernel without recompiling it. It is capable of reading and
using the symbol table (list of variable names) in the kernel binary,
e.g.
1.SYS:NetBSD> binpatch -s _scsi_no_dma -r 1 vmunix.714
0x1436ba: 0 (0x0)
Here, binpatch reports the address of the variable _scsi_no_dma and the old
value (0), and replaces it with the new value given (1). The options
to binpatch include:
-a <address> Patch the variable at address given
-b Patch a single byte (as opposed to 32-bit word)
-r <value> Replace with given value
-s <name> Patch the variable with the given symbolic name
Phase II - Installing the Software and Setting Up Multi-User Mode
-----------------------------------------------------------------
Read the whole section before proceeding.
You should now have a minimal NetBSD installation with rootfs and swap
partitions. We will now create additional partitions to install the
operating system and other software. To calculate the size(s) needed,
use the following rough formula:
HDToolBox size (Mb) = (Installed blocks / 2048) * 1.2
The reason for the 1.2 scaling factor (apart from a safety margin and
allowing for formatting) is that NetBSD reserves part of each
partition: a partition will be reported as being 100% full when it
still has some space left - root and other superusers will be allowed
to write to the partition, but ordinary users will not.
The following table gives the installed size in 512 byte blocks for
each of the bin-...gz archives (make sure you get the ones that go
with the kernel you are using, the 720 ones are currently in the
".../NetBSD-Amiga/incoming" subdirectory). There are two sizes given:
the first size is for the executables that use shared libraries, and
these need vmunix.720 or later to work. The size in brackets is for
the old statically linked executables which are larger but work with
any kernel.
Archive Unpacks to Installed Size (old)
------- ---------- --------------------
These files are essential for proper operation of NetBSD:
bin-bin.tar.gz /bin (Included in new rootfs)
bin-sbin.tar.gz /sbin (Included in new rootfs)
bin-usr.sbin.tar.gz /usr/sbin 3108 (10960)
bin-usr.bin.tar.gz /usr/bin 13174 (25686)
bin-usr.lib.tar.gz /usr/lib 5184 ( 2416)
bin-usr.libexec.tar.gz /usr/libexec 3766 ( 3882)
bin-usr.share.tar.gz /usr/share 25038 (25038)
Total: 50270 (67982)
Not essential, but useful:
For building code -
bin-usr.include.tar.gz /usr/include 2274? ( 2258)
GCC, Emacs, etc. (compiling and editing) -
bin-usr.gnu.tar.gz /usr/gnu 61156? (61156)
For a little break -
bin-usr.games.tar.gz /usr/games 6172? ( 6172?)
Total: 69602? (69586?)
Current X11R5 (lib, libs, bin, include) 46170?
To begin with, I decided to make a 100Mb partition for /usr, and to
make a 70Mb partition to be mounted as /home, for the NetBSD users' home
directories. Since I used the old rootfs, I left an 11Mb space for the
partition and later rebuilt it to get a root partition 11Mb in size.
Decide what partitions you want; you could just rebuild the rootfs
(see below) onto one enormous partition and keep everything there, but
the usual caveats about backups etc. apply to NetBSD as much as to
AmigaDOS. In the instructions that follow I assume my system with the
partitions I detailed above; vary them according to what you have set
out.
Now decide how you are going to get the bin-...gz files into NetBSD -
basically, you need a temporary space to copy them to. If you are
lucky enough to have a SCSI tape drive you can use that, otherwise the
easiest way is to create an extra NetBSD partition, which we will
leave unformatted, and to use that.
1. Set the partitions up with HDToolBox, using the same method as
before. The partitions should be given types 0x42534444 ("BSDD"),
0x42534445 ("BSDE") etc. up to 0x42534448 ("BSDH") If you are using
more than one drive, reuse the names (i.e. start from "BSDD" with each
drive). If you will be using a scratch partition (rather than tape) to
install the files, create it too. It will have to accommodate the
largest file (uncompressed), so I would suggest one of at least 30Mb
in size to cope with "bin-usr.gnu.tar.gz". Keep in mind the following
rules:
- Only one each of "BSDD" etc. per disk
- Only one rootfs on the whole system
- " " swap " " " "
I made "BSDD" for /usr, "BSDE" for /home and a 30Mb scratch partition
which I called 0x42534447 ("BSDG").
2. We will now boot NetBSD and format the partitions. You will need to
know the relation between partition types (in HDToolBox) and the
special file names on the NetBSD side; the special file name
incorporates the drive number (SCSI device number) and the partition
type, e.g. on my system:
Partition Partition Type ID NetBSD Special File
--------- ----------------- -------------------
root 0x42534452 "BSDR" /dev/sd6a
swap 0x42534453 "BSDS" /dev/sd6b
/usr 0x42534444 "BSDD" /dev/sd6d
/home 0x42534445 "BSDE" /dev/sd6e
If I put a "BSDE" partition on my Quantum (SCSI ID 0), it would be
/dev/sd0e
3. Boot NetBSD into single user mode as before.
4. Format each of your new partitions (but NOT rootfs nor swap) using
the newfs command. If you will be using a scratch partition to install
the bin-...gz files, don't bother formatting it. In my case, the
commands are:
newfs /dev/rsd6d
newfs /dev/rsd6e
Note the "r" - the device used is /dev/rsd6d and not /dev/sd6d. Ignore
any "Can't write disklabel" messages.
5. When NetBSD starts up in single user mode, the rootfs is mounted as
a read-only file system. To make it writable, we have to remount it,
e.g.:
mount -u /dev/sd6a /
(Substitute the appropriate device name for your disk in place of "sd6a")
6. We will now create the mount points for these partitions. A mount
point is the place on the filing system where a partition is attached,
and it merely consists of an empty directory. Again, following my
example:
mkdir /usr ; chmod 755 /usr
mkdir /home ; chmod 755 /home
You will find the two in this example already exist in the rootfs you
are given, but you may need to create others.
7. Now we need to create a table listing the partitions. Since we
don't have an editor installed yet we'll just have to type it in.
( Actually you can use "ed" if you know its command syntax ) You
can use TABs instead of spaces, and the alignment isn't important.
Here I have shown the prompt as it doesn't appear while you're typing
the file in. Here is how it looks on my system:
root(26)$ cat > /etc/fstab
/dev/sd6a / ufs rw 1 1
/dev/sd6b /tmp mfs rw 1 1
/dev/sd6d /usr ufs rw 1 1
/dev/sd6e /home ufs rw 1 1
<Ctrl-D>
Note that /tmp is mfs while the others are ufs. If you make a mistake,
exit with Ctrl-D and start again.
8. Now look at the file system; the "df" command shows all mounted
partitions and their size:
df
It should show just the root partition.
9. Now we tell mount to mount all the partitions listed in /etc/fstab:
mount -av
and try df again:
df
All of your partitions should appear. If there are any problems, use
the command "umount -av" to unmount the partitions and go back and do
/etc/fstab again.
10. Now we will shut down NetBSD and get the files ready to install.
Unmount the partitions:
umount -av
and then flush the file system buffers:
sync ; sync ; sync
and then:
reboot
You should follow a similar procedure every time you shut down NetBSD
to avoid corrupting the file system; however, to shut down from
multi-user mode you should use the "shutdown now" command.
11. The procedure for installing a bin-...gz archive is as follows:
- from AmigaOS, put it on your temporary space
(i.e. tape or scratch partition)
- Boot NetBSD and mount the partitions
- Unpack it into the NetBSD filesystem
- Shutdown NetBSD, reboot AmigaOS and do the next one
Of course, if you have more than one scratch partition, or more than
one blank tape, you can do several in one NetBSD cycle.
*********************************************************************
* Use a tape drive if you can since it is quicker, easier and safer *
* than using a scratch partition. *
*********************************************************************
The procedure for a scratch partition is:
a. Calculate its start block and size as you did with rootfs; my
scratch partition starts at cylinder 541 and ends at 861, so I
calculated:
start block = 541 * 192 = 103872
size = (861 - 541 + 1) * 192 = 61632
b. In AmigaOS, uncompress the archive, e.g.
gzip -d bin-usr.bin.tar.gz
c. Calculate the tar file's size in blocks, by:
Blocks = File size / 512
e.g.
Size of bin-usr.bin.tar = 12892160 / 512 = 25180
d. Use filetodev to put it on the scratch partition, e.g.
filetodev 103872 25180 bin-usr.bin.tar scsi.device 6 1000
e. Boot up NetBSD, mount the partitions, and unpack the file into the
root directory, e.g.
mount -av
cd /
tar xvfp /dev/sd6g
It should be possible to just dump the compressed archive onto the
partition and decompress it on the fly (using "tar xvzfp /dev/sd6g")
but I couldn't get this to work with filetodev. ( The current tar
does not support gzip compressed files. Try the command sequence:
gzip -d </dev/rsd6g | tar xvfp - )
The procedure for tape is slightly easier. Just put the compressed
file on the tape, e.g.
copy bin-usr.bin.tar.gz tape:
( For the tape: device support, pick up the dtape10.lzh package. )
Then boot NetBSD and unpack it:
mount -av
cd /
gzip -d </dev/rst0 | tar xvfp -
The current tar does not support gziped files, but when it does, the
command to use will be: tar xzvfp /dev/rst0.
When shutting down NetBSD, remember to unmount the partitions and
flush the file system buffers:
umount -av
sync ; sync ; sync
reboot
Once you have it installed, the command "fastboot" has the same effect
(unmounting etc.) as the above sequence of commands.
12. After a few repetitions, you should have all the software
installed. We can now configure NetBSD for single user mode. Boot up
NetBSD, and use the following commands:
mount -av (as always)
export TERM=vt200 (needed by the editors)
If you used the old rootfs, edit /etc/gettytab (with vi, emacs or
whatever) and change ":ap:" to ":np:" in the entry for default (around
line 20), e.g.
vi /etc/gettytab
Most generic Unix books have a chapter on using "vi", but here is a
minimum to get you started:
Vi is a "modal editor", i.e. the keys work differently depending on
the mode.
Normal Mode:
h Left
l Right
j Down
Return Down
k Right
Space Right
i Enter insert mode, starting before the current character
a (Append) Enter insert mode, starting after current char.
x Delete current character
:d Delete a line |
:x Exit and save the file | Press return after any
:quit! Abort the edit | of these commands
Insert Mode:
Type text to insert it, press ESC to end. You can only edit the
line you are currently typing.
You may now want to change the list of users. Edit the password file
with:
vipw
The file consists of lines like this:
fred:k%56Fj:234:567::0:0:Fred Bloggs:/home/fred:/bin/bash
Each represents a user. The colons (":") separate the fields. The
important ones are the 2nd one (their password, encrypted), the 3rd
and 4th (user and group id's), the 8th (real name), 9th (login
directory) and 10th (login program).
Make sure that root has no encrypted password (for now), and that
there is a user to log in as. Make one for yourself if you like.
Exit vi, and the user database will be updated. If you have added
users, create their home directories as follows:
mkdir /home/fred ; chown fred /home/fred
If you used the old rootfs, edit /etc/rc and comment out the line
which starts the program "named".
13. To start multi user mode, exit the single user mode shell:
exit
If all is well, after a few messages you should see a prompt like:
BSD 4.3 on amy.domain.domain (console)
login: _
To shut down from multi user mode, log in as root (or use "su") and
use the command:
shutdown -r now
Rebuilding the Root Partition
-----------------------------
When you received it, the rootfs image you got was a canned copy of a
fully formatted partition, and there was no way you could alter the
size. If you installed NetBSD using the old 16448 block rootfs and are
updating the binaries, or for other reasons of your own, you may find
there is insufficient space in the root partition and you may wish to
rebuild it to create one of a larger size.
Restructuring other partitions is fairly easy, as you can archive
them, etc., but the root partition requires a bit of trickery as
detailed below.
If you want to expand the root partition to occupy a larger space you
reserved for it earlier, repeat this procedure twice, copying it away
and back again.
1. Create the new partition for root, but give it a partition type which
makes it an ordinary partition, e.g. 0x42534448 "BSDH"
2. Start up NetBSD
3. Format the new partition, make a mount point and mount it, e.g.
newfs /dev/rsd6h
mkdir /newroot
mount /dev/sd6h /newroot
4. Use the following commands to copy the partition. Note the l option
to tar (local file system only) which stops it trying to copy other
partitions which may be mounted to the root one, and from incestuously
trying to copy /newroot.
cd /
tar clfp - | (cd /newroot ; tar xvlfp - )
5. Shut down and return to AmigaOS, e.g.
umount -av
umount /newroot
sync ; sync ; sync
reboot
6. When AmigaOS boots, enter HDToolBox and alter the partition types,
changing the "newroot" partition to root (0x42534452 "BSDR") and
removing the "BSDR" label from the old root partition.
7. Boot NetBSD and check that your new root partition is working.
NetBSD FTP Sites
----------------
The NetBSD files are available from a number of places. Please use the
site nearest you. I have not given numeric addresses as these are
subject to change; if you can't use symbolic addresses at your site,
hassle your site admin :-)
Site Name Location NetBSD-Amiga Top Directory
--------- -------- --------------------------
ftp.eunet.ch * Switzerland pub/NetBSD-Amiga/
ftp.luth.se Sweden pub/NetBSD/NetBSD-Amiga/
ftp.hrz.uni-kassel.de Germany pub/machines/amiga/NetBSD/
ftp.uni-regensburg.de Germany pub/os/NetBSD/NetBSD-Amiga/
ftp.funet.fi Finland pub/amiga/unix/NetBSD-Amiga/
att2.cs.mankato.msus.edu USA ** pub/mirrors/ftp.eunet.ch/NetBSD-Amiga/
* ftp.eunet.ch should only be used outside office hours, Swiss time
(2 hours ahead of GMT, 8 hours ahead of USA's EST)
** The administrators of att2... request that you use fsp rather than
ftp if at all possible.
The "home" of NetBSD in general is sun-lamp.cs.berkeley.edu
1-Feb-94
----