Proper backup and restore -- is there a way?

Joep L. Blom jlblom at neuroweave.nl
Thu Jan 26 08:49:39 UTC 2012


On 26-01-12 06:39, Marcus Reid wrote:
> Hi,
>
> I am trying to find out the best way to make backups of an Ubuntu
> machine that allows me to restore to bare metal, boot, and go home.
> As an example of what I'm looking for, here is how I do it in FreeBSD
> and Solaris:
>
> FreeBSD (ufs):
>
>    - Use 'dump' (with -L) to dump consistant snapshots of each filesystem
>      (no need to shut down databases to ensure consistency, etc.)
>
>    - When it comes time to restore, boot off of cd/thumbdrive, 'fdisk
>      -BI' for the mbr, partition disk and install 2nd stage bootloader
>      with 'bsdlabel', 'restore' each partition, and reboot.  Go home
>      and go back to sleep.
>
>    - I have not tested any backup/restore of ZFS-based FreeBSD machines.
>
> Solaris (zfs):
>
>    - make a zfs replication stream of snapshots of all partitions in the
>      root pool with 'zfs snapshot -r rpool at now', then 'zfs send -R
>      rpool at now>  backupfile'.  Do the same for other pools, if any, being
>      backed up.
>
>    - Netboot the machine to a jumpstart server or boot off of install
>      media, and use the procedure documented at:
>
>        http://docs.oracle.com/cd/E19963-01/html/821-1448/ghzvz.html#ghzur
>
> Now, with this Ubuntu box (ext4) I'm seeing a couple of things that I
> would like to find solutions for:
>
>    - lack of snapshots prevents dumping of an active filesystem without
>      corrupting active databases, etc.
>
>    - how does one go about restoring to bare metal with Ubuntu?  Boot
>      off of install media, partition, and lay down dumps?  Are there
>      special considerations for the /dev/md0 /boot partition and the
>      device mapper partitions?  For example, here is what I've got to
>      work with:
>
>          mreid at socit:~$ mount
>          /dev/mapper/socit-root on / type ext4 (rw,relatime,errors=remount-ro)
>          proc on /proc type proc (rw,noexec,nosuid,nodev)
>          none on /sys type sysfs (rw,noexec,nosuid,nodev)
>          none on /sys/fs/fuse/connections type fusectl (rw)
>          none on /sys/kernel/debug type debugfs (rw)
>          none on /sys/kernel/security type securityfs (rw)
>          none on /dev type devtmpfs (rw,mode=0755)
>          none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
>          none on /dev/shm type tmpfs (rw,nosuid,nodev)
>          none on /var/run type tmpfs (rw,nosuid,mode=0755)
>          none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
>          none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
>          /dev/md0 on /boot type ext4 (rw)
>          /dev/mapper/socit-tmp on /tmp type ext4 (rw,nosuid,nodev,relatime)
>          /dev/mapper/socit-home on /home type ext4 (rw,relatime)
>          /dev/mapper/socit-var on /var type ext4 (rw)
>
> I have asked around a bit and have not seen much in the way of peoples
> actual methods, so I would love to hear what you do when faced with a
> dead system that needs to be restored.
>
> Thanks,
>
> Marcus
>
Look at backuppc. It's in the repositories and makes a complete backup 
of all file systems you indicate. It is very complete, letting you 
backup all systems on a network even systems that are not always on the 
network (laptops, etc.). It works completely in the background and 
automatically. It's interface is browser oriented.
I use it now for over 2 years and it saved me when my main HD 
unexpectedly crashed and I could restore all my documents, sheetmusic, 
recorded music, etc. by simply restoring my home directory. If I hadn't 
had backuppc work of over 7 years had been lost!.
I don't know if you can make snapshots with it as on a new HD I simple 
reinstall ubuntu and let backuppc restore the most important directories 
(/home,/etc).
Of course you must use an external HD to store the backups and it is 
very handy to have a list of most used applications that are not 
automatically installed when installing a new OS.
Just my advice,
Joep



More information about the ubuntu-users mailing list