Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2001
    Posts
    46

    tarring up a folder into different pieces?

    I would like to know if it's possible to tar up a folder into different pieces, like for example if a folder contains up to 20gb in size and I would like to tar it up and split into individual 2gb in size each. If so how do we untar it those individual pieces again? Thanks!

  2. #2
    Join Date
    Nov 2005
    Location
    Los Angeles, CA
    Posts
    4
    tar cvfz - will give you a tar.gz
    split -b 2m - will split your tar.gz into 2mb chunks
    cat [ordered list of splits] > .tar.gz - will reassemble the chunks from split
    tar xvfz - untar

  3. #3
    Join Date
    Sep 2001
    Posts
    46
    so if it's into gb then i just use split -b 2gb ?

  4. #4
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,097
    The -b flag's options only go up to m. Just multiply by 1000 for gigs.

    It would probably be more efficient to do it with a pipe; disk I/O is slow, so to get rid of the intermediate file:

    To create:
    Code:
    tar zcv directory | split -b2000m
    To reconstruct:
    Code:
    cat x* | tar zxv

  5. #5
    Join Date
    Sep 2001
    Posts
    46
    thanks alot for the pointers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •