What's the best way to backup a USB drive with bootable data on it? For instance, I have what's called an ESXi server on a bootable USB, it's basically a linux variant with multiple partiions. What's the best way to back it up in case the original USB drive fails and the server needs to be put back together in a hurry?
It seems my desires are:
- 1 Keep the backup solution as simple as possible
- 2 Keep system online for when system files are routinely backed up
- 3 Make drive replacement easy
So with dd alone, criterion 1 and 3 are met possibly with...
sudo dd if=/dev/sdc | gzip > /storage/backups/esxi-usb-backup-2014-nov.gz
but someone on the internet criticized using dd due to geometry not being garanteed between drives. I didn't really understand what they meant because they were inarticulate, but I understand that a replacement drive of the same spec as the original may contain more bad sectors than the original and thus may not be able to fit all the partitions from the original on it. Is that what he meant? Would a workaround be to only allocate 80% of the thumb drive to leave slack for bad sectors? That's still an option at this point I believe.
If 1 and 3 are met with DD, then I can use ssh and rsync the file system to a backup location, then when the USB drive eventually dies, I can flash a new drive using the dd image, and then rsync the files over thereafter, accomplishing 2 and 3 (but not really achieving 1).
Does anyone know of a more practicle solution?
Typically, one would backup the ESXi host's configuration and, in the event of a failure, reinstall ESXi to a new USB disk and restore the backup.
It's actually bad practice to use USB boot for VMware ESXi hosts when you don't have shared storage or a VMware cluster.
When you're in a VMware cluster situation, your virtual machines live on a shared NAS or SAN and you're more capable of dealing with a host failure. If you are just running one VMware server, then booting off of USB (or SDHC card) is an unnecessary risk.
Long term, the better solution is to install VMware on actual disks if you're using a single host server. Otherwise, you can take periodic backups of the configuration from the host's shell or command line with:
This produces a web link that you'll be able to browse to and download a tarball of the host's configuration.
Also see: What happens when the USB key or SD card I've installed VMware ESXi on fails?