openwrt-storage-failsafe
Skill0 starsChanged 2 months agoMITView on GitHub
OpenWrt Flash partition geometry, MTD, overlayfs recovery, Failsafe mode (Telnet), and U-Boot TFTP rescue specialist.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ark-theme-uiSkill
- openwrt-hardware-offloadingSkill
- openwrt-imagebuilderSkill
- openwrt-luci-modernSkill
- openwrt-network-firewallSkill
- openwrt-sqm-bufferbloatSkill
- openwrt-storage-failsafeSkill
- openwrt-wifi-meshSkill
- posix-shellSkill
- security-auditorSkill
- systematic-debuggingSkill
- ark-theme-uiSkill
- openwrt-hardware-offloadingSkill
- openwrt-imagebuilderSkill
- openwrt-luci-modernSkill
- openwrt-network-firewallSkill
- openwrt-sqm-bufferbloatSkill
- openwrt-wifi-meshSkill
- posix-shellSkill
- security-auditorSkill
- systematic-debuggingSkill
The file
Files
OpenWrt Storage, MTD & Failsafe Recovery (ARK Router)
Objetivo
Dominar o mapa de partições MTD da memória Flash SPI, proteger blocos críticos de calibração de rádio (ART/EEPROM) e executar recuperação de emergência sem abrir o gabinete do roteador (sem adaptador serial TTL).
1. Mapa de Partições MTD (/proc/mtd)
[!CAUTION] PROIBIÇÃO DE COMANDOS GENÉRICOS DE MTD OU FLASH: É terminantemente PROIBIDO executar ou sugerir comandos de escrita em partição (
mtd write,dd,flash_erase) ou procedimentos genéricos de botão de reset/TFTP sem antes verificar:
- O modelo exato da placa:
cat /tmp/sysinfo/modeloucat /proc/cpuinfo.- A tabela real de partições do dispositivo ativo:
cat /proc/mtd. O número das partições MTD (mtd0,mtd2, etc.) varia entre modelos e targets (ex.: Filogic vs Atheros vs Mediatek MT7621), e gravar no offset errado causará brick permanente no roteador.
Em roteadores de referência com 16 MB SPI Flash (como exemplo ilustrativo), a tabela típica pode se dividir em:
dev: size erasesize name
mtd0: 00040000 00010000 "u-boot" (Bootloader - NUNCA SOBRESCREVER)
mtd1: 00010000 00010000 "u-boot-env" (Variáveis de ambiente do boot)
mtd2: 00040000 00010000 "factory" (DADOS DE CALIBRAÇÃO ART / MAC ADDRESS)
mtd3: 00f00000 00010000 "firmware" (Kernel + SquashFS + Overlay)
mtd4: 00ac0000 00010000 "rootfs" (SquashFS somente leitura)
mtd5: 00400000 00010000 "rootfs_data" (Partição JFFS2 / Overlay gravável)[!CAUTION] A Partição Sagrada (
factory/ ART): A partiçãofactorycontém as tabelas de ganho de antena, potências de transmissão de RF e endereços MAC gravados na fábrica. SEMPRE faça backup antes de mexer no MTD:dd if=/dev/mtd2 of=/tmp/factory_backup.bin
2. Modo Failsafe (Acesso de Emergência sem SSH)
Se um script quebrar a rede ou a senha de root for perdida:
Como Entrar no Modo Failsafe:
- Desligue o roteador da tomada.
- Ligue e observe o LED de Status/Power.
- Quando o LED começar a piscar rapidamente (2 a 3 segundos após ligar), pressione o botão RESET ou WPS 3 vezes seguidas.
- O LED começará a piscar em ritmo ultra-rápido (indicando modo Failsafe ativo).
Como Conectar:
- Conecte o cabo Ethernet no PC e configure o IP estático:
- IP:
192.168.1.2 - Máscara:
255.255.255.0 - Gateway:
192.168.1.1
- IP:
- Abra o terminal e conecte via Telnet:
(O modo Failsafe não exige senha e não roda SSH).telnet 192.168.1.1
Comandos de Recuperação no Failsafe:
- Montar a partição gravável para consertar arquivos:
mount_root - Redefinir senha de root:
passwd - Reset de Fábrica Completo (Limpa o Overlay):
firstboot -y && reboot
3. Recuperação Via U-Boot TFTP (Unbrick)
Se a imagem estiver corrompida e o roteador não inicializar:
- Mantenha o botão RESET pressionado enquanto liga a fonte de energia por 5 a 7 segundos.
- O U-Boot entrará no modo cliente/servidor TFTP.
- Configure o PC para o IP de recuperação padrão do fabricante (no Cudy WR3000:
192.168.1.254ou192.168.1.2). - Sirva a imagem limpa
openwrt-*-sysupgrade.binvia servidor TFTP (ex: Tftpd64 no Windows). - O bootloader puxará a imagem automaticamente e regravará o Flash SPI.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

