2

I recently installed an Ubuntu Server for home use. As it was my first time doing so, it took a while (and a few reinstalls) to configure everything they way I wanted it. The server install itself is on a small partition on my harddrive.

Is there an easy way to create an image of that partition so if it crashed I could just copy over the image to a new hard drive and boot right up? How do you back up a sever so if it crashes you don't have to reconfigure it?

I'm only concerned with being able to quickly reinstall the OS if it crashes, and not the data on it which is backed up in another location (I found some questions about how to back up user data and data files on this site, just not related specifically to a server's configuration. I'm sorry I missed something and this is a duplicate question!) Hopefully there is a better way than my current meth of just backing up relavent files in /etc/ :). Thanks in advance for your help and input!

UPDATE: I plan on keeping the backups on an external hard hard drives. Sorry I left that out, was tired last night :). Thanks for your help!

evan
  • 23
  • 1
  • 5
  • 1
    What do you plan to back it up *to*. Yes, with comprehensive backups it's possible to restore to a new HDD and continue operation; but if you want specific plans you'll have to tell us what you've got by way of backup media: USB HDD, tape, NAS, what? – MadHatter Nov 13 '10 at 08:10
  • +1 - more information from OP to give better recommendations. Shooting in the dark helps neither evan nor future readers... – Zayne S Halsall Nov 13 '10 at 18:33

2 Answers2

3

You can use FSArchiver to back up an entire partition efficiently. The simplest way is to run it from a LiveCD like SystemRescueCD, but if you partitioned using LVM you can also back up from an LVM snapshot. I recommend against using partimage because partimage backups are not robust to data corruption.

Tobu
  • 4,367
  • 1
  • 23
  • 31
  • Thanks, FSArchiver looks like it's exactly what I need. Thanks! As a side question, can it be used to backup a virtual computer in such a way that I could migrate a virtual hard drive to a physical harddrive or vise versa? (I'm thinking in the future I could set up my server in a virtual machine and then just copy to a physical partition when I have it working.) Thanks! – evan Nov 14 '10 at 01:15
  • You could, with a few caveats. Your virtual installation mustn't be too trimmed down, and you'll need to rerun grub-install so it can boot. And FSArchiver works at the filesystem level, so you'll need to prepare partitions with gparted before copying the data. – Tobu Nov 14 '10 at 02:43
2

http://gparted.sourceforge.net/ which is available right from the Ubuntu Software Center should meet your needs in making copies of the OS partition.

user48838
  • 7,393
  • 2
  • 17
  • 14
  • You're right, but the OP specifically says that his OS takes up "a small partition on his harddrive", suggesting to me that he only has the one resident HDD. He can most definitely use gparted to clone that to another partition on the same HDD, but that doesn't protect him against HDD failure. Advising him on what to do to protect against that, it seems to me, requires us to know where *else* he has avaialble to put the data. – MadHatter Nov 13 '10 at 10:07
  • gparted can be used to copy partitions between drives too, it is not limited to copying within one drive. – user48838 Nov 13 '10 at 12:40
  • thanks for your answer. I'm going to go with FSarchiver because I couldn't seem to figure out if it was possible to compress (or at least copy to a smaller/larger partition) a copied partition with gparted? (not something I initially realized would be possible which is why I didn't mention it in my original question.) – evan Nov 14 '10 at 01:18
  • The copy capabilities for gparted is basically limited to one-for-one copies. – user48838 Nov 14 '10 at 03:59