public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Broken symlinks after rsync
@ 2012-03-18 20:41 Leo Alekseyev
  2012-03-19  9:21 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Alekseyev @ 2012-03-18 20:41 UTC (permalink / raw)
  To: cygwin

I recently tried to transfer the cygwin directory from one machine to
another by rsyncing the source to an external drive, and rsyncing
again from external drive to the destination.  As a result, all my
symlinks got corrupted -- they are now Unicode files with the path
text.  In particular, if I examine the contents of a valid and an
invalid symlink files in Emacs, they appeare identical
(!<symlink>\377\376 followed by the unicode path string). However, one
works with cygwin on the new machine, and the other doesn't.

Both machines are running Cygwin 1.7.

Any thoughts on whether this can be fixed without a complete reinstall
/ recreation of every link?

--Leo

--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Broken symlinks after rsync
  2012-03-18 20:41 Broken symlinks after rsync Leo Alekseyev
@ 2012-03-19  9:21 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2012-03-19  9:21 UTC (permalink / raw)
  To: cygwin

On Mar 18 16:40, Leo Alekseyev wrote:
> I recently tried to transfer the cygwin directory from one machine to
> another by rsyncing the source to an external drive, and rsyncing
> again from external drive to the destination.  As a result, all my
> symlinks got corrupted -- they are now Unicode files with the path
> text.  In particular, if I examine the contents of a valid and an
> invalid symlink files in Emacs, they appeare identical
> (!<symlink>\377\376 followed by the unicode path string). However, one
> works with cygwin on the new machine, and the other doesn't.

For this kind of symlink the problem is the missing DOS SYSTEM file
attribute.  This attribute is used to recognize symlinks in the first
place.  Only files with the SYSTEM bit are opened and their content
examined if they are symlinks.

I don't know anything about your external drive, so I don't know where
the SYSTEM bit was lost.  In fact, rsync should just have tried to create
symlinks either way, so I assume the system bit has gone lost due to
some unrelated operation.

> Both machines are running Cygwin 1.7.
> 
> Any thoughts on whether this can be fixed without a complete reinstall
> / recreation of every link?

find the files by their !<symlink> header and set the DOS SYSTEM
attribute.  That fixes it.


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-19  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-18 20:41 Broken symlinks after rsync Leo Alekseyev
2012-03-19  9:21 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).