- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reading header and trailer records from the tape
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2004 09:06 AM
тАО10-04-2004 09:06 AM
Reading header and trailer records from the tape
How can I get the header and trailer records (80 characters each) from the tape.
Please let me know.
Thank you.
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-04-2004 01:51 PM
тАО10-04-2004 01:51 PM
Re: Reading header and trailer records from the tape
e.g.
dd if=/dev/rmt/1mnb bs=80 of=header1
Next read the file itself with the appropriate blocksize; if you don't know the blocksize it doesn't matter as long as you don't need the data itself. Typically the record size and blocking is part of the header. In any event you need to read until the next file mark and then read the trailer (if it exists).
e.g
dd if=/dev/rmt/1mnb bs=5120 of=data1
dd if=/dev/rmt/1mnb bs=80 of=trailer1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2004 02:03 AM
тАО10-05-2004 02:03 AM
Re: Reading header and trailer records from the tape
mt -t /dev/rmt/1mnb fsf 1
will forward space 1 file.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2004 07:50 AM
тАО10-05-2004 07:50 AM
Re: Reading header and trailer records from the tape
I tried to read header and trailer blocks using above commands but I saw same results.
Actually, I don't understand exactly about your replies because I don't have enough knowledge about tape. If I want to read header or trailer blocks, Do I have to move to header or trailer blocks and read it ?
Please let me know detail information.
Thank you.
Best Regards,
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2004 08:21 AM
тАО10-05-2004 08:21 AM
Re: Reading header and trailer records from the tape
# dd if=/dev/rmt/0mn of=/tmp/header bs=80b count=1
# dd if=/dev/rmt/0mn of=/tmp/trailer skip=NNNm bs=80b count=1
where NNN is the size of the data/file on the tape.
Say, if you have a 2 GB file on the tape
# mt -t /dev/rmt/0mn rew
# dd if=/dev/rmt/0mn of=/tmp/header bs=80b count=1
# dd if=/dev/rmt/0mn of=/tmp/trailer skip=2096992b bs=80b count=1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2004 02:39 AM
тАО10-06-2004 02:39 AM
Re: Reading header and trailer records from the tape
Thank you for your reply.
If I use bs and skip options, is it block size or byte ?
I restored first tape to disk.
And I checked restored total file size
using du command.
$du -s
12553744 .
So I think total file size is 12553744 blocks.
Please check below command.(If b means byte, I'll have to change to byte.)
# dd if=/dev/rmt/1m of=/trailer skip=12553744b bs=80b count=1
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-06-2004 04:32 AM
тАО10-06-2004 04:32 AM
Re: Reading header and trailer records from the tape
The way I see it, is you have a true tape? not DAT which is formated for mainframe purpose, if this is so you havent said all...
I believe you have a tape generated with a header 80 char then follows DATA of XXXchar and ends with trailer record of 80char
unless the data records are of 80 characters
the Solution:
you will have to use a no rewind device and use dd 3 times:
rewind the tape:
mt -t /dev/rmt/1mn rew
then load in 3 separate files the content of the tape file:
dd of=/tmp/file.header if=/dev/rmt/1mn ibs=80 obs=80
dd of=/tmp/file.data if=/dev/rmt/1mn ibs= obs=
dd of=/tmp/file.trail if=/dev/rmt/1m ibs=80 obs=80
Notice at the end the difference on tape device so it will rewind at the end...
All the best
Victor