LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-03-2005, 11:58 AM   #1
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Rep: Reputation: 30
Problem writing to a tape drive


I know how to tar things and I can run tar and mt to feed direcly to the tape, but by backups make incrementals and I need to be able to copy them to a tape. Don't worryt about tape popsition as I know how to contol that but I can not cp a file to it like this
cp backup_main_060605.tar.gz

How do you manually write a file to a tape?
 
Old 06-03-2005, 12:28 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Here is one method:
dd if=/location/backup-yada.tar.gz of=/dev/nst0 (or st0 if you want to rewind the tape)
 
Old 06-03-2005, 01:31 PM   #3
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Original Poster
Rep: Reputation: 30
I just found out that I could you cat > and that will do it.
 
Old 06-03-2005, 02:38 PM   #4
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Original Poster
Rep: Reputation: 30
I am getting this error when ever I try and write to the tape. Does anyone know why?

cat 2005-06- 01_full.tar.gz > /dev/nst0
cat: write error: Invalid argument
 
Old 06-03-2005, 03:26 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
Originally posted by phatboyz
I am getting this error when ever I try and write to the tape. Does anyone know why?

cat 2005-06- 01_full.tar.gz > /dev/nst0
cat: write error: Invalid argument
Is the space between - and 0 a typo?
 
Old 06-03-2005, 03:41 PM   #6
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Original Poster
Rep: Reputation: 30
Just a typo. I check the histroy and i ran the command right I am sure. Also my DDS4 drive in my windows2000 server makes the writing noises while running backups ands this DDS3 drive the light come on but thats about it.

Being that I can mount and umount and erase and rewind I would have assumed that I installed the drive properly mt status says its online.
 
Old 06-06-2005, 07:13 AM   #7
phatboyz
Member
 
Registered: Feb 2004
Location: Mooresville NC
Distribution: CentOS 4,Free BSD,
Posts: 358

Original Poster
Rep: Reputation: 30
Its here...

dmesg | grep st0
Attached scsi tape st0 at scsi0, channel 0, id 6, lun 0
st0: try direct i/o: yes (alignment 512 B), max page reachable by HBA 1048575
st0: Block limits 1 - 16777215 bytes.
st0: Write not multiple of tape block size.
st0: Write not multiple of tape block size.
st0: Write not multiple of tape block size.
st0: Write not multiple of tape block size.

ls -l /dev/st0
crw-rw---- 1 root disk 9, 0 May 31 04:17 /dev/st0
 
Old 06-06-2005, 07:21 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Try using the dd command and see what happens.
dd if=/location/backup-yada.tar.gz of=/dev/nst0 bs=512 (or /dev/st0 for rewind)

The bs=512 writes using 512B blocks which the cat command does not according to the above error.
 
Old 07-07-2005, 01:36 PM   #9
maveric7911
LQ Newbie
 
Registered: Aug 2004
Distribution: Arch Linux .7
Posts: 20

Rep: Reputation: 0
Ok some how I am having the same issue at the same exact spot as he is. Here is the reply to your last command you issued ..

# dd if=file.tar.bz2 of=/dev/nst0 bs=512
dd: writing `/dev/nst0': Invalid argument
1+0 records in
0+0 records out

Same results when using st as well.
 
Old 07-08-2005, 10:08 AM   #10
maveric7911
LQ Newbie
 
Registered: Aug 2004
Distribution: Arch Linux .7
Posts: 20

Rep: Reputation: 0
any ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing to the tape problem (ADAPTEC 19160 + HP DAT20) borovikov SUSE / openSUSE 8 03-16-2009 11:41 AM
Tape Drive Problem!! tranquil222 Linux - Software 1 07-08-2004 12:48 AM
Tape drive problem ahmedmekawy Solaris / OpenSolaris 0 05-12-2004 06:58 AM
Tape Drive problem under Slack9 da_tibmeister Linux - Hardware 1 10-09-2003 07:20 AM
Tape Drive spinning up and writing slowly chrisk5527 Linux - General 2 04-21-2003 09:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration