basic dd if=/dev/hdc of=/dev/hdd (to clone) dd if=/dev/hdc of=/path/to/file.img (backup to file) dd if=/path/to/file.img of=/dev/hdc (restore from file) --Assumes that hdc is smaller or equal in size to hdd stdin/stdout dd if=/dev/hda | ssh 10.1.1.2 dd of=/dev/hda dd if=/dev/hda | ssh 10.1.1.2 dd of=/path/to/file.img ssh 10.1.1.2 dd if=/path/to/file.img | dd of=/dev/hda --You will be prompted for password unless you setup key exchange --Great for backing up a system before making any major changes - easy to roll back g4u (ghost for unix) consists of floppy or bootable CD with NetBSD kernal and a few shell utils requires ftp server to store the resulting images image is gzip'd on the fly to save space tips and tricks boot system to be cloned with knoppix, tom's root boot, rescue image, etc, do NOT try to dd a live, active mounted filesystem make disk images smaller by zeroing out unused space (on each filesystem) and compressing dd if=/dev/zero of=/home/tmpfile bs=1k see www.cpqlinux.com/sshcopy.html for lots of examples FILE backup one flexible and powerful method is to mount directories from other hosts on the network once a directory or filesystem is mounted it looks acts as if local this "pull" method is generally very safe since the client shares can be set read-only all scripting is run from the backup server, not the client For windows hsots, "share" the directory and use smbmount to mount it smbmount //winhost/c /mnt/smb -o guest For *nix hosts, add directories in /etc/exports and make them available using NFS mount -t nfs 10.1.1.2:/home /mnt/nfs For OS X, either method Heavy Lifting once a remote dir is mounted, several ways to copy cp -av /mnt/smb/* /backup/winhost/ tar -cvzf /backup/tarball /mnt/smb/ rsync -av /mnt/smb/ /backup/winhost/ (note trailing slash) make sure backup device is slower than the source and/or network (optical media especially) Tapes and tarballs only few commands most tapes are recognized as /dev/st0 tar -cvf /dev/st0 /home /etc /var (to backup) (could use z for hardware compression) tar -xvf /dev/st0 /tmp (to restore) (maybe not use v when streaming data to tape??) other basic commands mt -f /dev/st0 rewind (rewind tape) mt -f /dev/st0 offline (to eject) RSYNC! rsync at its lowest level basic syntax is just like 'cp' rsync [-av] rsync -avze ssh --progress --exclude rsync/ /home/trilug/foo/ example.com:/home/foo/foo-backup I need the TriLUG presentation!!! my rsync needs help!!! NEED to setup ssh keys... *sigh* rsback possible for me?! rdiff-backup, rsnapshot (may require special util for restoration) Tonight's talk is posted here: http://www.trilug.org/talks/2004-05-backup/ Here are the links we referred to in tonight's meeting: Network File Copy with SSH: http://www.cpqlinux.com/sshcopy.html Easy Snapshot-Style Backups with rsync: http://www.mikerubel.org/computers/rsync_snapshots/ rsback: http://www.pollux.franken.de/hjb/rsback/ rsback startup script: http://www.trilug.org/~jeremy/run-rsback.sh Introducing ssh-agent and keychain: http://www-106.ibm.com/developerworks/linux/library/l-keyc/ [part 1] http://www-106.ibm.com/developerworks/linux/library/l-keyc2/ [part 2]