🐧 Pop!_OS migration — PC ai-brain

Dual-boot Linux primary + Windows secondary. Plan zatwierdzony 2026-05-20. Last update: 2026-05-21.

⚡ After Pop!_OS install — uruchom JEDNĄ KOMENDĘ
curl -fsSL https://raw.githubusercontent.com/f1th4p/pc-services/main/scripts/setup-linux.sh | bashclick to copy
Skrypt robi 10 kroków idempotentnie (~15-20 min): apt deps + Chrome + Tailscale + NVIDIA verify + env vars restore + rclone/PAT restore + git clone repos + venv setup + Claude Code + state restore + systemd units. Log: ~/setup-linux.log.
Wymaga: D: drive NTFS mounted (skrypt sam montuje), backup w /mnt/d/backups/pre-linux-migration/.

📀 Disk layout

STAGE 1 — Original Windows (snapshot pre-migration)
C: Kingston SATA SSD
446 GB · 162 GB free
Windows 11OS
D: Seagate HDD 2 TB
1863 GB · 494 GB free
health-recordings + Docker
E: Samsung NVMe SSD ⚡
465 GB · 123 GB free
_Projekty164 GB
huggingface56 GB
AEcache44 GB
stable-diffusion-webui36 GB
ComfyUI_windows_portable17 GB
STAGE 2 — Cache + _Projekty migration (NOW)
C: unchanged
Windows zostaje
Windows 11
D: ★ ~174 GB free
Cache + _Projekty migrated
health-recordings
cache/AE ✓
cache/huggingface ✓
cache/stable-diffusion ✓
cache/ComfyUI ✓
_Projekty ✓ 164 GB
E: ★ PUSTY (po cleanup)
~465 GB ready dla Linux
Free dla Pop!_OS465 GB
STAGE 3 — Final Pop!_OS dual-boot (UEFI + GPT)
C: Windows secondary
161 GB free · Adobe + drukarka (rzadko)
Windows 11OS
D: Shared NTFS
~174 GB free · R/W z obu OSów
health-recordings (.mov)
cache (AE / HF / SD / ComfyUI)
_Projekty 164 GB
Docker + backups
E: ★ Pop!_OS PRIMARY ⚡
NVMe 465 GB · UEFI dual-boot · ✓ verified Get-Partition
p1 Windows ESP (preserved) 100 MB
p2 MSR Reserved 16 MB
p3 Pop!_OS ext4 /448 GB
p4 Windows Recovery 509 MB
p5 Pop!_OS ESP /boot/efi 1 GB
p6 Linux swap 16 GB

Plot twist 2026-05-21: Pop!_OS installer odrzucił Windows ESP 100 MB jako "too small" — wymagany osobny ESP 1 GB. Bartek utworzył NOWY p5 FAT32 z boot+esp flags, Pop!_OS GRUB tam install. Dwa ESP partitions coexist — Windows EFI bootloader na p1 (preserved), Pop!_OS GRUB na p5. UEFI Boot Order decyduje który ładuje się default — initial post-install Windows had priority (Boot priority fix → Step 6½).

🚀 Boot flow (post-migration)

Press Power GRUB menu (3s) default: Pop!_OS
Auto-start (systemd): pose_server · dashboard · LM Studio · Tailscale · sweep-nightly.timer
GRUB menu strzałka ↓ Windows Boot Manager Enter (Adobe / drukarka)

🔧 Pre-install checklist (Windows side, OBOWIĄZKOWE przed boot USB)

Wyniki audytu 2026-05-21 — issues które trzeba załatwić ZANIM włożysz USB Pop!_OS.

1
Disable Fast Startup + Hibernation✓ verified 2026-05-21
Fast Startup zostawia NTFS w "dirty" state → Linux ntfs-3g mount jako READ-ONLY. Wykonane: powercfg /h off (powercfg /a confirms "Hibernation not available").
2
Backup Windows EFI + BCD✓ done
ESP backup → D:\backups\pre-linux-migration\windows-esp\ (36.9 MB, 150 files). BCD export → bcd-backup (36 KB). Insurance jeśli installer zniszczy ESP.
3
Decyzja Secure Boot — DISABLE w BIOS przed boot USB
Pop!_OS NVIDIA driver wymaga signed key. Wybór Bartka: A (Disable):
  • A. ✓ Reboot → F2/Del przy boot logo → BIOS → Security → Secure Boot → Disabled → Save & Exit. Windows nadal działa (Win11 nie wymaga ENABLED Secure Boot, tylko CAPABLE firmware).
  • B. odrzucone (MOK enrollment) — Bartek's use case (server, brak anti-cheat games) nie wymaga complexity.
4
Properly shutdown przed USB boot
Shut down (NIE Restart, NIE Sleep) z menu Start → Power → Shut down. Po Fast Startup off Windows zrobi full shutdown. To zapewni:
  • NTFS filesystem clean state → Linux może mount R/W
  • Cold RAM clear → BIOS settings change pickup

📋 Migration steps (właściwe install)

1
Credentials backup✓ done
env-vars.txt + rclone.conf + supabase-cli-pat + claude-state (memory + 32 MB sessions) → D:\backups\pre-linux-migration\. ACL: bartekp only.
2
Google Drive cloud backup✓ 15/15 done
Wszystkie historic recordings (video.mov + analysis.json) → gdrive:health-workouts/. Cloud safety net na wypadek disk failure.
3
Pop!_OS NVIDIA ISO download✓ 2954 MB
Variant z pre-installed NVIDIA driver (RTX 3060 out-of-box). Saved jako D:\backups\pre-linux-migration\pop-os_22.04_nvidia.iso.
4
Cache + _Projekty transfer E:→D: + cleanup✓ 317 GB + E: cleanup done
AEcache 44 + huggingface 56 + stable-diffusion-webui 36 + ComfyUI 17 + _Projekty 164 = 317 GB migrated (Robocopy /MIR /MT:8 /Z).
Gotcha 2026-05-21: robocopy /MIR mirror src→dst ale NIE usuwa src files. iOS-Claude z GParted view live USB zauważył 341 GB nadal used na E: (duplikaty!). Cleanup wymaga osobny Remove-Item E:\<folder> per dir.
Result: E: 464.7 GB free (z 465.1 GB), 99.9% pusty. Pop!_OS installer ma czyste konto dla wipe nvme0n1p3.
5
Flash USB Pop!_OS✓ done 2026-05-21
Balena Etcher → Pop!_OS 22.04 NVIDIA ISO (2954 MB) → USB ready. Następny krok: BIOS Secure Boot OFF → shutdown → boot USB.
6
Boot USB + Pop!_OS install✓ install done 2026-05-21 ~17:00
Boot menu (F12 / F11 / F8 — zależy od mobo) → "Pop!_OS Live" → "Install Pop!_OS" → Custom (advanced).
Gotcha 2026-05-21: Pop!_OS installer odrzucił Windows ESP 100 MB jako "too small" (triangle warning). Solution: utworzyć NOWY 1 GB FAT32 partition z boot + esp flags (linux-efi) — Pop!_OS GRUB instaluje się tam, Windows ESP 100 MB zostaje nietknięte. Dwa ESP partitions coexist on disk (Windows p1, Linux p5).
Final partition mapping (Custom install):
  • nvme0n1p1 Windows ESP 100 MB → Use OFF (preserved)
  • NEW nvme0n1p5 linux-efi 1 GB FAT32 → Use ON, Format ON, mount /boot/efi
  • nvme0n1p3 448 GB → Use ON, Format ON ext4, mount /
  • NEW nvme0n1p6 16 GB → Use ON, Format ON, swap
  • nvme0n1p2 MSR, nvme0n1p4 WinRE, Kingston, ST2000 → Use OFF
⚠ Fix UEFI boot priority~2 min — Bartek manual
Issue 2026-05-21 ~17:30: Po install + restart, Windows załadował się zamiast Pop_OS. Diagnoza (Get-Partition Disk 2):
  • Pop_OS install ZADZIAŁAŁ ✓ — wszystkie 6 partycji obecne (p3 ext4 448 GB, p5 ESP 1 GB, p6 swap 16 GB)
  • GRUB jest installed na p5 (dedicated linux-efi)
  • Root cause: UEFI Boot Order ma "Windows Boot Manager" wyżej niż "Pop_OS / ubuntu" entry
Mobo confirmed: MSI PRO Z690-P DDR4 (MS-7D36) — keys: F11 Boot Menu, Del BIOS Setup.

Wariant 0 — BEST (z Windows, no F-key timing):
shutdown /r /fw /t 0 # elevated PS — reboot direct do UEFI Firmware Settings
Re-startuje PC i landuje GWARANTOWANO w BIOS bez spam F-key. Potem patrz Wariant 2 steps od pkt 2.

Wariant 1 — Szybki one-shot boot do Pop_OS (test czy GRUB działa):
  1. Restart
  2. Spam F11 ZARAZ po MSI logo (POST)
  3. MSI Boot Menu pokaże listę. Szukaj: UEFI: Pop!_OS / ubuntu / UEFI HARD DISK: Samsung NVMe
  4. Wybierz Pop_OS → Enter → załaduje GRUB → Pop_OS
Wariant 2 — Stały fix (recommended, po Variant 1 verify):
  1. Restart → spam Del (lub Wariant 0) → MSI Click BIOS 5
  2. Settings → Boot → Boot Option Priorities
  3. #1: UEFI: Pop!_OS / ubuntu (above Windows Boot Manager)
  4. #2: Windows Boot Manager
  5. F10 Save & Exit
  6. Default boot → GRUB → Pop_OS
Po pierwszym Pop_OS boot jeśli GRUB nie pokazuje Windows Boot Manager jako entry:
sudo update-grub # os-prober dorzuci Windows do menu
7
⚡ One-shot setup command~15-20 min
Po pierwszym boot Pop!_OS, otwórz Terminal i uruchom:
curl -fsSL https://raw.githubusercontent.com/f1th4p/pc-services/main/scripts/setup-linux.sh | bash
Skrypt: apt deps + Chrome + Tailscale + NVIDIA verify + env restore + rclone + git clone + venvs + Claude Code + state restore + systemd unit files. Idempotent (safe re-run).
8
Manual finalization~10 min
Po skrypcie wykonaj 4 rzeczy ręcznie (browser/sudo/CUPS):
sudo tailscale up # OAuth w Chrome source ~/.bashrc # reload env vars cd ~/Developer/pc-services && claude --resume # Claude Code z full state # Drukarka USB: System Settings → Printers → Add (CUPS auto-detect) sudo cp services/systemd/*.{service,timer} /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now pc-services-pose pc-services-dashboard sudo systemctl enable --now pc-services-sweep-nightly.timer
9
Validation + post-install tweaks~10 min
Sanity checks:
curl http://localhost:8001/health # 200 OK (pose_server) rclone lsd gdrive: # lists Drive folders tailscale status # Connected, IP 100.109.129.16 # iPhone HealthIOS: upload workout test via Funnel
Tweaks (po reboot):
sudo timedatectl set-local-rtc 1 # match Windows RTC (zegar nie skoczy 2h przy boot Linux) sudo update-initramfs -u # rebuild initrd po NVIDIA install jeśli MOK
Opcjonalnie cleanup stary EFI/ubuntu entry z poprzedniego Linux dual-boot:
sudo mount /dev/nvme0n1p1 /mnt/esp # E: ESP sudo rm -rf /mnt/esp/EFI/ubuntu # legacy leftover from prior install

🎯 Co działa cross-OS (no migration needed)

⚠️ Co tracimy (zaakceptowane 2026-05-20)

🛠️ Troubleshooting (5 known issues)

D: drive not mounted automatically
Pop!_OS auto-mounts via udisks2 jako /media/$USER/Data, ale skrypt szuka /mnt/d. Script auto-detects oba; jeśli zawiódł:
sudo mkdir -p /mnt/d sudo mount -t ntfs-3g $(lsblk -f | grep -i ntfs | head -1 | awk '{print "/dev/"$1}') /mnt/d
NVIDIA driver missing po install
Pop!_OS NVIDIA ISO powinien ship driver. Jeśli nvidia-smi nie działa:
ubuntu-drivers devices # list available sudo apt install -y nvidia-driver-535 sudo reboot
CUDA toolkit dla PyTorch
Setup-linux.sh pip install torch wymaga CUDA wheels — match Windows version (cu121):
pip install torch>=2.2 --index-url https://download.pytorch.org/whl/cu121
Tailscale Funnel re-enable
Po Tailscale up, re-enable Funnel z path-mount config:
tailscale serve reset tailscale funnel reset tailscale funnel --bg 8001 tailscale serve --bg --set-path=/webhook/github http://localhost:8080/webhook/github
Docker daemon nie startuje
Po apt install docker.io, użytkownik musi być w grupie docker (skrypt to robi, ale wymaga logout/login):
sudo usermod -aG docker $USER # logout + login (lub: newgrp docker w bieżącym shell) docker ps # verify