diff options
author | sadbeast <sadbeast@sadbeast.com> | 2024-05-30 00:47:47 +0000 |
---|---|---|
committer | sadbeast <sadbeast@sadbeast.com> | 2025-01-11 12:20:20 -0800 |
commit | 8c12d7db633cc421cd96690d077461cf45195334 (patch) | |
tree | c3112acb5cd045ceeb2ada81a281a5991b4c501d /fs-diff.sh | |
download | nix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.gz nix-config-8c12d7db633cc421cd96690d077461cf45195334.tar.bz2 |
Diffstat (limited to 'fs-diff.sh')
-rwxr-xr-x | fs-diff.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs-diff.sh b/fs-diff.sh new file mode 100755 index 0000000..3c10bec --- /dev/null +++ b/fs-diff.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +sudo mkdir /mnt +sudo mount -o subvol=/ /dev/mapper/enc /mnt +#sudo mount -o subvol=/ /dev/sdb3 /mnt + +set -euo pipefail + +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 + +sudo umount /mnt +sudo rmdir /mnt |