Bläddra i källkod

chore(impermanence): simplify condition for moving root subvolume

Zander Hawke 7 månader sedan
förälder
incheckning
a92094b09f
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      hosts/odin/system/impermanence.nix

+ 2 - 2
hosts/odin/system/impermanence.nix

@@ -23,9 +23,9 @@
     mkdir -p /mnt/old-roots
 
     # Move current root to old-roots with current timestamp
-    if [[ -e /mnt/@root && ! -e /mnt/@root-blank ]]; then
+    if [[ -e /mnt/@root ]]; then
       timestamp=$(date +%Y-%m-%d_%H:%M:%S)
-      if ! mv /mnt/@root "/mnt/old-roots/@root-$timestamp"; then
+      if ! btrfs subvolume snapshot -r /mnt/@root "/mnt/old-roots/@root-$timestamp"; then
         echo "Failed to move /mnt/@root to old-roots"
         umount /mnt
         exit 1