Backup corrupted by restore process (admittedly, with user error)

Asked by Jon Brase

I had lost the ability to log in to my system with my usual desktop environment due to what I suspected to be user profile corruption, so I logged in with an alternate desktop environment tried restoring my home folder from a BIT backup. I did not initially realize that I needed to explicitly tell BIT to delete existing files in order to restore the old state of files already on the drive, so this initial restore did nothing and did not resolve my problem. I then tried restoring / instead of ~/, and ran into the same issue. It was after this second restore that I realized I needed to explicitly tell BIT to restore existing files. I then did another restore of / (of course, at this point I *should* have tried restoring ~/ again), and, in a flash of idiocy, did it from the running system instead of from a LiveCD.

I had set up BIT to exclude /media, so that the backup itself would not be recursively backed up. When I ran this final restore, BIT saw that /media was empty on the backup, and "deleted" everything on the running system that was under /media (meaning that it renamed everything from "*" to "*.backup.20150223"). Then, because of other issues having to do with why one should never run a root folder restore on a running system, the system became completely inoperable (to the point that I couldn't open a shell by any means) and BIT died completely without, as far as I can tell, actually completing the restore.

So I've managed to render my OS unbootable and to make every backup on my backup drive not immediately usable (all the data is there, but the filenames have been changed).

Before I screw myself over worse, what's the best way to get my backup back to a consistent state so that I can perform a restore the right way from a Live CD?

Question information

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

Hi Jon,
Sorry, I didn't thought about such an issue. I should have prevented this when I added the 'restore and delete' function.

To get back your snapshots please change into your snapshot folder and run:
find ./ -name "*.backup.20150223" -print | rename 's/\.backup\.20150223$//'

BTW "to restore the old state of files already on the drive" a simple restore (without delete) should be enough. Files which had changed will be overwritten. "Restore and delete" is only necessary to delete those files which were ADDED after that snapshot.

Regards,
Germar

Revision history for this message
Jon Brase (jonathan-brase) said :
#2

The find/rename pipe has solved the filename corruption problem.

At this point, however, I'm trying to figure out how to restore a backup from a LiveCD. When I start BIT, it asks me to create a backup profile for the purposes of backing up the currently running environment, but I don't want to back up the LiveCD environment, and I can't seem to find a way of pointing BIT at the existing snapshots to restore them.

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

Please install the latest version from PPA with 'sudo add-apt-repository ppa:bit-team/stable && sudo apt-get update && sudo apt-get install backintime-qt4'

At first start it will ask you to restore configuration. You might need to adjust the path to match the mountpoint of your backup drive. Than mount your local filesystem in /mnt and restore to /mnt

Revision history for this message
Jon Brase (jonathan-brase) said :
#4

Backintime-qt4 dies with an error after installing the PPA package. Backintime-gnome fails silently.

This is on an Ubuntu Mate 14.04 LiveCD.

The complete output of backintime-qt4 is:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'net.launchpad.backintime.serviceHelper': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/backintime/qt4/app.py", line 1363, in <module>
    cfg = backintime.start_app( 'backintime-qt4' )
  File "/usr/share/backintime/common/backintime.py", line 156, in start_app
    cfg = config.Config(config_path)
  File "/usr/share/backintime/common/config.py", line 270, in __init__
    self.setupUdev = tools.SetupUdev()
  File "/usr/share/backintime/common/tools.py", line 1055, in __init__
    conn = bus.get_object(SetupUdev.CONNECTION, SetupUdev.OBJECT)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1

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

Hi Jon,
I just downloaded ubuntu-mate-14.04.1-final-desktop-amd64.iso and tried to confirm this in a VM but it does work like expected here. Could you please try again maybe with a different Live-CD? This one:
http://releases.ubuntu.com/trusty/ubuntu-14.04.2-desktop-amd64.iso

Regards,
Germar

Revision history for this message
Jon Brase (jonathan-brase) said :
#6

It appears that my previously having installed the Ubuntu-repository-default version had confused things somehow. A reboot from the same disk, with the direct installation of the PPA version, solved the issue. The restore is running now.

At this point, I *think* everything is solved from the BIT side. I'm fairly confident that the machine will boot and I'll have at least some sort of working environment once the restore finishes...

So here's hoping that a restore to the state of the machine on the morning of the 23rd fixes the issue that started this whole mess...

Revision history for this message
Jon Brase (jonathan-brase) said :
#7

My system is now running approximately as well as it was before I did the restore.

I do have some concerns: BIT froze at a point that made it difficult to tell if the restore had been completed. The fact that my machine boots suggests that it had been completed, but BIT never let me know that and had to be killed (it was using up 100% CPU on one core, but wasn't actually doing anything). Also, the permissions on my ~/.dmrc file were not properly set, which suggests that BIT may not have finished restoring permissions on all files. I have a feeling I'll have to wait for something to bite me in the rear before I know what other than my .dmrc has been affected, though.

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

Could you please rerun the restore? But this time start backintime-qt4 from terminal and post the output if it freeze again.

Revision history for this message
Jon Brase (jonathan-brase) said :
#9

I'm currently trying to troubleshoot the issue that started the whole mess, so I'd prefer not to boot back into the LiveCD environment, but I'm currently running a restore of my 2/23/2015 backup from my running system into a subfolder of my home folder (lesson learned about restoring to the root folder of a running system!), and will see if I can duplicate the issue that way. If not I will boot back into the LiveCD environment.

Revision history for this message
Jon Brase (jonathan-brase) said :
#10

I get the following output up to the point that it freezes:

$ pkexec backintime-qt4

Back In Time
Version: 1.1.2

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime-qt4 --license' for details.

no crontab for root
Clearing all Back In Time entries
no crontab for root
Clearing system Back In Time entries
Profile: Main profile
Automatic backup: Disabled
/media/[username redacted]/Backup/BackInTime/backintime/[hostname redacted]/root/1 does not exist
Check snapshot folder: /media/ubuntu/Backup/BackInTime
Clearing system Back In Time entries
Profile: Main profile
Automatic backup: Disabled
WARNING: Inhibit Suspend failed.
INFO: Restore: / to: /mnt
INFO: Command "rsync -rtDHh --links --no-p --no-g --no-o --info=progress2 --no-i-r -R -v --chmod=Du=rwx,Fu=rX,go= --backup --suffix=.backup.20150304 "/media/ubuntu/Backup/BackInTime/backintime/[hostname redacted]/root/1/20150223-110002-673/backup/./" "/mnt/"" returns 0
INFO: Restore permissions

------------------------------------------------------------------------------------------------------------------

Beyond "INFO: Restore permissions" there is no further output.

pstree on the process for backintime gives this:

$ pstree 4670
backintime-qt4───python3─┬─ssh-agent
                         └─2*[{python3}]

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

Thanks Jon!

There is a new bug report. I think this is the same problem.

Regards,
Germar