I have a home file server in the following configuration:
- 4 HDDs of 2TB each
- 1 USB flash drive running the Debian OS of 8GB
I would like to make a full disk backup of the OS flash drive to another (non-identical) 8GB+ flash drive mounted in the OS. I'd like to do this without having to physically or manually access the server by just setting up a scheduled automated task to perform the backup.
What I've found while searching for a solution is that the main issue with this relates to not being able to prevent writes to the file system for the duration of the backup; which can then potentially corrupt the backup.
One possible solution would be to boot into single user mode and then use the
dd utility but I don't know how feasible that would be to wholly automate. My thought would be:
- Cron job initiates backup, starting by rebooting into single user (runlevel 1)
- Somehow get to a state to be able to mount the backup drive and run the dd command?
- Reboot back into the normal usage mode (runlevel 2 for my system)
Then if the system fails I'd like to just remove the failed drive, plug in the backup, and replace the backup with a fresh USB drive since the backup system will also have the backup script running on it.
Does this plan seem feasible or will it not work at all? Is there some other utility out there that can provide me with a similar solution?