Quasijarus 4.3BSD on 1600bpi magtape

From: Fred N. van Kempen <Fred.van.Kempen_at_microwalt.nl>
Date: Sat Jan 25 05:03:00 2003

> > > Yes. Use maketape from the 2.11BSD distribution.
> > I strongly advise against this approach.
> Well, I had to use some programm to write the tapes, dd(1),
> maketape, or somthing else.
Indeed.

There is *nothing* magical about making tapes from selected files.
What you have to keep in mind are:

- select the correct tape boot blocks
  (MT, TK etc)
- grab the correct kernel and/or RAM disk image
- use the right blocksize for the above "file" (usually 512bytes)

For the remaining files on the tape, blocksizes vary between OSes,
and can be anywhere between 512 (old systems) and 10K (UNIX tar
files). The key issue is to generate a magtape file marker between
the individual files, so the tape handling software knows where a
file ends.

The block size and tape marker generation are done correctly by the
Maketape program. If you want to do it manually:

- grab the first ("bootable") file for the tape, and dd it to the
  tape:

        dd if=bootfile.img of=/dev/ntape bs=512

  this copies "bootfile.img" to the tape, using a block size of 512
  bytes, and when done, it will write a tape mark and **NOT** rewind
  the tape ("ntape" - can be /dev/nrst0, /dev/nrmt0h, /dev/ntk0, etc.)

- copy the other files to the tape:

        dd if=nextfile.foo of=/dev/ntape bs=10240

  which copies "nextfile.foo" to the tape, using a block size of 10240
  bytes (common for UNIX tar files) and when done, writes the tape mark,
  and NOT rewind.

- when done, write a tape mark and rewind the tape:

        mt -f /dev/ntape weof
        mt -f /dev/ntape rewind

  where the first command (Write EOF) is optional, as most UNIX systems
  do this automatically when rewinding a tape in write mode.

This creates a magtape in the right format for booting. Tools like the
Maketape program do this as well, based on a small description file which
tells it what goes where and such.

> > dd if=stand of=/dev/nrmt0h bs=512
> I learnd that the bs= parameter of dd doesn't set the block
> size of the tape with an ioctl, it is only the buffersize
> parameter that is used in the write(2) syscall.
Correct. The 'dd' program **does not** set the physical block
size of the tape device, as it is a generic block/deblock tool,
and has no knowledge of devices whatsoever.

It sets the block buffer size(s), on which the READ(2) and WRITE(2)
system calls are based, which in turn tell the tape device driver
what the block size is to be. This only works in the "raw" mode of
tape devices, by the way- always use the 'r' device file of a tape
unit when doing the above.

Cheers,
        Fred
Received on Sat Jan 25 2003 - 05:03:00 GMT

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:36:03 BST