This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: special name for vss shadow copy device?


On Feb 26 10:10, Corinna Vinschen wrote:
> On Feb 25 19:20, Greg Freemyer wrote:
> > On Wed, Feb 25, 2009 at 6:01 PM, Larry Hall (Cygwin)
> > <reply-to-list-only-lh@cygwin.com> wrote:
> > > Greg Freemyer wrote:
> > > <snip>
> > >
> > >> Time to experiment with Cygwin 1.7
> > >>
> > >> I know the whole package is still considered test. ?How stable is the
> > >> actual dll(s). ?Especially as relates to this type of functionality.
> 
> The DLL is quite stable but there are certainly some bugs as well.
> 
> > I tried the "dosdev" trick from one of the links to mount the snapshot
> > as V:.  Apparently that is a XP only trick.  Or at least Vista does
> > not have it.

Here's how it does NOT work:

  $ dosdev 'V:' '\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy21'
  $ mount
  [...]
  C: on /cygdrive/c type ntfs ...
  $

  The reason is that the path the drive points to has to be a native NT
  path.  The path containg the GLOBALROOT is a long Win32 path name which
  is invalid in this case.  However, the dosdev functionality is nothing
  but creating a symbolic link in the native NT namespace and the target
  of such a symlink can be anything which can be expressed in a 64K buffer.

Here is how it works:

  $ dosdev 'V:' '\Device\HarddiskVolumeShadowCopy21'
  $ mount
  [...]
  C: on /cygdrive/c type ntfs ...
  V: on /cygdrive/v type ntfs ...

  What you have to do is to create a native NT symlink which points
  to the actual native NT device name which is as shown above, just
  \Device\HarddiskVolumeShadowCopy21.

  That works like a champ on Cygwin and in Windows Explorer on Vista.

Btw., I'm using my own crude dosdev:

======================================================================
#include <stdio.h>
#include <windows.h>

int
main (int argc, char **argv)
{
  DWORD flags = 0;

  if (argc < 2)
    {
      fprintf (stderr, "usage: %s DosDevice [NTDevice]\n", argv[0]);
      return 1;
    }
  if (argc == 2)
    flags = DDD_REMOVE_DEFINITION;
  else
    flags = DDD_RAW_TARGET_PATH;
  if (!DefineDosDevice (flags, argv[1], argc == 2 ? NULL : argv[2]))
    {
      fprintf (stderr, "Error %d\n", GetLastError ());
      return 1;
    }
  return 0;
}
======================================================================

$ gcc -o mydosdev mydosdev.c
$ # Create the dos link
$ ./mydosdev 'V:' '\Device\HarddiskVolumeShadowCopy21'
$ # Remove it
$ ./mydosdev 'V:'                                       


HTH,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]