Efficient System Backups


My OpenSUSE setup has become quite complex and so I would like to back it up in order to shorten the time it takes to restore from backup and get the system running. I already have an excellent way to back my data (documents, photos, downloads, etc), so this need not be a solution for those.

What I want to be able to restore is:

  • Operating system (Using 11.2 64bits)
  • System settings (Things like the /etc/hosts file, services, apache2 setup)
  • Applications (Most installed through Yast, some from RPM and scripts from tar/gz files)
  • Application settings (things in /home/<username/.* for example)
  • Virtual machine for Parallels

What I care about is restoring my exact configuration efficiently. I do not mind not having every binary to do it stored. So I’m thinking something like this:

  • Installation of the OS from the DVD media.
  • Have a list of all packages on my system and a way to install/download all the needed ones and remove the unneeded ones.
  • Apply system configuration, basically all changed files from the point there were installed (except for logs)
  • Apply application configuration.

I expect to need different software to do this, so if you know even how to implement one of the above, please let me know.

Thanks in advance,

  • idanan,

easy, yet disk space consuming method: Make images of your system.
Rather easy, not so powerful method: Yast’s Backup

Else we are talking about professional backup solutions where you have to know well what ypu do. Check bacula: http://www.bacula.org


Very easy method if you have enough spare disk space, on an external disk for example, and your system is partitioned well so the system is seperate from your data.

Simply using rsync -Sax, can update a copy of / filesystem. Repeat if you have /boot, /var or /usr seperate.

Then should you need to replace internal hard disk, you can simply copy it back, then you can run CD/DVD (Live or installer) and YaST Bootloader module to reinstall GRUB, should you require baremetal recovery.

A 8 or 16 GiB flash drive is an inexpensive and convenient backup solution for the whole system partition.

There are many easy solutions to backing up /home but that’s not your problem.

To backup /etc/, /var and all that you need root privileges but most common backup apps - even the simple ones like BackinTime, fwbackups etc - can easily be run as root.

To backup the entire system for a “bare metal restore”, you need something like Clonezilla or another disk mirroring rather than file backup application.

Thanks for all the replies. I’ll be trying them out and go from there!

It’s me again :slight_smile:

All the solutions proposed are quite good. I particularly like the simplicity of using rsync since I use a combination of removable drives and DVDs for my data backups anyways.

Now, I’d like to plunge a bit further into system backups. All the answers given cover the case of a hard-drive failing or corrupting, because the system restored should work 100% as the old one once the hard-drive is replaced, even if the exact size is not the same.

Another scenario I’d like to look at is the case where I must restore my backups on a different system. Say the system gets stolen or burns, or gets otherwise destroyed… It won’t be possible to get the same hardware if it is more than 2 or so years old, so I have to be able to get up and running as fast as possible on a possible different system.

Now, as I said before, I know how to get my data back efficiently, it is the “system” I’m consdered, although in such scenario it will most likely different. What still needs to be restored is all the packages (system or apps) and their configuration (generated via config options or edited manually).

How would one do this kind of thing?

Is there a way to export the list of packages from the system and list of modified configuration files? And a way to take a new fresh OpenSUSE install and give it this list and the modified files (as diffs most likely) to produce a system as close as possible to the original one? It should work with any config I’ve edited like the hosts file, apache config and service started status, etc.

Thanks in advance,

rpm -qa --queryformat '%{NAME} ’

Will list all packages installed by Yast/RPM. Any you installed by compiling they won’t be in the list.

rpm -qa --queryformat '%{NAME} ’ > rpm.bak

will write this list to a file called rpm.bak

You can then use this list to restore on a fresh system.

zypper install $(cat rpm.bak)

fwbackups writes a list of rpms to a text file automatically.

You can always make an image of a partition, and restore that to a like-sized partition on another drive. dd and gzip are the relevant commands. Factors to consider: the partition image files take up space; and the imaged partition should be unmounted. But, disk space is too cheap these days to worry about, and you should have a bootable cdrom around anyway.

I use Puppy Linux, and keep a few / and /home partition image files around.

Hope this helps.

No that is not true! You simply need a copy of all the files, and then re-install the GRUB map file (needed to find filesystem specific stages) so you can boot.

Otherwise simply using cp -ax & rsync -ax would not be able to move the / filesystem. It is when moving /boot with GRUB or lilo files in it, where extra step is required.

Then you do it in same way, but now you need to boot from DVD/CD-ROM and re-make the initrd for the kernel.

The reason is if you may well need different drivers to read the disk, with a different chipset, so different modules in the initrd are required to mount / successfully.

I have done this by chroot-ing into the on-disk installation (with Live CD for different distro), but you really need to understand things in depth, Gentoo install docs (installing from another distro) helped me do this successfully.

The solution for most users, is to do an install on new machine into a new partition, and then copy over the relevant kernel files.