[TriLUG] Linux Backup Strategies
Aaron S. Joyner
aaron at joyner.ws
Wed Jun 16 07:37:18 EDT 2004
dd if=/dev/hda of=/path/to/samba/share/image.dmg
To dump a full-sized image of your disc to the samba share, the above
command will do the trick. On the other hand, if you'd prefer a more
elegant solution (which only works over ftp) check out the g4u package.
If space over speed is a concern, you can also compress the image like so:
dd if=/dev/hda | gzip > /path/to/samba/share/image.dmg
As an additional concern, if you'd like not to take up more space in the
image than necessary, at the expense of not being able to "undelete"
anything you may have already deleted (not such a big concern, imho) -
you can clear out all of the once-used space on the drive, like this...
dd if=/dev/zero of=/zerofile.tmp ; rm /zerofile.tmp
If you have more than one partition, you'll need to create a zero file
like the one above, for each partition. A bash script to automate that
based on /etc/fstab shouldn't be more than about 6 lines. Keep in mind,
that of course if you have more than one disc in the computer you'll
need to do it for each disc, and of course you may need to adjust the
/dev/hda references above if you're not using a single ide drive located
as the primary master.
Personally, I wouldn't do it image-style as this suggests. I would use
tar or dump, as it creates a more concise image, and gives you the
flexibility of doing incrementals in the future. Also, tar or dump will
give you the ability to easily do individual file restore. As another
step in the direction of elegance, Jeremy presented on rsync backups
using rsbackup at the May meeting. It's yet another "better" solution,
although depending on your purposes it may be cumbersome over smb.
All of this was covered in Jeremy's and Jason's recent backup
presentation. The presentation itself should be searchable in the
archives, sometime around the 2nd tuesday of May. Hope that's a start! :)
Aaron S. Joyner
Tarus Balog wrote:
> Okay, so I should have come to the meeting on this topic, but I have
> a quick question that I hope someone here can answer.
> I want to take an image of a Linux box and store it on an SMB share
> as a backup. Any ideas about getting this to work? If the image can
> be created and stored, how could it be restored?
> P.S. The client is a Windows shop and they do have Ghost. Anyone use
> Ghost to back up Linux boxen?
> Tarus Balog, OpenNMS Maintainer Main: +1 919 545 2553
> Blast Internet Services, Inc. Fax: +1 503-961-7746
> Email: tarus at opennms.org URL: http://www2.blast.com/tarus
> PGP Key Fingerprint: 8945 8521 9771 FEC9 5481 512B FECA 11D2 FD82 B45C
More information about the TriLUG