I have a hosts file (19M) that I'd like to use with dnsmasq to block advertising and porn sites. I uploaded this file to my router (/etc) before I realized how large it was. For some reason that worked, even though my router has only 8MB of flash.
So my question is, first of all, why am I able to upload a file to my router that's larger than the available flash memory? Is /etc stored in RAM as opposed to flash? (I have 32MB RAM.)
Second, since this file is so large, is there any way I can use it to block sites with dnsmasq without uploading it to the router? I know one solution would be to have a separate firewall/dns server, but I'd like to do this on the router if possible.
Edit: Okay I'm pretty sure /etc is not in RAM but in flash. Here's my disk usage before upload:
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 4.6M 364.0K 4.3M 8% /
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 14.1M 80.0K 14.0M 1% /tmp
/dev/mtdblock3 4.6M 364.0K 4.3M 8% /overlay
overlayfs:/overlay 4.6M 364.0K 4.3M 8% /
tmpfs 512.0K 0 512.0K 0% /dev
Since /etc isn't listed, I think that means it falls under rootfs, which is mounted on /. And since there's only 4.3M available, there's no way I can store the hosts file there. Which is weird, because after I upload the file my disk usage is:
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 4.6M 4.5M 108.0K 98% /
/dev/root 2.3M 2.3M 0 100% /rom
tmpfs 14.1M 80.0K 14.0M 1% /tmp
/dev/mtdblock3 4.6M 4.5M 108.0K 98% /overlay
overlayfs:/overlay 4.6M 4.5M 108.0K 98% /
tmpfs 512.0K 0 512.0K 0% /dev
Now rootfs is almost entirely full, but why isn't it 100% full? And, assuming this is flash, why does it say size is 4.6M as opposed to 8MB?
I guess tmpfs, which is mounted on /tmp, is my RAM. But, in that case, why does it say size is 14.1M instead of 32MB? Can I store the hosts file there or will it get wiped out on reboot?
(Last edited by davidkennedy85 on 23 May 2015, 20:29)