How to reach files from tape drive using dd


 
Thread Tools Search this Thread
Operating Systems BSD How to reach files from tape drive using dd
# 1  
Old 08-28-2007
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!
# 2  
Old 08-28-2007
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.
# 3  
Old 09-01-2007
It solves all my problems.

Thanks a lot for help!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. HP-UX

TAPE drive

I have used ioscan -fnC tape and the system identified the tape drive. what is the command to show a listing of what is on the tape? I have used ls /dev/rmt/rmt0 to no avail. can anyone help? Thanks in advance (10 Replies)
Discussion started by: Randydog
10 Replies

2. Solaris

Help with tape drive

Hey folks, Linux admin here, forced to use Opensolaris to try to use ufsdump/ufsrestore to get some data of some old tapes. I've got Opensolaris 2009.06 on x86 and a Sony SDX-700V. As a "control" experiment, I booted the system with a Linux live CD and the tape drive worked perfectly. ... (2 Replies)
Discussion started by: eddy_sysad
2 Replies

3. Solaris

Backup files to tape drive on solaris

Hi, I want to take backup of files older than 20 days from a directory onto a tape drive on remote machine on Solaris. The files are of format abc-20100301000000.gz on my local machine. I know the below commands for searching files older than x days and command for backup procedure. solar1 #... (7 Replies)
Discussion started by: jyothi_wipro
7 Replies

4. Filesystems, Disks and Memory

Appending files to a tape drive

I've starting playing with a tape drive for the first time. Its a new one, an IBM Ultrium LTO 4. After initially copying a file to the tape with tar cvf /dev/st0 /root/dummy, all subsequent files appended take an increasing amount of time with tar rvf /dev/st0 /root/dummyX. Is it normal for each... (2 Replies)
Discussion started by: jeriryan87
2 Replies

5. UNIX for Dummies Questions & Answers

How to send files to remote tape drive

We have 2 UNIX machines, 1.HP-UX 11i where oracle database running on it. 2.AIX 5 with Ultrium LTO3 tape drive connected. My query is, i want to send oracle database archive files from HP machine to the tape drive which connected on AIX machine, everyday. These files should be appended. I... (3 Replies)
Discussion started by: yashdbad
3 Replies

6. Solaris

Problem restoring files from remote tape drive

Server 1 - Sun Solaris 5.8 sparc SUNW,Sun-Fire-480R with attached DLT tape drive /dev/rmt/0n Server 2 - Old DG-UX box which has restore command on it compatible with the files on the backyup tape - backed up with dump2 Server 3 - Sun solaris 5.9 sparc SUNW,Sun-Fire-V490 with lots of free space... (4 Replies)
Discussion started by: lindab
4 Replies

7. UNIX for Dummies Questions & Answers

tape drive

Hi, I need to restore my tape backup, when I type "tape status" it gives; status : ready beginning-of-tape write-protected soft errors : 0 hard errors : 0 underruns : 3 but... (4 Replies)
Discussion started by: alisevA3
4 Replies

8. Filesystems, Disks and Memory

moving files to tape drive

What is the unix command to move files/backups from the Os to tape. Thanx in advance, Kavita (3 Replies)
Discussion started by: knarayan
3 Replies
Login or Register to Ask a Question