preserve guid:uid tar / cp

hello,

i've a backup of a xen image which was tar'ed. i extracted the tarfile with --preserve and moved it to the lvm partition useing cp -p to preserve the ownership informations of the files in this step too.

but unfortunatly after extracting the archive some uid and guids which are present on the current system get replaced ( but with different names than they had on the original system ).

when i try to boot the machine sql and other services don't startup because of those false guiid:uids.

sooo my big question is, how can i extract and copy my linux-image.tar file without having the guid and uids of the archive replaced between those steps?

any help would be appreciated!

thanks i advance,

Copying files from one system to another can get complicated. If the numeric value of the UID:GUID in the password file do not match you will get the effect you describe even when the username exists on both servers. All unix processes use the numeric values and the character version is purely for human use.

One method which I have used is to copy the password file from the target system to a temporary directory on the source server and use that file as a reference. Each file to be copied is copied to a further temporary area and we change the UID:GID to match the equivalent username on the target system before copying to the target system. Thus the target system never receives a file with a wrong UID:GID. Preserving file and directory permissions is a separate issue and can be best tackled by creating a cpio archive rather than a tar archive.

Footnote: As you will be aware files can be owned by a numeric UID:GID which does not exist in the unix password file.

i hope ive understood u correctly, well i thought it over again.....

when ls -la in my xen-image folder while logged into on the dom0 the uid and guid is replaced by my current /etc/passwords file, but are still the same.

when i start the domU and log in via ssh and do ls -la again the numbers should be replaced with the /etc/passwords file of the current domU.

so if iam right the uid and guids arent changed and that shouldnt be the problem..

the system boots, most daemons work but when i log into phpmyadmin i see that all tables from the databases r gone, i cant create a db as root and importing an sqldump doesnt work too...

i guess my backup is completely fuc**d up.. :confused:

or should i give it a try and copy the /etc/password file?

For general understanding of this supplementary post, we need an explanation of "dom0" "domeU" "xen" "xen-image" ?
How exactly was the backup created?

iam running Linux version 2.6.26-2-xen-amd64 (Debian 2.6.26-21)

Dom0 is mybox
DomU is a virtual host

the domU contained a linux installation with webserver and so on... and was backuped by mounting the partition /dev/lvm/xen/....domU-harddisk, then the image got tared and pushed on an ftp server.

so i got a new server,setted up xen copied the files back from ftp to my dom0, mounted the lvm partitions of my virtialhost, copied the files there and wanted to start it up again :slight_smile:

Sorry I cannot continue with this topic. Techniques that I might use in unix may not be relevant to cloning in Linux.

I think you need a Debian Linux expert who knows about "xen" and Linux server cloning. Please make it clear whether you still have the original computer intact?