It is strongly advised that you do not enable swapping on flash-based drives (internal flash, SD/MMC, USB sticks)
I see that this article has not been updated in a while. Does this recommendation still hold true?
My Netgear R7500v2 has 128 MB Flash memory, 256 MB RAM and two USB 3.0 ports. I'm currently using it as a firewall, NAT, AP and DDNS. I'd like to add a small PBX connected to one of the LAN ports (w/possible QoS) and an IKEv2 VPN.
Is the 256 MB RAM enough? If not, can I go ahead and add a swap partition on a USB 3.0 flash drive? How much swap would you recommend for my intended use case? _________________ Netgear R7500v2 (1.4GHz dual core, 128MB Flash, 256MB RAM, two USB 3.0 ports, one eSATA port)
v3.0-r34320M kongat (Firewall, NAT, AP, DDNS)
Joined: 01 Nov 2017 Posts: 4 Location: Wisconsin, USA
Posted: Thu Feb 08, 2018 20:59 Post subject: Re: Linux SWAP
Quote:
Flash memory has a limited number of write cycles before it wears out. It is still going to be recommended that you do not create a swap partition in flash memory for these routers.
Got it. Thanks for the reply.
Quote:
Have you actually tried running everything you would like to run and see if it will run in the memory that you have in your router without swap space?
I have not. Not yet, at least. I only recently purchased a 32 GB USB 3.0 drive, so I am still in the planning phase. I'm new to the Linux and DD-WRT worlds, so I appreciate the help. I downloaded GParted and read the USB Storage article on the DD-WRT Wiki, which has a section that reads:
Quote:
For large HD drives that you "permanently" attach to your router you may want to consider creating three or four partitions:
one: for optware packages - make it 32MB - 2GB - use ext2/3 as the format
two: for swap file - make it 16-256 MB - format it as linux swap file
three: for data space - make it fit the rest of the disk - use ext2/3 or FAT32 as the format
four: for jffs space - make it 32MB - 2GB - use ext2/3 as the format
While it is possible to use the routers flash to host any websites, we are going to use a USB drive in order to store a larger amount of data. Get your usb device ready and partition it with the tool of your choice.
I recommend sat least 2 partitions. First partition should be a swap with ~512MB. For the second partition I recommend a drive with a few gigabytes and filesystem Ext3. When creating the second partition you can label it with the name „Jffs“, thus the integrated automounter will mount it directly to /jffs.
My confusion was further fueled because this blog post seems to suggest that it is okay to use a USB for a swap partition. Given that the USB drive that I bought has 32 GBs, I assumed that I will never fill up all of that storage, so I figured "why not" add a swap partition, if I can. _________________ Netgear R7500v2 (1.4GHz dual core, 128MB Flash, 256MB RAM, two USB 3.0 ports, one eSATA port)
v3.0-r34320M kongat (Firewall, NAT, AP, DDNS)