The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > BSD
Google UNIX.COM


BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to send files to remote tape drive yashdbad UNIX for Dummies Questions & Answers 3 12-29-2007 06:33 AM
Can I use Any DSS Tape in My Drive ? AIX122 AIX 2 11-12-2007 12:27 PM
Problem restoring files from remote tape drive lindab SUN Solaris 4 07-02-2007 05:52 AM
4MM Tape Drive joeweisser AIX 1 08-18-2005 05:44 AM
moving files to tape drive knarayan Filesystems, Disks and Memory 3 03-09-2002 06:12 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-27-2007
Registered User
 

Join Date: Aug 2007
Posts: 7
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
How to reach files from tape drive using dd

Hi all!

I have problem with copying files from tape drive.

The contents of tape:
silverman# tcopy /dev/sa1

file 0: block size 10240: 21 records
file 0: eof after 21 records: 215040 bytes
file 1: block size 10240: 20712 records
file 1: eof after 20712 records: 212090880 bytes
file 2: block size 10240: 7 records
file 2: eof after 7 records: 71680 bytes
file 3: block size 10240:
file 3: eof after 44991 records: 460707840 bytes
file 4: block size 10240: 34298 records
file 4: eof after 34298 records: 351211520 bytes
file 5: block size 10240:
file 5: eof after 127911 records: 1309808640 bytes


Copy first file:
silverman# dd if=/dev/sa1 of=/tmp/1 bs=10240 count=21
Excelent first file copied.

Copy second file:
(skipping first file + mark EOF - maybe here is something wrong?)
silverman# dd if=/dev/sa1 of=/tmp/2 bs=10240 count=20712 skip=22
dd: skip reached end of input
silverman#

The size of 2 is 0.


Could you know how to reach tha second, third, etc files from tape using dd? or you have any other suggestion how to read it?

Many thanks for help!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-28-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,253
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Check the man page for the tape driver. There should be a no-rewind style of device file. It might be /dev/nrsa1 or something like that. You need to use that device file. Then do dd without count= or skip= so that dd will encounter the filemarks. the first dd will read the first file on the tape and leave the tape positioned to read the second file. So you just run a second dd command to read that file. And continue until you have all of the files. Another way would be the mt command. It will have some option to forward space files. So you might be able to do "mt -f /dev/nrsa1 fsf 3", and follow that by a dd to read only file 4 (assuming that you started with the file rewound). And you can use the mt command to explicitly rewind the tape when you need that.
Reply With Quote
  #3 (permalink)  
Old 09-01-2007
Registered User
 

Join Date: Aug 2007
Posts: 7
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
It solves all my problems.

Thanks a lot for help!!!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
"inappropriate ioctl for device" 421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix curses.h cut command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive gzip password hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script scp recursive segmentation fault(coredump) sftp script snoop unix stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com vi substitute while loop within while loop shell script


All times are GMT -7. The time now is 02:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101