Montag, 24. November 2014

Nilfs2 is a great filesystem for slow pen drives and sd-cards

To extend the capacity limited SSD of my Notebook I tend to move a lot of seldom-used data (e.g. the installation-directory of my Steam installation) to compact usb pen drives and sd cards. These cheap flash devices all have a very weak FTL (flash translation layer) in common and are extremly slow for small random writes (like filesystem metadata updates).

Initially I used ext4 for the pen-drive which caused Steam to be nearly unuseable - often the user interface was blocked for 10s of seconds and launching games took minutes.
Out of curiosity I re-formatted the pen-drive with NILFS2 (a log-structured file-system) which writes data only in linear in a log-structured way. Now the FTL is freed from managing randomly written chunks and the drive performs only the linear writes it was designed for. Games launch instantly and Steam doesn't experience any hangs or issues. Beside the higher performance, write amplification is decreased a lot by not forcing read-modify-write cycles when modifying data randomly.

Kudos to the Nilfs2 developers!

Samstag, 1. November 2014

The dangers of gift usb pen-drives

I've seen quite a few (~5) usb pen drives dying the last months, usually after what I would consider as light useage. They did not go read-only, but instead lost all content and dropped dead.
All those pen drives had in common, they were/had:
  • very small (1-4 GB) 
  • free / gifts
  • Alcor Micro controllers

The reason they all have small capacity stems from the fact that junk flash is used, where only a small portion is functional.
The image below shows an open Digikey 1GB pen-drive (I got two of these, both died with < 5GB written). The flash is unlabelled, only marked with what appears crayon.  Using ChipGenius to read the flash configuration, it turns out the chip is actually an 8GB Sandisk part.

The shown part is from digikey, but I've head the same stuff from Freescale and other companies, all were highly unreliable. I've had gift pen-drivers which looked exactly the same and were fine (but didn't have "junk flash"), so I guess some manufacturer has started building that stuff in high volume.

Bottom line: Those pen drives are gutter crap. If your data/time is valueable, don't use them. In don't understand why companies like Digikey or Freescale destroy their reputation with crap like this - better no gifts than stuff like this.