• 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 have 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: