Impermanence.

This commit is contained in:
Lorenzo Good 2025-02-03 17:19:22 -06:00
parent 859556d0e6
commit abeef2cb58
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
5 changed files with 105 additions and 1 deletions

View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# fs-diff.sh
# run on server.
set -euo pipefail
if [[ -f /mnt ]]; then
mkdir /mnt
fi
if ! mountpoint /mnt > /dev/null; then
mount -t btrfs /dev/disk/by-label/NIXROOT /mnt
fi
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
OLD_TRANSID=${OLD_TRANSID#transid marker was }
sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
sed '$d' |
cut -f17- -d' ' |
sort |
uniq |
while read path; do
path="/$path"
if [ -L "$path" ]; then
: # The path is a symbolic link, so is probably handled by NixOS already
elif [ -d "$path" ]; then
: # The path is a directory, ignore
else
echo "$path"
fi
done