Skip to main content

Backing up to another drive

·137 words·1 min

Backing up to a drive #

I’m on a final step of migrating to another datastore but before I begin the mirroring step of the process, I thought that I’d take a full, encrypted backup of the one drive that I currently have configured. This is a note to remind me of how to do it in the future.

This is based in part on the source from: https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F548-crypt-btrfs-setup.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Format the disk using fdisk first as a linux partition
cryptsetup luksFormat /dev/sdc1
cryptsetup open /dev/sdc1 my_encrypted_backup
mkfs.ext4 /dev/mapper/my_encrypted_backup
mkdir /mnt/backup_drive

mount /dev/mapper/my_encrypted_backup /mnt/backup_drive

# Test a backup using a dry run first
rsync -aHAX --info=progress2 --stats \
  --dry-run \
  --one-file-system \
  --exclude='.snapshots/' \
  --exclude='*/.snapshots/' \
  --exclude='.btrfs/' \
  /mnt/secured/personal \
  /mnt/backup_drive/secured/