User Tools

Site Tools


Backup of partition using DD

I know this is super-obvious, but the aim here is to figure out a way to quickly backup and restore Virtual Machines both by taking a copy of the .img or .qcow2 file and by taking a direct file-system backup.

  dd if=/dev/hda1 of=~/partition1.img

(I'm not 100% sure how to do a backup/snapshot using LVM, so this should do for the time being!)

A better way, especially for ARM boards would be something like this:

   sudo dd if=/dev/sda bs=16M | sudo xz -9 --block-size=16MiB - > /mnt/disk2/backups/kolab.img.xz

This would be where you mounted an NFS share in /mnt. It backs up to a .img.xz which means you can fire a MicroSDXC card into the PC and fire up Gnome Disks and restore an image file.

using_dd_to_backup_partitions.txt · Last modified: 2017/03/22 23:19 (external edit)