Obnam restore

Having done a restore and re-install recently of my Debian wheezy box, I made notes on what exactly I did. This was a 'planned' restore in that I decided at about 1430 to start the restore now rather than wait for doing it tomorrow. Whilst Obnam was completing its backup I did some groundwork, like storing my 'backup-notes.txt' on my backup drive. In this document I wrote down things like the exact configuration to do a restore. It could be quite complex so I wanted to list them first, along with how to get the generation number for the backup to use. Once obnam had finished, I did a quick rsync backup of ~/cron which also contained a load of data files, and my zim wiki which has got lots of valuable information in it, including a copy of the obnam man page.

sudo obnam --config=/home/boudiccas/cron/conf/obnam.conf generations>/home/boudiccas/cron/generate.txt

this lists all the generations in the active backup system and lists them in 'generate.txt'. This is a similar listing

111833 2013-10-22 08:00:20 .. 2013-10-22 08:18:21 (183308 files, 246634944350 bytes)

where the first number '111833' is the generation number used for backups and restores. So the actual restore command that I was going to use was this -

sudo obnam --config=/home/boudiccas/cron/conf/obnam.conf --generation=113746 restore /home/boudiccas --to=/opt/

I restored to /opt because I've learnt through experience that if you restore to /home then your restore will stop and break leaving you half-restored and trying to continue unsuccessfully!

So first you do your Debian wheezy reinstallation, in this case from a 'net.iso' which means that you get a base install, just enough to get it running independently, and it then updates from the repos online. When it finally finishes you have a completely up-to-date machine requiring nothing to be done except you installing the programmes that you want to use. In my case this was done mainly with my reinstall.sh script, as mentioned in "Reinstall, jdiskreport, emptyTrash, debian-timescale, startup, podcasts http://www.sharons.org.uk/2013/01/28/reinstall-jdiskreport-emptytrash-debian-timescale-startup-podcasts/"

When this completes you can immediately start doing your obnam restore from backup. In my case it refused to start saying (roughly) "London is not a recognised client". The hostname of my machine was London before, and it was London again, so back to Backup v5.6 again, and this threw me and required some time to track down and correct. It turns out that the hostname of my previous setup was 'london', and the hostname of today's setup is 'London'. It should not be capitalised, so I had to use nano like this

sudo nano /etc/hostname

and change it from London to london.

Then I tried my restore command again, and it started working so I left it alone, and eventually went to bed. Some time later I checked on it, and it had almost finished restoring to /opt/home/$USER and eventually completed with these statistics - 225.8gb restored in 5h7m18s. Knowing that it is going to take a long time, its wise to have a good book to read :)

Then comes the arduous task of transferring your /home from /opt to its normal place, which doesn't really take long, its just fiddly and requires concentration to sort out whether to over-write x file or leave it uncopied. Once everything is in its rightful place, then you can reboot and log into your favourite Desktop Environment, in my case fluxbox, and continue with configuration of various things like sound, getting MPD to work again, and starting regular backups too.

MPD restore

Because I keep copies of various configuration files in ~/cron/conf, they are regularly backed up with obnam, and also with my 'backup' script nightly with rsync, as mentioned here Backup v5.6. So it was just a matter of using the relevant config files and either amending them in /etc, or of copying them over again.

First of all,

  • you need to amend /etc/mpd.conf so that everything is commented out, which means that you need to put '#' in front of every open line in it.
  • Next open /etc/default/mpd and amend these lines like this -
  • If you don't amend 'START_MPD=false' then you wont be able to run MPD as the $USER.
  • Next /etc/init.d/mpd needs to be opened, and these lines need to be updated -

Then .... reboot! MPD wont run unless you reboot! It allows everything to just run and do its job.


comments powered by Disqus