Skip to content

docs: Emergency recovery guide for sliceanddice boot issues#188

Draft
aspauldingcode wants to merge 6 commits into
masterfrom
cursor/fix-sliceanddice-emergency-mode-75c8
Draft

docs: Emergency recovery guide for sliceanddice boot issues#188
aspauldingcode wants to merge 6 commits into
masterfrom
cursor/fix-sliceanddice-emergency-mode-75c8

Conversation

@aspauldingcode

Copy link
Copy Markdown
Owner

Problem

The sliceanddice system entered emergency mode after recent changes. Analysis reveals a branch mismatch issue between master and development.

Root Cause

The development branch includes new sliceanddice configuration that imports additional files:

  • disko.nix - disk/filesystem configuration (btrfs layout)
  • kbd-bl-ask.nix - keyboard backlight configuration
  • msi-ec-sword-kbd-disable.patch - MSI EC kernel patch
  • Enhanced power management features
  • Boot generation limiting

If the system tried to rebuild with development branch config but these files were missing or inaccessible, it would fail to activate and drop into emergency mode.

Solution Provided

This PR adds comprehensive recovery documentation:

📋 Files Added

  1. QUICKSTART.md - Fast recovery steps (TL;DR version)
  2. SOLUTION.md - Complete analysis and multiple recovery options
  3. EMERGENCY_RECOVERY.md - Detailed technical recovery procedures
  4. diagnose-emergency.sh - Diagnostic script for emergency mode

🚀 Quick Recovery Steps

For the user:

  1. Reboot and press Space/Esc at boot menu
  2. Select an older NixOS generation (from before the issue)
  3. Boot into that generation
  4. Switch to master branch: cd /etc/nixos/.dotfiles && git checkout master
  5. Rebuild: sudo nixos-rebuild switch --flake .#sliceanddice

📊 Branch Comparison

Master (current, stable):

  • ext4 root filesystem
  • No disko management
  • Basic hardware config
  • ✅ Working and tested

Development (ahead, new features):

  • disko-managed partitions
  • btrfs subvolumes support
  • Power management (RAPL/EPP)
  • On-disk NixOS installer
  • Boot generation limiting (prevents /boot from filling)
  • ⚠️ Requires additional files

Files Changed

  • Added recovery documentation (4 files)
  • No changes to existing configuration
  • This is a documentation-only PR

Testing

The recovery procedures are based on:

  • Git history analysis showing the branch divergence
  • Examination of the missing imports in development branch
  • Standard NixOS recovery best practices

Recommendations

  1. Immediate: Use the recovery guides to restore sliceanddice to a working state
  2. Short-term: Decide whether to stay on master (stable) or properly merge development features
  3. Long-term: If merging development, ensure all required files are present and tested before deploying to the physical machine

Related Commits

  • ba8fb7cb - feat(sliceanddice): on-disk NixOS installer + btrfs disko (development)
  • 963b83f1 - fix(sliceanddice): cap systemd-boot generations (development)
  • 6142c7b2 - feat(sliceanddice): silent Windows IoT LTSC dual-boot (development)

These commits on the development branch added features that require the additional files.

Open in Web Open in Cursor 

cursoragent and others added 6 commits July 15, 2026 20:24
Add comprehensive recovery documentation and diagnostic script for emergency
mode issues. Includes analysis of master vs development branch differences
and step-by-step recovery procedures.

Addresses potential causes:
- Missing disko.nix import from development branch
- Filesystem mounting failures
- Boot partition space issues
- Configuration branch mismatches

Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Provides one-command fix for emergency mode issues. The script:
- Detects configuration problems (missing disko.nix, wrong branch)
- Switches to stable master branch
- Rebuilds the system configuration
- Provides clear feedback and next steps

Usage: sudo bash fix-emergency-auto.sh

Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Central emergency recovery documentation that ties all the recovery
resources together. Provides quick navigation to the right solution
based on user's situation and technical comfort level.

Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Co-authored-by: Alex Spaulding <aspauldingcode@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants