cancel
Showing results for 
Search instead for 
Did you mean: 

Expire images from tape of a policy (retention infinity)

yadda123
Level 4

I need to free up some tapes, but on these tapes I have images from a policy with a retention of infinity. There may also be some other images from _other_ policies on the tapes which I do not want to remove. I haven't removed/expired any images before on this setup, so I am here asking for guidance so I dont do something wrong. 

 

Example:

 

Policy "BACKUP1" is a backup that spans 15 tapes, and has a retention of infinity. How would I go about deleting all images of BACKUP1 so I can free up the space on those tapes that I can then run backup for a new policy? Is there a simple command to run to expire the image(s) associated with that policy? Or would I need to run a command against each tape ID? I am using NB6.5(linux). Command line is preferred(the GUI is slow for me; both either way will work for me). Remember, I want to remove all backups from one policy and reuse that space freed on the tapes for a new policy.

 

ALso, would I need to have the tape media in my library when I expire the images? Or may I expire the images beforehand, and then add the tapes in at a later time?

1 ACCEPTED SOLUTION

Accepted Solutions

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi,

 

No, the tapes do not need to be in the library.

 

So, if you want to expire the image that spans 15 tapes, you can use bpexpdate -backupid "image name" -d 0. If there are indeed no other images on the tape you'll see that the 15 media id's dissappear from the output of bpimagelist. This means that they're available for new backups.

 

Should you perform this command and you still see the media in the list, then you know there are other images on the tape.

 

Please take care when expiring images with bpexpdate, if you make a mistake its a time consuming exercise to re-import them.

 

Hope that helps.

 

R

View solution in original post

11 REPLIES 11

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi,

 

You could potentially "expire" only the images of one "policy", which is actually a backup image. The poroblem is this expiry is only going to expire (remove) the images from your catalog. NetBackup is not going to use that tape again unless all the images have expired, or if there is space at the end of the tape (and you're performing a backup of the same retention, or if you are mixing retention on the tape).

 

Think about it this way, say you write 5x blocks to a tape, then 4x, then 6x. So now you want to expire the images that is 4x. NetBacup will not use the tape because it now has to find an images that will fit in the 4x gap you created before the 6x image. Thats just too complicated.

 

You should expire all the images or none of them. Alternatively if you really want to complicate it, you can expire the ones you don't need, them duplicate the ones you want to keep to new media, and then expire the old media completely. Which would then give you free tapes (but you would have used more tapes for the duplication).

 

R

Deepak_G
Level 6
Certified

use bpexpdate command to expire the images. You can expire the only the images or all the images on a tapes.

bpexpdate -backupid client_XXXXXXXXX -d 0

bpexpdate -m MEDIA_ID -d 0

yadda123
Level 4

Thanks for the responses(and quickly, too!). All of my policies have a retention of infinity(these are one time backups, and the source filesystems are readonly). So, in my example, one policy spans about 15 tapes, and there is only a slight chance that there may be an image from another policy on those tapes in question. So, if only one of those tapes has an image from a policy I want to remove, would the other 14 be immediately available to be written to?

 

Also, if I use bpexpdate, would I need to have the tapes in question in my library?

Marianne
Level 6
Partner    VIP    Accredited Certified

You can only write to tapes again if ALL images on these tapes have expired. If you just expire certain images, the space can not be re-used.

This blog explains it nicely:

https://www-secure.symantec.com/connect/blogs/understanding-how-netbackup-writes-tape

yadda123
Level 4

So, I have media IDs 000400-000414. They only contain images of the policy I want to remove. So I can just do a:

 

bpexpdate -m 000400 -d 0

bpexpdate -m 000401 -d 0

 

etc..correct? Do I need to have these tapes in the library when I perform the bpexpdate? Or can I run the bpexpdate now, and then when I add the tapes back into the library netbackup in the next few days, netbackup will apply the changes?

yadda123
Level 4

 

So, I have media IDs 000400-000414. They only contain images of the policy I want to remove. So I can just do a:

 

bpexpdate -m 000400 -d 0

bpexpdate -m 000401 -d 0

 

etc..correct? Do I need to have these tapes in the library when I perform the bpexpdate? Or can I run the bpexpdate now, and then when I add the tapes back into the library netbackup in the next few days, netbackup will apply the changes?

Deepak_G
Level 6
Certified

You dont have to need them in library. when you expire a tape it just means that you are updating the Database and whenever the tape is inserted immediately it is recognised as scratch tape after the inventory.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi,

 

No, the tapes do not need to be in the library.

 

So, if you want to expire the image that spans 15 tapes, you can use bpexpdate -backupid "image name" -d 0. If there are indeed no other images on the tape you'll see that the 15 media id's dissappear from the output of bpimagelist. This means that they're available for new backups.

 

Should you perform this command and you still see the media in the list, then you know there are other images on the tape.

 

Please take care when expiring images with bpexpdate, if you make a mistake its a time consuming exercise to re-import them.

 

Hope that helps.

 

R

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Dont use bpexpdate -m, it will expire all the images on the tape, use -backupid. Unless you're sure that the tapes only contain the images of the backup image you want to expire.

 

Refer to my post above.

yadda123
Level 4

You have all been a great help. I am expiring my images of the policy from the gui(catalog -> search via policy name, and expiring), and then will see what, if anything, still resides on the tapes and I will handle from there. Thank you all.

Sriram
Level 6

I agree what Marianne said, you cannot use reuse the tape until all the images on it is expired.

So your entire concept to free-up the tape does not work.

 

But if you still want to expire some selective images of a particular policy, it can be very well done through command line using a simple shell script. It will save you lots of time than doing it through GUI

 

Let me know if you are interested.