delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/01/30/06:43:31

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sun, 30 Jan 2011 12:43:09 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin Support for Shadow Copies Exposed As Drives?
Message-ID: <20110130114309.GA3299@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <03cc01cbc013$9d2a0740$d77e15c0$@vaultnow.com>
MIME-Version: 1.0
In-Reply-To: <03cc01cbc013$9d2a0740$d77e15c0$@vaultnow.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019