New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

COPY from backup

Got problems with your B2 or B3? Share and get helped!
Post Reply
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

COPY from backup

Post by LudwigVan »

Hi, now I updated my B2 with Bubba 2 software version 2.4.1. I made a fresh new install. Before I backuped everything in the data partition. I have 3 different users. Now I want to copy the data back to the users directories. How can I do that.

I made the backup with rsync so properties and user rights are still kept from the old installation.

L.
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

Ok, just to make it more detail.

I made the backup using

Code: Select all

 rsync --rav
which preserves the user rights and time stamps. Now I want to copy them back to the new user directory. I am not very familiar with rsync, but it seems that he userrights are preserved also, when I copy the data back. This leads to not beeing able to delete or copy or even access the files. So what parameters do I need to set If I just want to preserve time-stamp?

L.
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: COPY from backup

Post by Gordon »

The issue may be that your users are not the same. The owner and group that are assigned to folders are registered as integer numbers that are matched against the PAM database (in most cases, including Bubba, the passwd, shadow and group file).
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: COPY from backup

Post by RandomUsername »

Code: Select all

man rsync
will give you information on all the different switches. If you're having trouble with permissions then run the command as root.
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

ok I think

Code: Select all

rsync -rltgov
will do. I am copying with root anyway. If I sync into the users folder are the rights assigned of the users?

L
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: COPY from backup

Post by Gordon »

No

The rights are kept like they were; e.g. if a file originally belonged to user 1001 then it will be restored as belonging to user 1001 regardless of whether this user exists on the system where it is restored to. Similarly if on the original system the files belonged to user Sven but on the target system user 1001 is named Anna, then Sven's restored files will belong to Anna.
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

ok. what to do then?

I can plug the hdd to my linux computer and assign new rights. Meaning read, edit and so on for all users. Would that do?

I mean, whats the use of doing rsync for backup if I can not copy the files back?

L.
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

I named the users the same. Now how can I check whats the user id on bubba and on my files?

L.
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: COPY from backup

Post by Gordon »

The shell command `getent passwd` will show you the users and their numerical ID. Of course since the original system does not exist anymore, that will not give you the information you need because there's nothing to compare it to.

A dead giveaway if you restore to a new system is to verify the owner of each folder in /home; obviously you want each of those folders to belong to a user with the same name. Every mismatch you see there will also count for other files and folders of that user.
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

Ok. Then I am left with resetting the user rights to all users and distribute the files as they belong to each user.

:?

L.
johannes
Posts: 1470
Joined: 31 Dec 2006, 07:12
Location: Sweden
Contact:

Re: COPY from backup

Post by johannes »

In my experience it always works if you simply create your new users in the same order as you created the old ones. And of course, don't remove or add any new ones.
/Johannes (Excito co-founder a long time ago, but now I'm just Johannes)
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

I will give it a try. If it not works I just will set up the server as third time. However I already have folders and files which are without user and thus can not be deleted. They belong technically to the third user I created. However after syncing the storage folder for test end tried to delete the content I realized they stay. I can only read the content but not write into the folder and so on. Although storage must be accessible to all users, theoretically. So this is strange.

This just tells me that my third user has a different ID compared to the first installation.

What I do not understand is that apart from admin the users have the following ID

Code: Select all

user2 1001
user3 1002


We will see.
nobody
Posts: 226
Joined: 10 Mar 2012, 14:46

Re: COPY from backup

Post by nobody »

you can change the user id by editing /etc/passwd. It's not really the way it's meant to be used, but it's effective
LudwigVan
Posts: 50
Joined: 20 Aug 2009, 01:17

Re: COPY from backup

Post by LudwigVan »

:wink:
Post Reply