# DAT, doing a backup [solved]

## menschmeier

Hi,

I have now a DAT device on my box and I am now trying to use it. I tried several utilities but always failed.

I can use serveral operations mit the mt command, but creating a archive on a tape always fails.

```
mt -f /dev/tape status

drive type = Generic SCSI-2 tape

drive status = 637534208

sense key error = 0

residue count = 0

file number = 0

block number = 0

Tape block size 0 bytes. Density code 0x26 (unknown).

Soft error count since last status=0

General status bits on (41010000):

 BOT ONLINE IM_REP_EN

```

Teh device is a softlink to /dev/nst0

```
lrwxrwxrwx  1 root root 9 2005-09-26 11:15 /dev/tape -> /dev/nst0
```

When I try to do a backup, I always get this error ...

```
tar: /dev/tape: Cannot write: Input/output error

tar: Error is not recoverable: exiting now]
```

This happens too when I use /dev/st0 as device.

Does anyone have an glue what I am doing wrong??

menschmeier

----------

## keyson

Hi.

Check the permission on the /dev/nst0 it should say root tape.

Think you can solve it by adding your user to the tape group in

/etc/group

----------

## menschmeier

Hi keyson,

yes the permisssions are as you said:

```
Jupiter:~# ll /dev/tape

lrwxrwxrwx  1 root root 9 Sep 26 11:15 /dev/tape -> /dev/nst0

Jupiter:~# ll /dev/nst0

crw-rw----  1 root tape 9, 128 Feb 26  2005 /dev/nst0

```

But I am trying to backup as root ....

```
Jupiter:~# tar -cvf /dev/nst0 /usr/local/bin/*

tar: Removing leading `/' from member names

...

tar: /dev/nst0: Cannot write: Input/output error

tar: Error is not recoverable: exiting now

```

In /var/log/messages there are the following entries:

```
Sep 26 15:41:51 Jupiter kernel: sym0:6: ERROR (0:19) (8-28-30) (f/bf/0) @ (scripta af0:10000e00).

Sep 26 15:41:51 Jupiter kernel: sym0: script cmd = 10000000

Sep 26 15:41:51 Jupiter kernel: sym0: regdump: da 10 c0 bf 47 0f 06 06 80 08 86 28 80 01 00 01 00 fc 75 0f 08 00 00 00.

Sep 26 15:41:51 Jupiter kernel: sym0: SCSI BUS reset detected.

Sep 26 15:41:51 Jupiter kernel: sym0: SCSI BUS has been reset.

Sep 26 15:41:51 Jupiter kernel: st0: Error 80000 (sugg. bt 0x0, driver bt 0x0, host bt 0x8).

Sep 26 15:42:01 Jupiter kernel: st0: Error with sense data: Info fld=0x1, Current st0: sense key Unit Attention

```

It is a driver problem?? 

menschmeier

----------

## keyson

Hmmm.

What is your kernel version ?

Think i noticed that one of the 2.6 hade some issues.

Type of tape drive ?

I got the same on one tape that was used in another machine.

But i did a erase of the tape and it start writing.

You say that the mt commands work (I se your mt -f /dev/tape status).

And it look's ok.

Can you do a rewind ?

```
mt -f /dev/st0 rewind
```

If you try to erase (take a loooong time if you have a large tape) can it erase ?

----------

## menschmeier

Hi,

yes rewinding is possible. I did an erase days ago, it took many hours because it was a 20GB tape ...

So because rewinding, requesting status, erasing etc. is possible I do not understand why writing is not.

BTW, the kernel I am using is a 2.6.8 one ... With this kernel I am very satisfied till now.

menschmeier2.6.8

----------

## keyson

Yep.

The only thing that i can think of is that the tape is bad or you

need to clean the 'read/write head'. It is like a small videorecorder inside.

There is a spinning drum with heads on it.

Is it a new unit or has it been used alot? The problem is that the

picup drum get worn out. (Just like an old videorecorder that gives a bad

picture when the video head is bad.)

Can you test it with a new tape ?

----------

## menschmeier

Hi,

the tape is brand new, but maybe I have to clean the drive. It wasn't used a lost I guess, but maybe there is a lot of dust inside.

menschmeier

----------

## e-ipi

 *menschmeier wrote:*   

> Hi,
> 
> the tape is brand new, but maybe I have to clean the drive. It wasn't used a lost I guess, but maybe there is a lot of dust inside.
> 
> menschmeier

 

Usually the drive will show a warning light when it wants a cleaning tape put in.   DDS3 & 4 drives are pretty fragile.  If you know the tapes are good (although the tapes are pretty fragile, too) and you can use mt, etc., I'd say there's something wrong with the drive.   But try setting the tape type in mt to the one you're using.  Try a cleaning, both with a cleaning tape and by getting the dust out.  If that doesn't help, I don't know what to tell you.

----------

## menschmeier

Hi,

I solved the problem, ist was a hardware/driver problem. In this box (I bought used) are 2 SCSI-Adpaters, one is a Compaq one the other an Adaptec (Adaptec AHA-2940U/UW). Unfortunately the DAT wasn't connected to the Adaptec controller - which I didn't recognized. So  the system had a confict with the drivers, because rewinding, erasing a tape was possible. I didn't expect that problem, but when I opend the case I saw it immediatly ...  :Smile: 

So now I am using mt and tar for handling my tape device, I tried KDAT but KDAT isn't that stable and useful, because it doesn't work as I should (e.g. creating a backup profile) and when I try to backup some data it crashes after a few minutes.

menschmeier

----------

## keyson

Ahaaa...

Then it work ok now   :Very Happy: 

Yes the KDAT is not so usefull. If you search the google for (backup +script +/dev/nst0) you

get som fine hitt's on nice backup scripts to use.

----------

## Drunkula

I haven't had much luck with kdat either.  You might want to snag a copy of taper.

http://www.maresth.nl/TuxOnTape/

It seems to work well enough anyhow...

----------

