Re: Copying a file system w/ tar - symbolic links not copied right - More info

2006-05-11 Thread Philip Hallstrom

Hi all...

Ok... More info for the puzzle.

I'm trying to move a file system from one disk to another, and when I do
this:

tar cf - /source/* | ( cd /destination  tar xfv - )

It copies all the files, but the symbolic links are copied as files of 0
length, rather than re-established as links.

BUT

When I just:

tar -cf file.tar /source/*

And then:

tar -xf file.tar

Then the symbolic links are made correctly Any reason why this should
work and not the piped version for 'all in one' copying?


If it's an actual filesystem why not use dump/restore?

Otherwise I'm not sure, but you might also want to add in -pS to handle 
permissions and sparse files as well...


-philip
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right - More info

2006-05-11 Thread Don O'Neil
Well... I'm moving it from one file system to another of different sizes,
that's the main reason. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Philip Hallstrom
Sent: Thursday, May 11, 2006 10:35 AM
To: Don O'Neil
Cc: freebsd-questions@freebsd.org
Subject: Re: Copying a file system w/ tar - symbolic links not copied right
- More info

 Hi all...

 Ok... More info for the puzzle.

 I'm trying to move a file system from one disk to another, and when I 
 do
 this:

 tar cf - /source/* | ( cd /destination  tar xfv - )

 It copies all the files, but the symbolic links are copied as files of 
 0 length, rather than re-established as links.

 BUT

 When I just:

 tar -cf file.tar /source/*

 And then:

 tar -xf file.tar

 Then the symbolic links are made correctly Any reason why this 
 should work and not the piped version for 'all in one' copying?

If it's an actual filesystem why not use dump/restore?

Otherwise I'm not sure, but you might also want to add in -pS to handle
permissions and sparse files as well...

-philip
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right

2006-05-11 Thread Jerry McAllister
 
  Hi all...
 
  Ok... More info for the puzzle.
 
  I'm trying to move a file system from one disk to another, and when I do
  this:
 
  tar cf - /source/* | ( cd /destination  tar xfv - )
 
  It copies all the files, but the symbolic links are copied as files of 0
  length, rather than re-established as links.
 
  BUT
 
  When I just:
 
  tar -cf file.tar /source/*
 
  And then:
 
  tar -xf file.tar
 
  Then the symbolic links are made correctly Any reason why this should
  work and not the piped version for 'all in one' copying?
 
 If it's an actual filesystem why not use dump/restore?

Ditto on dump/restore.
It is the clean and reliable way to do it.
The complete filesystem will be recreated in the new location
with all links, permission, etc intact.

jerry

 
 Otherwise I'm not sure, but you might also want to add in -pS to handle 
 permissions and sparse files as well...
 
 -philip
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-11 Thread Kevin Kinsey

Olivier Nicole wrote:

 I'm trying to move a file system from one disk to another, and when I do
this:


I think that the way to go is:

tar cf - /source/* | ( cd /destination  tar xfvBp - )

Note the Bp at the end of the extract tar.

olivier


Is that for BSD tar, or gtar (GNU)?  We still haven't decided
which is offering the problem, and I don't find -B
described in bsdtar(1), although I can see why you'd want
it in gtar, perhaps.

Nonetheless, the tests I made with both tars didn't seem
to have this problem.  Can Don confirm whether this only occurs
if /source/ is a filesystem mount point?  (Also, which tar
are you using?

KDK

--
Computer programs expand so as to fill the core available.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right.

2006-05-11 Thread Don O'Neil
I've tried both the BSD and GNU tars, I get the same results on both. It's
very strange. 

When I add the B option, no different I used:

tar cf - /array01/* | ( cd /mnt/disk01  tar xfvBp - )

Maybe this is something specific to 4.11? 

Here's what happens:

Source file: 

lrwxrwxrwx1 root  wheel21 Feb 19 03:05 apache.log -
/var/shc/apache/logs/

Destination file created on the tar backup: 

--   1 root  wheel 0 May 11 11:02 apache.log 

Some have suggested using dump/restore. The problem with dump/restore is
that I can't do it across the network and the file systems need to match.
The whole point is to move these files/directories from one server to
another to a volume with a LOT more space on a RAID array.

-Original Message-
From: Kevin Kinsey [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 11, 2006 10:54 AM
To: Olivier Nicole
Cc: [EMAIL PROTECTED]; freebsd-questions@freebsd.org
Subject: Re: Copying a file system w/ tar - symbolic links not copied right.

Olivier Nicole wrote:
  I'm trying to move a file system from one disk to another, and when 
 I do
 this:
 
 I think that the way to go is:
 
 tar cf - /source/* | ( cd /destination  tar xfvBp - )
 
 Note the Bp at the end of the extract tar.
 
 olivier

Is that for BSD tar, or gtar (GNU)?  We still haven't decided which is
offering the problem, and I don't find -B
described in bsdtar(1), although I can see why you'd want it in gtar,
perhaps.

Nonetheless, the tests I made with both tars didn't seem to have this
problem.  Can Don confirm whether this only occurs if /source/ is a
filesystem mount point?  (Also, which tar are you using?


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right - More info

2006-05-11 Thread Philip Hallstrom

Well... I'm moving it from one file system to another of different sizes,
that's the main reason.


Dump won't care about that...

dd would, but dd isn't right for this anyway...

I'd give dump a try.




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Philip Hallstrom
Sent: Thursday, May 11, 2006 10:35 AM
To: Don O'Neil
Cc: freebsd-questions@freebsd.org
Subject: Re: Copying a file system w/ tar - symbolic links not copied right
- More info


Hi all...

Ok... More info for the puzzle.

I'm trying to move a file system from one disk to another, and when I
do
this:

tar cf - /source/* | ( cd /destination  tar xfv - )

It copies all the files, but the symbolic links are copied as files of
0 length, rather than re-established as links.

BUT

When I just:

tar -cf file.tar /source/*

And then:

tar -xf file.tar

Then the symbolic links are made correctly Any reason why this
should work and not the piped version for 'all in one' copying?


If it's an actual filesystem why not use dump/restore?

Otherwise I'm not sure, but you might also want to add in -pS to handle
permissions and sparse files as well...

-philip
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]




___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-11 Thread Jerry McAllister
 
 I've tried both the BSD and GNU tars, I get the same results on both. It's
 very strange. 
 
 When I add the B option, no different I used:
 
 tar cf - /array01/* | ( cd /mnt/disk01  tar xfvBp - )
 
 Maybe this is something specific to 4.11? 
 
 Here's what happens:
 
 Source file: 
 
 lrwxrwxrwx1 root  wheel21 Feb 19 03:05 apache.log -
 /var/shc/apache/logs/
 
 Destination file created on the tar backup: 
 
 --   1 root  wheel 0 May 11 11:02 apache.log 
 
 Some have suggested using dump/restore. The problem with dump/restore is
 that I can't do it across the network and the file systems need to match.
 The whole point is to move these files/directories from one server to
 another to a volume with a LOT more space on a RAID array.

I used to do it over the net regularly with dump/restore.
Just take advantage of the pipe ability.Since the other system
has so much room, just pipe the dump file over there and unroll
it with restore on the other machine as you please or just leave
it in a dump file if you don't want.

jerry


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right - More info

2006-05-11 Thread Don O'Neil
I will... Thanks to all for helping... Still weird what's happening though!


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Philip Hallstrom
Sent: Thursday, May 11, 2006 12:29 PM
To: Don O'Neil
Cc: freebsd-questions@freebsd.org
Subject: RE: Copying a file system w/ tar - symbolic links not copied right
- More info

 Well... I'm moving it from one file system to another of different 
 sizes, that's the main reason.

Dump won't care about that...

dd would, but dd isn't right for this anyway...

I'd give dump a try.



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Philip 
 Hallstrom
 Sent: Thursday, May 11, 2006 10:35 AM
 To: Don O'Neil
 Cc: freebsd-questions@freebsd.org
 Subject: Re: Copying a file system w/ tar - symbolic links not copied 
 right
 - More info

 Hi all...

 Ok... More info for the puzzle.

 I'm trying to move a file system from one disk to another, and when I 
 do
 this:

 tar cf - /source/* | ( cd /destination  tar xfv - )

 It copies all the files, but the symbolic links are copied as files 
 of 0 length, rather than re-established as links.

 BUT

 When I just:

 tar -cf file.tar /source/*

 And then:

 tar -xf file.tar

 Then the symbolic links are made correctly Any reason why this 
 should work and not the piped version for 'all in one' copying?

 If it's an actual filesystem why not use dump/restore?

 Otherwise I'm not sure, but you might also want to add in -pS to 
 handle permissions and sparse files as well...

 -philip
 ___
 freebsd-questions@freebsd.org mailing list 
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
[EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Andy Greenwood

# man tar

specifically, the -L option

On 5/10/06, Don O'Neil [EMAIL PROTECTED] wrote:

Hi all...

 I'm trying to move a file system from one disk to another, and when I do
this:

tar cf - /source/* | ( cd /destination  tar xfv - )

It copies all the files, but the symbolic links are copied as files of 0
length, rather than re-established as links.

What am I doing wrong here, or is my tar broken?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Don O'Neil
My man says:

 -L number
 --tape-length numberChange tapes after writing number * 1024 bytes. 

Nothing about symbolic links Now there is an option --unlink-first and
--dereference... Both of which don't copy the links, but unlink or copy the
actual source file.

Don

-Original Message-
From: Andy Greenwood [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 10, 2006 6:24 PM
To: Don O'Neil
Cc: freebsd-questions@freebsd.org
Subject: Re: Copying a file system w/ tar - symbolic links not copied right.

# man tar

specifically, the -L option

On 5/10/06, Don O'Neil [EMAIL PROTECTED] wrote:
 Hi all...

  I'm trying to move a file system from one disk to another, and when I 
 do
 this:

 tar cf - /source/* | ( cd /destination  tar xfv - )

 It copies all the files, but the symbolic links are copied as files of 
 0 length, rather than re-established as links.

 What am I doing wrong here, or is my tar broken?

 ___
 freebsd-questions@freebsd.org mailing list 
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
[EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Murray Taylor

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Andy Greenwood
 Sent: Thursday, 11 May 2006 11:24 AM
 To: Don O'Neil
 Cc: freebsd-questions@freebsd.org
 Subject: Re: Copying a file system w/ tar - symbolic links 
 not copied right.
 
 # man tar
 
 specifically, the -L option
 
 On 5/10/06, Don O'Neil [EMAIL PROTECTED] wrote:
  Hi all...
 
   I'm trying to move a file system from one disk to another, 
 and when I 
  do
  this:
 
  tar cf - /source/* | ( cd /destination  tar xfv - )
 
  It copies all the files, but the symbolic links are copied 
 as files of 
  0 length, rather than re-established as links.
 
  What am I doing wrong here, or is my tar broken?
 

to preserve symlinks you need to use cpio   specifically the -p and -l
options

man cpio

It is a bit of a read 


Murray Taylor

Special Projects Engineer
Bytecraft Systems

P: +61 3 8710 2555
F: +61 3 8710 2599
D: +61 3 9238 4275
E: [EMAIL PROTECTED] 

--
Any intelligent fool can make things bigger and more complex... It
takes a
touch of genius - and a lot of courage to move in the opposite
direction.
  Albert Einstein 
-- 
---
The information transmitted in this e-mail is for the exclusive
use of the intended addressee and may contain confidential
and/or privileged material. Any review, re-transmission,
dissemination or other use of it, or the taking of any action
in reliance upon this information by persons and/or entities
other than the intended recipient is prohibited. If you
received this in error, please inform the sender and/or
addressee immediately and delete the material. 

E-mails may not be secure, may contain computer viruses and
may be corrupted in transmission. Please carefully check this
e-mail (and any attachment) accordingly. No warranties are
given and no liability is accepted for any loss or damage
caused by such matters.
---

***This Email has been scanned for Viruses by MailMarshal.***
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Kevin Kinsey

 On 5/10/06, Don O'Neil [EMAIL PROTECTED] wrote:

 tar cf - /source/* | ( cd /destination  tar xfv - )

 It copies all the files, but the symbolic links are copied as files of
 0 length, rather than re-established as links.

 What am I doing wrong here, or is my tar broken?


 From: Andy Greenwood [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 10, 2006 6:24 PM
 To: Don O'Neil

 # man tar

 specifically, the -L option


Don O'Neil wrote:

My man says:

 -L number
 --tape-length numberChange tapes after writing number * 1024 bytes. 


Nothing about symbolic links Now there is an option --unlink-first and
--dereference... Both of which don't copy the links, but unlink or copy the
actual source file.

Don




And again:

 What am I doing wrong here, or is my tar broken?

Heh, heh, could be.  Andy is referring to BSDtar, which
is tar(1) on later releases, and your -L option is from GNUtar,
which is tar(1) on, IIRC, 4.X and elder, and is now available in
ports as gtar.

As for what's really the problem, I can't say as I can tell.
On my 6.X box, everything works as expected.  For fun, I shelled
into a 4.11 box, and everything works as expected, both my tests
and your example.  Maybe your tar *is* broken.  Or, more likely,
we're both a tad dense ATM.

Kevin Kinsey

--
What foods these morsels be!

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Dan Nelson
In the last episode (May 10), Don O'Neil said:
 Hi all...
 
 I'm trying to move a file system from one disk to another, and when I
 do this:
 
 tar cf - /source/* | ( cd /destination  tar xfv - )
 
 It copies all the files, but the symbolic links are copied as files
 of 0 length, rather than re-established as links.
 
 What am I doing wrong here, or is my tar broken?

Sounds like your tar's broken.

([EMAIL PROTECTED]) /tmp/z ln -s testing link
([EMAIL PROTECTED]) /tmp/z md bsdtar gnutar
([EMAIL PROTECTED]) /tmp/z bsdtar cf - link | ( cd bsdtar  bsdtar xvf - )
x link
([EMAIL PROTECTED]) /tmp/z gtar cf - link | ( cd gnutar  gtar xvf - )
link
([EMAIL PROTECTED]) /tmp/z ls -l bsdtar gnutar
bsdtar:
total 4
drwxr-xr-x  2 dan  wheel  512 May 10 21:19 ./
drwxr-xr-x  4 dan  wheel  512 May 10 21:18 ../
lrwxr-xr-x  1 dan  wheel7 May 10 21:18 link@ - testing

gnutar:
total 4
drwxr-xr-x  2 dan  wheel  512 May 10 21:19 ./
drwxr-xr-x  4 dan  wheel  512 May 10 21:18 ../
lrwxr-xr-x  1 dan  wheel7 May 10 21:19 link@ - testing
([EMAIL PROTECTED]) /tmp/z bsdtar --version
bsdtar 1.01.020, libarchive 1.02.033
Copyright (C) 2003-2004 Tim Kientzle
([EMAIL PROTECTED]) /tmp/z gtar --version
tar (GNU tar) 1.13.25

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Copying a file system w/ tar - symbolic links not copied right.

2006-05-10 Thread Olivier Nicole
  I'm trying to move a file system from one disk to another, and when I do
 this:

I think that the way to go is:

tar cf - /source/* | ( cd /destination  tar xfvBp - )

Note the Bp at the end of the extract tar.

olivier
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]