Fix issues where cryptsetup would fail to unmount

There were occasions where removing the backup drive would confuse luks
and prevent re-mounting. This fixes the issue by attempting to luks
close and open the drive before mounting, thereby correcting any issues
where the drive would stick.
This commit is contained in:
ducoterra
2022-02-01 20:25:26 -05:00
parent 81a0007028
commit 8abfbcf561
5 changed files with 128 additions and 94 deletions

View File

@@ -26,6 +26,8 @@ ansible-playbook -i hosts --ask-become-pass playbooks/pi.yaml
Run the manjaro playbook
NOTE: Restore home directory and __REBOOT__ first
```bash
ansible-playbook --ask-become-pass ansible/setup-full.yml
```
@@ -92,4 +94,10 @@ sudo mkdir -p /mnt/backup0
# Add to fstab
echo '/dev/mapper/backup0 /mnt/backup0 btrfs defaults,noatime,compress=zstd 0 0' > /etc/fstab
# mount
sudo cryptsetup luksOpen /dev/disk/by-uuid/1d7ce570-e695-47a0-9dda-5f14b5b20e21 backup0 --key-file=/home/ducoterra/.lukskeys/backup0
# close (or fix issues)
sudo cryptsetup luksClose backup0
```