Problems with restore

Asked by Martin Fisher

Following a computer failure I am using somebody else's laptop but I am having problems restoring my files from a usb drive so that I can access them. I have installed testing backintime on the temporary laptop and was prompted to restore my profile, which I have successfully done. However, when I navigate in BIT to the folder I wish to restore it appears to be empty (although it is not: I can see the files if I use BiT root).

This is a permission problem I presume but I am uncertain how I should restore files to the temporary Ubuntu laptop (where I have created an account for myself) so that I can access them.

Should I do a restore as root? I successfully did this with one test file but when I try to access it on the temporary laptop I am unable to do so as the owner and group of the folder appear to be for the other user account on the laptop (even though I am logged in as myself and am an administrator).

I would be grateful for any suggestions by those more knowledgeable than myself. Should I, for example, do the restore in some other way. I have spent the whole day trying to sort this out and now have little hair left...

With grateful thanks, Martin

Question information

Language:
English Edit question
Status:
Answered
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Germar (germar) said :
#1

Hi Martin!

This sounds like an UID permission problem. For example if your user on your old system was the first (and maybe only) user it had the UID 1000. Now you created a new user on the second system which will get UID 1001 because 1000 is already in use. File permissions only store this UID and not your username. You can see your UID with 'id' in Terminal.

You could restore your files either with root or with the user having the same UID as you had before (that should be the one who is shown as fileowner by 'ls -la' in the snapshot folder). After restoring (no matter if you used root or the other user) you need to change the ownership of all files and folder. This can be done with 'sudo chown martin -R /path/to/files' where 'martin' is your username.

Kind Regards,
Germar

Revision history for this message
yusuf.martin@gmail.com (martin-pescador) said :
#2

Hi Germar

Many thanks for this helpful information: this all makes sense and I have managed to transfer files and change the ownership...phew.

For the future (once I have a new computer, for example), can I presume that if I am UID 1000 and the same user and group as the old computer, I will be able to make a restore without needing to change ownership of the files afterwards?

With grateful thanks, Martin

Revision history for this message
yusuf.martin@gmail.com (martin-pescador) said :
#3

Herewith some further information. It transpires that if I do a restore and then sudo chown, etc... I can no longer log into my account (login goes into an endless loop of loginscreen-enterdetails-loginscreen-etc). Tried everything I could find/think of but in the end had to go into the other account on the laptop and, with sudo, copy across my files, delete my user account, recreate it, copy across files.

I don't know whether the problem was created by the restore, or by the sudo chown... command. I would be grateful for any ideas! At the moment I have only restored essential files and am holding off restoring more (as this has happened twice).

Wtih thanks, Martin

Revision history for this message
Germar (germar) said :
#4

Hi Martin,
on your new computer you should be fine if you have the same UID again (just create the users in the same order you did on your old machine).

It could be that the login-loop-problem was caused by hidden files (starting with a dot) which where not changed in ownership. You could try to run 'sudo chown martin -R .*' inside your home (note the dot).

Revision history for this message
yusuf.martin@gmail.com (martin-pescador) said :
#5

Hi Germar

Many thanks indeed for this further help. As I now have a functioning system - having copied files/folders as required from BiT backup, rather than using restore) I am not going to test by using a restore followed by your useful new chown suggestion - but I will bear it in mind for the future!

I shall use restore on the new laptop, however. So, one last question: I presume that if I am UID=1000 then a restore from the backup (where I was also UID=1000) will restore using the former permissions and ownership? I believe the previous laptop was host martin-laptop and name martin. Do I need to keep them the same?

With thanks, Martin

Revision history for this message
Germar (germar) said :
#6

Yes, ownership and permissions should get restored just fine. If you name your new laptop hostname or username different you need to switch of 'Auto Host / User /Profile ID' and change the values for Host and User to match your old machines names.

Revision history for this message
yusuf.martin@gmail.com (martin-pescador) said :
#7

I finally have a new computer and wish to restore my backintime backup but I have run into an unexpected problem! Although I am the first and only user on the new laptop, I have the uid and gid 1001 (I have no idea why). My backup has uid 1000. I am unsure what my best approach is to do a restore. I don't really want to mess with the uid on the laptop - it is beyond my expertiese. Could I simply change the uid of the backup and all nested folders and files?

Reading http://superuser.com/questions/208606/how-to-change-file-permissions-for-a-directory-in-one-command, it suggests I should use

chown -R username:groupname

I would appreciate some advice before I start meddling.

Many thanks, Martin

Revision history for this message
yusuf.martin@gmail.com (martin-pescador) said :
#8

...well I decide to start meddling anyway after some further reading and I post my progress here in case it is of help to anybody. I couldn't see any reson why my new installation is uid 1001 rathe than 1000, and there was no user with uid 1000. I therefore followed information I gleaned from http://askubuntu.com/questions/16700/how-can-i-change-my-own-user-id and http://askubuntu.com/questions/312919/how-to-change-user-gid-and-uid-in-ubuntu-13-04 to change my uid and gid (user and group ids) to 1000. All went well.

Using BiT to do a restore did not go so well, as read-write permissions were not retained. I therefore used

cp -a pathtocopyfrom pathto copyto

and this respects permissions. It is a bother to use however as the path to the backintime files is very long. For future use I would like to know how to ensure that a restore preserves file permissions, if possible.

With thanks, Martin

Revision history for this message
Germar (germar) said :
#9

Hmm. Not sure, why permissions failed. Could you send me a log? It's under ~/.local/share/backintime/restore_.log

Did you use 'full rsync mode' for that snapshot?

Can you help with this problem?

Provide an answer of your own, or ask Martin Fisher for more information if necessary.

To post a message you must log in.