.TH "doc_help_kdb-mount_md" 3elektra "Fri Aug 4 2023" "Version 0.11.0" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
doc_help_kdb-mount_md \- kdb-mount(1) - Mount a file to the key database 
 
.SH "SYNOPSIS"
.PP
\fCkdb mount [<path> <mount point>] [<plugin> [<config>] [\&.\&.]]\fP
.br
.PP
.IP "\(bu" 2
Where \fCpath\fP is the path to the file the user wants to mount\&. See \fCkdb plugin-info resolver\fP for details what an absolute and relative path means\&. See also IMPORTANT below\&.
.IP "\(bu" 2
\fCmountpoint\fP is where in the key database the new backend should be mounted\&. For a cascading mount point, \fCmountpoint\fP should start with \fC/\fP\&. See also IMPORTANT below\&.
.IP "\(bu" 2
A list of such plugins with a configuration for each of them can be given:
.IP "  \(bu" 4
\fCplugin\fP should be an Elektra plugin\&.
.IP "  \(bu" 4
Plugins may be followed by a \fC,\fP separated list of \fCkeys=values\fP pairs which will be used as plugin configuration\&.
.PP

.PP
.SH "DESCRIPTION"
.PP
This command allows a user to persistently mount a new \fIbackend\fP\&. Mounting in Elektra allows the user to mount a file into the current key database like a user may mount a partition into the current file system\&. This functionality is key to Elektra as it allows users to build a global key database comprised of many different configuration files\&.
.PP
A backend acts as a worker to allow Elektra to interpret configuration files as keys in the central key database such that any edits to the keys are reflected in the file and vice versa\&. Additionally, the user can use this command to list the currently mounted backends by running the command with no arguments\&. More about mounting is explained in \fBelektra-mounting(7)\fP\&.
.SH "IMPORTANT"
.PP
This command writes into the \fC/etc\fP directory to make the mounting persistent\&. As such it requires root permissions\&. Use \fCkdb file system:/elektra/mountpoints\fP to find out where exactly it will write to\&.
.PP
Absolute paths are still relative to their namespace (see \fCkdb plugin-info resolver\fP)\&. Only system+spec mount points are actually absolute\&. Read \fBelektra-namespaces(7)\fP for further information\&.
.PP
For cascading mount points (starting with \fC/\fP) a mount point for the namespace \fCdir\fP, \fCuser\fP and \fCsystem\fP is created\&. Each of this mount point uses a different configuration file, either below current directory, below home directory or anywhere in the system\&. Use \fCkdb file <path>\fP to determine where the file(s) are\&.
.SH "OPTIONS"
.PP
.IP "\(bu" 2
\fC-H\fP, \fC--help\fP: Show the man page\&.
.IP "\(bu" 2
\fC-V\fP, \fC--version\fP: Print version info\&.
.IP "\(bu" 2
\fC-p\fP, \fC--profile <profile>\fP: Use a different kdb profile\&.
.IP "\(bu" 2
\fC-C\fP, \fC--color <when>\fP: Print never/auto(default)/always colored output\&.
.IP "\(bu" 2
\fC-v\fP, \fC--verbose\fP: Explain what is happening\&. Prints additional information in case of errors/warnings\&.
.IP "\(bu" 2
\fC-d\fP, \fC--debug\fP: Give debug information or ask debug questions (in interactive mode)\&. Prints additional information in case of errors/warnings\&.
.IP "\(bu" 2
\fC-q\fP, \fC--quiet\fP: Suppress non-error messages\&.
.IP "\(bu" 2
\fC-i\fP, \fC--interactive\fP: Instead of passing all mounting information by parameters ask the user interactively\&.
.IP "\(bu" 2
\fC-s\fP, \fC--strategy\fP: (experimental, use with care) By default mounting is rejected if the mountpoint already exists\&. With the strategy \fIunchanged\fP you can change the behavior to be successful if \fIexactly\fP the same config would be written (see #1306 why this does not always work correctly)\&.
.IP "\(bu" 2
\fC-R\fP, \fC--resolver <resolver>\fP Specify the resolver plugin to use if no resolver is given, the default resolver is used\&. See also \fCbelow in KDB\fP\&.
.IP "\(bu" 2
\fC-0\fP, \fC--null\fP: Use binary 0 termination\&.
.IP "\(bu" 2
\fC-1\fP, \fC--first\fP: Suppress the first column\&.
.IP "\(bu" 2
\fC-2\fP, \fC--second\fP: Suppress the second column\&.
.IP "\(bu" 2
\fC-c\fP, \fC--plugins-config <plugins-config>\fP: Add a plugin configuration for all plugins\&.
.IP "\(bu" 2
\fC-W\fP, \fC--with-recommends\fP: Also add recommended plugins and warn if they are not available\&.
.IP "\(bu" 2
\fC-f\fP, \fC--force\fP: Unmount before mounting: Does not fail on already existing mount points\&.
.PP
.SH "KDB"
.PP
.IP "\(bu" 2
\fC/sw/elektra/kdb/#0/current/quiet\fP: Same as \fC-q\fP: Suppress default messages\&.
.IP "\(bu" 2
\fC/sw/elektra/kdb/#0/current/resolver\fP: The resolver that will be added automatically, if \fC-R\fP is not given\&.
.IP "\(bu" 2
\fC/sw/elektra/kdb/#0/current/plugins\fP: It contains a space-separated list of plugins and their configs which are added automatically (by default sync)\&. The plugin-configuration syntax is as described above in the \fCsynopsis\fP\&.
.PP
.SH "EXAMPLES"
.PP
To list the currently mounted backends:
.br
 \fCkdb mount\fP
.PP
To mount a system configuration file using the ini format:
.br
 \fCkdb mount /etc/configuration\&.ini system:/example ini\fP
.PP
Print a null-terminated output of paths and backend names:
.br
 \fCkdb mount -02 | xargs -0n 2 echo\fP
.PP
To mount the /etc/file system file with two plugins with a respective configuration option each:
.br
 \fCkdb mount /etc/file system:/file plugin1 plugin1config=config1 plugin2 plugin2config=config2\fP
.PP
To mount the /etc/file system file with two plugins and setting both to be verbose:
.br
 \fCkdb mount -c verbose=1 /etc/file system:/file plugin1 plugin2\fP
.PP
To recode and rename a configuration file using Elektra:
.br
 \fCkdb mount recode\&.txt dir:/recode ni rename cut=path iconv to=utf8,from=latin1\fP
.SH "SEE ALSO"
.PP
.IP "\(bu" 2
\fBelektra-glossary(7)\fP\&.
.IP "\(bu" 2
\fBkdb-spec-mount(1)\fP\&.
.IP "\(bu" 2
\fBkdb-umount(1)\fP\&.
.IP "\(bu" 2
\fBkdb-mountOdbc(1)\fP\&.
.IP "\(bu" 2
\fBelektra-mounting(7)\fP\&. 
.PP

