Simulate flash filesystem using RAM memory
You must be root to start this driver.|
[-a] [-b priority]
[-E] [-f verifylevel] [-i arrayindex[,partindex]]
[-l] [-m mountover]
[-p backgroundpercent[,superlimit]] [-r]
[-t threads] [-u update] [-V] [-v]
MIPS, PowerPC, x86, SH, and ARM
- Don't automount filesystem partitions present on the media.
See also the -R option.
- -b priority
- Enable background reclaim at the specified priority.
By default, background reclamation is disabled.
- Do not daemonize. Exit on EBADFSYS with partition num + 1 of corrupt
- -f verifylevel
- Simulate flash verify; only provided for syntax
compatibity with real flash hardware (default=0, 0=none, write=1, erase=2,
- -i arrayindex[,partindex]
- Starting socket index and first partition index;
0 >= index >=15. The default is 0,0.
Use this to give multiple drivers unique IDs.
The -i option is just a suggestion for the resource
database manager; the selected indexes can be larger.
- List the available flash databases and exit.
- -m mountover
- Override the mountpoints assigned to a file system that are
formatted with an empty (i.e. flashctl -p/dev/fs0p0 -e -f -n "") mountpoint. The mountover
argument can include two
%X format specifiers (like those for printf())
that are replaced by the socket index and the partition index.
|| The -m option doesn't override a mountpoint specified with
- -p backgroundpercent[,superlimit]
- Set the background-reclaim percentage trigger (stale space over free
space) and, optionally, the superseded extent limit before reclaim.
The default is 100,16.
- Mount the automount filesystem as read-only. It doesn't affect raw
partition mounts. The -R option has an effect only at startup and
initialization. Any subsequent mounting (with either flashctl or
ignores the -R option. If you use -a option, the
-R option is ignored.
- Specify this option always. Enable fault recovery for
dirty extents, dangling extents, and partial reclaims. If you
don't specify -r, recovery isn't performed, which, when power
faults are likely, can waste space on the media or make the media
read-only. You should always specify the -r option unless you're
trying to debug a flash corruption issue or you don't have the
time to repair a damage.
- -s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]
- Set socket options, normally the base physical address, window size,
array offset, array size, unit size, bus width, and interleave. The format is left flexible
for socket services with customized drivers.
The arguments are:
- Physical base address of the flash part. This value is board-specific.
For the devf-ram utility, the base argument carries a
- Allocate system memory.
- Use the exact physical address. You must exercise caution here. See the caveats below.
- Size of the physically contiguous flash part.
- For SRAM, the offset from the base address to the start of the flash
- For SRAM, the size of the flash array. The default is equal to
- The size of a physical erase sector. For SRAM, this number can be any power of two.
64K should be the minimum, for performance reasons.
- The total width of the data bus, as seen from the microprocessor's perspective. This is the
width of one simulated flash chip multiplied by the interleave.
The value is specified as a power of 2 (1,2,4,8).
- The number of simulated flash chips arranged on the data bus.
You can specify the base physical address, sizes, and offset
in octal (0777), hexadecimal (0x1ff), or
The sizes must be a power of two, and you can specify them with any of
the following suffixes:
- (nothing) -- bytes
- k -- kilobytes
- m -- megabytes
|| On ARM targets, devf-ram can't resize the shared object
If you need to restart devf-ram with a new size, first unlink
the old shared object:
- -t threads
- Number of threads;
1 >= threads >= 4
(default is 2). Extra threads increase performance when
background reclaim is enabled (with the -b option) and
when multiple chips and/or spare blocks are available.
- -u update
- Update level for timestamps; 0 for never update,
1 to update files only, and 2 to update files
and directories. The default update is 0.
- Display filesystem and MTD version information.
- Display verbose information.
- -w buffersize
- Write (append) buffer size in bytes. The default
buffersize is 512. Using a larger write-buffer
prevents the creation of very small extents, reducing overhead.
If buffersize is 0, appending is disabled.
The devf-ram manager simulates flash filesystem in RAM using the
following default filenames (the ID, n, appended to
be changed via the -i option):
- Default mountpoint for socket n.
- Raw access for socket n, partition 0.
- Flash filesystem mountpoint for socket n, partition 0 with
||You should always specify the -r option unless you're trying to
debug a flash corruption issue or you don't have the time to repair a damage.
See the background information for this:
- If an erase was happening when the power is cut off,
it results in a number of dangling extents at the next
power on. These extents continue to occupy space forever, until they
are deleted. Using the -r option will cause them to be deleted.
If you start the the driver with -vv, it prints dangle
every dangling extent found.
- If the
filesystem detects an error, and the -r isn't specified, the
driver marks the partition read-only, so that more damage isn't done.
The second case is when a reclaim was interrupted by a power-loss. In this
case the spare block may be unusable and the driver prints
partial to the console. The partition is still read-write, but
turned off, which means overwriting of files will eventually fill up the
filesystem with stale data.
You can specify the mountpoint above with the
mount attribute of the
command, and override it with the
-n option to
By default, it's /fsnp0.
Start devf-ram with a 16MB partition.
Start devf-ram and automatically mount the flash filesystem
partitions, with an initial fault recovery process, most POSIX semantics
enabled and background reclaim at priority 5 (default size: 1M):
devf-ram -r -u2 -b5 &
Create a 32MB flash partition, allocated from system RAM, with a 64KB unit
devf-ram -s0,32m,,,64k -v -r
Create a 128MB flash partition in system RAM, with large block sizes (to
devf-ram -s0,128m,,,512k -v -r
Create a 4MB partition from system RAM:
devf-ram -s0,4m,,,64k -v -r
||You must format and erase a
devf-ram partition before you can mount the flash filesystem. See
the caveats below.
||If you specify a blocksize in your buildfile for DRAM-based flash filesystems,
limit the size to the default, which is 64K.|
Although the flash filesystem 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 everything related to hard links (the
. and .. directories don't exist,
struct stat's nlink member is hard-coded,
of directories returns ENOTSUP).
- Access times aren't updated on the media; they're set to
the modification time.
QNX Neutrino flash filesystem version 3 no longer
provides built-in decompression.
The flash filesystem's decompression functionality has moved into the
resource manager. You should now use the deflate utility to compress files.
Performance might be slow when multiple writers are writing randomly
to a shared file or to a shared directory (e.g. using unlink or
In these cases,
the offset pointers have to be rewound for every access.
There's no performance penalty when appending to a file, or when
creating files with open(O_CREAT),
mkdir, mknod, or link.
Don't try to create a devf-ram partition at the address of a real flash memory.
You may get an error message: Unable to properly identify any flash
Don't try to create a devf-ram partition (e.g. using nonzero value for
base argument) at the address of physical memory that is in use.
It may destroy applications and crash the operating system.
The only use for specifying such nonzero base is to create a
flash filesystem for board specific memory (e.g. SRAM).
You must format and erase a
devf-ram partition before you can mount the flash filesystem. e.g.
flashctl -p /dev/fs0p0 -e -f -m
If there's insufficient RAM, when you try to create an nM size
partition with -s0 option, the
devf-ram driver returns without an error message.
The partition isn't created.
in the Working With Filesystems chapter of the User's Guide