preserve guid:uid tar / cp


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users preserve guid:uid tar / cp
# 1  
Old 02-04-2010
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,
# 2  
Old 02-04-2010
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.
# 3  
Old 02-04-2010
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.. Smilie

or should i give it a try and copy the /etc/password file?
# 4  
Old 02-04-2010
For general understanding of this supplementary post, we need an explanation of "dom0" "domeU" "xen" "xen-image" ?
How exactly was the backup created?
# 5  
Old 02-05-2010
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 Smilie
# 6  
Old 02-05-2010
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?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tar extract: remap uid gid ?

OK, so simple question here: Is there anyway to REMAP, while extracting with tar, specific uid's and gid's on extracted files ? Background: The usual transfer between two servers with same literals username's names, but with different gid and uid. I would like, for example, files owned by... (6 Replies)
Discussion started by: fidodido
6 Replies

2. UNIX for Dummies Questions & Answers

tar file help and uid guid?

when I executed tar xvf jre-7u7-soloris-i586.tar.gz it created the last entry with user as 10 and group as 143. When I execute the cd to the jrel directory I get directory not found error. Not sure why this is happening. I am in the root account just trying to install Java Enterprise. ... (2 Replies)
Discussion started by: Fingerz
2 Replies

3. UNIX for Dummies Questions & Answers

Tar command to preserve the folder/file arrangement

Hi, I do have question for un tar a file. I have several 'tar'ed files. For example: SRS.tar.bz2. I was trying to untar them in a linux server using the command: tar xvjf SRS.tar.bz2 It worked perfectly. but when I open this file in my mac computer all the files are extracted into a... (7 Replies)
Discussion started by: Lucky Ali
7 Replies

4. UNIX for Dummies Questions & Answers

Difference between normal Execute permission and GUID

Hi, Any can explain the difference between the normal execute permission for the file and GUID of the file. Since the normal execute permission has right to execute file why there is need of providing GUID for the same file. Also share some examples for SUID and SGID programs. Regards... (3 Replies)
Discussion started by: ksgnathan
3 Replies

5. Shell Programming and Scripting

Need some help extracting a GUID from file

I'm fairly new to scripting, and need some help in extracting a piece of data from some output I have. This is what the original output looks like: .--------------------------------------------------------------------------------------. | GUID | C1 | C2 ... (3 Replies)
Discussion started by: Akilleez
3 Replies

6. UNIX for Dummies Questions & Answers

what is SUID,GUID and Sticky bit?

Dear all, what is SUID,GUID and Sticky bit permission? can anyone gave me explanation with example? thanks in advance.. (2 Replies)
Discussion started by: masthan25
2 Replies

7. Solaris

setuid and guid

Hi All, Can someone give me some info about setuid or guid topic? Also about sticky bit. Thanks in advance, itik (9 Replies)
Discussion started by: itik
9 Replies

8. UNIX for Advanced & Expert Users

tar: how to preserve atime? (also on extracted version, not just original)

How do I make tar set the correct atime on the extracted version? The option --atime-preserve works just on the original, not on the extracted file. The extracted files always have current time as atime, which is bad. (10 Replies)
Discussion started by: frankie06
10 Replies

9. UNIX for Dummies Questions & Answers

what is SUID/GUID bits in UNIX/Solaris

Hi, I have a Oracle Database on Solaris 5.10 . Following file are showing with SUID/GUID bits . -rwsr-xr-x root dba /optware/oracle/10.2.0.2/db/bin/extjob What will happen if this is changed to oracle dba . I need to know the will there be a effect if the owner of extjob is... (3 Replies)
Discussion started by: reply2soumya
3 Replies

10. Shell Programming and Scripting

Rsync - Preserve owner/group with different UID/GID

Dear Folks :-) I want to rsync some files between some servers and preserve files owner and group (not UID or GID), in some machines UID and GID are differents, for example: a) In the rsync server: # stat vbseo.php File: `vbseo.php' Size: 26758 Blocks: 56 IO... (1 Reply)
Discussion started by: Santi
1 Replies
Login or Register to Ask a Question