HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- getting data off tape #2
Operating System - Linux
1830232
Members
1911
Online
109999
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-03-2003 08:41 AM
10-03-2003 08:41 AM
getting data off tape #2
Everybody seems to think that doing the tar cv filename wouldn't corrupt the data on the backup tape. I think it corrupted the header data so that I can't use tar xv or dd to get the data off the tape.
I believe all I did to create the tape was
tar cv
and that loaded the tar files onto the tape in alphabetical order. To get them off when I was verifying that they got written to tape, I did
tar xv IGS00.tar IGS01.tar IGS02.tar IGS97.tar IGS98.tar IGS99.tar
I did this to get the correct filenames because just doing a tar xv didn't give me the right filenames.
Yesterday, when I wanted to download these files, I did
tar cv IGS00.tar IGS01.tar IGS02.tar IGS97.tar IGS98.tar IGS99.tar
When I realized my mistake (c instead of v), I control c'd the operation. Now there seems to be nothing retrievable from this tape, not even the null tar files that could have been created. That's what tar does when a file it's trying to tar doesn't exist, it creates a null (1k byte) tar file. I tested this already.
The actual files were probably not overwritten, but the header info is probably lost.
Any ideas for getting the data off the tape?
thanx,
keith
I believe all I did to create the tape was
tar cv
and that loaded the tar files onto the tape in alphabetical order. To get them off when I was verifying that they got written to tape, I did
tar xv IGS00.tar IGS01.tar IGS02.tar IGS97.tar IGS98.tar IGS99.tar
I did this to get the correct filenames because just doing a tar xv didn't give me the right filenames.
Yesterday, when I wanted to download these files, I did
tar cv IGS00.tar IGS01.tar IGS02.tar IGS97.tar IGS98.tar IGS99.tar
When I realized my mistake (c instead of v), I control c'd the operation. Now there seems to be nothing retrievable from this tape, not even the null tar files that could have been created. That's what tar does when a file it's trying to tar doesn't exist, it creates a null (1k byte) tar file. I tested this already.
The actual files were probably not overwritten, but the header info is probably lost.
Any ideas for getting the data off the tape?
thanx,
keith
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2003 09:29 PM
10-03-2003 09:29 PM
Re: getting data off tape #2
Hi Keith,
Of course tar cv may damage the beginning of the tape, even if interrupted after few seconds. Tar is a sequential command, so it starts immediately because no data re-organization is done at the beginning.
To retrieve some of your data files, you may try to skip end of tape marks using the "mt" command with NOREWIND device file (/dev/nst0).
For example :
tar tvf /dev/nst0
mt -f /dev/nst0 fsf 1
tar tvf /dev/nst0
...
Even if getting errors, you may try again until end of tape. May be you will get some files.
If it doesn't work with "fsf", try "fsr" (read the manpage of mt for further explanations).
And don't forget to use the NO REWIND device file (/dev/nst0), otherwise your tape may be rewinded at the end of each command, and for sure you would retrieve nothing.
Good luck.
Kodjo
Of course tar cv may damage the beginning of the tape, even if interrupted after few seconds. Tar is a sequential command, so it starts immediately because no data re-organization is done at the beginning.
To retrieve some of your data files, you may try to skip end of tape marks using the "mt" command with NOREWIND device file (/dev/nst0).
For example :
tar tvf /dev/nst0
mt -f /dev/nst0 fsf 1
tar tvf /dev/nst0
...
Even if getting errors, you may try again until end of tape. May be you will get some files.
If it doesn't work with "fsf", try "fsr" (read the manpage of mt for further explanations).
And don't forget to use the NO REWIND device file (/dev/nst0), otherwise your tape may be rewinded at the end of each command, and for sure you would retrieve nothing.
Good luck.
Kodjo
Learn and explain...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2003 01:20 AM
10-04-2003 01:20 AM
Re: getting data off tape #2
if you run tar cv filename "tar would by default run on default tape (you could also have a variable TAPE to point to ex : /dev/st6"
so if there is default and this point to a reel tape in wich you have a tape where there are some tar file of a previous tar cv command then you will overwrite your previous tar create.
Fist make sure your tape is write protected !
To check just do the following as root
#mt status
if the above return status of tape not errors then you have the default "tape" and it point to your real physical tape... I hope I havent confuse you !"
now this default is usualy "on most Linux distribution I have seen "/dev/tape"
so do an ls -l /dev/tape
This in turn could be a soft link to some think like "/dev/st0, /dev/nst0, /dev/nst6"
now let us say for example sake that /dev/tape is a soft link to /dev/st0
then to try and retrive some of your tar files on tape you could do the following
#mt rewind
just to be sure ! (in fact should not be needed as your dev /dev/st0 will alway's rewind)
#tar -tvf /dev/nst0
to test from start of tape and to see if there is a valid tar (let this run it may take a while) notice I here force the use of norewind by using /dev/nst0.
this in your case will probably return a tar error message.
do again
#tar -tvf /dev/nst0
as the tape has not been rewinded this will try to see if there is something futher on the tape ...
Repeat the tar -tvf /dev/nst0 as many time as you think there could be a tar file on your original tape !
now if all the above does not able to help you could try and figure out what is on your tape with something like
#mt -f /dev/st0 rewind
#cat /dev/st0 > tempo.test
interrupt this after a few seconds with ^C then do the following.
#strings tempo.test | less
and see if you can figure it out you will typicaly see some funny strings but some may make sense "like text files that where on your tar backup" (if it's all binarys then not very usefull)
The above is very crude it is just a check !
if you found some of your data on above then you coul try out
#mt -f /dev/st0 rewind
#dd if=/dev/nst0 of=tempo1.extract
#dd if=/dev/nst0 of=tempo2.extract
#dd if=/dev/nst0 of=tempo3.extract
Sorry if for this lengty reply I hope this can be of some help ?
J-P
so if there is default and this point to a reel tape in wich you have a tape where there are some tar file of a previous tar cv command then you will overwrite your previous tar create.
Fist make sure your tape is write protected !
To check just do the following as root
#mt status
if the above return status of tape not errors then you have the default "tape" and it point to your real physical tape... I hope I havent confuse you !"
now this default is usualy "on most Linux distribution I have seen "/dev/tape"
so do an ls -l /dev/tape
This in turn could be a soft link to some think like "/dev/st0, /dev/nst0, /dev/nst6"
now let us say for example sake that /dev/tape is a soft link to /dev/st0
then to try and retrive some of your tar files on tape you could do the following
#mt rewind
just to be sure ! (in fact should not be needed as your dev /dev/st0 will alway's rewind)
#tar -tvf /dev/nst0
to test from start of tape and to see if there is a valid tar (let this run it may take a while) notice I here force the use of norewind by using /dev/nst0.
this in your case will probably return a tar error message.
do again
#tar -tvf /dev/nst0
as the tape has not been rewinded this will try to see if there is something futher on the tape ...
Repeat the tar -tvf /dev/nst0 as many time as you think there could be a tar file on your original tape !
now if all the above does not able to help you could try and figure out what is on your tape with something like
#mt -f /dev/st0 rewind
#cat /dev/st0 > tempo.test
interrupt this after a few seconds with ^C then do the following.
#strings tempo.test | less
and see if you can figure it out you will typicaly see some funny strings but some may make sense "like text files that where on your tar backup" (if it's all binarys then not very usefull)
The above is very crude it is just a check !
if you found some of your data on above then you coul try out
#mt -f /dev/st0 rewind
#dd if=/dev/nst0 of=tempo1.extract
#dd if=/dev/nst0 of=tempo2.extract
#dd if=/dev/nst0 of=tempo3.extract
Sorry if for this lengty reply I hope this can be of some help ?
J-P
Smile I will feel the difference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2003 09:21 AM
10-04-2003 09:21 AM
Re: getting data off tape #2
have done it again I cut and paste the wrong end of file to my previous reply
-----------------------------------
if you found some of your data on above then you could try out
#mt -f /dev/st0 rewind
#dd if=/dev/nst0 of=tempo1.extract
!at return of prompt invoke again
#dd if=/dev/nst0 of=tempo2.extract
!at return of prompt invoke again
#dd if=/dev/nst0 of=tempo3.extract
!at return of prompt invoke again
after that you could tailor from tempo?.extract using emacs or vi the file the part of the data you need
this could be very tedious, long and in most case you will lose file/ownership protecting
and probably only be able to retrieve text file or ASCII data, binaries is event more
difficult.
never try this so just suggestions here, perhaps some one will have a better suggestion ?
Sorry if for this lengthy reply I hope this can be of some help ?
J-P
---------------
if you found some of your data on above then you could try out
#mt -f /dev/st0 rewind
#dd if=/dev/nst0 of=tempo1.extract
!at return of prompt invoke again
#dd if=/dev/nst0 of=tempo2.extract
!at return of prompt invoke again
#dd if=/dev/nst0 of=tempo3.extract
!at return of prompt invoke again
after that you could tailor from tempo?.extract using emacs or vi the file the part of the data you need
this could be very tedious, long and in most case you will lose file/ownership protecting
and probably only be able to retrieve text file or ASCII data, binaries is event more
difficult.
never try this so just suggestions here, perhaps some one will have a better suggestion ?
Sorry if for this lengthy reply I hope this can be of some help ?
J-P
Smile I will feel the difference
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP