Forum Discussion

arun660's avatar
arun660
Level 3
10 years ago
Solved

CLI option for "Restore directories without crossing mount points" using bprestore command

Hi Experts,

Would like to know if we have any option for the "Restore directories without crossing mount points" using bprestore command while restoring to a client.
I have tried looking at the man page, but it doesn't say anything about this option.

Is this a limitation when restore is done from command line or something else? 

Regards,
Arun

  • In your second example, how each file system was backed up has a direct effect on how it is restored.

     If the file systems "/data" and "/data/filesystem1" were backed up as a single backup stream and the option to not cross mount points was not specified, then you will need to explicitly exclude the second file system. Any files that you specify must be listed at the end of the command line after all other options. You must use absolute file paths. You can also use the "-f filelist" option to specify the restore files.  The use of the exclamation point at the start of the full path indicates it is to be excluded. If 'do not cross mount points' was specified, then the /data and the /data/filesystem1 file system mount points will each be their own data streams. If not specified, the /data/filesystem1 mount point will get backed up twice, once under /data and the second time as /data/filesystem1.

    By default, the original file paths will be used for the restore. Unless specified otherwise (using the -K option), they will overwrite existing files that match the full path.  To redirect the files to an alternate path, you must specify a rename file and use the "-R rename_file" option. Use the following form for entries in the rename file:

    change backup_filepath to restore_filepath

    The file paths specified must start with / (slash)

    So what does that mean to you? Let's assume that the /data backup files are to be restored under the /filesystem3 mount point. The 'bprestore' CLI invocation would read:

    bprestore -R my_rename_file -f my_filelist

    The contents of my_rename_file would be:

    change /data to /filesystem3/data

    The contents of my_filelist would be:

    /data
    !/data/filesystem1

    You can skip the -f option and use this format:

    bprestore -R my_rename_file /data !/data/filesystem1

    Personally, I would make use of the -R and the -f options which are straight forward and simple.

    All of this can be found in the NetBackup 7.X Commands Reference Guide.

    And imporatant to note,  restoring the root (/) filesystem over itself on a running Unix/Linux server will cause the running client to kernel panic and crash rather swiftly. That's where use of the BMR recovery comes in. Trying to recover root file system files for a system recovery without BMR is covered by a separate document on this site.

     

7 Replies

  • There is no such option.

    If for example /data is a different mountpoint, why would you want to restore to root instead of the mountpoint?

    Maybe tell us the reason for your query?
    What needs to be restored and where do you need to restore it to?

  • Thanks for the reply Marianne

    Well, the requirement is this,

    Let's say I have below filesystems mounted while backup.

    /dev/md/dsk/d10        /
    /dev/md/dsk/d40        /filesystem1
    /dev/md/dsk/d50        /filesystem2

     

    While restore, I am using bprestore from CLI and restoring just "/" onto the below
    /dev/md/dsk/d60        /filesystem3

    Will this restore just "/" root or all the other filesystems/directories under / ?

     

    Regards,
    Arun

  • To restore root filesystem, you should use BMR, not normal filesystem restore.

    If you want to restore from backup, you should do a restore to an alternative disk or just restore selected files and folders.

    You cannot restore / over a running OS.

    There are some recommendations in Disaster Recovery chapter of the Troubleshooting Guide regarding client OS restore.

  • I am sorry, may be I was not clear in explaining the query.

    Suppose if I have a backup of filesystems
    /data/filesystem1
    /data

    How do I do it now to restore just /data?

    Regards,
    Arun

  • When you restore, you can select/unselect directories, so just unselect /data/filesystem1, so that only files and directories in /data are restored, so something like:

    bprestore /data !/data/filesystem1

     

    Mike

  • In your second example, how each file system was backed up has a direct effect on how it is restored.

     If the file systems "/data" and "/data/filesystem1" were backed up as a single backup stream and the option to not cross mount points was not specified, then you will need to explicitly exclude the second file system. Any files that you specify must be listed at the end of the command line after all other options. You must use absolute file paths. You can also use the "-f filelist" option to specify the restore files.  The use of the exclamation point at the start of the full path indicates it is to be excluded. If 'do not cross mount points' was specified, then the /data and the /data/filesystem1 file system mount points will each be their own data streams. If not specified, the /data/filesystem1 mount point will get backed up twice, once under /data and the second time as /data/filesystem1.

    By default, the original file paths will be used for the restore. Unless specified otherwise (using the -K option), they will overwrite existing files that match the full path.  To redirect the files to an alternate path, you must specify a rename file and use the "-R rename_file" option. Use the following form for entries in the rename file:

    change backup_filepath to restore_filepath

    The file paths specified must start with / (slash)

    So what does that mean to you? Let's assume that the /data backup files are to be restored under the /filesystem3 mount point. The 'bprestore' CLI invocation would read:

    bprestore -R my_rename_file -f my_filelist

    The contents of my_rename_file would be:

    change /data to /filesystem3/data

    The contents of my_filelist would be:

    /data
    !/data/filesystem1

    You can skip the -f option and use this format:

    bprestore -R my_rename_file /data !/data/filesystem1

    Personally, I would make use of the -R and the -f options which are straight forward and simple.

    All of this can be found in the NetBackup 7.X Commands Reference Guide.

    And imporatant to note,  restoring the root (/) filesystem over itself on a running Unix/Linux server will cause the running client to kernel panic and crash rather swiftly. That's where use of the BMR recovery comes in. Trying to recover root file system files for a system recovery without BMR is covered by a separate document on this site.

     

  • Hi All,

    Thanks for all the responses in this regard. Jamie, it is an excellent write up, regarding the backups with or without cross mount points and restoring them correctly.

    The second paragraph is the one which sorts it all.

    If I am using "/usr/openv/netbackup/bin/bpbackup -k test /" command it is by default has set "Do not cross mount points" option and it backs up only root without any filesystems under it.

    And When I am restoring using the command "/usr/openv/netbackup/bin/bprestore -k test -R /tmp/ren_file /", it just restores root(/).

    Contents of /tmp/ren_file file
    change / to /test_root

    Yeah ofcourse i was not restoring directly to root (/), was using the rename or change file option to redirect the data to some other directory.

     

    Once again thanks to all.


    Regards,
    Arun