• Moving Large Directories on Solaris

    When moving or copying really really large directories on Solaris, you can sometimes run into trouble, especially when some of the files in those directories are larger than 8 Gigabytes. One solution is to use a “ufsdump pipe to ufsrestore” command, but I have even had problems with this from time to time. My perfered method these days is to use a “tar pipe to tar” command. Be aware, however, that on Solaris you will need to include the “E” flag if the directory you are copying contains files larger than 8 Gigabytes.

    Here is an example. Simply “CD” into the directory you want to copy and execute the following command, replacing “/new/directory” with path to the new destination directory.

    tar cpBEf - * | (cd /new/directory; tar xBEf -)

    This entry was posted on Monday, August 13th, 2007 at 1:36 pm and is filed under Data and Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
  • 7 Comments

    Take a look at some of the responses we've had to this article.

    1. Brian Gupta
      Aug 13th
      Reply

      You can get read of the option B. When reading from standard input, “-”, this function modifier is selected by default to ensure that tar can recover from short reads.

      (I’ve never had to use “B” before).

    2. Aug 13th
      Reply

      Sure enough Brian, you are correct… Interestingly, the E flag is ignored when used with -x. I guess the command would be cleaner like this:

      tar cpEf – * | (cd /new/directory; tar xf -)

      Thanks for the sharp eye.

    3. Jay
      Dec 14th
      Reply

      Be careful – there are old versions of tar that have a 2gb file size limit. The best way I found is using CPIO and FIND.

      cd
      find . | cpio -pvdum

    4. Bruce Jackson
      Jul 1st
      Reply

      You are better off using double ampersand between the CD and the tar.

      tar cpBEf – * | (cd /new/directory; tar xpf -)

      What do you think happens if the “cd” fails for some reason (permissions, fat finger, etc)? The tar dutifully runs from the current working directory clobbering files.

      If we change it to:

      tar cpBEf – * | (cd /new/directory && tar xpf -)

      The 2nd tar command will run if and only if the “cd” command before it was successful.

      Users of GNU tar also have the option of the ‘k’ option on the 2nd tar.

      • Jul 2nd
        Reply

        Very good point. Thanks for the addition!

    5. Murali
      Jun 7th
      Reply

      Dear friends

      I would like to install epson l1 690 dot matrix printer on solaris 5.6 platform – please advise me the procedures.

      thanks

    6. [...] Moving Large Directories on Solaris | spiralbound.net – Moving Large Directories on Solaris. When moving or copying really really large directories on Solaris, you can sometimes run into trouble, especially when some of the files in those directories are larger than 8 Gigabytes. … [...]

  • Leave a Reply

    Let us know what you thought.

  • Name (required):

    Email (required):

    Website:

    Message:

Visitors have tagged this post: t (210) - solaris cp (175) - cp Solaris (105) - move directory solaris (54) - linux tar pipe (52) - solaris move directory (50) - solaris copy directory (49) - tar move (41) - SOLARIS COPY command (36) - perl move directory (31) - copy directory solaris (28) - solaris 10 copy directory (28) - solaris tar copy (24) - solaris copy (23) - solaris tar pipe (22) - cp in solaris (21) - solaris tar large files (19) - solaris move files (18) - move directory in Solaris (18) - solaris cp command (18) - solaris (17) - copy directory in Solaris 10 (16) - move files with tar (15) - copy directory solaris 10 (15) - linux pipe to tar (15) - cp command in solaris (15) - tar large directories (14) - f (14) - moving directories in solaris (14) - solaris copy directories (13) - Solaris cpio (13) - tar large files solaris (13) - tar Use E function modifier (13) - copy directory in solaris (12) - how to copy directory in solaris (12) - solaris copy large files (12) - tar pipe linux (12) - tar move directory (12) - move files in solaris (12) - how to copy a directory in solaris 10 (12) - tar large directory (11) - how to tar a directory in solaris (11) - find cpio solaris (11) - solaris copy tar (10) - tar move files (10) - move files solaris (10) - how to move directory in solaris (10) - copy command in solaris (10) - solaris tar large file (10) - how to copy directory in solaris 10 (10) - tar to move files (10) - ufsdump copy directory (9) - ufsdump pipe ufsrestore (9) - tar move directories (9) - cpio large files solaris (9) - cpio move (9) - solaris move directories (9) - linux pipe tar (9) - moving directory with tar (8) - copying directories solaris (8) - solaris move dir (8) - tar E function modifier (8) - copy directory on solaris (8) - tar big file solaris (8) - cpio solaris 10 (8) - solaris tar size (8) - move directories solaris (8) - using tar to move directories (8) - cp command solaris (8) - tar move dir (7) - solaris copy dir (7) - tar a directory in solaris (7) - solaris move file (7) - solaris directory size (7) - move a directory in solaris (7) - cp tar pipe (7) - solaris find large files (7) - tar large files (7) - cp directory solaris (7) - solaris find directory (7) - perl move directories (7) - solaris moving directories (7) - solaris copy cpio (7) - solaris copy a directory (7) - move directory solaris 10 (7) - solaris 10 move directory (7) - solaris move partition (6) - "pipe to tar" (6) - solaris tar copy directory (6) - tar pipe copy (6) - find large files solaris (6) - find big files solaris (6) - copy directory with tar (6) - using cpio to move files (6) - solaris tar size limit (6) - tar copy directory (6) - tar directory solaris (6) - perl moving a directory (6) - solaris cpio copy directory (6) - tar copy solaris (6) - solaris copy using tar (6) - solaris moving a directory (6) - copy directories solaris (6) - How to move directory Solaris (6) - perl move dir (6) - linux tar large directory (6) - copying large files solaris (5) - solaris copy directory tar (5) - solaris copying large files (5) - Copying large files in Solaris (5) - moving directory in solaris (5) - tar a directory Solaris (5) - tar solaris (5) - Solaris move a directory (5) - tar pipe copy partition (5) - solaris cpio large files (5) - solaris find biggest files (5) - find large files solaris 10 (5) - moving directories in perl (5) - solaris cp -rp (5) - mv directory solaris (5) - copy dir solaris (5) - how to copy directories in Solaris (5) - move directories tar (5) - ufsdump to copy directory (5) - tar copy directories (5) - cp link solaris (5) - perl moving directories (5) - how to move directories in solaris (5) - solaris large file copy (5) - moving directories with tar (5) - solaris tar limits (5) - cpio move files (5) - solaris cp examples (5) - solaris copy directory command (5) - solaris cp -pr (5) - ufsdump solaris (4) - solaris cp -p (4) - copy directory command solaris (4) - tar pipe cd (4) - how to copy a directory in solaris (4) - move files tar (4) - solaris 10 find large files (4) - solaris cp directories (4) - tar copy directory solaris (4) - cpio largefiles solaris (4) - tar large file solaris (4) - size of directory solaris (4) - solaris cpio largefile (4) - cpio solaris example (4) -