delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/19/05:22:08

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 19 Mar 2012 10:19:54 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Broken symlinks after rsync
Message-ID: <20120319091954.GB30682@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CADzxs1=d65Babe1VLbLFUQg03Cu5ZkUqV_qhxmr1kfUg9ft8zQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CADzxs1=d65Babe1VLbLFUQg03Cu5ZkUqV_qhxmr1kfUg9ft8zQ@mail.gmail.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 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

- Raw text -


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