Home > Linux > Backup in Linux

Backup in Linux

September 29th, 2010 Leave a comment Go to comments

Hello all Linux users out there!

Here are some tips how to backup your system. Backup is really important but is often ignored.

Look at http://www.linuxjournal.com/magazine/hack-and-when-disaster-strikes-attack-rm-command
Think again to backup the system!!!

Amanda is a great Open Source backup solution if you’re willing to spend the time to learn how to set it up. It works very well, and there’s good support from their mailing lists.

Ref: http://amanda.zmanda.com/

BackupPC is also a nice solution for backups in Debian/Ubuntu. It should work on all Linux as well.

Ref: http://www.debian-administration.org/articles/588
Ref: http://www.linux-magazine.com/w3/issue/105/060-061_kurt.pdf

Bacula is another backup solution which can handle tape robots and disk staging. It can be compared to Legato Networker and similar big expensive products.

Ref: http://www.bacula.org
Ref: http://www.linux-magazine.com/w3/issue/57/Bacula_Backup_System.pdf

CloneZilla is a free (GPL) Software. It’s like an Open Source version of Symantec (Norton) Ghost. Filesystem supported: ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS of MS Windows, and HFS+ of Mac OS. Therefore you can clone GNU/Linux, MS Windows and Intel-based Mac OS, no matter it’s 32-bit (x86) or 64-bit (x86-64) OS. For these file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.

LVM2 (LVM version 1 is not) under GNU/Linux is supported.
Multicast is supported in Clonezilla SE, which is suitable for massively clone. You can also remotely use it to save or restore a bunch of computers if PXE and Wake-on-LAN are supported in your clients.

Ref: http://clonezilla.org/

Mondo is comprehensive. Mondo supports LVM 1/2, RAID, ext2, ext3, ext4, JFS, XFS, ReiserFS, VFAT, and can support additional filesystems easily: just e-mail the mailing list with your request. It supports software raid as well as most hardware raid controllers. It supports adjustments in disk geometry, including migration from non-RAID to RAID. Mondo runs on all major Linux distributions (RedHat, RHEL, SuSE, SLES, Mandriva, Debian, Gentoo) and is getting better all the time. You may even use it to backup non-Linux partitions, such as NTFS. Mondo is free! It has been published under the GPL v2 (GNU Public License), partly to expose it to thousands of potential beta-testers but mostly as a contribution to the Linux community.

Ref: http://www.mondorescue.org/

Arkeia could be a commercial alternative. Manages cross platform but ain’t free, although they offer a free test for very small Linux users:

Arkeia Network Backup, Free Edition is fully-featured and is not time-limited. One free, perpetual license is granted per individual (for personal use) or per company (for corporate use) and only web registration is required. The no-cost license includes:

  • One backup server for any Linux distribution,
  • Two backup agents to protect two machines including Windows workstations and any Linux, Mac OS X and BSD machines,
  • Support of up to 250GB capacity for backup to disk,
  • Support of any single tape drive for backup to tape, and
  • Technical Support via on-line forums, knowledgebase, and Arkeia’s documentation wiki

Ref: http://www.arkeia.com

Backup your hard drive over the network with dd and ssh

Since hard disks on unix systems are just represented as files you can do exact copies of them with it. It’s strength is really it’s weakness. It copies all the data on the disk if you tell it to copy your harddrive. That means everything. Even data that is was on the disk before but was not written over. Unless you wipe the disk with a disk wiping program (writing zero’s across it) the previous data (if there was any) is still there. Copying every bit means it takes a very long time. We are talking hours to copy a disk. But your copy is exact. Partition info, boot sector info, everything.

I wanted to copy everything off the disk and send it over the network. So we can do it with ssh. First zero out the non used space on the running disk to make compressing the image much eaiser. Using the command (if you have 20MB of free space on your hard drive):

dd if=/dev/zero of=0bits bs=20M; rm 0bits

Then boot knoppix (or any other bootable linux distro like sysrescuecd) from the machine you want to image and give the command:

dd if=/dev/sda | gzip -1 – | ssh user@hostname dd of=image.gz

Assuming sda is your hard drive. This sends the local disks data to the remote machine. To restore the image boot knoppix on the machine to restore and pull the image that you created and dump it back with the command (assuming you want to restore to the hard drive called /dev/sda – BEWARE! This can damage your present data if you’re making a misstake when typing the output device name!):

ssh user@hostname dd if=image.gz | gunzip -1 – | dd of=/dev/sda

This will usually take a few hours so be prepared.

Ref: http://www.pantz.org/software/dd/drivecopywithsshanddd.html

Categories: Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.