Welcome! Log In Create A New Profile

Advanced

USB vs NAND as a swap location

Posted by chackoc 
USB vs NAND as a swap location
March 03, 2013 09:26PM
I've got an E02 that's currently running Arch from a USB thumb drive. A couple of the daily jobs running on the box require swap. At the moment I'm using a swapfile but as I understand it running a swapfile on a USB thumb drive can kill the drive quickly.

Does anyone know anything about running swap on the NAND? I don't really know what NAND is so are there any issues with using that type of memory for swap? If I make /dev/mtd3 a swap partition will that break anything the default uboot needs? I'd like to keep the default behavior in case something ever goes wrong with my Arch installation and I need to fall back to the default kernel.

Another thought I had was get a small usb thumb drive just for swap and consider replacing it from time to time as an operating cost. At least that way I don't kill the entire OS if the drive dies prematurely. Still if the on-board NAND is safe to use I'd obviously prefer that approach.

Also the jobs sometimes need up to 200MB of swap so the setup would involve NAND as high priory and a swapfile on the USB drive as low priority. So no matter what I will still need to hit the USB drive occasionally. The implication being that if thumb drives handle swap usage terribly then maybe even using the NAND won't provide sufficient protection for my USB drive? If that's the case then maybe using a dedicated thumb drive is the only way to go anyway.

Any thoughts from people with experience in this sort of thing?
Re: USB vs NAND as a swap location
March 04, 2013 12:41AM
chackoc Wrote:
-------------------------------------------------------

> Another thought I had was get a small usb thumb
> drive just for swap and consider replacing it from
> time to time as an operating cost. At least that
> way I don't kill the entire OS if the drive dies
> prematurely.

Of course it's best to have HDD for swap, but this is a good approach, I would do the same thing. If you're running a lot of apps on your plugs, you should move all the logs to /tmp too.

> Still if the on-board NAND is safe to
> use I'd obviously prefer that approach.
>

I don't think this is good. You will wear out NAND, and therefore the whole box.
Re: USB vs NAND as a swap location
March 16, 2013 07:12PM
There are two options that I know of:

1.) Use ZRAM/CompCache, which must be compiled into the kernel. This can come in very handy with devices with a low amount of RAM.

2.) Get a small(-ish) flash drive based on SLC, rather than MLC Flash chips. It will last far longer and is more robust and even faster.
Re: USB vs NAND as a swap location
March 16, 2013 07:53PM
ingmar_k Wrote:
-------------------------------------------------------
> There are two options that I know of:
>
> 1.) Use ZRAM/CompCache, which must be compiled
> into the kernel. This can come in very handy with
> devices with a low amount of RAM.
>
> 2.) Get a small(-ish) flash drive based on SLC,
> rather than MLC Flash chips. It will last far
> longer and is more robust and even faster.

Thanks, this is interesting! How do we know which flash drive uses SLC?
Re: USB vs NAND as a swap location
March 17, 2013 10:16AM
Good question.
Most manufacturers will mention it somehow in the product description, though. SLC-NAND is faster, more robust and thus much more expensive than MLC. So it's a feature!
Besides that it's not really easy to tell, without closer inspection.
Re: USB vs NAND as a swap location
March 25, 2013 11:35AM
It is kind of hard to find detailed info on the flash type that certain USB drives use.
After some searching however, I found, what seems to be a safe bet:

http://www.mx-technology.com/en/product/flash2.php?sid=38

Those are guaranteed to use SLC NAND. And from the looks of it they aren't even as expensive as I had feared. However, I have no info on the reliability.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: