NTFS Junction/symlink and Unix symlink interoperability issues

UNIX traditionally supports so called symbolic links, created by the command “ln –s”. On Windows, however, it is still largely an unsupported feature, although the NTFS filesystem specification allows to create symlinks and from Vista on, the default directory structure also uses some symlinks to keep backward compatibility for older programs utilizing directories like C:\Documents and Settings (pointing to new C:\Users) etc. There are some command line tools like Junction and Mklink, a great context menu tool called Link Shell Extension and also a listing tool NTFSLinksView. The major problem  is that there is virtually no backup tool or compression software that would support this filesystem feature. Finally I found maybe the best solution available today, which is CYGWIN and TAR, that saves absolute paths starting with /cygdrive/ when (Win2000+) Junctions are used, and relative paths when (Vista+) Symlinks are used. Unfortunately, the same tool cannot restore the native NTFS symlinks when decompressing, it makes the symlinks useful only for Cygwin environment!

Because I was looking for a solution that could regularly backup data keeping the symlink structure, being able to reconstruct it when needed, this is clearly not a perfect solution, as it is one-way only. The native backup tools bundled with Vista or Win7 are useless as they cannot use Truecrypted volumes as the target of the backup, they don’t see such partitions at all!

After some research, I found two ways how one could regularly backup data within Windows keeping the Junction/symlink structure:

1. the already mentioned TAR from CYGWIN. I use a BASH shell script that combines it with compression with 7Zip because of password encryption, so archives can be safely burned onto DVD, keeping a decent security. This way I backup the AppData folders:


NOW=$(date +"%F")







tar -cf - $INC | 7za a -si -mx3 $OUTPATH/$OUTC.tar.7z -p$P

tar -cf - $IND | 7za a -si -mx3 $OUTPATH/$OUTD.tar.7z -p$P

Both TAR and NTFS directly can be one-way transformed into regular Unix symlinks on UNIX-based systems (GNU/Linux etc.), but apparently the opposite direction is not possible yet.

2. For incremental backup, using DeLorean Copy from Link Shell Extension (or command line tool ln.exe). First backup consists of regular copying with keeping the inner symlink structure (“Smart Copy”), next backups just make hardlinks to the first backup and copies only new or changed files. The directory where such backups ar e kept can be at least NTFS compressed. It is impossible to transfer such backups to DVD or other non-NTFS media.

3. The Smart Copy feature of Link Shell Extension can be used also for doing backups that are going to be burned to DVD or other media. But it is necessary to burn not just individual files and folders, but whole NTFS filesystem enclosed in some container. There are few options available, but the preferred for me is to create a Truecrypt file-based container of the size of the target medium, format it as NTFS, mount this volume and then perform the SmartCopy procedure. After dismounting of the volume, the file of the container can be burned to DVD or saved to any medium. Security is ensured by the Truecrypt encryption. 



Pracuji jako ajťák a grafik na volné noze, zejména ale pro brněnskou firmu vyrábějící ekodrogerii. Dále působím v brněnském systému místní směny Rozleťse, Českém zahrádkářském svazu, České psychedelické společnosti, spolku Archetypal a Mezinárodní komunitě dzogčhenu. Chcete mě podpořit? BTC: 37mf2FJR26Ce3DxMkocukJDgB1eVjasnZB, příp. PGP podepsané adresy dalších kryptoměn.

Napsat komentář

Vaše e-mailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *