[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] external hard drive.



On Thu, 2009-02-26 at 08:09 +0000, robert fallis wrote:
> I've just had a major crash, reinstalled now,but lost a lot of data.
> I'm thinking of putting my Data on to an external hard dive, in the hope
> that it will not be lost, Will this work? and is thier anything I should
> be aware of in doing?

This will certainly work, as long as it is a copy of what you hold on
the computer's internal disk. It's what I use myself as a backup
strategy (in addition to a pair of raid-mirrored drives in the actual
computer).

My very simple scheme is to use rsync to make a backup every night, then
if I leave the house for an extended period, along comes the external
drive (the data is critical to my livelihood).

Here's the script I use for the backup. It shows you how you can also
back up a remote machine (as I do) onto the drive, as well as the main
PC. The --excludes are important to avoid copying the things which you
don't want to back up.

############################################################
#!/bin/bash

# Make sure the disk is mounted
if [ -L /dev/disk/by-id/usb-Maxtor_Basics_Desktop_2HBE9P0B ]; then
  mount /mnt/usb-max-750GB
else
  echo "Backup drive is not available, exiting."
  exit
fi

# Back up the database (on heptagon) with this script before proceeding
/etc/cron.daily/mysql_backup

# Back up heptagon onto the usb disk
/usr/bin/rsync --progress -az -e "ssh" --delete \
    --exclude=dev --exclude=tmp --exclude=sys \
    --exclude=proc \
    root@heptagon:/ /mnt/usb-max-750GB/heptagon

# Back up circle/localhost onto the usb disk
/usr/bin/rsync --progress -az --delete \
    --exclude=/bu --exclude=/data/bu --exclude=/tmp \
    --exclude=/dev --exclude=/sys --exclude=/proc \
    --exclude=/mnt --exclude=/media \
    --exclude=/data/swap / /mnt/usb-max-750GB/circle

/bin/umount /mnt/usb-max-750GB
############################################################

Be prepared to wait for a fairly long time to do the initial format of
the disk into your preferred filesystem (If you use the default VFAT and
you find you need to restore from the usb disk, you will not get a
perfect copy of your system).

Be prepared also to wait some time for the initial back up, if you have
a lot of data. This script takes around an hour and a half to complete
for me, most nights, but I have a large number of files (rsync has to
compare each file on your filesystem for changes).

very best regards,

Seb




_______________________________________________
Sheffield Linux User's Group
http://sheflug.org.uk/mailman/listinfo/sheflug_sheflug.org.uk
FAQ at: http://www.sheflug.org.uk/mailfaq.html

GNU - The Choice of a Complete Generation