I've been using OpenWRT on my WRT1900AC v1 for a while now and I love it. A few days ago, I decided to attach a 4TB HDD to the router to use it as a NAS. However, whenever I try to transfer a large file to it (20GB+), the router reboots by itself halfway through the transfer. I was thinking that it might be caused by not having enough RAM 256MB), so I added a SWAP drive, but the problem persists. Anyone has an idea on how to fix this issue?
Sorry about that.
The OS is the latest version (18.06.1).
I haven't tried snapshots.
-Netatalk AFP (I'm also using the NAS as a time machine for backing up my MacBook Pro (Mid-2015, 1TB WD Black (2018) NVMe SSD))
-HDD is Seagate Backup Plus 4TB (USB 3.0, self-powered)
-Filesystem is ext4 (GPT)
USB-powered, spinning-platter drive connected via USB?
I'd put my money on not enough power being supplied under load, the voltage dropping, and the router rebooting when the voltage recovers. If so, a powered hub may resolve it for you.
It's either power or the router is running out of RAM. If it's the latter, you need to create a swap partition on external storage media, then mount that partition as swap memory.
try running this at system startup: #keep a bit more free memory to increase stabilty:
echo 32768 >/proc/sys/vm/min_free_kbytes
depending on the Openwrt build you are using, it might be the OS uses so much memory for caching that the wifi driver can run out of memory and crash the kernel. Above change keeps a more healty limit, and keeps things stable under load.
Definitely worth a try. The only solution I can recall working from when this was experienced in the old OpenWrt forum's WRT1900AC thread was to create a swap partition.
It's been a few years, but I believe there were HW Buffer patches that someone came up with around that point in time, which I believe were to address the RAM issue and Swap usage, but I could also very well be mis-remembering and the HW Buffer patch may have been for something else.
If it was to address the RAM and Swap usage, it'd shoot @davidc502 a PM and see if he remembers what specifically that patch applied to and whether it was ever implemented upstream for the WRT AC Series (I can't recall the exact user who came up with the patch).
Again, if I'm remembering right, the Swap partition should be being utilized if the file transfers include files >~240MB... then again, I could be mis-remembering and correlating two separate issues