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 -)

7 thoughts on “Moving Large Directories on Solaris

  1. 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. 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. 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. 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.

  5. 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. Pingback: Linux Mount | Sekolah Linux Indonesia

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>