I've been looking for a way to do a disk image backup of a running linux server.
There are several questions which answer this, like How to make a disk image, Mirror Live Linux (Debian) Server, Linux live hot backup snapshot and debian live server image.
Most of them seem to suggest dd
, using a gui wrapper around partclone
, using a proprietary tool (not an option for me) or do file-based backups instead (eg. rsync
). While I'm versed with those tools, I'm not sure about using the first two on a remote live server for creating a hot image backup, because of data integrity issues.
So I'd like to know
- Could using
dd if=/dev/vda1
on a running server result in a broken image that is not in a valid state when trying to restore the server from it, or other data integrity issues? - Are filesystem-aware tools like
partclone.ext4
able to work around / avoid potential filesystem errors when cloning from a live server or do they just save backup space? Or do they even give potential for more problems than just usingdd
? - Would
mount -o remount,ro /
before creating a disk image effectively prevent potential issues? Has the downside of creating service downtime. - Is there another solution to create a backup image of a running server I might have overlooked which does not result in service downtime?
The question is generic and not for a specific type of service; the solution should work on mailserver, webserver, fileserver, monitoring, buildserver, whatever. Also should work with ext4 for servers where I'm not able to use a different filesystem which offers snapshot functionality.
Unfortunately this isn't something I could just test once and then be sure it will work everytime if it worked the first time.