From 457ea6648783258458bb12280d39d5816450ff62 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 19 Jul 2026 00:23:36 +0200 Subject: Rename backup -> mount as a role --- roles/backup/README.md | 75 -------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 roles/backup/README.md (limited to 'roles/backup/README.md') diff --git a/roles/backup/README.md b/roles/backup/README.md deleted file mode 100644 index 62cada76..00000000 --- a/roles/backup/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Backup Role - -Mounts a dedicated backup drive on the target host. - -## Overview - -Prepares a dedicated storage device as the local backup destination S3-compatible object store (ex. Garage). - -## Configuration - -### Required Variables - -```yaml -backup_device: "PARTLABEL=backup" # no default — must set in host_vars -``` - -### Optional Variables - -```yaml -backup_mount_point: "/backup" -backup_fstype: "ext4" -backup_mount_options: "defaults,noatime" -``` - -## Preparing the Drive - -### 1. Install parted - -```bash -sudo apt install parted -``` - -### 2. Partition with a named label - -```bash -# check device name -lsblk - -# create GPT partition table + single labeled partition -sudo parted /dev/sdX --script mklabel gpt mkpart backup ext4 0% 100% -sudo parted /dev/nvme0nX --script mklabel gpt mkpart backup ext4 0% 100% - -# verify label -sudo parted /dev/sdX print -sudo parted /dev/nvme0nX print -``` - -### 3. Format as ext4 - -```bash -sudo mkfs.ext4 /dev/sdX1 -sudo mkfs.ext4 /dev/nvme0nXp1 - -# verify -sudo blkid /dev/sdX1 -sudo blkid /dev/nvme0nXp1 - -ls /dev/disk/by-partlabel/ -``` - -### 4. Set host variable - -In `host_vars/rpi5.local.yml`: - -```yaml -backup_device: "PARTLABEL=backup" -``` - -`PARTLABEL` is stable across reboots regardless of device enumeration order (`/dev/sda` vs `/dev/sdb`). -`ansible.posix.mount` handles `PARTLABEL=` values natively. - -## Notes - -- `noatime` mount option reduces unnecessary write cycles on the drive -- Role adds a persistent fstab entry — drive auto-mounts on reboot -- cgit v1.2.3