SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Restoring a folder. Uid not correct
Author Message
Post Restoring a folder. Uid not correct 
I have found a problem when I was doing a restore, regarding the uid and
gid information.

I have a backup that is like..

mybackup/bin/....
mybackup/home/....
mybackup/usr/....
mybackup/var/.... etc

if I backup with rdiff-backup -r now mybackup/home/ server::/test/home/
then the uid's gid's are correct.

But if I backup the whole lot with rdiff-backup -r now mybackup
server::/test/mybackup, the uid's and gid's are not correct.

ie if there are four users under /home

fred = 1000
jo = 1001
andrew = 1002
tom = 1003

I have done one restore where all of the uid's are 1000 and on another
backup the uid's are all 103

So at the moment I am having to restore via a list of restores, of each
of the folders, instead of being able to restore the who set in 1 go.


UPDATE:

When I restored the home folder with 4 users, as /home to /home, the
first user had the correct uid's, and the others all had the same uid's
as the first user.

It is like the uid to restore with is getting overwritten, or not loaded
correctly.

Cheers

Fran

Post Restoring a folder. Uid not correct 
TO test this out..

On the dest machine, do

find * -printf "%p = %U:%G\n" >owners.txt
sort owners.txt >owner.txt

On source machine use this perl program


#!/usr/bin/perl


open(ChangeUid,">UpdateUID.sh");
open(CheckUid,">CheckUID.txt");
open(CheckP,">CheckPermissions.txt");

open(IN,"zcat $ARGV[0] | ");

while(<IN>) {
chomp();
if($_=~/File/) {
< at > line=split(/File /,$_);
$File = $line[1];
} elsif ($_=~/Uid/) {
< at > line=split(/Uid /,$_);
$Uid = $line[1];
} elsif ($_=~/Gid/) {
< at > line=split(/Gid /,$_);
$Gid = $line[1];
} elsif ($_=~/Permissions/) {
< at > line=split(/Permissions /,$_);

print ChangeUid "chown $Uid:$Gid \"$File\"\n";
print CheckUid "$File = $Uid:$Gid\n";
printf CheckP "$File = %o\n",$line[1];
}
}

close(IN);
close(ChangeUid);
close(CheckUid);
close(CheckP);



And run with ./test.pl /path/to/the/rdiff-backup-data/mirror-metadata.......gz file

It will output 3 files.

sort CheckUID.txt >UID.txt

diff UID.txt owner.txt

Can use the UpdateUID.sh to set the uid's on the dest machine correctly.

F.

On Mon, 2004-05-31 at 14:08, Fran Firman wrote:
I have found a problem when I was doing a restore, regarding the uid and
gid information.

I have a backup that is like..

mybackup/bin/....
mybackup/home/....
mybackup/usr/....
mybackup/var/.... etc

if I backup with rdiff-backup -r now mybackup/home/ server::/test/home/
then the uid's gid's are correct.

But if I backup the whole lot with rdiff-backup -r now mybackup
server::/test/mybackup, the uid's and gid's are not correct.

ie if there are four users under /home

fred = 1000
jo = 1001
andrew = 1002
tom = 1003

I have done one restore where all of the uid's are 1000 and on another
backup the uid's are all 103

So at the moment I am having to restore via a list of restores, of each
of the folders, instead of being able to restore the who set in 1 go.


UPDATE:

When I restored the home folder with 4 users, as /home to /home, the
first user had the correct uid's, and the others all had the same uid's
as the first user.

It is like the uid to restore with is getting overwritten, or not loaded
correctly.

Cheers

Fran


______________________________________________________________________
_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki


Post Restoring a folder. Uid not correct 
Fran Firman <fran < at > netgate.net.nz>
wrote the following on Mon, 31 May 2004 14:08:06 +1200

I have found a problem when I was doing a restore, regarding the uid and
gid information.

Hmm, what version are you running, and what are the OSes and
filesystems on both sides? Is there anything unusual about your
system? Any warnings or strange messages?

You're restoring as root right? Just checking.

When I restored the home folder with 4 users, as /home to /home, the
first user had the correct uid's, and the others all had the same uid's
as the first user.

It would be super-helpful if this mistake were replicable on a toy
example: say a directory with just two files in it, one owned by one
user and one owned by another user.


--
Ben Escoto

Post Restoring a folder. Uid not correct 
Here is an example that works, or doesn't work depending on your point
of view... :)


In a test (called test) folder create four files

mkdir test

touch file1
touch file2
touch file3
touch file4

Change the ownership of the files to ones that don't exist on the
system.

chown 2000:2000 file1
chown 2002:2002 file2
chown 2003:2003 file3
chown 2004:2004 file4

Now backup the files with rdiff-backup, as the user root.

su -
rdiff-backup /home/fran/test test-backup

Now restore the files to a new folder

rdiff-backup -r now test-backup /home/fran/test/tt

cd /home/fran/test/tt

ls -l

and the files have

fran < at > ganymede:~/t/tt$ ls -l
total 0
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file1
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file2
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file3
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file4

The wrong uid's..
F.



On Mon, 2004-05-31 at 13:14, Ben Escoto wrote:
Fran Firman <fran < at > netgate.net.nz>
wrote the following on Mon, 31 May 2004 14:08:06 +1200

I have found a problem when I was doing a restore, regarding the uid and
gid information.

Hmm, what version are you running, and what are the OSes and
filesystems on both sides? Is there anything unusual about your
system? Any warnings or strange messages?

You're restoring as root right? Just checking.

When I restored the home folder with 4 users, as /home to /home, the
first user had the correct uid's, and the others all had the same uid's
as the first user.

It would be super-helpful if this mistake were replicable on a toy
example: say a directory with just two files in it, one owned by one
user and one owned by another user.

Post Restoring a folder. Uid not correct 
Oh and BTW the backup has the correct owners, so it is only on the
restore.

ganymede:~/backups/test# ls -l
total 4
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file1
-rw-r--r-- 1 2002 2002 0 2004-06-01 08:33 file2
-rw-r--r-- 1 2003 2003 0 2004-06-01 08:33 file3
-rw-r--r-- 1 2004 2004 0 2004-06-01 08:33 file4
drwx------ 3 root root 4096 2004-06-01 08:36
rdiff-backup-data
zcat mirror_metadata.2004-06-01T08\:35\:58+13\:00.snapshot.gz
File .
Type dir
ModTime 1086035606
Uid 1000
Uname fran
Gid 1000
Gname fran
Permissions 493
File file1
Type reg
Size 0
ModTime 1086035604
Uid 2000
Uname None
Gid 2000
Gname None
Permissions 420
File file2
Type reg
Size 0
ModTime 1086035605
Uid 2002
Uname None
Gid 2002
Gname None
Permissions 420
File file3
Type reg
Size 0
ModTime 1086035605
Uid 2003
Uname None
Gid 2003
Gname None
Permissions 420
File file4
Type reg
Size 0
ModTime 1086035606
Uid 2004
Uname None
Gid 2004
Gname None
Permissions 420



On Tue, 2004-06-01 at 08:40, Fran Firman wrote:
Here is an example that works, or doesn't work depending on your point
of view... :)


In a test (called test) folder create four files

mkdir test

touch file1
touch file2
touch file3
touch file4

Change the ownership of the files to ones that don't exist on the
system.

chown 2000:2000 file1
chown 2002:2002 file2
chown 2003:2003 file3
chown 2004:2004 file4

Now backup the files with rdiff-backup, as the user root.

su -
rdiff-backup /home/fran/test test-backup

Now restore the files to a new folder

rdiff-backup -r now test-backup /home/fran/test/tt

cd /home/fran/test/tt

ls -l

and the files have

fran < at > ganymede:~/t/tt$ ls -l
total 0
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file1
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file2
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file3
-rw-r--r-- 1 2000 2000 0 2004-06-01 08:33 file4

The wrong uid's..
F.



On Mon, 2004-05-31 at 13:14, Ben Escoto wrote:
Fran Firman <fran < at > netgate.net.nz>
wrote the following on Mon, 31 May 2004 14:08:06 +1200

I have found a problem when I was doing a restore, regarding the uid and
gid information.

Hmm, what version are you running, and what are the OSes and
filesystems on both sides? Is there anything unusual about your
system? Any warnings or strange messages?

You're restoring as root right? Just checking.

When I restored the home folder with 4 users, as /home to /home, the
first user had the correct uid's, and the others all had the same uid's
as the first user.

It would be super-helpful if this mistake were replicable on a toy
example: say a directory with just two files in it, one owned by one
user and one owned by another user.



_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users < at > nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki


Post Restoring a folder. Uid not correct 
Fran Firman <fran < at > netgate.net.nz>
wrote the following on Tue, 01 Jun 2004 08:40:41 +1200

Here is an example that works, or doesn't work depending on your point
of view... :)

Fix is at

http://savannah.nongnu.org/cgi-bin/viewcvs/rdiff-backup/rdiff-backup/rdiff_backup/metadata.py.diff?r1=1.15&r2=1.16&diff_format=u

Only recent versions of 0.13.x seem to be affected.


--
Ben Escoto

Post Restoring a folder. Uid not correct 
Thanks for that.

I have tested the patch and that has fixed the problem...

Cheers

Fran


On Tue, 2004-06-01 at 07:24, Ben Escoto wrote:
Fran Firman <fran < at > netgate.net.nz>
wrote the following on Tue, 01 Jun 2004 08:40:41 +1200

Here is an example that works, or doesn't work depending on your point
of view... :)

Fix is at

http://savannah.nongnu.org/cgi-bin/viewcvs/rdiff-backup/rdiff-backup/rdiff_backup/metadata.py.diff?r1=1.15&r2=1.16&diff_format=u

Only recent versions of 0.13.x seem to be affected.

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB