.\" Automatically generated by Pandoc 1.17.2
.\"
.TH "FLASHCACHE_CREATE" "8" "September 2011" "flashcache_create" ""
.hy
.SH NAME
.PP
flashcache_create \- create a new flashcache volume
.SH DESCRIPTION
.PP
\f[B]flashcache_create\f[] initializes a new flashcache volume from
unformated block devices.
It creates flashcache meta data and provides new volumes though their
volume mappings.
.SH SYNOPSIS
.PP
flashcache_create \-p \f[I]back\f[]|\f[I]around\f[]|\f[I]thru\f[] [\-s
\f[I]cache size\f[]] [\-b \f[I]block size\f[]] [\-v]
\f[I]cachedevname\f[] \f[I]cache_devname\f[] \f[I]disk_devname\f[]
.SH OPTIONS
.TP
.B \-v
verbose
.RS
.RE
.TP
.B \-p
\f[I]cache mode\f[].
Required argument.
Specify any supported option: (write\-)\f[B]back\f[],
(write\-)\f[B]thru\f[] or (write\-)\f[B]around\f[].
Their respective implications are denoted below.
.RS
.RE
.TP
.B \-s
\f[I]cache size\f[].
Optional argument.
By default, flashcache will use the auto\-detected full cache device
size.
When present, the given cache size is used instead.
The expected units are sectors, however any value can be suffixed by
"k", "m" or "g" to interpret the argument in kilo\-, mega\- or gigabytes
respectively.
.RS
.RE
.TP
.B \-b
\f[I]block size\f[].
Optional argument.
Defaults to 4KB.
Must be a power of 2.
The default units is sectors.
However, \f[I]k\f[] can be specified as unit type as well.
(A 4KB blocksize is the correct choice for the vast majority of
applications.
.RS
.RE
.TP
.B \-f
force create.
Bypass all sanity checks (for example for the sector size).
Use with care.
.RS
.RE
.SH CACHING MODES
.PP
The following caching modes are supported:
.PP
\f[I]Writethrough\f[] (\f[B]thru\f[]) \- safest mode, all writes are
cached to the cache device but are also being written to disk
immediately.
If the used cache device has a lower write performance than the backend
disk (many early generation SSD drives manufactured between 2008\-2010
are known for such a poor write performance) enabling the writethrough
mode may decrease the system write performance.
All disk reads are cached (tunable through flashcache\[aq]s
\f[I]/proc\f[] interface).
.PP
\f[I]Writearound\f[] (\f[B]ardound\f[]) \- again, very safe, writes are
not written to the cache device, but directly to the backend disk
instead.
Disk blocks will only be cached after they are read.
All disk reads are cached (tunable through flashcache\[aq]s
\f[I]/proc\f[] interface).
.PP
\f[I]Writeback\f[] (\f[B]back\f[]) \- fastest mode but less safe.
Writes only go to the cache device initially, and are being written to
the backend disk later, depending on configured system policie.
All disk reads are cached (tunable through flashcache\[aq]s
\f[I]/proc\f[] interface).
.SH CACHE PERSISTENCE
.PP
Writethru and Writearound caches are not persistent across a device
removal or a reboot.
Only Writeback caches are persistent across device removals and reboots.
This reinforces \[aq]writeback is fastest\[aq], \[aq]writethrough is
safest\[aq].
.SH EXAMPLES
.TP
.B \f[B]flashcache_create\f[] \-p back \-s 1g \-b 4k cachedev /dev/sdc /dev/sdb
Creates a 1GB writeback cache volume with a 4KB block size on the cache
device /dev/sdc to cache the disk volume /dev/sdb.
The name of the device created is "cachedev".
.RS
.RE
.TP
.B \f[B]flashcache_create\f[] \-p thru \-s 2097152 \-b 8 cachedev /dev/sdc /dev/sdb
Same as above but creates a write through cache with units specified in
sectors instead.
The name of the device created is "cachedev".
.RS
.RE
.SH SEE ALSO
.PP
\f[C]flashcache_load\f[](8), \f[C]flashcache_destroy\f[](8)
.PP
\f[I]README\f[] and other documents in
\f[B]/usr/share/doc/flashcache\-utils\f[].
In particular, see \f[B]flashcache\-sa\-guide.txt\f[] for configuring
the flashcache kernel module through its \f[I]/proc\f[] interface.
.PP
The flashcache source code and all documentation may be downloaded from
.
.SH AUTHORS
.PP
Flashcache is developed by Mohan Srinivasan
.PP
This man page was written by Dmitry Smirnov for
Debian GNU/Linux (but may be used by others).