Initial commit: NAS backup, NFS mount docs, NVMe fix docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
# System
|
||||||
|
|
||||||
|
Scripts and documentation for system administration tasks.
|
||||||
|
|
||||||
|
## NAS Backup
|
||||||
|
|
||||||
|
`nas-backup.sh` — rsyncs `/data/backup/` (gitea + postgres) to the NFS-mounted NAS at `/mnt/nas/backup/` every 15 minutes.
|
||||||
|
|
||||||
|
- **Timer**: `~/.config/systemd/user/nas-backup.timer`
|
||||||
|
- **Service**: `~/.config/systemd/user/nas-backup.service`
|
||||||
|
- **Sudoers**: `/etc/sudoers.d/nas-backup` (passwordless rsync)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check status
|
||||||
|
systemctl --user status nas-backup.timer
|
||||||
|
systemctl --user list-timers nas-backup.timer
|
||||||
|
|
||||||
|
# Run manually
|
||||||
|
systemctl --user start nas-backup.service
|
||||||
|
|
||||||
|
# View logs
|
||||||
|
journalctl --user -u nas-backup.service
|
||||||
|
```
|
||||||
|
|
||||||
|
## NFS NAS Mount
|
||||||
|
|
||||||
|
`nfs-nas-mount.md` — NAS connection details and mount configuration for `nas.local.pmagnus.dk:/omarchy` at `/mnt/nas`.
|
||||||
|
|
||||||
|
## NVMe Freeze Fix
|
||||||
|
|
||||||
|
`nvme-fix-plan.md` — Fix for Kingston SNV2S2000G freezes caused by NVMe deep power state transitions. Applied via `nvme_core.default_ps_max_latency_us=5000` kernel parameter.
|
||||||
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Elephant
|
||||||
|
After=graphical-session.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=elephant
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical-session.target
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fetch Medium Daily Digest emails
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/home/pmp/ai/medium/fetch-mail.sh
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Fetch Medium emails daily at 6:30
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*-*-* 06:30:00
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Rsync backup to NAS
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/home/pmp/ai/system/nas-backup.sh
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Rsync backup to NAS every 15 minutes
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*:0/15
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Omarchy Battery Monitor Check
|
||||||
|
After=graphical-session.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=%h/.local/share/omarchy/bin/omarchy-battery-monitor
|
||||||
|
Environment=DISPLAY=:0
|
||||||
|
LogLevelMax=warning
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Omarchy Battery Monitor Timer
|
||||||
|
Requires=omarchy-battery-monitor.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=1min
|
||||||
|
OnUnitActiveSec=30sec
|
||||||
|
AccuracySec=10sec
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SRC="/data/backup/"
|
||||||
|
DEST="/mnt/nas/backup/"
|
||||||
|
|
||||||
|
# Ensure NAS is mounted
|
||||||
|
if ! mountpoint -q /mnt/nas; then
|
||||||
|
echo "NAS not mounted at /mnt/nas, skipping backup" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$DEST"
|
||||||
|
sudo rsync -a --delete --no-group --no-perms --no-owner "$SRC" "$DEST"
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# NFS NAS Mount
|
||||||
|
|
||||||
|
## NAS Details
|
||||||
|
- **Hostname**: `nas.local.pmagnus.dk`
|
||||||
|
- **IP**: `192.168.50.112`
|
||||||
|
- **Protocol**: NFSv4.1
|
||||||
|
|
||||||
|
## Available NFS Exports
|
||||||
|
All exports are accessible from `192.168.50.0/24`:
|
||||||
|
- `/vol01`, `/vm`, `/umbrel`, `/pve`, `/omarchy`, `/k8s`, `/docker`, `/Dev1Partition1`, `/data`, `/citadel`, `/btcdata`
|
||||||
|
|
||||||
|
## Current Mount
|
||||||
|
- **Source**: `nas.local.pmagnus.dk:/omarchy`
|
||||||
|
- **Mount point**: `/mnt/nas`
|
||||||
|
- **Options**: `rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,hard,proto=tcp`
|
||||||
|
- **Size**: 7.1T total, 127G used (2%)
|
||||||
|
- **Contents**: `backup/`, `@Recycle/`
|
||||||
|
|
||||||
|
## Useful Commands
|
||||||
|
```bash
|
||||||
|
# Show NAS exports
|
||||||
|
showmount -e nas.local.pmagnus.dk
|
||||||
|
|
||||||
|
# Mount
|
||||||
|
sudo mount -t nfs nas.local.pmagnus.dk:/omarchy /mnt/nas
|
||||||
|
|
||||||
|
# Persistent mount (add to /etc/fstab)
|
||||||
|
nas.local.pmagnus.dk:/omarchy /mnt/nas nfs defaults,_netdev 0 0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
- This machine: `192.168.50.42` on `enp88s0`
|
||||||
|
- `nmap` is not installed; use `ip neigh show` for network discovery
|
||||||
|
- `sudo` requires a terminal (not available from Claude Code)
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# NVMe Freeze Fix Plan — Kingston SNV2S2000G
|
||||||
|
|
||||||
|
## Problem
|
||||||
|
System freezes and SSHD becomes unresponsive due to NVMe I/O write timeouts.
|
||||||
|
The Kingston SNV2S2000G firmware fails to wake from deep power states (PS3/PS4) in time,
|
||||||
|
causing the kernel to abort I/O operations and eventually hard-lock the system.
|
||||||
|
|
||||||
|
- 152 NVMe I/O timeout errors logged in previous boot (Feb 17-20)
|
||||||
|
- 1 NVMe controller reset (Feb 19 09:41)
|
||||||
|
- 52 unsafe shutdowns (hard power-offs from freezes)
|
||||||
|
- SMART health: PASSED — drive is not failing, firmware power management is the issue
|
||||||
|
|
||||||
|
## Root Cause
|
||||||
|
NVMe Autonomous Power State Transition (APST) puts the drive into PS3/PS4.
|
||||||
|
Exit latencies (5ms / 70ms) exceed what the firmware can reliably handle,
|
||||||
|
causing write and flush operations to time out.
|
||||||
|
|
||||||
|
## Fix: Disable Deep NVMe Power States
|
||||||
|
|
||||||
|
### Step 1 — Apply kernel parameter
|
||||||
|
|
||||||
|
Run with sudo in a terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo sed -i 's|rootfstype=btrfs|rootfstype=btrfs nvme_core.default_ps_max_latency_us=5000|' /boot/limine.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2 — Verify the change
|
||||||
|
|
||||||
|
```bash
|
||||||
|
grep nvme_core /boot/limine.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Every `cmdline:` line should now end with `nvme_core.default_ps_max_latency_us=5000`.
|
||||||
|
|
||||||
|
### Step 3 — Reboot
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 4 — Confirm after reboot
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Verify kernel parameter is active
|
||||||
|
cat /proc/cmdline | grep nvme_core
|
||||||
|
|
||||||
|
# Monitor for NVMe errors (should show nothing new)
|
||||||
|
journalctl -b -k | grep -i 'nvme.*timeout'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Monitoring
|
||||||
|
|
||||||
|
Watch for recurrence over the next few days:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check for any NVMe timeouts in current boot
|
||||||
|
journalctl -b -k | grep -i 'nvme.*timeout'
|
||||||
|
|
||||||
|
# Check SMART data periodically
|
||||||
|
sudo smartctl -a /dev/nvme0
|
||||||
|
```
|
||||||
|
|
||||||
|
## If Freezes Continue
|
||||||
|
|
||||||
|
1. Try a stricter latency limit: change `5000` to `0` (disables all power state transitions)
|
||||||
|
2. Check for Kingston firmware updates for SNV2S2000G (current: SBK00104)
|
||||||
|
3. If nothing helps, the drive may need replacement despite passing SMART checks
|
||||||
|
|
||||||
|
## Drive Info
|
||||||
|
- Model: KINGSTON SNV2S2000G (2TB)
|
||||||
|
- Serial: 50026B7784F6ACF9
|
||||||
|
- Firmware: SBK00104
|
||||||
|
- Percentage Used: 5%
|
||||||
|
- Bootloader: Limine
|
||||||
|
- Config: /boot/limine.conf
|
||||||
Reference in New Issue
Block a user