LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] How to copy some files

[ILUG] How to copy some files

Brian Foster blf at utvinternet.ie
Fri Jul 19 16:16:29 IST 2002


  | Date: Fri, 19 Jul 2002 15:22:26 +0100
  | From: "Matthew French" <mfrench42 at yahoo.co.uk>
  | 
  | Niall asked:
  |  > I have about 60G of data which I need to copy from one disk to
  |  > another.  [ ... ] The problem is the bulk of the data [ ... ]
  |  > have two directory entries i.e. there is a hard link [ ... ]
  | 
  | How about something like:
  | 
  |    cd {dest.dir}
  |    tar -C {source.dir} cf - | tar xf -
  | 
  | tar cf - will pipe the tar file to stdout and tar xf - will untar it. This
  | should keep permissions and links, and if you do it as root you will keep
  | the owners too... :)
  | 
  | Not tested, though. You may need other flags as well.

 the above (or something close to it) will work.

 however, the data will be read and written twice by the
 1st (source) `tar', and read twice by the 2nd (sink) `tar',
 albeit only written once as the sink realizes the second
 copy is a hard link to the first.  with c.60Gb of data,
 that will make a difference, at least in time and CPU
 resource consumed (albeit, in this case, not storage).

 the issue here is tar(1) (and cpio(1)) archives always
 contain the data for each name of a hard link.  this is
 (probably) for several reasons, and is not necessarily a
 bad thing.   e.g., it provides a degree of redundancy to
 help cope with bad media.

 the source `tar' is creating an archive, which is being
 written down the pipe (to be consumed by the sink `tar').
 that is why storage is not an issue per se here, as the
 full archive is not "saved" --- if it were, you'd need
 at least 2x60Gb, or over 120Gb!   (the extra is `tar's
 overhead, which is minimal but does add up, esp. when
 a "large" blocking factor is used.)

cheers!
	-blf-
--
 Innovative, very experienced, Unix and      | Brian Foster    Dublin, Ireland
 Chorus (embedded RTOS) kernel internals     | e-mail: blf at utvinternet.ie
 expert looking for a new position ...       | mobile: (+353 or 0)86 854 9268
  For a résumé, contact me, or see my website  http://www.blf.utvinternet.ie

    Stop E$$o (ExxonMobile):  «Whatever you do, don't buy Esso --- they
     don't give a damn about global warming.»    http://www.stopesso.com
     Supported by Greenpeace, Friends of the Earth, and numerous others...




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell