4

I am searching for a tool to assist me in making backup images of remotely running VPS servers. Thanks!

noname
  • 115
  • 2
  • 6

3 Answers3

2

To create full, working images nothing works better then dd.

mount your root system read-only; a bit tricky, you need to make sure nothing writes to the fs and then issue

mount -o ro -n /

(-n makes sure that the mount itself doesn't write to the filesystem)

and copy the contents using dd:

dd if=/dev/sda1 of=/otherfilesystem/imagefile.img

You can also create an empty filesystem:

dd if=/dev/zero of=/otherfilesystem/file.img bc=size

and format the file using mkfs.ext3 (or whatever your root is using).

after that you can mount the file and create /proc or /dev folders; you can also run grub on that file to make sure it boots the way you want. After you are done, pack all that in a script...

mik
  • 199
  • 2
  • 12
  • You can do this with a running system as well. Turn off all the services you can. In this case you will want to run fsck for the filesystem image after it is made. You may run into some files that were were being written while the image is being made. If these are text or log messages it may not be a big deal. Since dd copies all o the blocks, with or without data, I'd suggest that you compress the image while creating it, especially if you are going to copy it across a network. You may also want to look at dump or xfsdump if you are using ext2/3 or xfs. – Rik Schneider Aug 07 '09 at 01:51
1

You may use rsync, duplicity (I'd suggest with ftplicity) or dar.

Or, as already said, LVM or filesystem snapshots (some filesystems like XFS support snapshots), but these snapshots tend to be more space wasting than explicit file backups.

EDIT: You said servers. If you have many servers, thinking about an enterprise backup solution like Bacula might be the right choice.

Manuel Faux
  • 497
  • 3
  • 13
0

if data you want to backup [ whole system or just some part of it ] resides on lvm volume - use lvm snapshots.

on the other hand i think file-based backup should be fine [ except some databases, but for those you can use dedicated tools - mysqldump / pg_dump etc ].

[ probably it's not... ]

pQd
  • 29,561
  • 5
  • 64
  • 106