bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Regarding untaring tar files containing symlinks


From: Linda A. Walsh
Subject: Re: [Bug-tar] Regarding untaring tar files containing symlinks
Date: Sat, 05 Jul 2014 00:44:59 -0700
User-agent: Thunderbird



Amit Kapila wrote

Please extract in order as mentioned to ensure that symlink folder
gets extracted first.
Please check contents of C:\Data\pg_tblspc, ideally it should contain
symlink to C:\tbs.
---
It appears to work as you are wanting it to (console output below).

But I also note that if they are created in the wrong order (something
that would work on linux).  -- then I get the behavior you mention:

instead of a symlink, I get a file containing text:

C:\data\pg_tblspc>hexdump -C 16386
00000000 21 3c 73 79 6d 6c 69 6e 6b 3e ff fe 63 00 3a 00 |!<symlink>..c.:.|
00000010  5c 00 74 00 62 00 73 00  00 00                    |\.t.b.s...|
0000001a
----
Working case follows:
 mkdir tbs
/> cd tbs
/tbs> tar xvaf /tmp/tars/16386.tar
PG_9.5_201406292/
PG_9.5_201406292/12135/
PG_9.5_201406292/12135/16387
/tbs> ll -R
.:
total 0
drwxrwxr-x+ 1 0 Jul  4 21:47 PG_9.5_201406292/

./PG_9.5_201406292:
total 0
drwxrwxr-x+ 1 0 Jul  4 21:47 12135/

./PG_9.5_201406292/12135:
total 0
-rw-rw-r-- 1 0 Jul  4 21:47 16387
/tbs> cd ..
/> mkdir data
/> cd data
/data> tar xaf /tmp/tars/base.tar
/data> ll
total 47
-rw-rw-r--+ 1     4 Jul  4 00:01 PG_VERSION
-rw-------+ 1   206 Jul  4 21:47 backup_label
drwxrwxr-x+ 1     0 Jul  4 00:02 base/
drwxrwxr-x+ 1     0 Jul  5 00:18 global/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_clog/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_dynshmem/
-rw-rw-r--+ 1  4352 Jul  4 00:03 pg_hba.conf
-rw-rw-r--+ 1  1678 Jul  4 00:01 pg_ident.conf
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_llog/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_multixact/
drwxrwxr-x+ 1     0 Jul  4 21:45 pg_notify/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_replslot/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_serial/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_snapshots/
drwxrwxr-x+ 1     0 Jul  4 21:45 pg_stat/
drwxrwxr-x+ 1     0 Jul  4 21:47 pg_stat_tmp/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_subtrans/
drwxrwxr-x+ 1     0 Jul  4 21:46 pg_tblspc/
drwxrwxr-x+ 1     0 Jul  4 00:01 pg_twophase/
drwxrwxr-x+ 1     0 Jul  4 00:17 pg_xlog/
-rw-rw-r--+ 1    90 Jul  4 00:01 postgresql.auto.conf
-rw-rw-r--+ 1 21994 Jul  4 00:05 postgresql.conf
/data> ll pg_tblspc/
total 0
lrwxrwxrwx 1 4 Jul  4 21:46 16386 -> /tbs/
/data> cd pg_tblspc/
/data/pg_tblspc> ls
16386@
/data/pg_tblspc> cd 16386/
/data/pg_tblspc/16386> ls
PG_9.5_201406292/
/data/pg_tblspc/16386> cd ..
/data/pg_tblspc> cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\data\pg_tblspc>dir
Volume in drive C is System Disk
Volume Serial Number is E889-68E4

Directory of C:\data\pg_tblspc

07/04/2014  09:46 PM    <DIR>          .
07/04/2014  09:46 PM    <DIR>          ..
07/04/2014  09:46 PM    <SYMLINKD>     16386 [C:\tbs]
              0 File(s)              0 bytes
              3 Dir(s)  218,077,290,496 bytes free

C:\data\pg_tblspc>
-----------------

This might have to do with the version of cygwin you have.

You might make sure your cygwin is up to date -- as I vaguely remember
somewhat older versions of 'cygwin' didn't create actual windows
symlinks and hardlinks but created dummy files with the information
in them (like you are seeing).  But that changed... maybe 2-4 years ago?

If you are running on a 64-bit windows, there is also a 64-bit
cygwin that runs in native mode that gives some advantages over
32-bit  cygwin on a 64-bit machine (like 32-bit processes can't
see the real C:\windows\system32, but are redirected to C:\windows\syswow64
syswow64 = windows[32] on windows64)

you can tell which version you are running by running uname -a:
CYGWIN_NT-6.1 Athenae 1.7.30(0.272/5/3) 2014-05-23 10:36 x86_64 Cygwin

32-bit cygwin would say:
CYGWIN_NT-6.1-WOW64 Athenae 1.7.28(0.271/5/3) 2014-02-09 21:06 i686 Cygwin










reply via email to

[Prev in Thread] Current Thread [Next in Thread]