Embedded transaction filesystem for RAM/SRAM
fs-etfs-ram [common-options] [-Ddriver-options]
ARM, MIPS, PowerPC, SH4, x86, and XScale processors
|
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. |
- -a
- Update access times (atime). Default is to not update
atime, to reduce the number of flash writes.
- -b priority
- Run background reclaim at this priority. Default is 8.
- -B
- Don't detach and run in the background. This is useful for debugging.
- -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.
- -C 0|1|2
- Disable error checking/correction.
- 0
- No CRC check, no ECC correction (RAM).
- 1
- CRC check, no ECC correction (SRAM or NOR Flash).
- 2
- CRC check, ECC correction (NAND Flash).
Default: use CRCs for error checking and ECCs for
error correction.
- -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 are
not erased. Blocks that become bad during normal use (worn-out blocks) are
also skipped during the erasing.
- -f numfiles
- Set maximum number of files. The default value is 4096, with a maximum of 32,767.
- -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. Default is 6. The fs-etfs-ram
utility doesn't defragment if num is 0.
- -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.
- -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.
Default is 8.
- -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.
- -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).
- -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. Default is 4.
- -t sec
- Set a timer for background operations. Default is 5 seconds.
- -v[v...]
- Set verbosity. Each -v increases verbosity.
- -W erasediff
- Set 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. Default is 8.
- 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.
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.
|
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.
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
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:
- Hard links, and related links. For example
the . and ..
directories aren't returned in a readdir().
Symlinks are fully supported.
- Access times aren't updated on the media unless
the -a option is
specified, to reduce flash writes.
- The parent directory's modification time isn't updated when the
directory content changes (files are created or deleted).
etfsctl,
mketfs,
mount,
umount
Filesystems
chapter of System Architecture
“Filesystem limits”
in the Understanding System Limits chapter of the
QNX Neutrino User's Guide