Pagina 1 van 1

Centos backup

Geplaatst: 05 mar 2012 17:52
door tokkelpas
Ik zit momenteel op een VPS met Centos 5 waar ik mijn webserver heb op draaien.
Nu zou ik graag een image maken zodat ik in geval van nood de volledige vps kan terugzetten of verhuizen naar een ander hosting bedrijf.

Wat is de beste manier om een backup te maken van het volledige systeem via de command line ?

Re: Centos backup

Geplaatst: 06 mar 2012 15:31
door Tind.nl-Hans
Hi Tokkelpas,


Het is even afhankelijk van welke software de vps draait.
Misschien kan de leverancier van de vps een img voor je maken
Ik zou eens kijken naar dd of rsync om een complete image te maken.
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...
Denk er om dat dit niet zonder risico is enige *nix kennis is gewenst.


//Hans