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: Cygwin Support for Shadow Copies Exposed As Drives?


On Jan 29 17:21, Leon Vanderploeg wrote:
> References: <002b01cbac64$54079040$fc16b0c0$@vaultnow.com>

With the upcoming 1.7.8 (and recent snapshots, see
http://cygwin.com/snapshots/) you can access volume shadow copies very
easily:

As administrator, elevated on Vista and later:

  $ cd /proc/sys/Devices
  $ ls -l Harddisk*
  drwxrwx--- 1 Administrators SYSTEM      0 Jan 30 12:27 Harddisk0
  brwxrwx--x 1 Administrators SYSTEM 0, 242 Jan 30 12:27 HarddiskVolume1
  brwxrwx--x 1 Administrators SYSTEM 0, 242 Jan 30 12:27 HarddiskVolume2
  brwxrwx--x 1 Administrators SYSTEM 0, 242 Jan 30 12:27 HarddiskVolume3
  brwxrwx--x 1 Administrators SYSTEM 0, 242 Jan 30 12:27 HarddiskVolumeShadowCopy3
  lr--r--r-- 1 Administrators SYSTEM      0 Jan 30 12:27 HarddiskVolumeShadowCopy{6faf6d91-2259-11e0-9403-000c295ff74f} -> /proc/sys/Device/HarddiskVolumeShadowCopy3
  $ cd HarddiskVolumeShadowCopy3
  HarddiskVolumeShadowCopy3: Not a directory
  $ cd HarddiskVolumeShadowCopy3/
  $ pwd
  /proc/sys/Devices/HarddiskVolumeShadowCopy3
  $ ls -1
  $Recycle.Bin
  Documents and Settings
  PerfLogs
  Program Files
  ProgramData
  Recovery
  System Volume Information
  Users
  Windows
  autoexec.bat
  config.sys
  cygwin
  hiberfil.sys
  pagefile.sys
  $

Note that you have to use a trailing slash to cd into the root directory
of the drive.  The reason is that the name "HarddiskVolumeShadowCopy3"
refers to the block device in the first place.  Only by attaching the
trailing slash the system (Windows, not Cygwin!) realizes that you
want to access the drive's root dir.  This is not necessary to access
other directories on the drive:

  $ cd /proc/sys/Devices/HarddiskVolumeShadowCopy3/cygwin
  $ ls -1
  Cygwin.bat
  Cygwin.ico
  Cygwin.tcsh.bat
  bin
  cygdrive
  dev
  etc
  home
  lib
  sbin
  tmp
  usr
  var

Due to the layout of the native NT namespace and the extra DOS device
path handling there are a couple of other ways to access the shadow
copies, for instance:

  $ cd /proc/sys/GLOBAL\?\?/HarddiskVolumeShadowCopy3/
  $ cd /proc/sys/\?\?/global/HarddiskVolumeShadowCopy3/
  $ cd //./HarddiskVolumeShadowCopy3/
  $ cd //?/HarddiskVolumeShadowCopy3/
  $ cd //./GLOBALROOT/Devices/HarddiskVolumeShadowCopy3/

but personally I prefer the access via /proc/sys/Devices.  It's the 
cleanest and easiest one, IMHO.


Corinna

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

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


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