Operating System - OpenVMS
1752772 Members
4812 Online
108789 Solutions
New Discussion

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

 
SOLVED
Go to solution
Volker Halle
Honored Contributor
Solution

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

Ruslan,

what you need to do with the data from your .VDISK is: write a program to READ from that (foreign-mounted) disk (block by block or better 63. blocks at a time) and write the output buffers to a NEW FILE on another mounted disk (use the same file/record attributes as the original image-backup saveset, i.e. fixed-length 32256 byte records). Then you have a valid BACKUP saveset, from which you can restore the original disk.

Volker.

Ruslan R. Laishev
Super Advisor

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

It's what I doing right now ... :-) 

Thanks!

 

H.Becker
Honored Contributor

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

There is already such a tool, it is called COPY. As shown, it prints some messages but does the job. And yes, you can create the new file with the expected record attributes, but BACKUP has a /REPAIR qualifier, which will change/adjust the attributes as necessary.

Don't ask me, why BACKUP can't read raw save set data. It seems it was always the case. It seems it expects a file. Same for writing a save set. Did you ever try to use the PIPE command and write a backup save set into a pipe to use a ZIP utility to compress from the pipe? It doesn't work because BACKUP expects a file, here an RFA to position in the output file - the save set.

Ruslan R. Laishev
Super Advisor

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

Hi !

Just to keep ya is informed, follows piece of code (stolen from Hoff' text stuff, and reformated) work nice for me.

I discovered a yet another problem with my backup save sets, they has been "broken" in the middle of save set file - but it's a yet another story. I have tried to undesrstand how to recovery ... Will take a know.

 

 

 

 

 

 

 

 

 

 

 

 

 

#include        <starlet.h>
#include        <descrip.h>
#include        <rms.h>
#include        <lib$routines.h>


$DESCRIPTOR     (srcdev_dsc,    "_DKA200:");
$DESCRIPTOR     (dstfile_dsc,   "ZZ.BCK");


notlib_copy(struct dsc$descriptor *inp_file, struct dsc$descriptor *out_file)
{
struct FAB inp_fab, out_fab;
struct RAB inp_rab, out_rab;

char buffer[32256];
long stat;

        inp_fab = cc$rms_fab;
        inp_fab.fab$b_fac = FAB$M_BIO | FAB$M_GET;
        inp_fab.fab$l_fna = inp_file->dsc$a_pointer;
        inp_fab.fab$b_fns = inp_file->dsc$w_length;
        inp_fab.fab$l_fop = FAB$M_SQO;
        inp_fab.fab$b_shr = FAB$M_SHRPUT | FAB$M_UPI;

        if ( !(1 & (stat = sys$open(&inp_fab))) )
                lib$signal(stat, inp_fab.fab$l_stv);

        inp_rab = cc$rms_rab;
        inp_rab.rab$l_fab = &inp_fab;
        inp_rab.rab$l_rop = RAB$M_BIO;

        if ( !(1 & (stat = sys$connect(&inp_rab))) )
                lib$signal(stat, inp_rab.rab$l_stv);


        out_fab = cc$rms_fab;
        out_fab.fab$b_fac = FAB$M_BIO | FAB$M_PUT;
        out_fab.fab$l_fna = out_file->dsc$a_pointer;
        out_fab.fab$b_fns = out_file->dsc$w_length;
        out_fab.fab$w_ifi = 0;
        out_fab.fab$b_shr = FAB$M_SHRPUT | FAB$M_UPI;

        if( !(1 & (stat = sys$create(&out_fab))) )
                lib$signal(stat, out_fab.fab$l_stv);


        out_rab = inp_rab;
        out_rab.rab$l_fab = &out_fab;
        out_rab.rab$w_isi = 0;

        if ( !(1 & (stat = sys$connect(&out_rab))) )
                lib$signal(stat, out_rab.rab$l_stv);


        inp_rab.rab$l_ubf = out_rab.rab$l_rbf = buffer;
        inp_rab.rab$w_usz = sizeof(buffer);

        while (1)
                {
                if( !(1 & (stat = sys$read(&inp_rab))) && (stat != RMS$_EOF) )
                        {
                        lib$signal(stat, inp_rab.rab$l_stv);
                        break;
                        }
                else if (stat == RMS$_EOF )
                        {
                        stat = RMS$_NORMAL;
                        break;
                        }
                else    {
                        out_rab.rab$w_rsz = inp_rab.rab$w_rsz;

                        if ( !(1 & (stat = sys$write(&out_rab))) )
                                {
                                lib$signal(stat, out_rab.rab$l_stv);
                                break;
                                }
                        }
                }

        sys$close(&inp_fab);
        sys$close(&out_fab);

        return stat;
}


int     main    (int argc, char argv[])
{
        return  notlib_copy(&srcdev_dsc, &dstfile_dsc);
}
$

 

Ruslan R. Laishev
Super Advisor

Re: AlphaVM, Backup's saveset maped to a disk device ... How to ?!

Hi !

In order to keep informed ...

I have resolved a problem with restoring from damaged BACKUP save sets.  May be someone will found it's useful:

 

http://185.74.221.217:8080/~laishev/WORK/UNBACKUP/*.*

http://185.74.221.217:8080/~laishev/WORK/UNBACKUP/*unba*.*

http://185.74.221.217:8080/~laishev/WORK/UNBACKUP/UNBACKUP.C - main module.