Yes, it’s in Spanish, but if anyone finds it useful, I’ll make an English version.
Edited: Here is the english version OpenWRT-Tools/firewall_backup-eng.sh at main · fbarcelo2/OpenWRT-Tools · GitHub
I was actually “playing” around quite a bit with the firewall because I wanted to set it up so Docker containers could access the internet, but at the same time, not be accessed from the internet—only from the internal network.
To make matters worse, I used iptables out of habit, which led to a mix of iptables and nftables rules. So, eventually, I had to migrate everything.
And every time I messed up, I had to go downstairs (I work on the first floor of my house) and connect locally or even use TTY. To make things even more fun, on a couple of occasions, I managed to knock the internet offline for the entire LAN, which didn’t make my wife (working at my side) too happy
That’s why I created a script that allows me to quickly restore just the firewall in a simple and fast way.
Speaking of Docker… as soon as I installed it and spun up a few containers (Cloudflare, etc.), the overlay partition filled up. I uninstalled the containers and changed the Docker configuration to mount it on the NVME drive I installed at /mnt/NVME/opt/docker/, but still, the root system is ridiculously full.
The eMMC is much larger than what the root system is using right now, and honestly, this partitioning scheme is kind of confusing, and I’m worried I’ll make a mistake.
I found several guides to expand the filesystem to use the entire eMMC (which, frankly, I don’t understand why it wasn’t sized like that from the beginning), but they’re inconsistent, and I’m not sure which one to follow.
My goal is to use the whole eMMC. In the future, I plan to connect an external HDD via USB, so using a USB stick like some guides suggest isn’t an option for me.
Do you have any suggestions?
root@casabarba:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 2M 1 disk
mtdblock1 31:1 0 126M 0 disk
mmcblk0 179:0 0 7.3G 0 disk
├─mmcblk0p1 179:1 0 512K 0 part
├─mmcblk0p2 179:2 0 2M 0 part
├─mmcblk0p3 179:3 0 4M 0 part
├─mmcblk0p4 179:4 0 32M 0 part
├─mmcblk0p5 179:5 0 448M 0 part
└─mmcblk0p128 259:0 0 4M 0 part
mmcblk0boot0 179:8 0 4M 1 disk
mmcblk0boot1 179:16 0 4M 1 disk
ubiblock0_4 254:0 0 16.2M 0 disk
fit0 259:1 0 10.7M 1 disk /rom
fitrw 259:2 0 431.9M 0 disk /overlay
nvme0n1 259:3 0 3.6T 0 disk
└─nvme0n1p1 259:4 0 3.6T 0 part /mnt/NVME/opt/docker
/mnt/NVME
root@casabarba:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 10.8M 10.8M 0 100% /rom
tmpfs 1.9G 628.0K 1.9G 0% /tmp
/dev/fitrw 429.9M 426.3M 3.6M 99% /overlay
overlayfs:/overlay 429.9M 426.3M 3.6M 99% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/nvme0n1p1 3.6T 20.9G 3.4T 1% /mnt/NVME
/dev/nvme0n1p1 3.6T 20.9G 3.4T 1% /mnt/NVME/opt/docker
overlay 3.6T 20.9G 3.4T 1% /mnt/NVME/opt/docker/overlay2/28119acec8c9701967949c640c5e994a82e8d6c5ceb5dc5f07f12da75c359691/merged
overlay 3.6T 20.9G 3.4T 1% /mnt/NVME/opt/docker/overlay2/b4b9ae06a946b606ea86dcfa6714ed031f82ca036f66853fcf3be021435e973e/merged