delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/04/16/05:18:38

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 16 Apr 2008 10:16:41 +0100 (WEST)
From: Hugh Sasse <hgs AT dmu DOT ac DOT uk>
To: cygwin AT cygwin DOT com
Subject: Re: file accessibility and copying/archive/...
In-Reply-To: <48057350.D77AC915@dessent.net>
Message-ID: <Pine.GSO.4.64.0804161006320.10102@brains.eng.cse.dmu.ac.uk>
References: <Pine DOT GSO DOT 4 DOT 64 DOT 0804151952460 DOT 5320 AT brains DOT eng DOT cse DOT dmu DOT ac DOT uk> <48057350 DOT D77AC915 AT dessent DOT net>
MIME-Version: 1.0
X-IsSubscribed: yes
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

---559023410-851401618-1208337401=:10102
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 15 Apr 2008, Brian Dessent wrote:

> Hugh Sasse wrote:
>=20
> > Trying to copy a windows XP NTFS drive to a big disk using cygwin tools
> > I encounter inaccessible files such as ntusers.dat.  tar is not
>=20
> ntuser.dat is the filename of the per-user registry hive
> (HKEY_CURRENT_USER).  It is opened by the system in exclusive mode, so
> it cannot be opened.

Yes, that one I understand, the others I don't.
>=20
> > I suspect this is a common problem, but don't know how to frame it
> > correctly to extract something useful from Google.  The setup in
> > question only has the one PC so things like rsync are out.  Windows
>=20
> Note that rsync works just fine as a local copying tool like xcopy.=20
> There's nothing that says you have to use it with a remote machine.  But

Just the "r" :-)  OK, I'll look into that, thank you.

> it will be of no use to you in this case.

Because it won't access things either?  I can live without ntuser.dat
but its knowing what the others are and why they fail that is part of
the problem.
>=20
> > keeps some things in use, but I don't know what.  Can anyone point
> > me at the specific thing I should be reading, or suggest anything?
> > If you mail me off list then, if there is interest I will summarize
> > to the list.  Thank you.
>=20
> You can't open the file because it's been opened with a sharing mode
> that disallows any other process to open it.  The third parameter of
> CreateFile() is dwShareMode and can one or more of FILE_SHARE_DELETE,
> FILE_SHARE_READ, FILE_SHARE_WRITE.  If it is 0 then no sharing is
> allowed, and the file cannot be opened by any other process until the
> handle is closed.

So I'd need to boot off something else to get everything then?
>=20
> This is why backup programs are more than just file copying utilities.=20
> There are a number of files that you can't just copy from a live
> system.  Even if you could forcibly open the file, if you were to
> na=EFvely copy it you might get inconsistent state, since the whole point
> for opening a file exclusively is so that you can have full control over
> it and implement your own form of transactions.

A good case to consider.  So some databases will also fail if they are live.
>=20
> Starting with XP, Microsoft introduced the Volume Shadow Copy service,
> as the other reply in this thread indicated.  This is a vastly
> complicated[1] COM interface that can be used by backup programs to get

See what you mean!=20
> consistent state for all files on a live system.  Certainly no Cygwin
> tool or app uses this API.

Thank you.
>=20
> What I do is simply use the built in Windows backup program (ntbackup)
> to create a backup to a file.  Ntbackup uses all the proper backup APIs
> and can deal with all in-use files correctly, and the resulting output
> is just a plain file that can be copied around with standard tools, or
> split/burned to DVDR, or whatever.

Can it extract individual files from the backup?  I don't want to copy
old Windows System files on to the new machine when it appears.
>=20
> Brian
>=20
> [1] http://msdn2.microsoft.com/en-us/library/aa384589.aspx
>=20


---559023410-851401618-1208337401=:10102
Content-Type: text/plain; charset=us-ascii

--
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/
---559023410-851401618-1208337401=:10102--

- Raw text -


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