Technical article 105089

Get error "tar:xxx cannot create" restoring OSR5 tar to an OpenServer 3.0 system.

OpenServer 5.0.0

Written · Last revised

Problem

When restoring an SCO OpenServer Release 5.0 filesystem or directory structure using 'tar -x' onto an SCO Open Server 3.0 server, I receive the error:

tar: ./<dir_name>/<fname> - cannot create
tar: cannot make directory ./<dir_name>/<fname>

This error will occur even if the subdirectory structure already exists on the 3.0 system.

Cause

SCO OpenServer 5.0 includes a new tar(C) binary.  This new version
of tar adds the ability to follow symbolic links and archive new
directory structure information.  The older versions of tar cannot
follow the symbolic links and cannot use the new directory
information.  Old versions of tar(C) will attempt to create the
subdirectory, but instead will fail and generate a 0 byte file
with the subdirectory's name.
This problem does not manifest itself if there are only files
on the tar(C) media to be restored.  Empty files will be created,
but empty subdirectories will not appear.

Solution

1. Use the '-P' flag when you generate the 5.0 tar(C) media to
preserve compatibility with older UNIX versions.  This will prevent
tar(C) from following symbolic links when restoring on an older
version.

The tar command can be given on any other options or flags that are desired.

Example:
5.0 System tar(C) floppy creation:
                cd /u/data
                tar cvP6 ./*
3.0 System restore:
                cd /u/<dir_name>
                tar xv6
2. If you have a tar(C) archive that was created in SCO OpenServer
Release 5.0.0 without using the '-P' toggle, you may use the -w
flag for tar(C) to restore on an 3.0 System.  This will prompt you
 before extracting each file allowing you to bypass the entries for
 the directories.
3. One other solution is to cd directly into the subdirectory
on SCO OpenServer 5.0.0 and generate a backup of files only.  The
tar(C) restore on older releases does not have a problem restoring
files only.

From the Xinuos technical article database, record 105089. Reproduced with permission. The original is at www.sco.com/ta/105089, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.