Video Screencast Help

How to get the media id by filename

Created: 13 Aug 2012 • Updated: 07 Nov 2012 | 13 comments
This issue has been solved. See solution.

Hi all,

If I achive or backup a file, how to know the ID of the media which storage the file?

In STORNEXT, the command fsfileinfo can do this function. I don't know how to do in NBU.

Comments 13 CommentsJump to latest comment

mph999's picture


 bpimagelist -backupid womble_1344924835 -L

Copy number:       1
 Fragment:         1
 Kilobytes:        110624
 Remainder:        0
 Media Type:       Media Manager (2)
 Density:          4mm (12)
 File Num:         1
 ID:               R0TP01    <<<  Media ID
 Host:             womble
 Block Size:       262144
or ...
 bpimagelist -backupid womble_1344924835
IMAGE womble 0 0 9 womble_1344924835 womble_rob_0 0 *NULL* root full 0 10 1344924835 117 1345011235 0 0 110624 3446 1 1 0 womble_rob_0_1344924835_FULL.f *NULL* *NULL* 0 1 0 0 0 *NULL* 0 0 0 0 0 0 0 *NULL* 0 0 0 *NULL* 318 0 0 425077 0 0 *NULL* *NULL* 0 0 0 0 *NULL* *NULL* 0 12 0 0
HISTO 0 0 0 0 0 0 0 0 0 0
FRAG 1 1 110624 0 2 12 1 R0TP01 womble 262144 2 1344924835 0 0 *NULL* 1345011235 0 65546 0 0 0 1 0 1344924952 1 1 *NULL* *NULL* 0 0
On the lines that start 'FRAG', look at the 10th field from the left
FRAG 1 1 110624 0 2 12 1 R0TP01  <<<<  Media ID
Regards,  Martin
Setting Logs in NetBackup:
revarooo's picture

If you want to know the media id that holds a specific 'file' use the Backup, Archive & Restore section and restore the file, that will tell you which tape it's going to use.

You can then cancel the restore.

chenjrsgs's picture

hi mph999:

    Thank u.

    Now I know I can get media id by backupid.

    But the question is how to get backupid according filename.


mph999's picture


Sorry - I misread your question.

You would have to use cat_convert command on the backup id .f file in the catalog to check it has the file you want, then, get the media id like I showed.

You could do variations like using bplist command, but this wouldn't be too easy. 

I don't know of a way of getting the media id directly APART from the BAR GUI, like ravaroo explained - you select the file in the Back/ Archive/ Restore GUI, start the restore, and see which tape it picks.

Interestingly, I can see your requirement, but that is a question very very few people ask.


Regards,  Martin
Setting Logs in NetBackup:
chenjrsgs's picture

hi revaroo,

           Thank you for your suggestion.

           But I am sure I get what u meant.

           Did you mean that if I want to know the mediaid according by specific filename I should use the Backup, Archive & Restore section?

           What's Backup, Archive & Restore section?



revarooo's picture

Yes it's one way of doing it. Backup Archive & Restore is normally at the top of the GUI which you use for doing GUI manual backups, restores and archives. My suggestion was to start a restore of the 'file' you want to know what tape it's on. Cancel the restore as soon as you see the mount request for the media id (the tape)

Patrick Whelan 2's picture

I know you want the media id for a particular file, but you could try bpimagelist -preview with other paramaters to narrow down the search. This will give you the media ids for the criteria specified.

Patrick Whelan

Senior NetBackup Specialist

mph999's picture

Useful option, didn't remember that.

But, this only gives the media for a given backupid unfortunately, effectivly, the easy way to do what I did above ...


Regards,  Martin
Setting Logs in NetBackup:
chenjrsgs's picture

hi revaroo,

       Thank you for your explain.

        I think this function is a normal function. When the tape is out-line and I want to retrieve the file to the disk, I need know in which tape the file is. Then I find the tape by the media id and put the tape in.


chenjrsgs's picture

Hi Patrick,

        Thank u.

          I will try your advice. But now I meet another problem.

          I restarted the machine but failed.

         It's the first time I reboot this machine. The installation was done by the other people.

           I posted this problem. The site is


Marianne's picture

You don't need to know the tape number in order to do a restore.

Use the BAR section of the GUI, select the Client name that you need a file restore for, along with the policy type that was used for the backup. Expand directory tree until you find the filename that you need to restore.

If you want to be sure that the media is in the robot, you can click on Media Preview button to see all Media id's that were used in the backup set.

See NBU Backup, Archive, and Restore Getting Started Guide  for more info.

PS: Please do not compare NetBackup with StorNext. They are totally different and have nothing in common.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

chenjrsgs's picture

Hi Marianne,

          Thank you for your clear explain.

           I will try your suggestion after I start the machine.


mph999's picture

Thumbs up to Marianne, I'd forgotten about the media preview button ...

Regards,  Martin
Setting Logs in NetBackup: