1834434 Members
2311 Online
110067 Solutions
New Discussion

Re: TAR issue

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

TAR issue

I am tarring up some files and the files have numbers for the uname and gname. Tar gives me an error that says tar: couldn't get uname for uid 65534
tar: couldn't get gname for gid 65534
11 REPLIES 11
Francois Bariselle_3
Regular Advisor

Re: TAR issue

Hi,
Don't worry,

It's only because this is a file that the owner is removed from NIS.
Tar could not find the user on NIS.

Frank.
Fais la ...
Justo Exposito
Esteemed Contributor

Re: TAR issue

Hi,

It's not important the restore are fine, the only thing is that you remove an owner of a file from your system.

Regards,

Justo.
Help is a Beatiful word
Jeff Hagstrom
Regular Advisor

Re: TAR issue

Except that there are many files on the system that have no uname or gname. Files are being created from other system and are not assigning a name our group. Can I write a script to go and find and give them a uname or gname?
Clemens van Everdingen
Honored Contributor

Re: TAR issue

Hi,

No problem normally.
Unless the tar file is not extracted correctly.
But I pressume it did !

Only username and group id are failing on the system.

Use chown : * on the files which are restored.
This to give them a proper owner and group.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Francois Bariselle_3
Regular Advisor

Re: TAR issue

Hi again,

The data is copied correcly.

Frank
Fais la ...
Justo Exposito
Esteemed Contributor

Re: TAR issue

Hi Jeff,

You can do an script in oreder to find and change the uname and gname.

Try looking at find manpage.

Regards,

Justo.
Help is a Beatiful word
James R. Ferguson
Acclaimed Contributor

Re: TAR issue

Hi Jeff:

The standard HP-UX 'tar' does not support the archival of files larger than 2GB or files that have user/group IDs greater than 60K. Files with user/group IDs greater than 60K are archived and restored under the user/group ID of the current process.

A far superior version is the gnu version:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25/

Regards!

...JRF...
Magdi KAMAL
Respected Contributor

Re: TAR issue

Hi Jeff,

If your files /etc/passwd and /etc/group or your NIS database don't have any association between the User ID and The Group ID for the files on tape, you will have such warning messages.

But you will still be able to restaure your files.

You still also can re-attribute a new User ID and Group ID for these files after restauring them.

Magdi
John Carr_2
Honored Contributor
Solution

Re: TAR issue

Hi you can update your files with some of these commands

I change my false ID's to real ID's using the following command

find . -user "65534" -exec chown real_user_name {}\;

find . -group "65534" -exec chgrp real_group_name {} \;

or if all your files reside under a directory say /data and you had a valid username "john" with valid group"support" you could

chown -R john:support *

If you do this tar will stop complaining.

MANOJ SRIVASTAVA
Honored Contributor

Re: TAR issue

Hi Jeff

Tar does chnage the id owners of the file if the size increases more than 60K . Howeever the safer way is to restore all the files and then may be write a script to find and change the ownership .


Manoj Srivastava
Darrell Allen
Honored Contributor

Re: TAR issue

Hi Jeff,

Sounds like the issue is that some of your source files don't have an owner or group id defined on your system. Some consider it a security issue to have such files. They could be files left on the system when a user was deleted, whether the user was defined in /etc/hosts or NIS.

They could have also been extracted from a tarball and the user or group from the tarball wasn't found on your system. Again, you need to check out what the files are, determine if they are needed, and who should own them.

I run find commands on occassion just to see these files and directories. You then need to see if the files are needed or if they were left when a user was deleted and can be removed. The find command I run is:
find / -nouser -o -nogroup | xargs ll -d

You can easily write a script to include the find command above. You could pipe the output to xargs chown userid:groupid but I'd suggest you first list the files and investigate them. You may have an old passwd file that you could check them against to figure out who did own them.

If you do change the ownership, I'd suggest you not blindly change them to be owned by root.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)