Linux

Instructions for Ubuntu 6.06 (Dapper Drake, June 2006), the last ubuntu release to include ftape in the default kernel.

Install sshd

(source: www.howtoforge.com/perfect_setup_ubuntu_6.06_p3#-install-the-ssh-server)

Ubuntu does not install OpenSSH by default, therefore we do it now. Run

apt-get install ssh openssh-server

You will be prompted to insert the installation CD again.

ssh’ing in to a server this old

The cyphers in this version of sshd are so old that newer ssh clients will refuse to connect to them. Instead, you have to enable so-called “antique” cyphers by using:

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1

Disable ACPI (optional)

If you are using an older motherboard like I am, you may not have ACPI support and so the linux boot process will hang for a few minutes at the very beginning with the message:

ACPI: Unable to locate RSDP

Since this server will be used very infrequently, power saving it’s a priority and so I opted to disable ACPI in linux toonly be used once and a while I decided to disable ACPI instead.

Make a backup of grub menu: sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.original

Edit /boot/grub/menu.lst using your preferred text editor find the first line beginning with “kernel” and add noacpi acpi=off pci=noacpi to the and (after “ro quiet splash”). Save and reboot.

Some tutorials will tell you to run update-grub or grub-update after changing the menu.lst file. In our case, don’t. It will only overwrite the changes you just made and not update the grub boot menu at all.

(Hat-tip to www.columbia.edu/~em36/ubuntubreezythinkpadt42.html for this info)

Update apt sources

Since we’re using a version of Ubuntu that came out in the mid 2000’s, your apt sources are horribly out-of-date now. Update your /etc/apt/sources.list to have these:

deb http://old-releases.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ dapper-backports updates main restricted universe multiverse

Then run sudo apt-get update and it should actually succeed (for as long as those repos remain online).

Install packages

We’re going to need some packages installed:

sudo apt-get install lsscsi binutils build-essential modutils mtx
  • lsscsi: provides lsscsi util, helpful for configuring scsi tapes
  • binutils: provides strings util, helpful for human-parsing of tape dumps
  • build-essential: necessary if you want to build util to read MTF backups: http://laytongraphics.com/mtf
  • modutils: for ftape-util, below
  • mtx: magnetic tape changer control, also installs scsieject, scsitape and tapeinfo which are useful on their own. mtx and loaderinfoare for querying and controller loaders and libraries.

We also want to install ftape-util but it can’t be found in these repos. Instead, download it and install it manually:

$ wget http://old-releases.ubuntu.com/ubuntu/pool/universe/f/ftape-tools/ftape-util_1.09.2002.03.21-0.3_i386.deb
$ sudo dpkg -i ftape-util_1.09.2002.03.21-0.3_i386.deb

Local copy of .deb, in case that URL no longer works: ftape-util_1.09.2002.03.21-0.3_i386.deb

Installing ftape-util returns this helpful message:

Setting up ftape-util (1.09.2002.03.21-0.3) ...
+++ Creating ftape devices
--- Done!
We use now the new modutils setup. I will setup a simple internal 
tape drive configuration in /etc/modutils/ftape-util. Please check
the documentation if it doesn't work and change the file appropriately.
$ sudo vtblc 
Password:
Tape drive type: HP Colorado T1000 (0x11c5)
Using old ftape raw device with minor number 0x20
Reading header segment ... done.
Reading volume table segment ... done.
 Nr  Id          Label                   Date           Start      End    Space
--------------------------------------------------------------------------------
  0 VTBL "BCI-166 7-28-98 Office"  17:37:52 07/29/98        3     3894    28.61%

Install zftape kernel module

ftape and zftape merged a while ago, so the module is now called zftape. Install it with:

sudo modprobe zftape

On my Ubuntu 6.06 machine (with stock kernel), the following entries are added:

  • qft
  • nqft
  • nrawrawqft
  • nzqft
  • rawqft
  • zqft

Also creates some symlinks:

ln: creating symbolic link rft0' to qft0’: File exists ln: creating symbolic link nrft0' to nqft0’: File exists ln: creating symbolic link rawft0' to rawqft0’: File exists ln: creating symbolic link nrawft0' to nrawqft0’: File exists


  1. The standard SCSI tape devices are named st0, st1,…, nrst0, nrst1,…
  2. The standard IDE tape devices are named ht0, ht1,…, nrht0, nrht1,…
  3. The standard floppy tape devices are named ftape (rft0) and nftape (nrft0)

https://www.distributednetworks.com/configure-linux-components/module4/tape-control-commands.php

Also not nht0

http://etutorials.org/Linux+systems/how+linux+works/Chapter+13+Backups/13.6+Tape+Drive+Devices/ There are two versions of each tape device on a Unix system:

  • rewind tape device rewinds the tape after every operation. For example, /dev/st0 is a rewind device.
    • no-rewind tape device does not rewind the tape after an operation. No-rewind devices start with n; for example, /dev/nst0 is a no-rewind device.

linux.die.net/man/1/mt

mt

List of type values found: android.googlesource.com/platform/hardware/bsp/kernel/nxp/imx-v4.9/+/refs/heads/master/include/linux/ftape-vendors.h

$ sudo mt -f /dev/ht0 status
drive type = Generic SCSI-2 tape
drive status = 512
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 512 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (4000000):
 WR_PROT
# HP Colorado T1000
mnielsen@tapezilla:~$ sudo mt -f /dev/nqft1 status 
qic-117 drive type = 0x011c5, no tape or door open
drive status = 1
sense key error = 26
residue count = 0
file number = -1
block number = -1
gstat = 40000
# Summit SE 250, Mountain FS8000
$ sudo mt -f /dev/nqft0 status
qic-117 drive type = 0x00181, no tape or door open
drive status = 1
sense key error = 26
residue count = 0
file number = -1
block number = -1
gstat = 40000
$ lsscsi
[0:0:2:0]    tape    TANDBERG  TDC 4100        =05:  /dev/st0
$ sudo mt -f /dev/st0 status
drive type = Generic SCSI-2 tape
drive status = 512
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 512 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN
$ sudo vtblc -f /dev/st0
Error: This is not a floppy tape drive!
$ lsscsi
[0:0:4:0]    tape    TEAC     MT-2ST/N50       RV E  /dev/st0
$ sudo mt -f /dev/st0 status
drive type = Generic SCSI-1 tape
drive status = -2013265408
sense key error = 0
residue count = 0
file number = 0
block number = 0
Tape block size 512 bytes. Density code 0x88 (DLTtape IV 8000 uncompressed (40GB)).
Soft error count since last status=0
General status bits on (45010000):
 BOT WR_PROT ONLINE IM_REP_EN

GMT_IM_REP_EN(x): Immediate report mode. This bit is set if there are no guarantees that the data has been physically written to the tape when the write call returns. It is set zero only when the driver does not buffer data and the drive is set not to buffer data.

SCSI

dd might not return all the data on the tape, just the current record/block/whatever.

Find out how much stuff is there with mt -f /dev/nst0 eod; mt -f /dev/nst0 telland be sure to use the nst0 (no-rewind) device instead of st0 (auto-rewind after action). Then loop through everything on the tape until you get to that block.

rm gigatek_dc6150_complete.bin
for (( ; ; ))
do
  sudo dd if=/dev/nst0 conv=sync,swab,noerror >> gigatek_dc6150_complete.bin
  sudo mt -f /dev/nst0 tell
done

Reading

$ sudo dd if=/dev/st0 of=teac_1.bin count=1000
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 34.4567 seconds, 14.9 kB/s