Tape backup - Ubuntu linux - HP 72GB internal USB DAT - ML350g6

I'm having problem with tape backup. When I try " tar -czf /dev/st0 $SOURCE_DIRS", I get error: /bin/tar: /dev/st0: Cannot write: Input/output error.

mt -f /dev/st0 status
SCSI 2 tape drive:
File number=-1, block number=-1, partition=0.
Tape block size 0 bytes. Density code 0x0 (default).
Soft error count since last status=0
General status bits on (50000):

mt status returns:
  /dev/tape: Inappropriate ioctl for device
Which sounds bad.

My stinit.def:
manufacturer=HP model ="C7438A" {
can-bsr can-partitions auto-lock
mode1 blocksize=0 compression=1
mode2 blocksize=1024 compression=1
mode3 blocksize=0 compression=0
mode4 blocksize = 1024 compression=0 }

Any Ideas how to proceed?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DR_OPEN means there's no tape in the drive.
Also do this:
mt -f /dev/st0 rewind

Open in new window

veli-pekkaAuthor Commented:
Ok, new 'mt -f /dev/st0 status', this time with tape loaded:

SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x47 (DDS-5 or TR-5).
Soft error count since last status=0
General status bits on (41010000):

I did rewind, but it didn't help (I didn't get any errors).
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

So can you run your tar command now?
veli-pekkaAuthor Commented:
No I can't.
Is $SOURCE_DIRS properly set with complete path?  What error message do you get when you try to run it?
veli-pekkaAuthor Commented:
Yes it is. I have also tried with single folder. Error message is:
 /bin/tar: /dev/st0: Cannot write: Input/output error.

If I try for example:
 dd if=/dev/zero of=/dev/st0
I get the same "Cannot write: Input/output error"

Ok, first try setting the block size and then retry the dd command
mt -f /dev/nst0 setblk 0

Open in new window

veli-pekkaAuthor Commented:
I will continue with this on Friday.
veli-pekkaAuthor Commented:
Still no success:
  sudo mt -f /dev/st0 setblk 0
  sudo dd if=/dev/zero of=/dev/st0
dd: writing to 'dev/st0': Input/output error
dd: closing output file '/dev/st0': Input/output error
veli-pekkaAuthor Commented:

[ 6153.745797] st0: Add. Sense: Write error
[ 6153.745801] st0: Error on write filemark.
You need to check your driver.  Appears to me that your driver for the tape is not installed or not functioning

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
veli-pekkaAuthor Commented:

I checked the drivers and they should be fine (output was similar to this, I'm not at the server right now):
      lsmod | grep usb_storage
      usb_storage 61193 0

      lsmod | grep st
      st 35933 0

Should I check something else as well?
veli-pekkaAuthor Commented:
The problem was faulty drive.
So my comment 35108197 was close
veli-pekkaAuthor Commented:
The drive itself wasn't functioning
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.