Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.
Backup and Recovery Community Blog

Understanding how NetBackup writes to a tape.

Created: 03 Sep 2009 • Updated: 23 Oct 2009 • 18 comments
J.H Is gone's picture
+20 20 Votes
Login to vote

Understanding how NetBackup writes to tapes and what happens when images expire will help you better manage your tapes.

Tapes are linear - meaning that they write from the front to the back.

if we look at a tape.
BOT|day1image|day2image|blankspace|EOT

now the day1image expires on the tape - the assigned date does not change and you have this.

BOT|expiredimage|day2image|blankspace|EOT

if you try to write to this tape again it will ONLY write in the blankspace as tapes are Linear - meaning they can only append (tapes cannot write here and there like a disk can)

Now day2image expires - the assigned date of the tape goes blank - no assigned date

-------

Now look at it with multiplexing.

you use the tape - it gets an assigned date.

BOT|server1part1|server2part1|server1part2|server2part2|blankspace

if the backup for server1 fails or if the backup image expires then you have this

BOT|expiredimage|server2part1|expiredimage|server2part2|blankspace

remember tape is linear it cannot go back and write in those spaces where the failed image went.

So if a tape is full it cannot be written to again until ALL the images on the tape have expired.

expire the image and expire the tape are two different things.

when NetBackup goes to use a tape and mounts it, it gets assigned -
assigned means that NetBackup took a scratch tape with no assigned date and tried to use the tape today - does not mean that it wrote to it.

Now when NetBackup writes to the tape it gets an images ( this does not change the assigned date).

if the backup is good then the tape has an assigned date, and has a good images.

now say you use the SAME tape tomorrow - the assigned date does NOT change - but the tape does get a new image.  So now you have this (no multiplexing)

BOT|day1image|day2image|blankspace|EOT

now the day1image expires on the tape - the assigned date does not change and you have this.

BOT|expiredimage|day2image|blankspace|EOT

if you try to write to this tape again it will ONLY write in the blankspace as tapes are Linear - meaning they can only append (tapes cannot write here and there like a disk can)

Now day2image expires - the assigned date of the tape goes blank - no assigned date

-------

Now look at it with multiplexing.

you use the tape - it gets an assigned date.

BOT|server1part1|server2part1|server1part2|server2part2|blankspace

if the backup for server1 fails or if the backup image expires then you have this

BOT|expiredimage|server2part1|expiredimage|server2part2|blankspace

remember tape is linear it cannot go back and write in those spaces where the failed image went.

so you do lose space on a tape when a backup fails or expires.

a tape will stay assigned until all images on the tape have expired.
so if you want the tape to be unassigned, you need to expire all the images on it.

Now expiring a tape has to do with the Physical tape.
Not everybody puts an expiration date on a tape.
If you only want to use a tape for 3 years then you can put a date on the tape that sets it for 3 years.  After that date NetBackup will not longer use the tape to do backups on, but the tape can still be used for restores.
To see this you would right click on the media in the console.
that stuff at the top has to do with the expiration of the physical tape, people new to NetBackup quite often get this confused with expiring all the images on the tape.

Understanding how NetBackup writes to tapes and what happens when images expire will help you better manage your tapes.

Comments 18 CommentsJump to latest comment

Android's picture

This will go a long way toward helping people understand tape concepts. 

+1
Login to vote
Karthikeyan Sundaram's picture

Great Information !!! Thanks Hinch

Thanks, Karthikeyan Sundaram.

0
Login to vote
Will Restore's picture

yes

Will Restore -- where there is a Will there is a way

0
Login to vote
@Vimal's picture

Nice document

0
Login to vote
Vishal Sri's picture

Well explained.... But would like to know why multiple retention level backups are not allowed on tape.  As a tape may never expire if being used after very long time gaps with longer retention? OR rather how does it help to have similar retention backup on the same tape?

+1
Login to vote
Andy Welburn's picture

From the Admin Guide:

"...
By default, NetBackup stores each backup on a tape volume that contains existing backups at the same retention level.
...
To mix retention levels on volumes, select Allow multiple retentions per media on the Media host properties.

..."

So, NetBackup will only re-use a FULL tape once all the images on it have expired. It won't "fill in the gaps" created when images expire as it were.

As you've already intimated, if you can imagine a FULL tape with 800Gb of data on it where 799Gb of data is due to expire in a days time & 1Gb of data has an infinite retention then the tape will never be re-used (well not until sometime during 2038 that is!)

Advantage of allowing multiple retentions on media? Are there any? Would allow for less tapes to be utilsed initially but wasteful in the long run.

+6
Login to vote
J.H Is gone's picture

Andy makes some good points below.

In my description above you see that when an image expires it does not mean you can now write to that part of the tape - but only append.

So if you have an image with 2 week retention and image with 2 month retention mixed on the same tape and the tape is full with the 2 month at the end of the tape, the tape will not be used again for 2 months when all the images have expired.

but  if you put all your 2 week images on one tape and your 2 month images on a different tape, then you can reuse that 2 week tape sooner.

You can see where if were using 6 tapes and all 6 had mixed retentions then all 6 would be hung up for 2 months.  but if you segregate the retentions, only 3 tapes would be hung up for 2 months and the other 3 would be avail over and over again in that 2 month time Span.

I don't have to know how to spell....I work on Unix.
NetBackup 7.0.1 - AIX & Windows

+3
Login to vote
MOudt's picture

NB 7.01, VTL tapes

We have a tape, allocated on the 23st, last written to on the 23st, (5 hours later), containing 2 images according to NB Tape List Report, it has 78 kiloBytes writen on it, and NB is reporting the tape to be Full!

Since the allocation date is 23st, assigned to the tape when it was taken from the scratch pool, and this date is not changed when data is added or when previous images expire, i wonder why NB is reporting this tape as FULL?

If the tape had been written to before the 23st, say the 9th, and those images were expired, then the allocation date would have been set to the 9th, am i correct?

I have a couple more tapes, reporting to be FULL, whithin the 2 weeks time period after the allocation date,  and i really like to know why this happens. The opening post explains very well how NB handles tapes, but i cannot fit our Full tapes issue in it.

anyone can shed a light on this?

-2
Login to vote
J.H Is gone's picture

the tape was NOT in the scratch pool and completed expired when picked up on the 23ed lets say at 8 pm.

that means the backups for the 23 are APPENDING to the tape.

now at 10 pm on the 23ed the 9th images expire - so now the tape was filled up  with the 23ed backups, but when you look on the 24th it only has a little data on because it was appending.

I would have to first verify that the tape was really completely expired and in the scratch pool before the backups on the 23ed started.

I don't have to know how to spell....I work on Unix.
NetBackup 7.0.1 - AIX & Windows

-4
Login to vote
Tom VK's picture

Very usefull document.

-2
Login to vote
Yogesh9881's picture

This is what myself & my customer was looking for yes

If this post has helped you, please vote or mark as solution.

Before break-up, make sure you have a good backup.....  ;-)

-1
Login to vote
Bharath Achar's picture

Awesome explaination!!!!!!!

Similar can you please explain how Netbackup writes to Puredisk in detail???????

Regards,

Bharath

-1
Login to vote
J.H Is gone's picture

sorry don't know Puredisk

I don't have to know how to spell....I work on Unix.
NetBackup 7.0.1 - AIX & Windows

+1
Login to vote
ontherocks's picture

Good Information yessmiley

OTR

-1
Login to vote
azmie_ramly's picture

So if a backup have already started to write to the 2nd tape and it turned out that there's no tape avaliable and ended with error 96, what will happen to the 1st tape? Take note that it is not in suspended mode and it exited with error 96.

0
Login to vote
Yakub's picture

mail Useful info.

0
Login to vote