Host platform backup with Clonezilla
Host backups are filesystem images
Making a backup of a host platform usually means doing an image of its entire filesystem. This is a procedure that comes with several crucial concerns that you must ponder before executing it.
What gets inside a host backup
A full host backup is, in short, a complete copy of a host system. This means that you not only backup the operative system with all its critical files, like configuration ones, but also any other data you might have in it.
In the case of the Proxmox VE system deployed in this guide, if you make a full host clone image of it, you will copy in your backup:
The whole Proxmox VE system itself, including the underlying Debian operative system and all the Proxmox related files.
The virtual machines, templates and containers you may have created within Proxmox VE.
Within each virtual machine, there is operative system, application and user data.
It is important to be aware of this because, obviously, copying all of this data may result in one or more significantly big backup files.
Why doing this backup
The main utility for a host platform backup is to give you the possibility of a fast recovery to a previous stable version of your system. The scenarios in which you would need such capability are essentially two:
When applying major changes or updates on your host platform. Big upgrades can lead to unexpected issues or behaviors.
To rescue the system from some harmful event such as ransomware, storage drive failure, etc.
The convenience of being able to do a fast restoration of your system from those situations cannot be understated. This not only saves you time and spares your patience, but maybe even save you money!
How it affects the host platform
The problem with this kind of backup is that you cannot do it while your homelab is running. You must shut the whole system down, then reboot it with the backup tool of your choosing, which is Clonezilla in this case. Keep in mind that here we are talking about backing up your homelab setup’s lowest layer, the one supporting all the rest. The backup tool needs exclusive low level access to the storage drives to read and back them up properly, so there is no other way to do this.
When to do the backup
In this guide’s scenario, the system deployed is just a personal one, but you still have to plan when you want to do this to avoid disrupting your system’s availability too much. What could be a somewhat decent backup scheduling for your homelab setup? Here you have a few basic indications:
Backup always before any update or configuration change, regardless of its scope.
Regular monthly backups, to keep the clones fresh enough.
A combination of the previous two.
At the very least, you should make the backups before applying any major update on your host platform, meaning updates of the Proxmox VE server itself.
How to backup with Clonezilla
What you do with Clonezilla is generate clone images of the storage drives in your system. Remember that the Proxmox VE host platform in this guide uses two internal storage drives:
- The 1 TiB SSD drive that holds the Proxmox VE system itself and the virtual machines.
- The 2 TiB HDD drive that only has the data volumes connected to the virtual machines.
These two are the ones you must clone with their respective images with Clonezilla.
Steps for cloning storage drives with Clonezilla
Next are enumerated the steps required to clone the storage drives of your homelab setup:
Prepare an USB drive where you can install the Clonezilla Live system. If you use a tool like Ventoy, this is as easy as just copying the Clonezilla ISO file in the USB drive.
Prepare an external USB storage drive where you can keep the Clonezilla images. If you want the storage be compatible with Windows, you can format it to NTFS which is a filesystem Clonezilla is also able to use.
Warning
Careful when sharing the same storage drive for different backups
If you are storing backups from different systems or devices in one storage drive, clearly differentiate the backups in folders or partitions.Shutdown your Proxmox VE system.
If you have it connected, unplug the USB storage drive used in this guide for storing the backups for the Proxmox virtual machines and templates.
Plug in the external USB storage drive where you keep the Clonezilla images.
Plug in your Clonezilla Live USB and make your Proxmox VE system boot up with it.
Following the instructions explained in this official Clonezilla guide about saving a disk image, create a clone image of each of the internal storage drives in your system.
When you have done all the clone images you need, shutdown the system and unplug both the Clonezilla Live USB and the external storage drive holding your Clonezilla backups.
As a final verification step, check on a different computer that the images are present in the external storage drive you have used. You should have one folder per each clone image done.
How to restore with Clonezilla
Suppose you need to restore your Proxmox VE system because of a botched update, or a serious misconfiguration, that requires the reinstallation of the whole system. Since you already prepared for such situation, you have recent clone images of your system’s internal storage drives. Then, let’s see how this restoration procedure would go:
Shutdown your Proxmox VE system.
If you have it connected, unplug the USB storage drive used in this guide for storing the backups for the Proxmox virtual machines and templates.
Plug in the external USB storage drive where you have the Clonezilla images.
Plug in your Clonezilla Live USB and make your Proxmox VE system boot up with it.
Follow the instructions of this official Clonezilla guide for restoring a disk image.
Warning
Be very careful when you choose the storage drive or partition where you restore a clone image
Always double-check you are choosing the drive or partition where you really want to restore an image, and that it has enough room for all the data held by the image.After finishing the restoration, shutdown the system and unplug both the Clonezilla Live USB and the external storage drive holding your Clonezilla backups.
Finally, plug back in the other external USB storage drive with the Proxmox VM backups and then boot up normally your system to see if it has been restored properly.
Final considerations
Be aware that Clonezilla can also make images of partitions. This allows you to consider a backup strategy different from the one shown here. Furthermore, in a restoration of the Proxmox VE system used in this guide, you do not really need to restore the contents of both of the internal storage drives, just the one that truly contains the Proxmox root filesystem. But this also has its danger if the restored system expects a different (older) configuration on the secondary drive than the one currently present. Therefore, you must keep the clone images of both internal drives current and in sync, so to speak, to avoid discrepancies between what the system expects to have and what is really deployed in it.