fs-etfs-ram

Embedded transaction filesystem for RAM/SRAM

Syntax:

fs-etfs-ram [common-options] [-Ddriver-options]

Runs on:

QNX Neutrino

Targets:

ARMv7, x86

Options:

Note: Board Support Packages may include a board-specific embedded transaction filesystem. All fs-etfs-* filesystems use the same common options as fs-etfs-ram; for driver-specific options, see the BSP documentation or use the -D use option, as described in "Driver options," below.

Common options

-a
Update access times (atime). Default is to not update atime, to reduce the number of flash writes.
-B
Don't detach and run in the background. This is useful for debugging.
-b priority
Run background reclaim at this priority. The default is 8.
-C 0|1
Disable error checking/correction:
0
No CRC check, no ECC correction (RAM).
1
CRC check, no ECC correction (SRAM or NOR Flash).

Default: use CRCs for error checking and ECCs for error correction.

-c nclusters
Set the cache size. The cache holds recently read clusters in RAM, reducing the need to access the device if the same cluster is read again. It's also used to combine small writes into larger writes consisting of multicluster transactions. This reduces file fragmentation across the device and improves filesystem startup time. Since most devices are very fast, a small cache is usually acceptable. Larger caches may be desirable if many files are being written with small writes concurrently. The default value is 64 clusters, where cluster size is usually 1 KB or 2 KB, depending on the device.
-D
Specify driver options; see "Driver options," below.
-e
Erase the device and create an empty filesystem that is ready to use. For NAND flash, factory-marked bad blocks aren't erased. Blocks that become bad during normal use (worn-out blocks) are also skipped during the erasing.
-F num
Defragment if the average extent is less than num clusters. The value of num must be in the range from 0 through 16. The default is 6. The fs-etfs-ram utility doesn't defragment if num is 0.
-f numfiles
Set the maximum number of files. The default value is 4096, with a maximum of 32,767.
Note: Filenames that are more than 32 bytes long use two directory entries, reducing the number of files that you can actually have.
-I
Perform internal integrity checks of internal data structures while the filesystem is running. This slows down the filesystem; its main purpose is for debugging new drivers and new versions of the filesystem.
-k
Allow the automatic correction of the .counts file in an image created using mketfs. This file is an array of the blocks showing the read and erase counts, used in wear leveling.

If the value of the num_blocks attribute wasn't specified correctly, the size of the .counts file on the image won't be correctly calculated. The size of this file is also not updated at runtime at any point, and as such, it will leave many blocks with no wear-leveling enabled. The -k option automatically updates the size of the .counts file to cover all the blocks on the part.

-L
Don't perform .lost+found recovery at startup.
-m mountpoint
Set the directory for fs-etfs-ram to use as its mountpoint. On an embedded system where ETFS is the major filesystem, this is set as -m / for taking over the root. If you don't specify this option, the ETFS isn't mounted.
-o numattr
Set the number of attributes to cache, which speeds up opens slightly. The default is 8.
-R
Reserve a percentage of the flash to avoid issues that arise when a flash device becomes completely full. Default is 5% (of the device size).
-r kbytes
Set the size of the raw partition /dev/etfs1, in kilobytes. This partition, if present, is typically used to hold a boot image made using the mkifs utility. The default size is 0.
-S
Implement transaction checksum using a fast and simple sum calculation rather than the default polynomial CRC algorithm. This may be faster but less robust.
-s num
Set the number of flash blocks to use as spares. One spare block is required to perform a reclaim. During normal operation, flash devices wear, which causes flash blocks to fail. More than one spare block provides extra redundancy. The default is 4.
-t sec
Set a timer for background operations. The default is 5 seconds.
-V
Request read verifications on all writes.
-v[v...]
Be verbose. Each -v increases the verbosity.
-W erasediff
Set the wear-leveling span. Allow flash blocks to have erase counts that differ by more than erasediff before attempting to either :
  • force them into service if they are below erasediff

    Or:

  • give them a rest if they are above erasediff

The default value is 50.

-x nextents
Cache this number of file extent offsets. This option reduces the processing needed to read through file extents on the device. The default is 8.

Driver options

use
Get a list of driver-specific options. This option causes the filesystem to print a usage message and then terminate without accessing the device.
size=nnM
Set the size of the RAM disk to nn megabytes. The default is 16 MB.

Description:

The embedded transaction filesystem (ETFS) implements a high-reliability filesystem for use with embedded solid-state memory devices with particular attention to NAND flash memory. The filesystem supports a fully hierarchical directory structure with POSIX semantics as shown in the table below:

POSIX capability Supported by ETFS
Access date Yes (if enabled with -a command-line option)
Modification date Yes
Status change date Yes
Max filename length 91 characters
User permission Yes
Group permissions Yes
Other permissions Yes
Directories Yes
Hard links No
Symbolic links Yes

When started, ETFS creates two devices as follows:

/dev/etfs1
Raw partition for boot image
/dev/etfs2
Filesystem partition for etfs files.

The raw partition is used for boot images and is always at the start of the device. It may be zero bytes long if no boot image is needed. The filesystem partition is mounted in the pathname space as specified by the -m option.

Note: If you don't specify the -m option, the filesystem isn't mounted. You can use the mount command to mount it later:
mount -tetfs /dev/etfs2 my_mountpoint

ETFS is a filesystem composed entirely of transactions. Every write operation, whether of user data or filesystem metadata, consists of a transaction. A transaction either succeeds or is treated as if it never occurred.

For more information, see "Embedded transaction filesystem (ETFS)" in the Filesystems chapter of the System Architecture guide.

Examples:

Start ETFS to implement a temporary filesystem in RAM mounted at /tmp. Since it's not persistent across a reboot, and since RAM is reliable, you should disable all data error detection and correction (-C 0). The -e option initializes an empty filesystem ready to go upon startup. Since the filesystem is in high-speed RAM, you should specify the smallest cache possible with the -c 0 option.

fs-etfs-ram -C 0 -e -c 0 -m /tmp

Caveats:

Although ETFS supports most POSIX semantics, some functionality isn't implemented in order to keep the driver simple and efficient. The unsupported POSIX semantics include: