1834047 Members
2281 Online
110063 Solutions
New Discussion

tape size

 
amit singh_3
Advisor

tape size

If I am taking the backup on a tape device.
how to check the size of the tape.
means how many space is available on the
tape.


Amit Singh
9 REPLIES 9
Roberto Polli
Trusted Contributor

Re: tape size

Here is a hint, using awk: to check an indicator if a tar-file size you can do the following

tar tvf tarfile.tar|awk '{n+=$3; print n}'

the last line indicates the sum of the sizes of all files in the tar files.

You may need to adapt this to your dat /tar type. Then you should make the difference from your dat size and the command output.


Peace, R.

H.Merijn Brand (procura
Honored Contributor

Re: tape size

Roberto, he asked the free size available on the tape, not the size of the data to put on the tape.

# dd if=/dev/zero of=/dev/rmt/0m bs=10240

will report the number of 10k blocks that could be written on the tape

there is - as far as I know of - no C API or control command to return the free space left on tape from the current point on (as is available on VCR's)

Then there is another issue of how well the tape is able to compress the data if it is enabled, so predictions can't be made at all

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Roberto Polli
Trusted Contributor

Re: tape size

Well, I understood the answer. I thought that subtracting the size of the files from the one of the tape could work. I didn't think to compression and so on.
I'm not very familiar with tapes: I use it only for trivial bkups, so get one question for you:
how can you be sure that dd won't overwrite datas on dat?

Peace, R.

PS.Your command is very nice! I'll never thought of such a thing!
H.Merijn Brand (procura
Honored Contributor

Re: tape size

It DOES overwrite all data on tape :)
You are gonna write on it anyway, so who cares

Enjoy, Have FUN! H.Merijn [ who never beleives the sizes writen on the tape boxes ]
Enjoy, Have FUN! H.Merijn
Roberto Polli
Trusted Contributor

Re: tape size

Maybe I'm wrong, but can't I update contents of a tape using (eg adding a file to a tape archive) using
# tar uf /dev/tape file.ext
?

Thanks for the info,

Peace, Rob.
H.Merijn Brand (procura
Honored Contributor

Re: tape size

tar's 'u' option is very unlikely to work as expected on a tape, since it is a streaming device, and if the updated files would have a different size, well, just use your imagination :)

# tar cvf /dev/rmt/0m file ...

will put files on tape using tar. one after the other, streaming. a tape is a start-stop streaming device. you cannot delete a file or insert a file

it will only use as much tape as needed to store the data. if you have more data than the tape can store, you get end-of-tape or end-of-media error, and tar asks for a next tape (which might or might not work on restore). Just be sure the data will fit on one tape, which is what the original poster is trying to find out - I guess.

Imagine an audio tape, on which you recorded your favourite record. After a while you decide that you don't like song #3. You cannot push skip as on a CD player, but you could push fast-forward - while listening to the song played in fast mode - until you hear that the bad song is over, and can listen to song #4. You cannot delete song #3, nor can you insert song #3a

When the CD is longer than would fit on the tape, you have to continue on the back, but the last song on side A is kinda broken

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Roberto Polli
Trusted Contributor

Re: tape size

Thank you! I didn't know all this stuff!

Peace, R.
Peter Nikitka
Honored Contributor

Re: tape size

Hi Amit,

do you know how to add points to the answers of your questions?
Look here:

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Maatz
New Member

Re: tape size

Hi Amit,

you can get information about the capacity of a tape by using the command "ddsinfo". To use this command it is necessary to have a DDS-Drive.
This command shows informations about the current drive, tape capacity and values in the drive compression logs. It is also possible to clear the drive compression logs. With this little tool you have always informations about the usage of your tape. But as the others always mentioned the capacity varies with the compression ratio!

This tool is available from http://gatekeep.cs.utah.edu/hppd/cgi-bin/search

Sincerely,
Andreas