title
stringlengths
1
61
section
stringlengths
2
92
content
stringlengths
6
236k
Yakuake
Configuration
## Configuration ### Background transparency and blur on Plasma While most configuration options can be changed from Yakuake GUI, there are some options only accessible from modifying the configuration file, e.g. the option to use blur background under [Plasma](../en/KDE.html#Plasma "Plasma"). **Note:** Enabling the *Blur background* option in Yakuake's Konsole profile will enable blur for Yakuake's window but show a warning as `Konsole was started before desktop effects were enabled. You need to restart Konsole to see transparent background.`. There are [bug reports on upstream about this warning](https://bugs.kde.org/show_bug.cgi?id=395520) . The warning is somewhat misleading because Yakuake uses KonsolePart which does not have support for blur/transparency, but Yakuake itself can apply such effects to its window. In order to apply blur background for Yakuake, edit the following file: ``` ~/.config/yakuakerc ``` ``` [Appearance] Blur=true Translucency=true ``` Then restart Yakuake to apply the change.
Yakuake
Yakuake scripting
## Yakuake scripting Like [Guake](../en/Guake.html "Guake"), Yakuake allows to control itself at runtime by sending the [D-Bus](../en/D-Bus.html "D-Bus") messages. Thus it can be used to start Yakuake in a user defined session. You can create tabs, assign names for them and also ask to run any specific command in any opened tab or just to show/hide Yakuake window, manually in a terminal or by creating a custom script for it. Example of such a script is given below. This includes opening tabs, renaming tabs, splitting shells, and running commands. ``` #!/bin/bash # Starting Yakuake based on user preferences. Information based on https://forums.gentoo.org/viewtopic-t-873915-start-0.html # Adding sessions from previous website is broken, use this: https://koston.pl/blog/sublime-text-3-cheatsheet-modules-web-develpment/ # This line is needed in case Yakuake does not accept fcitx inputs. /usr/bin/yakuake --im /usr/bin/fcitx --inputstyle onthespot & # gives Yakuake a couple seconds before sending dbus commands sleep 2 # Start htop in tab and split to user terminal and run iotop TERMINAL_ID_0=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId 0) qdbus org.kde.yakuake /yakuake/tabs setTabTitle 0 "user" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 0 "htop" qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalLeftRight "$TERMINAL_ID_0" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 1 "iotop # Start split root sessions (password prompt) top and bottom SESSION_ID_1=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession) TERMINAL_ID_1=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId "$SESSION_ID_1") qdbus org.kde.yakuake /yakuake/tabs setTabTitle 1 "root" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 2 "su" qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalTopBottom "$TERMINAL_ID_1" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 3 "su" # Start irssi in its own tab. qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession qdbus org.kde.yakuake /yakuake/tabs setTabTitle 2 "irssi" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 4 "ssh home -t 'tmux attach -t irssi; bash -l'" # Start split ssh shells in own tab. SESSION_ID_2=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.addSession) TERMINAL_ID_2=$(qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.terminalIdsForSessionId "$SESSION_ID_2") qdbus org.kde.yakuake /yakuake/tabs setTabTitle 3 "work server" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 5 "ssh work" qdbus org.kde.yakuake /yakuake/sessions org.kde.yakuake.splitTerminalLeftRight "$TERMINAL_ID_2" qdbus org.kde.yakuake /yakuake/sessions runCommandInTerminal 6 "ssh work" ``` ### dbus-send instead of qdbus You can replace *qdbus* bundled with [Qt](../en/Qt.html "Qt") with more common *dbus-send*. For example, to show/hide Yakuake: ``` $ dbus-send --type=method_call --dest=org.kde.yakuake /yakuake/window org.kde.yakuake.toggleWindowState ```
Yakuake
Tips and tricks
## Tips and tricks ### Show notification when sudo asks password When you do a long process that requires entering sudo password at the end (for example, when building a package from AUR), you often want to hide yakuake window and do something else. But when you go back to check the status, you see that sudo had exited by timeout. To avoid that, you can configure yakuake to send system notifications at bell in inactive session. Inactive session is a session on another tab or on current tab but when yakuake is not in focus. In Yakuake's menu *(hamburger button) > Configure Notifications*. In that window select *Bell in Non-Visible Session* and enable *Show a message in a popup*. Additionally you can set a sound (usually `/usr/share/sounds/freedesktop/stereo/bell.oga` or `/usr/share/sounds/Oxygen-Sys-Warning.ogg`). Then you need to configure a sudo prompt to use a bell symbol. See [Sudo#Add terminal bell to the password prompt](../en/Sudo.html#Add_terminal_bell_to_the_password_prompt "Sudo").
Yakuake
Troubleshooting
## Troubleshooting ### True-color programs do not display correctly See [Konsole#True-color programs do not display correctly](../en/Konsole.html#True-color_programs_do_not_display_correctly "Konsole").
Yakuake
See also
## See also * [Yakuake scripting on coderwall.com](https://coderwall.com/p/kq9ghg/yakuake-scripting) [Categories](../Special:Categories.html "Special:Categories"): * [KDE](../en/Category:KDE.html "Category:KDE") * [Terminal emulators](../en/Category:Terminal_emulators.html "Category:Terminal emulators") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Yakuake&oldid=759241>" - This page was last edited on 7 December 2022, at 21:10. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Yandex Disk
Intro
# Yandex Disk \[ ] 2 languages * [日本語](https://wiki.archlinux.jp/index.php/Yandex_Disk "Yandex Disk – 日本語") * [Русский](../ru/Yandex_Disk.html "Yandex Disk – русский") From ArchWiki [Yandex.Disk](https://disk.yandex.ru) is a free cloud storage service created by Yandex that gives you access to your photos, videos and documents from any internet-enabled device. The official Yandex.Disk console client lets you: * synchronize files and folders with your Disk, * get public links to files and folders, * customize folder syncing.
Yandex Disk
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [yandex-disk](https://aur.archlinux.org/packages/yandex-disk/)AUR package. Note that it is a CLI client — there is no official GUI for it at the moment. For alternatives see [#Unofficial clients](#Unofficial_clients). To setup your proxy, user and local folder, enter ``` $ yandex-disk setup ``` Syncing will start after completing this step, now you are ready to use Yandex.Disk.
Yandex Disk
Commands
## Commands You can manage your folder using any file manager or console. Full list of commands is available in `man yandex-disk` or using ``` $ yandex-disk --help ``` Here are some examples of use: * `setup` — Launch the setup wizard. * `start` — Launch the daemon and start syncing folders. The current sync status is recorded in the file `.sync/status`. * `stop` — stop the daemon. * `status` — show daemon status: sync status, errors, recently synced files, disk space status. If FILE is specified, the status for this file will be returned. * `token` — receive OAuth token, encode and save it in a special file (by default `~/.config/yandex-disk/passwd`). If the options `-p password` or `--password password` are not specified, the password will be read from STDIN. * `sync` — sync the folder and log out (if the daemon is running, wait for syncing to finish). * `publish` — make the specified file/folder public and print the link to STDOUT. The item will be copied to the sync folder. Use the option `--overwrite` to rewrite existing items. * `unpublish` — removes public access to the file/folder.
Yandex Disk
Unofficial clients
## Unofficial clients * [ekstertera](https://aur.archlinux.org/packages/ekstertera/)AUR — GUI client based on [Qt5](../en/Qt.html "Qt"). * [yandex-disk-indicator](https://aur.archlinux.org/packages/yandex-disk-indicator/)AUR and [yandex-disk-indicator-git](https://aur.archlinux.org/packages/yandex-disk-indicator-git/)AUR — GUI panel indicator. * [ydcmd](https://aur.archlinux.org/packages/ydcmd/)AUR — console client written in [Python](../en/Python.html "Python") 3.
Yandex Disk
See also
## See also <https://help.yandex.com/disk/cli-clients.xml> [Category](../Special:Categories.html "Special:Categories"): * [Cloud synchronization](../en/Category:Cloud_synchronization.html "Category:Cloud synchronization") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Yandex_Disk&oldid=793987>" - This page was last edited on 6 December 2023, at 14:58. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Yggdrasil
Intro
# Yggdrasil \[ ] 2 languages * [日本語](https://wiki.archlinux.jp/index.php/Yggdrasil "Yggdrasil – 日本語") * [Русский](../ru/Yggdrasil.html "Yggdrasil – русский") From ArchWiki [Yggdrasil](https://yggdrasil-network.github.io/) is an early-stage implementation of a fully end-to-end encrypted IPv6 network. It is lightweight, self-arranging, supported on multiple platforms, and allows pretty much any IPv6-capable application to communicate securely with other Yggdrasil nodes. This article describes how to set up and use Yggdrasil.
Yggdrasil
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [yggdrasil](https://archlinux.org/packages/?name=yggdrasil) package.
Yggdrasil
Running
## Running [Start/enable](../en/Help:Reading.html#Control_of_systemd_units "Start/enable") `yggdrasil.service`. This will create a `tun` network interface and make available two new IPv6 network interfaces. The important one starts with `200:` which is what your machine will be known as in the Yggdrasil network. This IP address is using a reserved part of the IPv6 standard. This avoids any conflicts with the wider Internet. To test this works you can run: ``` # yggdrasilctl getself ```
Yggdrasil
Configuration
## Configuration You can create default configuration file `/etc/yggdrasil.conf` by running `yggdrasil-default-config.service`, also it will be created and used by running `yggdrasil.service` first time. By default your Yggdrasil instance will not have any peers and thus you are running a standalone service. Editing the `/etc/yggdrasil.conf` file, which uses the JSON format, allows one to add peers and after restarting the service your node can both reach the wider network, as well as others can find your node. **Tip:** You may want to enable a local firewall before peering with the wider network because your machine and all its services will reachable from outside when you do. More details about the configuration is available in [the upstream documentation](https://yggdrasil-network.github.io/configuration.html). To peer with the wider network, start with the [public-peers](https://github.com/yggdrasil-network/public-peers) documentation.
Yggdrasil
Local firewall
## Local firewall In todays networking practices a common Linux installation is not exposed directly to the Internet. Only servers will typically have a public IP address. As a result our ssh or similar services are not able to be attacked by anyone and everyone. It is important to realize that running Yggdrasil and peering it to the wider Yggdrasil network changes this. Services that listen on all network connections will become reachable by anyone that connects to this network. You might want configure them to not listen on the Yggdrasil network or quickly hide running services with a couple of [firewall](../en/Category:Firewalls.html "Firewall") rules. ``` /etc/iptables/ip6tables.rules ``` ``` #yggdrasil *filter :INPUT ACCEPT [8:757] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [5:463] -A INPUT -i tun0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A INPUT -i tun0 -m conntrack --ctstate INVALID -j DROP -A INPUT -i tun0 -j DROP COMMIT ``` [Start/enable](../en/Help:Reading.html#Control_of_systemd_units "Start/enable") `ip6tables.service` to make this take effect.
Yggdrasil
See also
## See also * [Upstream documentation](https://yggdrasil-network.github.io/) * [Yggdrasil services](https://yggdrasil-network.github.io/services.html) * [Wiki of Yggdrasil network users](https://howto.yggno.de/en:start) / yggdrasil network [link](http://\[222:a8e4:50cd:55c:788e:b0a5:4e2f:a92c]/en:start) * [Alfis](../ru/Alfis.html "Alfis") - DNS in Yggdrasil [Categories](../Special:Categories.html "Special:Categories"): * [Networking](../en/Category:Networking.html "Category:Networking") * [Peer-to-peer](../en/Category:Peer-to-peer.html "Category:Peer-to-peer") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Yggdrasil&oldid=797027>" - This page was last edited on 13 January 2024, at 20:32. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Yocto
Intro
# Yocto \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Yocto "Yocto – 日本語") From ArchWiki ![](../File:Gnome-colors-add-files-to-archive.svg)**This article is being considered for [archiving](../en/ArchWiki:Archive.html "ArchWiki:Archive").** **Reason:** Flagged out of date for years, no updates. (Discuss in [Talk:Yocto](../en/Talk:Yocto.html)) ![](../File:View-refresh-red.svg)**This article or section is out of date.** **Reason:** From YP Core 2.2 (Morty) and newer python3 is supported. (Discuss in [Talk:Yocto##Install in 2024](../en/Talk:Yocto.html##Install_in_2024 "Talk:Yocto")) The Yocto Project (YP) is a popular open-source collaboration project focused on embedded Linux developers. In early versions of YP it could be problematic to get it running on Arch Linux. In later versions this is no longer the case, and hopefully in the future it will be even easier. For information about how to get it running on older version, there is a good guide [here](https://wor.github.io/bash/2013/08/11/embedded-excursions-part-1.html). To use bitbake as a standalone tool, install [bitbake](https://aur.archlinux.org/packages/bitbake/)AUR. To edit bitbake recipes in vim, install [bitbake-vim](https://aur.archlinux.org/packages/bitbake-vim/)AUR. For this guide the focus will be on YP Core 1.8 (Fido) and newer. **Note:** Arch Linux is not validated to work with Yocto/Poky.
Yocto
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [git](https://archlinux.org/packages/?name=git), [diffstat](https://archlinux.org/packages/?name=diffstat), [unzip](https://archlinux.org/packages/?name=unzip), [texinfo](https://archlinux.org/packages/?name=texinfo), [python](https://archlinux.org/packages/?name=python), [chrpath](https://archlinux.org/packages/?name=chrpath), [wget](https://archlinux.org/packages/?name=wget), [xterm](https://archlinux.org/packages/?name=xterm), [sdl](https://aur.archlinux.org/packages/sdl/)AUR, [rpcsvc-proto](https://archlinux.org/packages/?name=rpcsvc-proto), [socat](https://archlinux.org/packages/?name=socat), [cpio](https://archlinux.org/packages/?name=cpio) and [inetutils](https://archlinux.org/packages/?name=inetutils) packages. Enable the [multilib](../en/Official_repositories.html#multilib "Multilib") repository and install the [multilib-devel](https://archlinux.org/packages/?name=multilib-devel) group. Clone the official git repository. In this example the *morty* branch is used. ``` $ git clone --branch morty git://git.yoctoproject.org/poky.git ~/poky ``` ### YP Core from Fido but before Morty YP Core required [python2](https://aur.archlinux.org/packages/python2/)AUR: ``` $ mkdir -p ~/bin $ ln -s /usr/bin/python2 ~/bin/python $ ln -s /usr/bin/python2-config ~/bin/python-config $ export PATH=~/bin:$PATH ``` **Note:** You will probably not get notified with **any message** if building the environment script fails because of invalid Python version.
Yocto
Build core-image-minimal
## Build core-image-minimal Time to build the *core-image-minimal* target. First place yourself in the `poky` directory and source the environment script. Then build it with *bitbake*: ``` $ cd ~/poky $ source oe-init-build-env build-qemux86 ``` **Tip:** In `~/poky/build-qemux86/conf/local.conf`: * Change the directory for downloads in order to reuse them, example `DL_DIR ?= "~/poky-downloads"`. * The build system can use a substantial amount of disk space during the build process, in order to preserve disk space add the line `INHERIT += "rm_work"`. ``` $ bitbake core-image-minimal ``` ``` WARNING: Host distribution "Arch-Linux" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Parsing recipes: 100% |########################################################################################################################################################################################################################################################################################| Time: 00:02:42 Parsing of 884 .bb files complete (0 cached, 884 parsed). 1285 targets, 41 skipped, 0 masked, 0 errors. NOTE: Resolving any missing task queue dependencies Build Configuration: BB_VERSION = "1.26.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "Arch-Linux" TARGET_SYS = "i586-poky-linux" MACHINE = "qemux86" DISTRO = "poky" DISTRO_VERSION = "1.8" TUNE_FEATURES = "m32 i586" TARGET_FPU = "" meta meta-yocto meta-yocto-bsp = "fido:08d32590411568e7bf11612ac695a6e9c6df6286" NOTE: Preparing RunQueue NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks WARNING: Failed to fetch URL http://downloads.sourceforge.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz, attempting MIRRORS if available NOTE: Tasks Summary: Attempted 1989 tasks of which 9 did not need to be rerun and all succeeded. Summary: There were 2 WARNING messages shown. ``` This will take some time to complete. For more details about yocto there is a [Quick Start Guide](https://www.yoctoproject.org/docs/1.8/yocto-project-qs/yocto-project-qs.html). **Note:** The first warning about Arch Linux not been validated is expected. The second warning can happen when failing to download a resource, the build system will then attempt to get that resource from the next mirror.
Yocto
Run core-image-minimal
## Run core-image-minimal To run this image in [QEMU](../en/QEMU.html "QEMU"), start it with the *runqemu* command as follows: ``` $ runqemu qemux86 ``` ``` Continuing with the following parameters: KERNEL: [/home/user/poky/build-qemux86/tmp/deploy/images/qemux86/bzImage-qemux86.bin] ROOTFS: [/home/user/poky/build-qemux86/tmp/deploy/images/qemux86/core-image-minimal-qemux86-20150804095542.rootfs.ext4] FSTYPE: [ext4] Setting up tap interface under sudo [sudo] password for user: Acquiring lockfile for tap0... Running qemu-system-i386... /home/user/poky/build-qemux86/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 -kernel /home/user/poky/build-qemux86/tmp/deploy/images/qemux86/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no,downscript=no -cpu qemu32 -hda /home/user/poky/build-qemux86/tmp/deploy/images/qemux86/core-image-minimal-qemux86-20150804095542.rootfs.ext4 -show-cursor -usb -usbdevice wacom-tablet -vga vmware -no-reboot -m 256 --append "vga=0 uvesafb.mode_option=640x480-32 root=/dev/hda rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 " Set 'tap0' nonpersistent Releasing lockfile of preconfigured tap device 'tap0' ``` **Tip:** If the kernel was recently updated, rebooting might help you avoid issues with *tunctl*. [Category](../Special:Categories.html "Special:Categories"): * [Development](../en/Category:Development.html "Category:Development") Hidden categories: * [Pages flagged with Template:Archive](../en/Category:Pages_flagged_with_Template:Archive.html "Category:Pages flagged with Template:Archive") * [Pages or sections flagged with Template:Out of date](../en/Category:Pages_or_sections_flagged_with_Template:Out_of_date.html "Category:Pages or sections flagged with Template:Out of date") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Yocto&oldid=809887>" - This page was last edited on 2 June 2024, at 07:44. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
yt-dlp
Intro
# yt-dlp \[ ] 5 languages * [Deutsch](https://wiki.archlinux.de/title/Youtube-dl "Youtube-dl – Deutsch") * [Español](../es/Youtube-dl.html "Youtube-dl – español") * [日本語](https://wiki.archlinux.jp/index.php/Youtube-dl "Youtube-dl – 日本語") * [Polski](../pl/Youtube-dl.html "Youtube-dl – polski") * [Українська](../uk/Youtube-dl.html "Youtube-dl – українська") From ArchWiki Related articles * [mpv](../en/Mpv.html "Mpv") * [FFmpeg](../en/FFmpeg.html "FFmpeg") **yt-dlp** is a command-line program that lets you easily download videos and audio from more than a thousand websites. See the [list of supported sites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md). **Note:** yt-dlp is a fork of [youtube-dl](https://ytdl-org.github.io/youtube-dl/) that was created after the parent project became stagnant. The upstream youtube-dl can still be [installed](../en/Help:Reading.html#Installation_of_packages "Install") as [youtube-dl](https://aur.archlinux.org/packages/youtube-dl/)AUR; commands on this page should still work, but check the [list of differences](https://github.com/yt-dlp/yt-dlp#differences-in-default-behavior).
yt-dlp
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [yt-dlp](https://archlinux.org/packages/?name=yt-dlp) package, or [yt-dlp-git](https://aur.archlinux.org/packages/yt-dlp-git/)AUR for the development version. It is recommended to also install [FFmpeg](../en/FFmpeg.html "FFmpeg") as it is used for muxing for some sites. See the optional dependencies. There are also various [graphical frontends](https://www.reddit.com/r/youtubedl/wiki/info-guis) to yt-dlp, such as [parabolic](https://aur.archlinux.org/packages/parabolic/)AUR, [tartube](https://aur.archlinux.org/packages/tartube/)AUR and [yt-dlg-git](https://aur.archlinux.org/packages/yt-dlg-git/)AUR. You can also install [yt-dlp-drop-in](https://aur.archlinux.org/packages/yt-dlp-drop-in/)AUR which provides a fake `/usr/bin/youtube-dl` executable (that just redirects to yt-dlp) for outdated programs that still look for a youtube-dl executable.
yt-dlp
Configuration
## Configuration The system-wide configuration file is `/etc/yt-dlp.conf` and the user-specific configuration file is `~/.config/yt-dlp/config`. The syntax is simply one command-line option per line. Example configuration: ``` --ignore-errors # --no-playlist # Save in ~/Videos -o ~/Videos/%(title)s.%(ext)s # Prefer 1080p or lower resolutions -f bestvideo[height<=?1080]+bestaudio/best ``` See [\[1\]](https://github.com/yt-dlp/yt-dlp/blob/master/README.md#configuration) for more information. A custom configuration file can also be specified with: ``` $ yt-dlp URL --config-locations PATH ```
yt-dlp
Usage
## Usage See [yt-dlp(1)](https://man.archlinux.org/man/yt-dlp.1) for the manual. ``` $ yt-dlp [OPTIONS] URL ``` **Tip:** In some cases (like YouTube) `URL` can be substituted with the video ID. ### Format selection When multiple formats of a video are available, *youtube-dl* will download the best ones by default. To get a list of the available formats: ``` $ yt-dlp -F URL ``` To select a specific one to download: ``` $ yt-dlp -f format URL ``` ### Extract audio Use `-x` for audio-only downloads (requires [FFmpeg](../en/FFmpeg.html "FFmpeg")): ``` $ yt-dlp -x -f bestaudio URL ``` Depending on the available source streams, this will often correct the audio-only container. If an audio-only stream is not available, exclude `-f bestaudio` from the example above. This will download the video and copy its audio as post process. By default this will remove the downloaded video, include `-k` to keep it. To also include album art (requires [atomicparsley](https://archlinux.org/packages/?name=atomicparsley)): ``` $ yt-dlp -x -f bestaudio[ext=m4a] --add-metadata --embed-thumbnail URL ``` ### Subtitles To see which languages are available: ``` $ yt-dlp --list-subs URL ``` To download a video with selected subtitles (comma separated): ``` $ yt-dlp --write-sub --sub-lang LANG URL ``` For auto-generated subtitles: ``` $ yt-dlp --write-auto-sub --sub-lang LANG URL ``` Add `--skip-download` to get only subtitles. ### Cookies To import cookies add the `--cookies-from-browser <browser>` Example of importing cookies from chromium ``` $ yt-dlp --cookies-from-browser chromium URL ```
yt-dlp
Tips and tricks
## Tips and tricks ### Faster downloads Some websites throttle transfer speeds. You can often get around this by choosing non DASH streams or by using [aria2](../en/Aria2.html "Aria2"), an external downloader which supports multi-connection downloads. For example: ``` $ yt-dlp --downloader aria2c --downloader-args '-c -j 3 -x 3 -s 3 -k 1M' URL ``` ### Playlist Using youtube-dl for a playlist usually boils down to the following options: ``` $ yt-dlp --ignore-errors --continue --no-overwrites --download-archive progress.txt usual options URL ``` This set of options allow for the download to effectively continue even after interruption. If you are archiving, add the usual `--write-xxx` and `--embed-xxx` options you may have. ### Trim (partial download) Parts of videos can be downloaded by using the output of `yt-dlp -g -f format URL` as *ffmpeg* input with the `-ss` (for input), `-t` and `-c copy` [options](https://ffmpeg.org/ffmpeg.html#Main-options). ### URL from clipboard A shell [alias](../en/Bash.html#Aliases "Alias"), a [desktop launcher](../en/Desktop_entries.html "Desktop launcher") or a keyboard shortcut can be set to download a video (or audio) of a selected (or copied) URL by outputting it from the [X selection](https://en.wikipedia.org/wiki/X_Window_selection "wikipedia:X Window selection"). See [Clipboard#Tools](../en/Clipboard.html#Tools "Clipboard").
yt-dlp
See also
## See also * [GitHub repository](https://github.com/yt-dlp/yt-dlp) for documentation. [Categories](../Special:Categories.html "Special:Categories"): * [Download utilities](../en/Category:Download_utilities.html "Category:Download utilities") * [Streaming](../en/Category:Streaming.html "Category:Streaming") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Yt-dlp&oldid=797630>" - This page was last edited on 20 January 2024, at 13:23. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
YubiKey
Intro
# YubiKey \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Yubikey "Yubikey – 日本語") From ArchWiki Related articles * [Universal 2nd Factor](../en/Universal_2nd_Factor.html "Universal 2nd Factor") * [OATH](../en/Initiative_for_Open_Authentication.html "OATH") * [dm-crypt/Encrypting an entire system](../en/Dm-crypt/Encrypting_an_entire_system.html "Dm-crypt/Encrypting an entire system") * [PAM](../en/PAM.html "PAM") * [GnuPG](../en/GnuPG.html "GnuPG") * [KeePass](../en/KeePass.html "KeePass") * [OpenPGP-card-tools](../en/OpenPGP-card-tools.html "OpenPGP-card-tools") * [Smartcards](../en/Smartcards.html "Smartcards") The [YubiKey](https://www.yubico.com) is a small [USB Security token](https://en.wikipedia.org/wiki/Security_token "wikipedia:Security token"). Depending on the model, it can: * Act as a smartcard (using the [CCID protocol](https://en.wikipedia.org/wiki/CCID_\(protocol\) "wikipedia:CCID (protocol)")) - allowing storage of both [PGP](https://developers.yubico.com/PGP/) and [PIV](https://developers.yubico.com/PIV/) secret keys. * Handle [Universal 2nd Factor](../en/Universal_2nd_Factor.html "Universal 2nd Factor") (U2F) requests. * Store and query approximately 30 [Initiative for Open Authentication](../en/Initiative_for_Open_Authentication.html "Initiative for Open Authentication") (OATH) credentials. * Handle [challenge-response requests](https://en.wikipedia.org/wiki/Challenge%E2%80%93response_authentication "wikipedia:Challenge–response authentication"), in either the Yubico OTP mode or the HMAC-SHA1 mode. * Generate [One-time passwords](https://en.wikipedia.org/wiki/One-time_password "wikipedia:One-time password") (OTP) - [Yubico's AES based standard](https://developers.yubico.com/OTP/). * "Type" a static password up to 63 characters. While offering many features, newer versions of the YubiKey are [not released as open source](https://www.yubico.com/blog/secure-hardware-vs-open-source/). Alternatives are the [Solo](../en/Solo.html "Solo"), [TKey](../en/Tillitis_TKey.html "Tillitis TKey") or [Nitrokey](../en/Nitrokey.html "Nitrokey").
YubiKey
Installation
## Installation ### Management tools * **YubiKey Manager** — Python library and command-line tool (`ykman`) for configuring and querying a YubiKey over USB. Has optional GUI. - <https://developers.yubico.com/yubikey-manager/> || [yubikey-manager](https://archlinux.org/packages/?name=yubikey-manager), [yubikey-manager-qt](https://archlinux.org/packages/?name=yubikey-manager-qt) * **Note:** After installation, enable `pcscd.service` * **YubiKey Personalization** — Library and tool for configuring and querying a YubiKey over the OTP USB connection. More powerful than ykman, but harder to use. Has optional GUI. - <https://developers.yubico.com/yubikey-personalization/> || [yubikey-personalization](https://archlinux.org/packages/?name=yubikey-personalization), [yubikey-personalization-gui](https://archlinux.org/packages/?name=yubikey-personalization-gui) ### Authentication tools * **Yubico PAM** — [PAM](../en/PAM.html "PAM") user authentication with either Yubico OTP or challenge-response. - <https://developers.yubico.com/yubico-pam/> || [yubico-pam](https://archlinux.org/packages/?name=yubico-pam) * **Yubico PAM-U2F** — [PAM](../en/PAM.html "PAM") user authentication with [U2F](../en/Universal_2nd_Factor.html "U2F"). - <https://developers.yubico.com/pam-u2f/> || [pam-u2f](https://archlinux.org/packages/?name=pam-u2f) * **Yubico Authenticator for Desktop** — GUI to read OATH codes from your YubiKey over USB. Support the newer OATH implementation (YubiKey NEO and 4) as well as the older slot-based implementation (YubiKey Standard and Edge). - <https://developers.yubico.com/OATH/YubiKey_OATH_software.html> || [yubioath-desktop](https://archlinux.org/packages/?name=yubioath-desktop) * **Yubico Authenticator 6 for Desktop** — Yubico Authenticator 6 is an application for managing the YubiKey's second factor credentials. Yubico Authenticator version 6 is a complete rewrite of the application using the Flutter framework. - <https://developers.yubico.com/yubioath-flutter/> || [yubico-authenticator-bin](https://aur.archlinux.org/packages/yubico-authenticator-bin/)AUR * **libfido2** — Client-side U2F support. Enables web browsers to use the U2F protocol for authentication with your YubiKey. - <https://developers.yubico.com/libfido2/> || [libfido2](https://archlinux.org/packages/?name=libfido2) * **YubiKey Full Disk Encryption** — Use challenge-response mode to create strong LUKS passphrases. Supports full disk encryption. - <https://github.com/agherzan/yubikey-full-disk-encryption> || [yubikey-full-disk-encryption](https://archlinux.org/packages/?name=yubikey-full-disk-encryption)
YubiKey
Inputs
## Inputs The YubiKey takes inputs in the form of API calls over USB and button presses. The button is very sensitive. Depending on the context, touching it does one of these things: * Trigger a static password or one-time password (OTP) (Short press for slot 1, long press for slot 2). This is the default behavior, and easy to trigger inadvertently. * Confirm / allow a function or access. The LED will illuminate to prompt the user. * Insert / eject the smartcard
YubiKey
Outputs
## Outputs The YubiKey transforms these inputs into outputs: * Keystrokes (emulating a USB keyboard), used to type static passwords and OTPs. (Note that static passwords are vulnerable to keyloggers.) * The built-in LED: * Blinks once when plugged in, useful for troubleshooting. * Blinks steadily when a button press is required to permit an API response. * API responses over USB. This is used for: * Challenge-Response requests (calculated using either Yubico OTP mode or HMAC-SHA1 mode) * U2F Challenge-Response requests * CCID Smartcard related requests
YubiKey
USB connection modes
## USB connection modes Depending on the YubiKey model, the device provides up to three different USB interfaces. Two of the interfaces implement the USB HID (Human Interface Device) device class; the third is a smart card interface (CCID). All three can be enabled or disabled independently, allowing control of their associated protocols. The following table shows which protocols use which interfaces: | Protocol | Interface | | -------- | ------------ | | OTP | Keyboard HID | | FIDO | Other HID | | PIV | CCID | | OpenPGP | CCID | | OATH | CCID | `ykman` uses the term "modes", named OTP, FIDO, and CCID. **Note:** ykman renamed "U2F" to "FIDO" in release 0.6.1 (2018-04-16). <https://developers.yubico.com/yubikey-manager/Release_Notes.html> ### Get enabled modes For YubiKey prior to version 5: ``` $ ykman config mode ``` ``` Current connection mode is: OTP+FIDO+CCID ``` **Note:** The command "ykman mode" has been deprecated and may be removed later For YubiKey version 5: ``` $ ykman info ``` ``` Device type: YubiKey 5 NFC Serial number: XXXXXXXXX Firmware version: 5.4.3 Form factor: Keychain (USB-A) Enabled USB interfaces: OTP, FIDO, CCID NFC transport is enabled. Applications USB NFC FIDO2 Enabled Enabled OTP Enabled Enabled FIDO U2F Enabled Enabled OATH Enabled Enabled YubiHSM Auth Enabled Enabled OpenPGP Enabled Enabled PIV Enabled Enabled ``` ### Set modes All modes are enabled from the factory. To change them: `$ ykman mode [OPTIONS] <MODE>` * `<MODE>` can be a string, such as `OTP+FIDO+CCID`, or a shortened form `o+f+c`. * `<MODE>` can be a mode-number, which encodes several enabled modes. Here is a table of mode-numbers, if you care to use them: | | | | -- | ----------------------------------- | | 0 | OTP device only. | | 1 | CCID device only. | | 2 | OTP/CCID composite device. | | 3 | U2F device only. | | 4 | OTP/U2F composite device. | | 5 | U2F/CCID composite device. | | 6 | OTP/U2F/CCID composite device. | | 81 | CCID device only, with touch-eject. | **Note:** Some examples use mode number 86, which is [invalid](https://github.com/Yubico/yubikey-manager/issues/20#issuecomment-326496204). The 80 will be ignored, and it will behave like 6. Options: * `--touch-eject` - The button will insert and eject the smart card. This only works if the mode is CCID only; FIDO and OTP must be disabled. * `--autoeject-timeout <SECONDS>` - Automatically eject the smart card after some time. Same restrictions as `--touch-eject`. * `--chalresp-timeout <SECONDS>` - Set the challenge-response timeout. For more information, see `$ ykman mode --help`
YubiKey
One-time password
## One-time password This feature has a somewhat misleading name, because it also encompasses the static password and challenge-response functions. 2 slots are provided for this feature, accessible by short and long button presses respectively. Each can be configured with **one** of the following: * Yubico OTP * OATH-HOTP * OATH-TOTP * Challenge-response * Static Password Each function has several configuration options provided at the time of creation, but once set they cannot be read back. It is possible to swap slots 1 and 2, with `$ ykman otp swap`. ### Factory configuration On a new YubiKey, Yubico OTP is preconfigured on slot 1. This initial AES symmetric key is stored in the YubiKey and on the Yubico Authentication server. This allows validating against YubiCloud, allowing the use of Yubico OTP in combination with the Yubico Forum website for instance or on <https://demo.yubico.com>). **Warning:** If you ever overwrite the factory key in slot 1, you cannot create a new key of the same trust level. Factory generated Yubico OTP credentials begin with a `CC` prefix, while user generated credentials begin with `VV`. There is no fundamental difference in security or functionality, though some services only trust `CC` credentials. More information can be found in this [forum thread](https://forum.yubico.com/viewtopic12ca.html?f%3D16\&t%3D1960). ### Yubico OTP The [Yubico OTP](https://developers.yubico.com/OTP/) is based on [symmetric cryptography](https://en.wikipedia.org/wiki/Symmetric_cryptography "wikipedia:Symmetric cryptography"). More specifically, each YubiKey contains a 128-bit [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard "wikipedia:Advanced Encryption Standard") key unique to that device, which is also stored on a validation server. When asked for a password, the YubiKey will create a token by concatenating different fields such as the ID of the key, a counter, and a random number, and encrypting the result. This OTP is sent to the target system, which passes it to a validation server. The validation server (also in posession of the secret key) decrypts it and verifies the information inside. The result is returned to the target system, which can then decide whether to grant access. #### YubiCloud and validation servers Yubico provides a validation server with free unlimited access, called YubiCloud. YubiCloud knows the factory configuration of all YubiKeys, and is the "default" validation service used by (for example) [yubico-pam](https://archlinux.org/packages/?name=yubico-pam). Yubico also offers [open-source implementations](https://developers.yubico.com/Software_Projects/Yubico_OTP/YubiCloud_Validation_Servers/) of the server. **Note:** To authenticate the Yubico validation server, you can use: * **HMAC**: use <https://upgrade.yubico.com/getapikey/> to get an HMAC key and ID * **HTTPS**: the validation server's certificate is signed by GoDaddy, and is thus trusted by default in Arch installs (at least if you have [ca-certificates](https://archlinux.org/packages/?name=ca-certificates) installed) #### Configuration and usage Generate a new key in slot 2, and upload it to YubiCloud (opens in a browser): ``` $ ykman otp yubiotp --generate-key --upload 2 ``` For more information, see `$ ykman otp yubiotp --help` #### Security risks ##### AES key compromise As you can imagine, the AES key should be kept secret. It cannot be retrieved from the YubiKey itself (or it should not, at least not with software). It is also present in the validation server, so the security of this server is very important. ##### Validation requests/responses tampering Since the target system relies on a validation server, a possible attack would be to impersonate it. To prevent this, the target system needs to authenticate the validation server, either using HMAC or HTTPS. ### Challenge-response A challenge is sent to the YubiKey, which calculates a response based on some secret. The same challenge always results in the same response. Without the secret this calculation is not feasible, even with many challenge-response pairs. This can be used for * True 2-factor authentication: The user is provided a challenge, they must provide the correct response in addition to a password. Both parties must have the secret key. * "Semi" 2-factor authentication: the challenge acts as a password, and the server stores the correct response. This is not an OTP, and if anyone can obtain the response they will gain access, but it is simpler as the server does not need the secret key. There are two Challenge-Response algorithms: * HMAC-SHA1 * Yubico OTP You can set them up with a GUI using the [yubikey-personalization-gui](https://archlinux.org/packages/?name=yubikey-personalization-gui), or with the following instructions: #### HMAC-SHA1 algorithm Set up slot 2 in challenge response mode with a generated key: ``` $ ykman otp chalresp --generate 2 ``` You can omit the `--generate` flag in order to provide a key, see `ykman otp chalresp --help`. A main advantage of providing a key is that it can be used to setup a second device as a backup. The command `openssl rand -hex 20` generates a suitable key, for example. #### Yubico OTP algorithm `ykman` Does not appear to support setting the chal-yubico algorithm, but you can use `ykpersonalize`. Generate a random key in slot 2: ``` $ ykpersonalize -2 -ochal-resp -ochal-yubico ``` For more information, see [ykpersonalize(1)](https://man.archlinux.org/man/ykpersonalize.1). #### Sending a challenge To send a challenge and get a response, the `ykchalresp -slot challenge` command can be used. For example, ``` $ ykchalresp -2 archie 12a19763be77d75af46fb76f0b737c117fa47205 ``` returns a 40-byte SHA1-hash unique to the programmed slot 2. A different challenge produces another unique response. ### Static password You can either generate a static password: ``` $ ykman otp static --generate slot ``` or provide one: ``` $ ykman otp static slot password ``` You have several options; you can set the length and character set of the generated password, and whether or not to send an Enter keystroke. See `ykman otp static --help` for more. **Tip:** Most YubiKeys provide only limited (2) slots to save static passwords. A setup challenge-response slot provides static hash responses for unlimited challenges. While these are numeric and lower alphabet only, the response length provides considerable entropy. ### Emulated USB keyboard limitations, or "Why does my password look so weak?" In order for the YubiKey to work with most keyboard layouts, passwords are by default limited to the ModHex alphabet (`cbdefghijklnrtuv`), digits `0-9`, and `!`. These characters use the same scan codes across a very large number of keyboard layouts, ensuring compatibility with most computers. Yubico has provided a [whitepaper](https://resources.yubico.com/53ZDUYE6/as/9hccqgx9bwwqq96mhkk8jb4h/Static_Password_Function.pdf) on the subject.
YubiKey
OATH
## OATH The YubiKey offers 2 [OATH](../en/Initiative_for_Open_Authentication.html "OATH") implementations: * OATH API Newer method, can store approximately 30 credentials depending on the model. (YubiKey 4, NEO, and newer) * OTP slot Older method, both OTP slots can store a single credential. (All models which support challenge-response) ### OATH API If you prefer a GUI, you can use [yubioath-desktop](https://archlinux.org/packages/?name=yubioath-desktop). `ykman` can add codes in the URI format with `ykman oath uri`. Here is a one-liner that will add a credential from an image of a QR code: ``` $ zbarimg qr_code.png --quiet --raw | xargs ykman oath accounts uri ``` You can also do things manually. Program a TOTP key, requiring a button touch to generate a code: ``` $ ykman oath accounts add --touch name secret ``` Program an HOTP key: ``` $ ykman oath accounts add --oath-type HOTP name secret ``` List credentials: ``` $ ykman oath accounts list ``` Generate codes: ``` $ ykman oath accounts code query ``` To see all available subcommands see `ykman oath --help`. To see information about each, use `ykman oath (subcommand) --help`. ### OTP slot implementation Program an HOTP in slot 2: ``` $ ykman otp hotp 2 key ``` Program a TOTP: ``` $ ykman otp chalresp --totp slot key ``` Generate an HOTP: ``` $ ykman otp calculate slot ``` Generate a TOTP: ``` $ ykman otp calculate --totp slot ``` See also: `ykman otp --help` and <https://developers.yubico.com/OATH/>
YubiKey
U2F
## U2F [Universal 2nd Factor](../en/Universal_2nd_Factor.html "Universal 2nd Factor") (U2F) with a YubiKey is very simple, requiring no configuration for the key itself. Note that this mode is also referred to as 'FIDO' in some documentation and utilities. You have a few limited management options through the `ykman` utility: * Set a PIN: `$ ykman fido access change-pin` * delete individual credentials: `$ ykman fido delete <QUERY>` * Reset all credentials and PIN: `$ ykman fido reset` To use U2F for authentication, see the instructions in [U2F](../en/Universal_2nd_Factor.html "U2F"). Also see [WebAuthn](../en/WebAuthn.html "WebAuthn").
YubiKey
CCID smartcard
## CCID smartcard CCID (Chip Card Interface Device) is a USB standard device class for use by USB devices that act as smart card readers or with security tokens that connect directly via USB, like the YubiKey. HID (Human Interface Device) and CCID are both USB device classes, i.e. they are in the same category of USB specifications. HID is a specification for computer peripherals, like keyboards. The YubiKey works like a USB (HID) keyboard when used in the OTP and FIDO modes, but switches to the CCID protocol when using the PIV application, or as an OpenPGP device. CCID mode should be enabled by default on all YubiKeys shipped since November 2015 [\[1\]](https://www.yubico.com/support/knowledge-base/categories/articles/use-yubikey-yubikey-windows-hello-app/). Enable at least the CCID mode. Please see [#Get enabled modes](#Get_enabled_modes). ### PIV Starting with the YubiKey NEO, the YubiKeys contain a PIV (Personal Identity Verification) application on the chip. PIV is a US government standard (FIPS 201) that specifies how a token using RSA or ECC (Elliptic Curve Cryptography) is used for personal electronic identification. The YubiKey NEO only supports RSA encryption, later models (YubiKey 4 and 5) support both RSA and ECC. The distinguishing characteristic of a PIV token is that it is built to protect private keys and operate on-chip. A private key never leaves the token after it has been installed on it. Optionally, the private key can even be generated on-chip with the aid of an on-chip random number generator. If generated on-chip, the private key is never handled outside of the chip, and there is no way to recover it from the token. When using the PIV mechanism, the YubiKey functions as a CCID device. ### OpenPGP smartcards The YubiKey can act as a standard OpenPGP smartcard; see [GnuPG#Smartcards](../en/GnuPG.html#Smartcards "GnuPG") for instructions on how to set up and use it with [GnuPG](../en/GnuPG.html "GnuPG"). Yubico also provides some documentation in <https://developers.yubico.com/PGP/>. If you do not want to use the other features (U2F and OTP), the button can be configured to insert and eject it, and an auto-eject timeout can be set as well. See [#USB connection modes](#USB_connection_modes) for more. The default user pin is `123456` and the default admin pin is `12345678`. The default PUK is also `12345678`. Remember to change all 3.
YubiKey
Use cases
## Use cases This section details how to use your YubiKey for various authentication purposes. It is by no means an exhaustive list. ### Full disk encryption with LUKS You have several options: * **Challenge-Response:** the [response](#Challenge-response) to some challenge is used as a LUKS key. The challenge can act as a password for true 2-factor authentication, or stored in plain-text for one-factor authentication. * **GnuPG:** Uses the yubikey's [PGP smartcard](#CCID_smartcard) functionality. Offers strong 2-factor authentication without needing a huge passphrase. * **FIDO HMAC Secret:** If your YubiKey supports [U2F](../en/Universal_2nd_Factor.html "U2F"), it can be configured to return a symmetric secret. **Note:** A disk's encryption is only as strong as its weakest key. Once you configure one of these tools, consider removing the initial passphrase, or replacing it with a very long one. #### Common prerequisites * A bootable [LUKS encrypted](../en/Dm-crypt/Encrypting_an_entire_system.html "Dm-crypt/Encrypting an entire system") system, using the `encrypt` [mkinitcpio](../en/Mkinitcpio.html "Mkinitcpio") hook, with at least one free keyslot. * With the exception of [mkinitcpio-ykfde](https://aur.archlinux.org/packages/mkinitcpio-ykfde/)AUR, the `sd-encrypt` hook is not supported by any of these tools. * Backed up LUKS header (Optional, though advisable) #### Challenge-response See [yubikey-full-disk-encryption](https://archlinux.org/packages/?name=yubikey-full-disk-encryption)'s [official documentation](https://github.com/agherzan/yubikey-full-disk-encryption#usage) for complete instructions. Broadly: 1. Install [yubikey-full-disk-encryption](https://archlinux.org/packages/?name=yubikey-full-disk-encryption) 2. Configure `/etc/ykfde.conf` 3. Enroll the disk: `# ykfde-enroll -d /dev/<DISK> -s <LUKS_SLOT>` 4. Add the `ykfde` [mkinitcpio hook](../en/Mkinitcpio.html#HOOKS "Mkinitcpio") before the `encrypt` hook. 5. Regenerate the initramfs: `# mkinitcpio -P` * **Note:** Plymouth Users: Replace the `plymouth-encrypt` hook with the `ykfde` hook. There are a few variations available: * 2FA: default behavior. You must provide the challenge as a password when enrolling the device, and upon boot. * 1FA: Set `YKFDE_CHALLENGE` in `ykfde.conf`. Note that this is stored in plaintext. Consider disabling non-root read permissions to this file. * [NFC support](https://github.com/agherzan/yubikey-full-disk-encryption#enable-nfc-support-in-ykfde-initramfs-hook-experimental) (Experimental) * [Suspend & Resume support](https://github.com/agherzan/yubikey-full-disk-encryption#enable-ykfde-suspend-service-experimental) (Experimental) Automatically lock encrypted volumes on suspend, unlock them on resume. You must regenerate the initramfs for any configuration changes to take effect. #### systemd-based initramfs Users of the `sd-encrypt` hook may install [mkinitcpio-ykfde](https://aur.archlinux.org/packages/mkinitcpio-ykfde/)AUR or [mkinitcpio-ykfde-git](https://aur.archlinux.org/packages/mkinitcpio-ykfde-git/)AUR and follow the instruction in the [project documentation](https://github.com/eworm-de/mkinitcpio-ykfde/blob/master/README-mkinitcpio.md). The procedure is broadly similar to [yubikey-full-disk-encryption](https://archlinux.org/packages/?name=yubikey-full-disk-encryption). #### GnuPG encrypted keyfile One tool to accomplish this is [initramfs-scencrypt](https://github.com/fuhry/initramfs-scencrypt); see its docs for complete instructions. Note that as of October 2022 this package is not in the AUR and is not thoroughly tested, though the GitHub repository offers a PKGBUILD. The [dm-crypt pages](../en/Dm-crypt/Specialties.html#Using_GPG,_LUKS,_or_OpenSSL_Encrypted_Keyfiles "Dm-crypt/Specialties") offer a few alternatives, though they are mostly links to old forum posts. #### HMAC secret extension of FIDO2 protocol Yet another way of using YubiKey for full disk encryption is to utilize [HMAC Secret Extension](https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#sctn-hmac-secret-extension) to retrieve the LUKS password from YubiKey. This can be protected by a passphrase. This functionality requires at least [YubiKey 5 with firmware 5.2.3+](https://support.yubico.com/hc/en-us/articles/360016649319-YubiKey-5-2-3-Enhancements-to-FIDO-2-Support). For a passphrase protected solution, install [khefin](https://aur.archlinux.org/packages/khefin/)AUR and follow instructions available in [project documentation](https://github.com/mjec/khefin/wiki/Arch-Linux-LUKS-configuration). For single factor (optionally PIN-protected) solution and starting with systemd 248, it is possible to use your FIDO2 key as LUKS2 keyslot. Instructions available in the [author's blog post](https://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html). ### KeePass [KeePass](../en/KeePass.html "KeePass") can be configured for YubiKey support; see the [YubiKey section](../en/KeePass.html#Yubikey "KeePass") for instructions. ### SSH keys #### CCID If your YubiKey supports CCID smartcards, you can use it as a hardware-backed [SSH key](../en/SSH_keys.html "SSH key"), either based on GPG or PIV keys. Yubico offers good documentation: * An [overview of both](https://developers.yubico.com/PIV/Guides/Securing_SSH_with_OpenPGP_or_PIV.html) possibilities, giving their advantages and disadvantages * Instructions for [PGP authentication](https://developers.yubico.com/PGP/SSH_authentication/index.html) * Instructions for [PIV authentication through user certificates](https://developers.yubico.com/PIV/Guides/SSH_user_certificates.html) * Instructions for [PIV authentication through #PKCS11](https://developers.yubico.com/PIV/Guides/SSH_with_PIV_and_PKCS11.html) - **Note:** The default PIN code of the PIV application on the YubiKey is `123456`; you may want to change it, as well as the default management key. See the [device setup instructions](https://developers.yubico.com/PIV/Guides/Device_setup.html) for more. #### U2F You may also use the U2F feature of the YubiKey to create hardware-backed SSH keys. See [SSH keys#FIDO/U2F](../en/SSH_keys.html#FIDO/U2F "SSH keys") for instructions. #### PIV [yubikey-agent](https://aur.archlinux.org/packages/yubikey-agent/)AUR stores the SSH key as PIV token. See <https://github.com/FiloSottile/yubikey-agent#readme> for a setup guide. ### Linux user authentication with PAM [PAM](../en/PAM.html "PAM"), and therefore anything which uses PAM for user authentication, can be configured to use a YubiKey as a factor of its user authentication process. This includes sudo, su, ssh, screen lockers, display managers, and nearly every other instance where a Linux system needs to authenticate a user. Its flexible configuration allows you to set whichever authentication requirements fit your needs, for the entire system, a specific application, or for groups of applications. For example, you could accept the YubiKey as an alternative to a password for local sessions, while requiring both for remote sessions. In addition to the Arch Wiki, You are encouraged to read [pam(8)](https://man.archlinux.org/man/pam.8) and [pam.conf(5)](https://man.archlinux.org/man/pam.conf.5) to understand how it works and how to configure it. There are several modules available which integrate YubiKey-supported protocols into PAM: * [pam-u2f](https://archlinux.org/packages/?name=pam-u2f) - Supports [#U2F](#U2F) via the FIDO2 standard. If you are not sure which method to use, this one is a good choice. * [Universal 2nd Factor#Authentication for user sessions](../en/Universal_2nd_Factor.html#Authentication_for_user_sessions "Universal 2nd Factor") * [Yubico's official docs](https://developers.yubico.com/pam-u2f/), including a list of supported module parameters. * Man Pages: [pam\_u2f(8)](https://man.archlinux.org/man/pam_u2f.8), [pamu2fcfg(1)](https://man.archlinux.org/man/pamu2fcfg.1) * [oath-toolkit](https://archlinux.org/packages/?name=oath-toolkit) - Supports [#OATH](#OATH) one-time passwords (either HOTP or TOTP) * [pam\_oath](../en/Pam_oath.html "Pam oath") * [yubico-pam](https://archlinux.org/packages/?name=yubico-pam) - Supports [#Yubico OTP](#Yubico_OTP) and challenge-response OTPs. Note that Yubico OTP mode requires a network connection to a validation server, while challenge-response mode does not. * [Yubico's official docs](https://developers.yubico.com/yubico-pam/) * [pam\_yubico(8)](https://man.archlinux.org/man/pam_yubico.8) - Take note of the `mode` parameter, used to set challenge-response mode. **Warning:** Exercise caution when modifying PAM configuration files. Mistakes can render a system completely insecure, or so secure that no authentication is possible. PAM configuration is beyond the scope of this article, but for a brief overview: * Create file(s) containing authorized keys, either in users' home directories or centrally. * Add a line in the appropriate place in the appropriate PAM configuration file which follows this format: ``` auth [required|sufficient] [module_name].so [module arguments] ``` * `auth required` for multifactor, `auth sufficient` for single factor. * `module_name` - Example: `pam_u2f.so`. See a list of installed modules: `$ ls /usr/lib/security` * Module configuration arguments are for things like the location of the keyfile, or which method the module should use for authentication. #### SSH notes * Yubico has provided [additional guidance](https://developers.yubico.com/yubico-pam/Yubikey_and_SSH_via_PAM.html). It is written for an old version of Ubuntu, but much of it still applies to an updated Arch system. * If you are configuring a distant server to use YubiKey, you should open at least one additional, rescue SSH session, so that you are not locked out if the configuration fails. * Check that `/etc/ssh/sshd_config` contains the following settings. The `sshd_config` shipped with [openssh](https://archlinux.org/packages/?name=openssh) has these set correctly by default. ``` ChallengeResponseAuthentication no UsePAM yes ``` ### Browser/web integration Many web services are beginning to support FIDO hardware tokens. See the [U2F](../en/Universal_2nd_Factor.html "U2F") and [WebAuthn](../en/WebAuthn.html "WebAuthn") pages for more information, but usually the only thing you need to do is to install [libfido2](https://archlinux.org/packages/?name=libfido2) and [try it](https://demo.yubico.com/webauthn-technical/registration).
YubiKey
Tips and tricks
## Tips and tricks ### Executing actions on insertion/removal of YubiKey device For example, you want to perform an action when you pull your YubiKey out of the USB slot, create `/etc/udev/rules.d/80-yubikey-actions.rules` and add the following contents: ``` ACTION=="remove", ENV{ID_VENDOR}=="Yubico", ENV{ID_VENDOR_ID}=="1050", ENV{ID_MODEL_ID}=="0010|0111|0112|0113|0114|0115|0116|0401|0402|0403|0404|0405|0406|0407|0410", RUN+="/usr/local/bin/script args" ``` Please note, most keys are covered within this example but it may not work for all versions of YubiKey. You will have to look at the output of lsusb to get the vendor and model ID's, along with the description of the device or you could use udevadm to get information. Of course, to execute a script on insertion, you would change the action to 'add' instead of remove. ### Start Yubico Authenticator on insertion The authenticator is a long-running GUI process. If run directly in a udev rule, the process would block udev's processing. If forked, udev would unconditionally kill the process after the event handling finishes. Thus you can't start the authenticator from udev rules. However, systemd.device may be used to handle this case. Similar to above, create `/etc/udev/rules.d/80-yubikey-actions.rules` and add the following contents: ``` ENV{ID_VENDOR}=="Yubico", ENV{ID_VENDOR_ID}=="1050", ENV{ID_MODEL_ID}=="0010|0111|0112|0113|0114|0115|0116|0401|0402|0403|0404|0405|0406|0407|0410", SYMLINK+="yubikey", TAG+="systemd" ``` Then create `~/.config/systemd/user/yubioath-desktop.service` and add the following contents: ``` [Unit] Description=Autostart Yubico Authenticator # Uncomment if you want to stop the authenticator when unplugged. #StopPropagatedFrom=dev-yubikey.device [Install] WantedBy=dev-yubikey.device [Service] Type=oneshot ExecStart=/usr/bin/yubioath-desktop ``` and run ``` systemctl --user enable yubioath-desktop.service ``` The command would warn that it is added as a dependency to a non-existent unit \`dev-yubikey.device\`. But it is okay. Such unit will start existing once the YubiKey is plugged in.
YubiKey
Maintenance / upgrades
## Maintenance / upgrades ### Installing the OATH Applet for a YubiKey NEO These steps will allow you to install the OATH applet onto your YubiKey NEO. This allows the use of Yubico Authenticator in the Google Play Store. **Note:** These steps are only for NEOs with a firmware version <= 3.1.2. The current generation NEOs (with U2F) come with the OpenPGP applet already installed) #### Configure the NEO as a CCID device 1. Install [yubikey-personalization-gui](https://archlinux.org/packages/?name=yubikey-personalization-gui) ([yubikey-personalization-gui-git](https://aur.archlinux.org/packages/yubikey-personalization-gui-git/)AUR). 2. Add the udev rules and reboot so you can manage the YubiKey without needing to be root 3. Run `ykpersonalize -m82`, enter `y`, and hit enter. #### Install the applet 1. Install [gpshell](https://aur.archlinux.org/packages/gpshell/)AUR, [gppcscconnectionplugin](https://aur.archlinux.org/packages/gppcscconnectionplugin/)AUR, [globalplatform](https://aur.archlinux.org/packages/globalplatform/)AUR, and [pcsclite](https://archlinux.org/packages/?name=pcsclite). 2. [Start](../en/Help:Reading.html#Control_of_systemd_units "Start") `pcscd.service`. 3. Download the most recent CAP file from the [ykneo-oath](https://developers.yubico.com/ykneo-oath/Releases/) site. 4. Download `gpinstall.txt` from [GitHub](https://github.com/Yubico/ykneo-oath/blob/master/gpinstall.txt). 5. Edit the line in gpinstall.txt beginning with `install -file` to reflect the path where the CAP file is located. 6. Open a terminal and run `gpshell <location of gpinstall.txt>` 7. Ideally, a bunch of text will scroll by and it ends saying something like ``` Command --> 80E88013D7C000C400BE00C700CA00CA00B400BE00CE00D200D500D700B000DB00C700DF00BEFFFF00BE00E400AC00AE00AE00DB00E700A A00EA00ED00ED00ED00BE00EF00F100F400F100F700FA00FF00BE00F700AA01010103010700CA00C400B400AA00F700B400AA00B600C7010C 010C00AA0140012001B0056810B0013005600000056810E0011006B4B44304B44404B44106B44B4405B443400343B002410636810E06B4B44 407326810B004B43103441003334002B102B404B3B403BB4003B440076820A4100221024405B4341008B44600000231066820A100 Wrapped command --> 84E88013DFC000C400BE00C700CA00CA00B400BE00CE00D200D500D700B000DB00C700DF00BEFFFF00BE00E400AC00AE00AE00DB00E700A A00EA00ED00ED00ED00BE00EF00F100F400F100F700FA00FF00BE00F700AA01010103010700CA00C400B400AA00F700B400AA00B600C7010C 010C00AA0140012001B0056810B0013005600000056810E0011006B4B44304B44404B44106B44B4405B443400343B002410636810E06B4B44 407326810B004B43103441003334002B102B404B3B403BB4003B440076820A4100221024405B4341008B44600000231066820A15D848CB77 27D0EDA00 Response <-- 009000 Command --> 80E60C002107A000000527210108A00000052721010108A000000527210101010003C901000000 Wrapped command --> 84E60C002907A000000527210108A00000052721010108A000000527210101010003C9010000B4648127914A4C7C00 Response <-- 009000 card_disconnect release_context ``` 1. Unplug the NEO and try it with the Yubico Authenticator app #### (Optional) Install the Yubico Authenticator desktop client You can get the desktop version of the Yubico Authenticator by installing [yubioath-desktop](https://archlinux.org/packages/?name=yubioath-desktop). While `pcscd.service` is running, run `yubioath-desktop` and insert your YubiKey when prompted.
YubiKey
Troubleshooting
## Troubleshooting Restart, especially if you have completed updates since your YubiKey last worked. Do this even if some functions appear to be functioning. ### YubiKey not acting as HID device **Note:** These steps are no longer necessary after [systemd since v244](https://github.com/systemd/systemd/commit/d45ee2f31a8358db0accde2e7c81777cedadc3c2) added native support for this functionality. Add udev rule as described in [this article](https://michaelheap.com/yubikey-on-arch/): ``` /etc/udev/rules.d/10-security-key.rules ``` ``` KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="users", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0" ``` Run `udevadm trigger` afterwards. ### ykman fails to connect to the YubiKey If the manager fails to connect to the YubiKey, make sure you have started `pcscd.service` or `pcscd.socket`. ### Error: Failed connecting to YubiKey 5 \[OTP+FIDO+CCID]. Make sure the application have the required permissions. This can occur when using `ykman` to access the oath credentials on the device if `scdaemon` has already taken exclusive control of the device. [\[2\]](https://github.com/Yubico/yubikey-manager/issues/35) To fix this you can set the `reader-port` option with the correct value for your device in `~/.gnupg/scdaemon.conf`. [\[3\]](https://support.yubico.com/hc/en-us/articles/360013714479-Troubleshooting-Issues-with-GPG) **Note:** This will cause the gpgagent to re-prompt you to unlock the YubiKey after each time you access the YubiKey through ykman. For YubiKey NEO and YubiKey 4: ``` reader-port Yubico Yubikey ``` or for YubiKey 5 ``` reader-port Yubico Yubi ``` ### YubiKey fails to bind within a guest VM Assuming the YubiKey is available to the guest, the issue results from a driver binding to the device on the host. To unbind the device, the bus and port information is needed from [dmesg](../en/Core_utilities.html#Essentials "Dmesg") on the host: ``` # dmesg | grep -B1 Yubico | tail -n 2 | head -n 1 | sed -E 's/^\[[^]]+\] usb ([^:]*):.*/\1/' ``` The resulting USB id should be of the form `X-Y.Z` or `X-Y`. Then, on the host, use `find` to search `/sys/bus/usb/drivers` for which driver the YubiKey is binded to (e.g. `usbhid` or `usbfs`). ``` $ find /sys/bus/usb/drivers -name "*X-Y.Z*" ``` To unbind the device, use the result from the previous command (i.e. `/sys/bus/usb/drivers/<DRIVER>/X-Y.Z:1.0`): ``` # echo 'X-Y.Z:1.0' > /sys/bus/usb/drivers/<DRIVER>/unbind ``` ### Error: \[key] could not be locally signed or gpg: No default secret key: No public key Occurs when attempting to sign keys on a non-standard keyring while a YubiKey is plugged in, e.g. as [Pacman](../en/Pacman/Package_signing.html "Pacman/Package signing") does in `pacman-key --populate`. The solution is to remove the offending YubiKey and start over. ### YubiKey disappears and reappears in Yubico Authenticator This happens when the CCID driver is not installed. You may need to [install](../en/Help:Reading.html#Installation_of_packages "Install") the [ccid](https://archlinux.org/packages/?name=ccid) package. ### YubiKey core error: timeout You are probably using the wrong slot. Try the other one. [Categories](../Special:Categories.html "Special:Categories"): * [OpenPGP](../en/Category:OpenPGP.html "Category:OpenPGP") * [Smartcards](../en/Category:Smartcards.html "Category:Smartcards") * [Universal 2nd Factor](../en/Category:Universal_2nd_Factor.html "Category:Universal 2nd Factor") - Retrieved from "<https://wiki.archlinux.org/index.php?title=YubiKey&oldid=809029>" - This page was last edited on 22 May 2024, at 18:29. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
ZFS
Intro
# ZFS \[ ] 3 languages * [日本語](https://wiki.archlinux.jp/index.php/ZFS "ZFS – 日本語") * [Português](../pt/ZFS.html "ZFS – português") * [中文(简体)](https://wiki.archlinuxcn.org/wiki/ZFS "ZFS – 中文(简体)") From ArchWiki Related articles * [File systems](../en/File_systems.html "File systems") * [ZFS/Virtual disks](../en/ZFS/Virtual_disks.html "ZFS/Virtual disks") * [Install Arch Linux on ZFS](../en/Install_Arch_Linux_on_ZFS.html "Install Arch Linux on ZFS") [ZFS](https://en.wikipedia.org/wiki/ZFS "wikipedia:ZFS") is an advanced filesystem, originally developed and released by [Sun Microsystems](https://en.wikipedia.org/wiki/Sun_Microsystems "wikipedia:Sun Microsystems") in 2005. Described as ["The last word in filesystems"](https://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/), ZFS is stable, fast, secure, and future-proof. Features of ZFS include: pooled storage (integrated volume management – zpool), [Copy-on-write](https://en.wikipedia.org/wiki/Copy-on-write "wikipedia:Copy-on-write"), [snapshots](https://en.wikipedia.org/wiki/Snapshot_\(computer_storage\) "wikipedia:Snapshot (computer storage)"), data integrity verification and automatic repair (scrubbing), [RAID-Z](https://en.wikipedia.org/wiki/RAID-Z "wikipedia:RAID-Z"), a maximum [16 exabyte](https://en.wikipedia.org/wiki/Exabyte "wikipedia:Exabyte") file size, and a maximum 256 quadrillion [zettabyte](https://en.wikipedia.org/wiki/Zettabyte "wikipedia:Zettabyte") storage with no limit on number of filesystems (datasets) or files[\[1\]](https://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/index.html). ZFS is licensed under the [Common Development and Distribution License](https://en.wikipedia.org/wiki/CDDL "wikipedia:CDDL") (CDDL). Because the CCDL is incompatible with the GPL, [it is not possible](https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/) for ZFS to be included in the Linux Kernel. This requirement, however, does not prevent a native Linux kernel module from being developed and distributed by a third party, as is the case with [OpenZFS](https://openzfs.org) (previously named ZFS on Linux). As a result of ZFS not being included in the Linux kernel: * OpenZFS project must keep up with Linux kernel versions. After making stable OpenZFS release - Arch ZFS maintainers release them. * This situation sometimes locks down the normal rolling update process by unsatisfied dependencies because the new kernel version, proposed by update, is unsupported by OpenZFS.
ZFS
Installation
## Installation The kernel modules for ZFS can be installed in two ways—either installing a package that provides the modules for a specific kernel version or using a [DKMS](../en/Dynamic_Kernel_Module_Support.html "DKMS") package that builds the modules for installed kernels. See the following sections. ZFS userspace utilities are provided by the [zfs-utils](https://aur.archlinux.org/packages/zfs-utils/)AUR package which is a dependency of all zfs kernel module packages. ### Kernel-specific packages **Warning:** Unless you use the [dkms](../en/Dynamic_Kernel_Module_Support.html "Dkms") versions of these packages, the ZFS and SPL kernel modules are tied to a specific kernel version. It will not be possible to apply any kernel updates until updated packages are uploaded to AUR or the [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") repository. **Tip:** You can [downgrade](../en/Downgrading_packages.html "Downgrade") your linux version to the one from [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") repository if your current kernel is newer or switch to the LTS kernel which may provide better compatibility with out-of-tree kernel modules. Install from the [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") repository or alternatively the [Arch User Repository](../en/Arch_User_Repository.html "Arch User Repository"): * [zfs-linux](https://aur.archlinux.org/packages/zfs-linux/)AUR—[stable releases](https://zfsonlinux.org/) for [linux](https://archlinux.org/packages/?name=linux). * [zfs-linux-git](https://aur.archlinux.org/packages/zfs-linux-git/)AUR—[development](https://github.com/openzfs/zfs) releases (with support of newer kernel versions) for [linux](https://archlinux.org/packages/?name=linux). * [zfs-linux-lts](https://aur.archlinux.org/packages/zfs-linux-lts/)AUR—stable releases for [linux-lts](https://archlinux.org/packages/?name=linux-lts). * [zfs-linux-hardened](https://aur.archlinux.org/packages/zfs-linux-hardened/)AUR—stable releases for [linux-hardened](https://archlinux.org/packages/?name=linux-hardened). * [zfs-linux-zen](https://aur.archlinux.org/packages/zfs-linux-zen/)AUR—stable releases for [linux-zen](https://archlinux.org/packages/?name=linux-zen). Test the installation by issuing `zpool status` on the command line. If an "insmod" error is produced, try `depmod -a`. ### DKMS Users can make use of [Dynamic Kernel Module Support](../en/Dynamic_Kernel_Module_Support.html "Dynamic Kernel Module Support") (DKMS) to rebuild the ZFS modules automatically. **Warning:** Occasionally, the dkms package might not compile against the newest kernel packages in Arch. Using the [linux-lts](https://archlinux.org/packages/?name=linux-lts) [kernel](../en/Kernel.html "Kernel") may provide better compatibility with out-of-tree kernel modules. Install from the [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") repository or alternatively the [Arch User Repository](../en/Arch_User_Repository.html "Arch User Repository"): * [zfs-dkms](https://aur.archlinux.org/packages/zfs-dkms/)AUR for versions with dynamic kernel module support. * [zfs-dkms-git](https://aur.archlinux.org/packages/zfs-dkms-git/)AUR for development releases for versions with dynamic kernel module support. **Tip:** Add an `IgnorePkg` entry to [pacman.conf](../en/Pacman.html#Configuration "Pacman.conf") to prevent these packages from upgrading when doing a regular update. To compile the ZFS modules provided by the aforementioned dkms packages, it is also necessary to install the appropriate headers package(s) for your installed kernel(s) (e.g. [linux-headers](https://archlinux.org/packages/?name=linux-headers) for [linux](https://archlinux.org/packages/?name=linux), [linux-lts-headers](https://archlinux.org/packages/?name=linux-lts-headers) for [linux-lts](https://archlinux.org/packages/?name=linux-lts), etc.). When either the dkms packages or the kernel is updated, the kernel modules will be automatically recompiled thanks to the [DKMS](../en/Dynamic_Kernel_Module_Support.html "DKMS") [pacman hook](../en/Pacman.html#Hooks "Pacman hook"). ### Root on ZFS See [Install Arch Linux on ZFS#Installation](../en/Install_Arch_Linux_on_ZFS.html#Installation "Install Arch Linux on ZFS").
ZFS
Experimenting with ZFS
## Experimenting with ZFS Users wishing to experiment with ZFS on *virtual block devices* (known in ZFS terms as VDEVs) which can be simple files like `~/zfs0.img` `~/zfs1.img` `~/zfs2.img` etc. with no possibility of real data loss are encouraged to see the [Experimenting with ZFS](../en/ZFS/Virtual_disks.html "Experimenting with ZFS") article. Common tasks like building a RAIDZ array, purposefully corrupting data and recovering it, snapshotting datasets, etc. are covered.
ZFS
Configuration
## Configuration ZFS is considered a "zero administration" filesystem by its creators; therefore, configuring ZFS is very straight forward. Configuration is done primarily with two commands: `zfs` and `zpool`. ### Automatic Start For ZFS to live by its "zero administration" namesake, `zfs-import-cache.service` must be enabled to import the pools and `zfs-mount.service` must be enabled to mount the filesystems available in the pools. A benefit to this is that it is not necessary to mount ZFS filesystems in `/etc/fstab`. `zfs-import-cache.service` imports the zfs pools reading the file `/etc/zfs/zpool.cache`. For each [imported pool](#Importing_a_pool_created_by_id) you want automatically imported by `zfs-import-cache.service` execute: ``` # zpool set cachefile=/etc/zfs/zpool.cache <pool> ``` **Note:** Beginning with [OpenZFS version 0.6.5.8](https://github.com/openzfs/zfs/releases/tag/zfs-0.6.5.8) the ZFS service unit files have been changed so that you need to explicitly enable any ZFS services you want to run. See [ArchZFS issue 72](https://github.com/archzfs/archzfs/issues/72) for more information. [Enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") the relevant service (`zfs-import-cache.service`) and targets (`zfs.target` and `zfs-import.target`) so the pools are automatically imported at boot time: To mount the ZFS filesystems, you have 2 choices: * Enable the [zfs-mount.service](#Using_zfs-mount.service) * Using [zfs-mount-generator](#Using_zfs-mount-generator) #### Using zfs-mount.service In order to mount ZFS filesystems automatically on boot you need to [enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") `zfs-mount.service` and `zfs.target`. **Note:** * This does not work with separated `/var` dataset because it does not get mounted early enough. Instead you should use [zfs-mount-generator](#Using_zfs-mount-generator) option. See [OpenZFS issue #3768](https://github.com/openzfs/zfs/issues/3768) for more information. * It appears that the ZFS module is loaded too late for using this method, see [BBS#274044](https://bbs.archlinux.org/viewtopic.php?id=274044) and [Talk:ZFS#zfs hook in mkinitcpio.conf](../en/Talk:ZFS.html#zfs_hook_in_mkinitcpio.conf "Talk:ZFS"). The workaround is to use the `ZFS` [mkinitcpio](../en/Mkinitcpio.html "Mkinitcpio") hook. #### Using zfs-mount-generator You can also use the zfs-mount-generator to create systemd mount units for your ZFS filesystems at boot. systemd will automatically mount the filesystems based on the mount units without having to use the `zfs-mount.service`. To do that, you need to: 1. Create the `/etc/zfs/zfs-list.cache` directory. 2. Enable the ZFS Event Daemon(ZED) script (called a ZEDLET) required to create a list of mountable ZFS filesystems. (This link is created automatically if you are using OpenZFS >= 2.0.0.) ``` # ln -s /usr/lib/zfs/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d ``` 3. [Enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") `zfs.target` and [enable/start](../en/Help:Reading.html#Control_of_systemd_units "Enable/start") the ZFS Event Daemon (`zfs-zed.service`). This service is responsible for running the script in the previous step. 4. You need to create an empty file named after your pool in `/etc/zfs/zfs-list.cache`. The ZEDLET will only update the list of filesystems if the file for the pool already exists. ``` # touch /etc/zfs/zfs-list.cache/<pool-name> ``` 5. Check the contents of `/etc/zfs/zfs-list.cache/<pool-name>`. If it is empty, make sure that the `zfs-zed.service` is running and just change the canmount property of any of your ZFS filesystem by running: ``` zfs set canmount=off zroot/fs1 ``` This change causes ZFS to raise an event which is captured by ZED, which in turn runs the ZEDLET to update the file in `/etc/zfs/zfs-list.cache`. If the file in `/etc/zfs/zfs-list.cache` is updated, you can set the `canmount` property of the filesystem back by running: ``` zfs set canmount=on zroot/fs1 ``` You need to add a file in `/etc/zfs/zfs-list.cache` for each ZFS pool in your system. Make sure the pools are imported by enabling `zfs-import-cache.service` and `zfs-import.target` as [explained above](#Automatic_Start).
ZFS
Storage pools
## Storage pools It is not necessary to partition the drives before creating the ZFS filesystem. It is recommended to point ZFS at an entire disk (ie. `/dev/sdx` rather than `/dev/sdx1`), which will [automatically create a GPT (GUID Partition Table)](https://www.reddit.com/r/zfs/comments/667na0/zfs_on_raw_or_gpt/dgh0l9t/) and add an 8 MB reserved partition at the end of the disk for legacy bootloaders. However, you can specify a partition or a file within an existing filesystem, if you wish to create multiple volumes with different redundancy properties. **Note:** If some or all device have been used in a software RAID set it is paramount to [erase any old RAID configuration information](../en/RAID.html#Prepare_the_devices "Mdadm"). **Warning:** For [Advanced Format](../en/Advanced_Format.html "Advanced Format") Disks with 4KB sector size, an ashift of 12 is recommended for best performance. Advanced Format disks emulate a sector size of 512 bytes for compatibility with legacy systems, this causes ZFS to sometimes use an ashift option number that is not ideal. Once the pool has been created, the only way to change the ashift option is to recreate the pool. Using an ashift of 12 would also decrease available capacity. See the OpenZFS FAQ: [Performance Considerations](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#performance-considerations), [Advanced Format Disks](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#advanced-format-disks), and [ZFS and Advanced Format disks](https://web.archive.org/web/20170913063528/https://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks). ### Identify disks OpenZFS recommends using device IDs when creating ZFS storage pools of less than 10 devices[\[2\]](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#selecting-dev-names-when-creating-a-pool-linux). Use [Persistent block device naming#by-id and by-path](../en/Persistent_block_device_naming.html#by-id_and_by-path "Persistent block device naming") to identify the list of drives to be used for ZFS pool. The disk IDs should look similar to the following: ``` $ ls -lh /dev/disk/by-id/ ``` ``` lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JKRR -> ../../sdc lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JTM1 -> ../../sde lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KBP8 -> ../../sdd lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KDGY -> ../../sdb ``` **Warning:** If you create zpools using device names (e.g. `/dev/sda`,`/dev/sdb`,...) ZFS might not be able to detect zpools intermittently on boot. #### Using GPT labels ![](../File:Tango-edit-clear.svg)**This article or section needs language, wiki syntax or style improvements. See [Help:Style](../en/Help:Style.html "Help:Style") for reference.** **Reason:** Missing references to [Persistent block device naming](../en/Persistent_block_device_naming.html "Persistent block device naming"), it is useless to explain the differences (or even what they are) here. (Discuss in [Talk:ZFS](../en/Talk:ZFS.html)) Disk labels and UUID can also be used for ZFS mounts by using [GPT](../en/Partitioning.html#GUID_Partition_Table "GUID Partition Table") partitions. ZFS drives have labels but Linux is unable to read them at boot. Unlike [MBR](../en/Partitioning.html#Master_Boot_Record "Master Boot Record") partitions, GPT partitions directly support both UUID and labels independent of the format inside the partition. Partitioning rather than using the whole disk for ZFS offers two additional advantages. The OS does not generate bogus partition numbers from whatever unpredictable data ZFS has written to the partition sector, and if desired, you can easily over provision SSD drives, and slightly over provision spindle drives to ensure that different models with slightly different sector counts can zpool replace into your mirrors. This is a lot of organization and control over ZFS using readily available tools and techniques at almost zero cost. Use [gdisk](../en/Partitioning.html#GUID_Partition_Table "GUID Partition Table") to partition the all or part of the drive as a single partition. gdisk does not automatically name partitions so if partition labels are desired use gdisk command "c" to label the partitions. Some reasons you might prefer labels over UUID are: labels are easy to control, labels can be titled to make the purpose of each disk in your arrangement readily apparent, and labels are shorter and easier to type. These are all advantages when the server is down and the heat is on. GPT partition labels have plenty of space and can store most international characters [wikipedia:GUID\_Partition\_Table#Partition\_entries](https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_entries "wikipedia:GUID Partition Table") allowing large data pools to be labeled in an organized fashion. Drives partitioned with GPT have labels and UUID that look like this. ``` $ ls -l /dev/disk/by-partlabel ``` ``` lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata1 -> ../../sdd1 lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata2 -> ../../sdc1 lrwxrwxrwx 1 root root 10 Apr 30 01:59 zfsl2arc -> ../../sda1 ``` ``` $ ls -l /dev/disk/by-partuuid ``` ``` lrwxrwxrwx 1 root root 10 Apr 30 01:44 148c462c-7819-431a-9aba-5bf42bb5a34e -> ../../sdd1 lrwxrwxrwx 1 root root 10 Apr 30 01:59 4f95da30-b2fb-412b-9090-fc349993df56 -> ../../sda1 lrwxrwxrwx 1 root root 10 Apr 30 01:44 e5ccef58-5adf-4094-81a7-3bac846a885f -> ../../sdc1 ``` **Tip:** To minimize typing and copy/paste errors, set a local variable with the target PARTUUID: `$ UUID=$(lsblk --noheadings --output PARTUUID /dev/sdXY)` ### Creating ZFS pools To create a ZFS pool: ``` # zpool create -f -m <mount> <pool> [raidz(2|3)|mirror] <ids> ``` **Tip:** One may want to read [#Advanced Format disks](#Advanced_Format_disks) first as it may be recommend to set `ashift` on pool creation. * **create**: subcommand to create the pool. - **-f**: Force creating the pool. This is to overcome the "EFI label error". See [#Does not contain an EFI label](#Does_not_contain_an_EFI_label). - **-m**: The mount point of the pool. If this is not specified, then the pool will be mounted to `/<pool>`. - **pool**: This is the name of the pool. - **raidz(2|3)|mirror**: This is the type of virtual device that will be created from the list of devices. Raidz is a single disk of parity (similar to raid5), raidz2 for 2 disks of parity (similar to raid6) and raidz3 for 3 disks of parity. Also available is **mirror**, which is similar to raid1 or raid10, but is not constrained to just 2 device. If not specified, each device will be added as a vdev which is similar to raid0. After creation, a device can be added to each single drive vdev to turn it into a mirror, which can be useful for migrating data. - **ids**: The [ID's](../en/Persistent_block_device_naming.html#by-id_and_by-path "Persistent block device naming") of the drives or partitions that to include into the pool. Create pool with single raidz vdev: ``` # zpool create -f -m /mnt/data bigdata \ raidz \ ata-ST3000DM001-9YN166_S1F0KDGY \ ata-ST3000DM001-9YN166_S1F0JKRR \ ata-ST3000DM001-9YN166_S1F0KBP8 \ ata-ST3000DM001-9YN166_S1F0JTM1 ``` Create pool with two mirror vdevs: ``` # zpool create -f -m /mnt/data bigdata \ mirror \ ata-ST3000DM001-9YN166_S1F0KDGY \ ata-ST3000DM001-9YN166_S1F0JKRR \ mirror \ ata-ST3000DM001-9YN166_S1F0KBP8 \ ata-ST3000DM001-9YN166_S1F0JTM1 ``` #### Advanced Format disks At pool creation, **ashift=12** should always be used, except with SSDs that have 8k sectors where **ashift=13** is correct. A vdev of 512 byte disks using 4k sectors will not experience performance issues, but a 4k disk using 512 byte sectors will. Since **ashift** cannot be changed after pool creation, even a pool with only 512 byte disks should use 4k because those disks may need to be replaced with 4k disks or the pool may be expanded by adding a vdev composed of 4k disks. Because correct detection of 4k disks is not reliable, `-o ashift=12` should always be specified during pool creation. See the [OpenZFS FAQ](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#advanced-format-disks) for more details. **Tip:** Use [blockdev(8)](https://man.archlinux.org/man/blockdev.8) (part of [util-linux](https://archlinux.org/packages/?name=util-linux)) to print the sector size reported by the device's ioctls: `blockdev --getpbsz /dev/sdXY` as the root user. Create pool with ashift=12 and single raidz vdev: ``` # zpool create -f -o ashift=12 -m /mnt/data bigdata \ raidz \ ata-ST3000DM001-9YN166_S1F0KDGY \ ata-ST3000DM001-9YN166_S1F0JKRR \ ata-ST3000DM001-9YN166_S1F0KBP8 \ ata-ST3000DM001-9YN166_S1F0JTM1 ``` #### GRUB-compatible pool creation By default, *zpool create* enables all features on a pool. If `/boot` resides on ZFS when using [GRUB](../en/GRUB.html "GRUB") you must only enable features supported by GRUB otherwise GRUB will not be able to read the pool. ZFS includes compatibility files (see `/usr/share/zfs/compatibility.d`) to assist in creating pools at specific feature sets, of which grub2 is an option. You can create a pool with only the compatible features enabled: ``` # zpool create -o compatibility=grub2 $POOL_NAME $VDEVS ``` ### Verifying pool status If the command is successful, there will be no output. Using the [mount](../en/File_systems.html#Mount_a_file_system "Mount") command will show that the pool is mounted. Using `zpool status` will show that the pool has been created: ``` # zpool status -v ``` ``` pool: bigdata state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM bigdata ONLINE 0 0 0 -0 ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0KDGY-part1 ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0JKRR-part1 ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0KBP8-part1 ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0JTM1-part1 ONLINE 0 0 0 errors: No known data errors ``` At this point it would be good to reboot the machine to ensure that the ZFS pool is mounted at boot. It is best to deal with all errors before transferring data. ### Importing a pool created by id Eventually a pool may fail to auto mount and you need to import to bring your pool back. Take care to avoid the most obvious solution. **Warning:** Do not run `zpool import pool`! This will import your pools using `/dev/sd?` which will lead to problems the next time you rearrange your drives. This may be as simple as rebooting with a USB drive left in the machine. Adapt one of the following commands to import your pool so that pool imports retain the persistence they were created with: ``` # zpool import -d /dev/disk/by-id bigdata # zpool import -d /dev/disk/by-partlabel bigdata # zpool import -d /dev/disk/by-partuuid bigdata ``` **Note:** Use the `-l` flag when importing a pool that contains [encrypted datasets keys](#Native_encryption), e.g.: ``` # zpool import -l -d /dev/disk/by-id bigdata ``` Finally check the state of the pool: ``` # zpool status -v bigdata ``` ### Destroy a storage pool ZFS makes it easy to destroy a mounted storage pool, removing all metadata about the ZFS device. **Warning:** This command destroys **any data** containing in the pool and/or dataset. To destroy the pool: ``` # zpool destroy <pool> ``` To destroy a dataset: ``` # zfs destroy <pool>/<dataset> ``` And now when checking the status: ``` # zpool status ``` ``` no pools available ``` ### Exporting a storage pool If a storage pool is to be used on another system, it will first need to be exported. It is also necessary to export a pool if it has been imported from the archiso as the hostid is different in the archiso as it is in the booted system. The zpool command will refuse to import any storage pools that have not been exported. It is possible to force the import with the `-f` argument, but this is considered bad form. Any attempts made to import an un-exported storage pool will result in an error stating the storage pool is in use by another system. This error can be produced at boot time abruptly abandoning the system in the busybox console and requiring an archiso to do an emergency repair by either exporting the pool, or adding the `zfs_force=1` to the kernel boot parameters (which is not ideal). See [#On boot the zfs pool does not mount stating: "pool may be in use from other system"](#On_boot_the_zfs_pool_does_not_mount_stating:_"pool_may_be_in_use_from_other_system"). To export a pool: ``` # zpool export <pool> ``` ### Extending an existing zpool A device (a partition or a disk) can be added to an existing zpool: ``` # zpool add <pool> <device-id> ``` To import a pool which consists of multiple devices: ``` # zpool import -d <device-id-1> -d <device-id-2> <pool> ``` or simply: ``` # zpool import -d /dev/disk-by-id/ <pool> ``` ### Attaching a device to (create) a mirror A device (a partition or a disk) can be attached aside an existing device to be its mirror (similar to RAID 1): ``` # zpool attach <pool> <device-id|mirror> <new-device-id> ``` You can attach the new device to an already existing mirror vdev (e.g. to upgrade from a 2-device to a 3-device mirror) or [attach it to single device to create a new mirror vdev](https://askubuntu.com/a/1303462). ### Renaming a zpool Renaming a zpool that is already created is accomplished in 2 steps: ``` # zpool export oldname # zpool import oldname newname ``` ### Setting a different mount point The mount point for a given zpool can be moved at will with one command: ``` # zfs set mountpoint=/foo/bar poolname ``` ### Upgrade zpools When using a newer `zfs` module, zpools may display an upgrade indication: ``` $ zpool status -v ``` ``` pool: bigdata state: ONLINE status: Some supported features are not enabled on the pool. The pool can still be used, but some features are unavailable. action: Enable all features using 'zpool upgrade'. Once this is done, the pool may no longer be accessible by software that does not support the features. See zpool-features(5) for details. ``` **Note:** * Lower version `zfs` modules will not be able to import a zpool of a higher version. * When dealing with important data, one may want to create a [backup](../en/System_maintenance.html#Backup "Backup") prior running a `zpool upgrade`. To upgrade the version of zpool *bigdata*: ``` # zpool upgrade bigdata ``` To upgrade the version of all zpools: ``` # zpool upgrade -a ```
ZFS
Creating datasets
## Creating datasets Users can optionally create a dataset under the zpool as opposed to manually creating directories under the zpool. Datasets allow for an increased level of control (quotas for example) in addition to snapshots. To be able to create and mount a dataset, a directory of the same name must not pre-exist in the zpool. To create a dataset, use: ``` # zfs create <nameofzpool>/<nameofdataset> ``` It is then possible to apply ZFS specific attributes to the dataset. For example, one could assign a quota limit to a specific directory within a dataset: ``` # zfs set quota=20G <nameofzpool>/<nameofdataset>/<directory> ``` To see all the commands available in ZFS, see zfs(8) or zpool(8). ### Native encryption ZFS offers the following supported encryption options: `aes-128-ccm`, `aes-192-ccm`, `aes-256-ccm`, `aes-128-gcm`, `aes-192-gcm` and `aes-256-gcm`. When encryption is set to `on`, `aes-256-gcm` will be used. See [zfs-change-key(8)](https://openzfs.github.io/openzfs-docs/man/8/zfs-change-key.8.html#Encryption) for a description of the native encryption, including limitations. The following keyformats are supported: `passphrase`, `raw`, `hex`. One can also specify/increase the default iterations of PBKDF2 when using `passphrase` with `-o pbkdf2iters <n>`, although it may increase the decryption time. **Tip:** * To import a pool with keys, one needs to specify the `-l` flag, without this flag encrypted datasets will be left unavailable until the keys are loaded. See [#Importing a pool created by id](#Importing_a_pool_created_by_id). * Native ZFS encryption has been made available in the stable 0.8.0 release or newer. Previously it was only available in development versions provided by packages like [zfs-linux-git](https://aur.archlinux.org/packages/zfs-linux-git/)AUR, [zfs-dkms-git](https://aur.archlinux.org/packages/zfs-dkms-git/)AUR or other development builds. Users who were only using the development versions for the native encryption, may now switch to the stable releases if they wish. * The default encryption suite was changed from `aes-256-ccm` to `aes-256-gcm` in the 0.8.4 release. To create a dataset including native encryption with a passphrase, use: ``` # zfs create -o encryption=on -o keyformat=passphrase <nameofzpool>/<nameofdataset> ``` To use a key instead of using a passphrase: ``` # dd if=/dev/random of=/path/to/key bs=1 count=32 # zfs create -o encryption=on -o keyformat=raw -o keylocation=file:///path/to/key <nameofzpool>/<nameofdataset> ``` The easy way to make a key in human-readable form (`keyformat=hex`): ``` # od -Anone -x -N 32 -w64 /dev/random | tr -d [:blank:] > /path/to/hex.key ``` To verify the key location: ``` # zfs get keylocation <nameofzpool>/<nameofdataset> ``` To change the key location: ``` # zfs set keylocation=file:///path/to/key <nameofzpool>/<nameofdataset> ``` You can also manually load the keys by using one of the following commands: ``` # zfs load-key <nameofzpool>/<nameofdataset> # load key for a specific dataset # zfs load-key -a # load all keys # zfs load-key -r zpool/dataset # load all keys in a dataset ``` To mount the created encrypted dataset: ``` # zfs mount <nameofzpool>/<nameofdataset> ``` #### Unlock/Mount at boot time: systemd It is possible to automatically unlock a pool dataset on boot time by using a [systemd](../en/Systemd.html "Systemd") unit. For example create the following service to unlock any specific dataset: ``` /etc/systemd/system/[email protected] ``` ``` [Unit] Description=Load %I encryption keys Before=systemd-user-sessions.service zfs-mount.service After=zfs-import.target Requires=zfs-import.target DefaultDependencies=no [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/bash -c 'until (systemd-ask-password "Encrypted ZFS password for %I" --no-tty | zfs load-key %I); do echo "Try again!"; done' [Install] WantedBy=zfs-mount.service ``` [Enable/start](../en/Help:Reading.html#Control_of_systemd_units "Enable/start") the service for each encrypted dataset, (e.g. `[email protected]`). Note the use of `-`, which is an escaped `/` in systemd unit definitions. See `systemd-escape(1)` for more info. **Note:** The `Before=systemd-user-sessions.service` ensures that systemd-ask-password is invoked before the local IO devices are handed over to the [desktop environment](../en/Desktop_environment.html "Desktop environment"). An alternative is to load all possible keys: ``` /etc/systemd/system/zfs-load-key.service ``` ``` [Unit] Description=Load encryption keys DefaultDependencies=no After=zfs-import.target Before=zfs-mount.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/zfs load-key -a StandardInput=tty-force [Install] WantedBy=zfs-mount.service ``` [Enable/start](../en/Help:Reading.html#Control_of_systemd_units "Enable/start") `zfs-load-key.service`. #### Unlock at login time: PAM If you are not encrypting the root volume, but only the home volume or a user-specific volume, another idea is to [wait until login to decrypt it](https://blog.trifork.com/2020/05/22/linux-homedir-encryption/). The advantages of this method are that the system boots uninterrupted, and that when the user logs in, the same password can be used both to authenticate and to decrypt the home volume, so that the password is only entered once. First set the mountpoint to legacy to avoid having it mounted by `zfs mount -a`: ``` zfs set mountpoint=legacy zroot/data/home ``` Ensure that it is in /etc/fstab so that `mount /home` will work: ``` /etc/fstab ``` ``` zroot/data/home /home zfs rw,xattr,posixacl,noauto 0 0 ``` On a single-user system, with only one `/home` volume having the same encryption password as the user's password, it can be decrypted at login as follows: first create `/usr/local/bin/mount-zfs-homedir` ``` /usr/local/bin/mount-zfs-homedir ``` ``` #!/bin/bash # simplified from https://talldanestale.dk/2020/04/06/zfs-and-homedir-encryption/ set -eu # Password is given to us via stdin, save it in a variable for later PASS=$(cat -) VOLNAME="zroot/data/home" # Unlock and mount the volume zfs load-key "$VOLNAME" <<< "$PASS" || continue zfs mount "$VOLNAME" || true # ignore errors ``` do not forget `chmod a+x /usr/local/bin/mount-zfs-homedir`; then get PAM to run it by adding the following line to /etc/pam.d/system-auth: ``` /etc/pam.d/system-auth ``` ``` auth optional pam_exec.so expose_authtok /usr/local/bin/mount-zfs-homedir ``` Now it will transparently decrypt and mount the /home volume when you log in anywhere: on the console, via ssh, etc. A caveat is that since your `~/.ssh` directory is not mounted, if you log in via ssh, you must use the default password authentication the first time rather than relying on `~/.ssh/authorized_keys`. If you want to have separate volumes for each user, each encrypted with the user's password, try the [linked method](https://blog.trifork.com/2020/05/22/linux-homedir-encryption/). ### Swap volume **Warning:** * On systems with extremely high memory pressure, using a zvol for swap can result in lockup, regardless of how much swap is still available. This issue is currently being investigated in [OpenZFS issue #7734](https://github.com/openzfs/zfs/issues/7734) * Swap on zvol does not support resume from hibernation, attempt to resume will result in pool corruption. Possible workaround: <https://github.com/openzfs/zfs/issues/260#issuecomment-758782144> ZFS does not allow to use swapfiles, but users can use a ZFS volume (ZVOL) as swap. It is important to set the ZVOL block size to match the system page size, which can be obtained by the `getconf PAGESIZE` command (default on x86\_64 is 4KiB). Another option useful for keeping the system running well in low-memory situations is not caching the ZVOL data. Create a 8 GiB zfs volume: ``` # zfs create -V 8G -b $(getconf PAGESIZE) -o compression=zle \ -o logbias=throughput -o sync=always\ -o primarycache=metadata -o secondarycache=none \ -o com.sun:auto-snapshot=false <pool>/swap ``` Prepare it as swap partition: ``` # mkswap -f /dev/zvol/<pool>/swap # swapon /dev/zvol/<pool>/swap ``` To make it permanent, edit `/etc/fstab`. ZVOLs support discard, which can potentially help ZFS's block allocator and reduce fragmentation for all other datasets when/if swap is not full. Add a line to `/etc/fstab`: ``` /dev/zvol/<pool>/swap none swap discard 0 0 ``` ### Access Control Lists To use [ACL](../en/Access_Control_Lists.html "ACL") on a dataset: ``` # zfs set acltype=posixacl <nameofzpool>/<nameofdataset> # zfs set xattr=sa <nameofzpool>/<nameofdataset> ``` Setting `xattr` is recommended for performance reasons [\[3\]](https://github.com/openzfs/zfs/issues/170#issuecomment-27348094). It may be preferable to enable ACL on the zpool as datasets will inherit the ACL parameters. Setting `aclinherit=passthrough` may be wanted as the default mode is `restricted` [\[4\]](https://docs.oracle.com/cd/E19120-01/open.solaris/817-2271/gbaaz/index.html); however, it is worth noting that `aclinherit` does not affect POSIX ACLs [\[5\]](https://askubuntu.com/questions/342553/activate-acl-for-zfs-pool-ubuntu-13-04#comment1220577_392008): ``` # zfs set aclinherit=passthrough <nameofzpool> # zfs set acltype=posixacl <nameofzpool> # zfs set xattr=sa <nameofzpool> ``` ### Databases ZFS, unlike most other file systems, has a variable record size, or what is commonly referred to as a block size. By default, the recordsize on ZFS is 128KiB, which means it will dynamically allocate blocks of any size from 512B to 128KiB depending on the size of file being written. This can often help fragmentation and file access, at the cost that ZFS would have to allocate new 128KiB blocks each time only a few bytes are written to. ![](../File:Inaccurate.svg)**The factual accuracy of this article or section is disputed.** **Reason:** At least MariaDB uses a default of 16Kib pages! Check your specific DBMS before setting this value. (Discuss in [Talk:ZFS](../en/Talk:ZFS.html)) Most RDBMSes work in 8KiB-sized blocks by default. Although the block size is tunable for [MySQL/MariaDB](../en/MySQL.html "MySQL"), [PostgreSQL](../en/PostgreSQL.html "PostgreSQL"), and Oracle database, all three of them use an 8KiB block size *by default*. For both performance concerns and keeping snapshot differences to a minimum (for backup purposes, this is helpful), it is usually desirable to tune ZFS instead to accommodate the databases, using a command such as: ``` # zfs set recordsize=8K <pool>/postgres ``` These RDBMSes also tend to implement their own caching algorithm, often similar to ZFS's own ARC. In the interest of saving memory, it is best to simply disable ZFS's caching of the database's file data and let the database do its own job: **Note:** [L2ARC](#L2ARC) requires `primarycache` to function, because it is fed with data evicted from `primarycache`. If you intend to use the L2ARC, do not set the option below, otherwise no actual data will be cached on L2ARC. ``` # zfs set primarycache=metadata <pool>/postgres ``` ZFS uses the [ZIL](#ZIL) for crash recovery, but databases are often syncing their data files to the file system on their own transaction commits anyway. The end result of this is that ZFS will be committing data **twice** to the data disks, and it can severely impact performance. You can tell ZFS to prefer to not use the ZIL, and in which case, data is only committed to the file system once. However, doing so on non-solid state storage (e.g. HDDs) can result in decreased read performance due to fragmentation ([OpenZFS Wiki](https://openzfs.org/wiki/ZFS_on_high_latency_devices)) -- with mechanical hard drives, please consider using a dedicated SSD as [ZIL](#ZIL) rather than setting the option below. In addition, setting this for non-database file systems, or for pools with configured log devices, can also *negatively* impact the performance, so beware: ``` # zfs set logbias=throughput <pool>/postgres ``` These can also be done at file system creation time, for example: ``` # zfs create -o recordsize=8K \ -o primarycache=metadata \ -o mountpoint=/var/lib/postgres \ -o logbias=throughput \ <pool>/postgres ``` Please note: these kinds of tuning parameters are ideal for specialized applications like RDBMSes. You can easily *hurt* ZFS's performance by setting these on a general-purpose file system such as your /home directory. ### /tmp If you would like to use ZFS to store your /tmp directory, which may be useful for storing arbitrarily-large sets of files or simply keeping your RAM free of idle data, you can generally improve performance of certain applications writing to /tmp by disabling file system sync. This causes ZFS to ignore an application's sync requests (eg, with `fsync` or `O_SYNC`) and return immediately. While this has severe application-side data consistency consequences (never disable sync for a database!), files in /tmp are less likely to be important and affected. Please note this does *not* affect the integrity of ZFS itself, only the possibility that data an application expects on-disk may not have actually been written out following a crash. ``` # zfs set sync=disabled <pool>/tmp ``` Additionally, for security purposes, you may want to disable **setuid** and **devices** on the /tmp file system, which prevents some kinds of privilege-escalation attacks or the use of device nodes: ``` # zfs set setuid=off <pool>/tmp # zfs set devices=off <pool>/tmp ``` Combining all of these for a create command would be as follows: ``` # zfs create -o setuid=off -o devices=off -o sync=disabled -o mountpoint=/tmp <pool>/tmp ``` Please note, also, that if you want /tmp on ZFS, you will need to [mask](../en/Help:Reading.html#Control_of_systemd_units "Mask") (disable) [systemd](../en/Systemd.html "Systemd")'s automatic tmpfs-backed /tmp (`tmp.mount`, else ZFS will be unable to mount your dataset at boot-time or import-time. ### Transmitting snapshots with ZFS Send and ZFS Recv It is possible to pipe ZFS snapshots to an arbitrary target by pairing `zfs send` and `zfs recv`. This is done through standard output, which allows the data to be sent to any file, device, across the network, or manipulated mid-stream by incorporating additional programs in the pipe. Below are examples of common scenarios: #### Basic ZFS Send First, let's create a snapshot of some ZFS filesystem: ``` # zfs snapshot zpool0/archive/books@snap ``` Now let's send the snapshot to a new location on a different zpool ``` # zfs send -v zpool0/archive/books@snap | zfs recv zpool4/library ``` The contents of `zpool0/archive/books@snap` are now live at `zpool4/library` **Tip:** See [man zfs-send](https://openzfs.github.io/openzfs-docs/man/8/zfs-send.8.html) and [man zfs-recv](https://openzfs.github.io/openzfs-docs/man/8/zfs-recv.8.html) for details on flags. ##### To and from files First, let's create a snapshot of some ZFS filesystem: ``` # zfs snapshot zpool0/archive/books@snap ``` Write the snapshot to a gzip file: ``` # zfs send zpool0/archive/books@snap > /tmp/mybooks.gz ``` **Warning:** Make sure to run `zfs send` with `-w` flag if you wish to preserve encryption during the send. Now restore the snapshot from the file: ``` # gzcat /tmp/mybooks.gz | zfs recv -F zpool0/archive/books ``` #### Send over ssh First, let's create a snapshot of some ZFS filesystem: ``` # zfs snapshot zpool1/filestore@snap ``` Next we pipe our "send" traffic over an ssh session running "recv": ``` # zfs send -v zpool1/filestore@snap | ssh $HOST zfs recv coldstore/backups ``` The `-v` flag prints information about the datastream being generated. If you are using a passphrase or passkey, you will be prompted to enter it. #### Incremental Backups You may wish update a previously sent ZFS filesystem without retransmitting all of the data over again. Alternatively, it may be necessary to keep a filesystem online during a lengthy transfer and it is now time to send writes that were made since the initial snapshot. First, let's create a snapshot of some ZFS filesystem: ``` # zfs snapshot zpool1/filestore@initial ``` Next we pipe our "send" traffic over an ssh session running "recv": ``` # zfs send -v -R zpool1/filestore@initial | ssh $HOST zfs recv coldstore/backups ``` Once changes are written, make another snapshot: ``` # zfs snapshot zpool1/filestore@snap2 ``` The following will send the differences that exist locally between zpool1/filestore\@initial and zpool1/filestore\@snap2 and create an additional snapshot for the remote filesystem coldstore/backups: ``` # zfs send -v -i -R zpool1/filestore@initial | ssh $HOST zfs recv coldstore/backups ``` Now both zpool1/filestore and coldstore/backups have the @initial and @snap2 snapshots. On the remote host, you may now promote the latest snapshot to become the active filesystem: ``` # rollback coldstore/backups@snap2 ```
ZFS
Tuning
## Tuning ### General ZFS pools and datasets can be further adjusted using parameters. **Note:** All settable properties, with the exception of quotas and reservations, inherit their value from the parent dataset. To retrieve the current pool parameter status: ``` # zfs get all <pool> ``` To retrieve the current dataset parameter status: ``` # zfs get all <pool>/<dataset> ``` To disable access time (atime), which is enabled by default: ``` # zfs set atime=off <pool> ``` To disable access time (atime) on a particular dataset: ``` # zfs set atime=off <pool>/<dataset> ``` An alternative to turning off atime completely, `relatime` is available. This brings the default ext4/XFS atime semantics to ZFS, where access time is only updated if the modified time or changed time changes, or if the existing access time has not been updated within the past 24 hours. It is a compromise between `atime=off` and `atime=on`. This property *only* takes effect if `atime` is `on`: ``` # zfs set atime=on <pool> # zfs set relatime=on <pool> ``` Compression is just that, transparent compression of data. ZFS supports a few different algorithms, presently lz4 is the default, *gzip* is also available for seldom-written yet highly-compressible data; consult the [OpenZFS Wiki](https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Workload%20Tuning.html) for more details. To enable compression: ``` # zfs set compression=on <pool> ``` To reset a property of a pool and/or dataset to its default state, use `zfs inherit`: ``` # zfs inherit -rS atime <pool> # zfs inherit -rS atime <pool>/<dataset> ``` **Warning:** Using the `-r` flag will recursively reset all datasets of the zpool. ### Scrubbing Whenever data is read and ZFS encounters an error, it is silently repaired when possible, rewritten back to disk and logged so you can obtain an overview of errors on your pools. There is no fsck or equivalent tool for ZFS. Instead, ZFS supports a feature known as scrubbing. This traverses through all the data in a pool and verifies that all blocks can be read. To scrub a pool: ``` # zpool scrub <pool> ``` To cancel a running scrub: ``` # zpool scrub -s <pool> ``` #### How often should I do this? From the Oracle blog post [Disk Scrub - Why and When?](https://blogs.oracle.com/wonders-of-zfs-storage/disk-scrub-why-and-when-v2): * This question is challenging for Support to answer, because as always the true answer is "It Depends". So before I offer a general guideline, here are a few tips to help you create an answer more tailored to your use pattern. - - What is the expiration of your oldest backup? You should probably scrub your data at least as often as your oldest tapes expire so that you have a known-good restore point. - How often are you experiencing disk failures? While the recruitment of a hot-spare disk invokes a "resilver" -- a targeted scrub of just the VDEV which lost a disk -- you should probably scrub at least as often as you experience disk failures on average in your specific environment. - How often is the oldest piece of data on your disk read? You should scrub occasionally to prevent very old, very stale data from experiencing bit-rot and dying without you knowing it. * If any of your answers to the above are "I do not know", the general guideline is: you should probably be scrubbing your zpool at least once per month. It is a schedule that works well for most use cases, provides enough time for scrubs to complete before starting up again on all but the busiest & most heavily-loaded systems, and even on very large zpools (192+ disks) should complete fairly often between disk failures. In the [ZFS Administration Guide](https://pthree.org/2012/12/11/zfs-administration-part-vi-scrub-and-resilver/) by Aaron Toponce, he advises to scrub consumer disks once a week. #### Start with a service or timer **Note:** Starting with OpenZFS 2.1.3 weekly and monthly [systemd](../en/Systemd.html "Systemd") timers/services are included. To use these [enable](../en/Help:Reading.html#Control_of_systemd_units "Enable")/[start](../en/Help:Reading.html#Control_of_systemd_units "Start") `[email protected]` or `[email protected]` for the desired pool. Using a [systemd](../en/Systemd.html "Systemd") timer/service it is possible to automatically scrub pools. To perform scrubbing monthly on a particular pool: ``` /etc/systemd/system/[email protected] ``` ``` [Unit] Description=Monthly zpool scrub on %i [Timer] OnCalendar=monthly AccuracySec=1h Persistent=true [Install] WantedBy=multi-user.target ``` ``` /etc/systemd/system/[email protected] ``` ``` [Unit] Description=zpool scrub on %i [Service] Nice=19 IOSchedulingClass=idle KillSignal=SIGINT ExecStart=/usr/bin/zpool scrub %i [Install] WantedBy=multi-user.target ``` [Enable](../en/Help:Reading.html#Control_of_systemd_units "Enable")/[start](../en/Help:Reading.html#Control_of_systemd_units "Start") `[email protected]` unit for monthly scrubbing the specified zpool. ### Enabling TRIM To quickly query your vdevs [TRIM](../en/Solid_state_drive.html#TRIM "TRIM") support, you can include trimming information in `zpool status` with `-t`. ``` $ zpool status -t tank ``` ``` pool: tank state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 ata-ST31000524AS_5RP4SSNR-part1 ONLINE 0 0 0 (trim unsupported) ata-CT480BX500SSD1_2134A59B933D-part1 ONLINE 0 0 0 (untrimmed) errors: No known data errors ``` ZFS is capable of trimming supported vdevs either on-demand or periodically via the `autotrim` property. Manually performing a TRIM operation on a zpool: ``` # zpool trim <zpool> ``` Enabling periodic trimming on all supported vdevs in a pool: ``` # zpool set autotrim=on <zpool> ``` **Note:** Because of how the automatic TRIM and a full `zpool trim` differ in their operation, [it can make sense to run a manual trim occasionally.](https://github.com/openzfs/zfs/commit/1b939560be5c51deecf875af9dada9d094633bf7) To perform a full `zpool trim` monthly on a particular pool using a [systemd](../en/Systemd.html "Systemd") timer/service: ``` /etc/systemd/system/[email protected] ``` ``` [Unit] Description=Monthly zpool trim on %i [Timer] OnCalendar=monthly AccuracySec=1h Persistent=true [Install] WantedBy=multi-user.target ``` ``` /etc/systemd/system/[email protected] ``` ``` [Unit] Description=zpool trim on %i Documentation=man:zpool-trim(8) Requires=zfs.target After=zfs.target ConditionACPower=true ConditionPathIsDirectory=/sys/module/zfs [Service] Nice=19 IOSchedulingClass=idle KillSignal=SIGINT ExecStart=/bin/sh -c '\ if /usr/bin/zpool status %i | grep "trimming"; then\ exec /usr/bin/zpool wait -t trim %i;\ else exec /usr/bin/zpool trim -w %i; fi' ExecStop=-/bin/sh -c '/usr/bin/zpool trim -s %i 2>/dev/null || true' [Install] WantedBy=multi-user.target ``` [Enable](../en/Help:Reading.html#Control_of_systemd_units "Enable")/[start](../en/Help:Reading.html#Control_of_systemd_units "Start") `[email protected]` unit for monthly trimming of the specified zpool. ### SSD Caching If your pool has no configured log devices, ZFS reserves space on the pool's data disks for its intent log (the ZIL, also called SLOG). If your data disks are slow (e.g. HDD) it is highly recommended to configure the ZIL on solid state drives for better write performance and also to consider a layer 2 adaptive replacement cache (L2ARC). The process to add them is very similar to adding a new VDEV. All of the below references to device-id are the IDs from `/dev/disk/by-id/*`. #### ZIL To add a mirrored ZIL: ``` # zpool add <pool> log mirror <device-id-1> <device-id-2> ``` Or to add a single device ZIL (unsafe): ``` # zpool add <pool> log <device-id> ``` Because the ZIL device stores data that has not been written to the pool, it is important to use devices that can finish writes when power is lost. It is also important to use redundancy, since a device failure can cause data loss. In addition, the ZIL is only used for sync writes, so may not provide any performance improvement when your data drives are as fast as your ZIL drive(s). #### L2ARC To add L2ARC: ``` # zpool add <pool> cache <device-id> ``` L2ARC is only a read cache, so redundancy is unnecessary. Since [ZFS version 2.0.0](https://github.com/openzfs/zfs/releases/tag/zfs-2.0.0), L2ARC is persisted across reboots.[\[6\]](https://github.com/openzfs/zfs/pull/9582) L2ARC is generally only useful in workloads where the amount of hot data is **bigger** than system memory, but small enough to fit into L2ARC. The L2ARC is indexed by the ARC in system memory, consuming 70 bytes per record (default 128KiB). Thus, the equation for RAM usage is: ``` (L2ARC size) / (recordsize) * 70 bytes ``` Because of this, L2ARC can, in certain workloads, harm performance as it takes memory away from ARC. ### ZVOLs ZFS volumes (ZVOLs) can suffer from the same block size-related issues as RDBMSes, but it is worth noting that the default recordsize for ZVOLs is 8 KiB already. If possible, it is best to align any partitions contained in a ZVOL to your recordsize (current versions of fdisk and gdisk by default automatically align at 1MiB segments, which works), and file system block sizes to the same size. Other than this, you might tweak the **recordsize** to accommodate the data inside the ZVOL as necessary (though 8 KiB tends to be a good value for most file systems, even when using 4 KiB blocks on that level). #### RAIDZ and Advanced Format physical disks Each block of a ZVOL gets its own parity disks, and if you have physical media with logical block sizes of 4096B, 8192B, or so on, the parity needs to be stored in whole physical blocks, and this can drastically increase the space requirements of a ZVOL, requiring 2× or more physical storage capacity than the ZVOL's logical capacity. Setting the **recordsize** to 16k or 32k can help reduce this footprint drastically. See [OpenZFS issue #1807](https://github.com/openzfs/zfs/issues/1807) for details. ### I/O Scheduler While ZFS is expected to work well with modern schedulers including, `mq-deadline`, and `none`, experimenting with [manually setting](../en/Improving_performance.html#Changing_I/O_scheduler "Improving performance") the I/O scheduler on ZFS disks may yield performance gains. The ZFS recomendation is "\[...] users leave the default scheduler [“unless you’re encountering a specific problem, or have clearly measured a performance improvement for your workload”](https://github.com/openzfs/zfs/issues/9778#issuecomment-569347505)"[\[7\]](https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html#zfs-vdev-scheduler)
ZFS
Troubleshooting
## Troubleshooting ### Creating a zpool fails If the following error occurs then it can be fixed. ``` # the kernel failed to rescan the partition table: 16 # cannot label 'sdc': try using parted(8) and then provide a specific slice: -1 ``` One reason this can occur is because ZFS expects pool creation to take less than 1 second[\[8\]](https://github.com/openzfs/zfs/issues/2582)[\[9\]](https://github.com/openzfs/zfs/issues/1646). This is a reasonable assumption under ordinary conditions, but in many situations it may take longer. Each drive will need to be cleared again before another attempt can be made. ``` # parted /dev/sda rm 1 # parted /dev/sda rm 1 # dd if=/dev/zero of=/dev/sdb bs=512 count=1 # zpool labelclear /dev/sda ``` A brute force creation can be attempted over and over again, and with some luck the ZPool creation will take less than 1 second. One cause for creation slowdown can be slow burst read writes on a drive. By reading from the disk in parallell to ZPool creation, it may be possible to increase burst speeds. ``` # dd if=/dev/sda of=/dev/null ``` This can be done with multiple drives by saving the above command for each drive to a file on separate lines and running ``` # cat $FILE | parallel ``` Then run ZPool creation at the same time. ### ZFS is using too much RAM By default, ZFS caches file operations ([ARC](https://en.wikipedia.org/wiki/Adaptive_replacement_cache "wikipedia:Adaptive replacement cache")) using up to two-thirds of available system memory on the host. To adjust the ARC size, add the following to the [Kernel parameters](../en/Kernel_parameters.html "Kernel parameters") list: ``` zfs.zfs_arc_max=536870912 # (for 512MiB) ``` In case that the default value of `zfs_arc_min` (1/32 of system memory) is higher than the specified `zfs_arc_max` it is needed to add also the following to the [Kernel parameters](../en/Kernel_parameters.html "Kernel parameters") list: ``` zfs.zfs_arc_min=268435456 # (for 256MiB, needs to be lower than zfs.zfs_arc_max) ``` You may also want to increase `zfs_arc_sys_free` instead (in this example to 8GiB): ``` # echo $((8*1024**3)) > /sys/module/zfs/parameters/zfs_arc_sys_free ``` For a more detailed description, as well as other configuration options, see [Gentoo:ZFS#ARC](https://wiki.gentoo.org/wiki/ZFS#ARC "gentoo:ZFS"). ZFS should release ARC as applications reserve more RAM, but some applications still [get confused](https://github.com/openzfs/zfs/issues/10255), and reported [free RAM is always wrong](https://github.com/openzfs/zfs/issues/10251). But in case all your applications work as intended and you have no problems, there is no need to change ARC settings. ### Does not contain an EFI label The following error will occur when attempting to create a zfs filesystem, ``` /dev/disk/by-id/<id> does not contain an EFI label but it may contain partition ``` The way to overcome this is to use `-f` with the zfs create command. ### No hostid found An error that occurs at boot with the following lines appearing before initscript output: ``` ZFS: No hostid found on kernel command line or /etc/hostid. ``` This warning occurs because the ZFS module does not have access to the spl hosted. There are two solutions, for this. Either place the spl hostid in the [kernel parameters](../en/Kernel_parameters.html "Kernel parameters") in the boot loader. For example, adding `spl.spl_hostid=0x00bab10c`. The other solution is to make sure that there is a hostid in `/etc/hostid`, and then [regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs") image. Which will copy the hostid into the initramfs image. ### Pool cannot be found while booting from SAS/SCSI devices In case you are booting a SAS/SCSI based, you might occassionally get boot problems where the pool you are trying to boot from cannot be found. A likely reason for this is that your devices are initialized too late into the process. That means that zfs cannot find any devices at the time when it tries to assemble your pool. In this case you should force the scsi driver to wait for devices to come online before continuing. You can do this by putting this into `/etc/modprobe.d/zfs.conf`: ``` /etc/modprobe.d/zfs.conf ``` ``` options scsi_mod scan=sync ``` Afterwards, [regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs"). This works because the zfs hook will copy the file at `/etc/modprobe.d/zfs.conf` into the initcpio which will then be used at build time. ### On boot the zfs pool does not mount stating: "pool may be in use from other system" #### Unexported pool If the new installation does not boot because the zpool cannot be imported, chroot into the installation and properly export the zpool. See [#Emergency chroot repair with archzfs](#Emergency_chroot_repair_with_archzfs). Once inside the chroot environment, load the ZFS module and force import the zpool, ``` # zpool import -a -f ``` now export the pool: ``` # zpool export <pool> ``` To see the available pools, use, ``` # zpool status ``` It is necessary to export a pool because of the way ZFS uses the hostid to track the system the zpool was created on. The hostid is generated partly based on the network setup. During the installation in the archiso the network configuration could be different generating a different hostid than the one contained in the new installation. Once the zfs filesystem is exported and then re-imported in the new installation, the hostid is reset. See [Re: Howto zpool import/export automatically? - msg#00227](https://web.archive.org/web/20151101094022/http://osdir.com/ml/zfs-discuss/2011-06/msg00227.html). If ZFS complains about "pool may be in use" after every reboot, properly export pool as described above, and then [regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs") in normally booted system. #### Incorrect hostid Double check that the pool is properly exported. Exporting the zpool clears the hostid marking the ownership. So during the first boot the zpool should mount correctly. If it does not there is some other problem. Reboot again, if the zfs pool refuses to mount it means the hostid is not yet correctly set in the early boot phase and it confuses zfs. Manually tell zfs the correct number, once the hostid is coherent across the reboots the zpool will mount correctly. Boot using zfs\_force and write down the hostid. This one is just an example. ``` $ hostid ``` ``` 0a0af0f8 ``` This number have to be added to the [kernel parameters](../en/Kernel_parameters.html "Kernel parameters") as `spl.spl_hostid=0x0a0af0f8`. Another solution is writing the hostid inside the initram image, see the [installation guide](../en/Install_Arch_Linux_on_ZFS.html#Configure_systemd_ZFS_mounts "Install Arch Linux on ZFS") explanation about this. Users can always ignore the check adding `zfs_force=1` in the [kernel parameters](../en/Kernel_parameters.html "Kernel parameters"), but it is not advisable as a permanent solution. ### Devices have different sector alignment Once a drive has become faulted it should be replaced A.S.A.P. with an identical drive. ``` # zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -f ``` but in this instance, the following error is produced: ``` cannot replace ata-ST3000DM001-9YN166_S1F0KDGY with ata-ST3000DM001-1CH166_W1F478BD: devices have different sector alignment ``` ZFS uses the ashift option to adjust for physical block size. When replacing the faulted disk, ZFS is attempting to use `ashift=12`, but the faulted disk is using a different ashift (probably `ashift=9`) and this causes the resulting error. For Advanced Format Disks with 4KB blocksize, an ashift of 12 is recommended for best performance. See [OpenZFS FAQ: Performance Considerations](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#performance-considerations) and [ZFS and Advanced Format disks](https://web.archive.org/web/20170913063528/https://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks). Use zdb to find the ashift of the zpool: `zdb `, then use the `-o` argument to set the ashift of the replacement drive: ``` # zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -o ashift=9 -f ``` Check the zpool status for confirmation: ``` # zpool status -v ``` ``` pool: bigdata state: DEGRADED status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scan: resilver in progress since Mon Jun 16 11:16:28 2014 10.3G scanned out of 5.90T at 81.7M/s, 20h59m to go 2.57G resilvered, 0.17% done config: NAME STATE READ WRITE CKSUM bigdata DEGRADED 0 0 0 raidz1-0 DEGRADED 0 0 0 replacing-0 OFFLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0KDGY OFFLINE 0 0 0 ata-ST3000DM001-1CH166_W1F478BD ONLINE 0 0 0 (resilvering) ata-ST3000DM001-9YN166_S1F0JKRR ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0KBP8 ONLINE 0 0 0 ata-ST3000DM001-9YN166_S1F0JTM1 ONLINE 0 0 0 errors: No known data errors ``` ### Pool resilvering stuck/restarting/slow? According to [ZFS issue #840](https://github.com/openzfs/zfs/issues/840), this is a known issue since 2012 with ZFS-ZED which causes the resilvering process to constantly restart, sometimes get stuck and be generally slow for some hardware. The simplest mitigation is to stop zfs-zed.service until the resilver completes. ### Fix slow boot caused by failed import of unavailable pools in the initramfs zpool.cache Your boot time can be significantly impacted if you update your intitramfs (eg when doing a kernel update) when you have additional but non-permanently attached pools imported because these pools will get added to your initramfs zpool.cache and ZFS will attempt to import these extra pools on every boot, regardless of whether you have exported it and removed it from your regular zpool.cache. If you notice ZFS trying to import unavailable pools at boot, first run: ``` $ zdb -C ``` To check your zpool.cache for pools you do not want imported at boot. If this command is showing (a) additional, currently unavailable pool(s), run: ``` # zpool set cachefile=/etc/zfs/zpool.cache zroot ``` To clear the zpool.cache of any pools other than the pool named zroot. Sometimes there is no need to refresh your zpool.cache, but instead all you need to do is [regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs"). ### ZFS Command History ZFS logs changes to a pool's structure natively as a log of executed commands in a ring buffer (which cannot be turned off). The log may be helpful when restoring a degraded or failed pool. ``` # zpool history zpool ``` ``` History for 'zpool': 2023-02-19.16:28:44 zpool create zpool raidz1 /scratch/disk_1.img /scratch/disk_2.img /scratch/disk_3.img 2023-02-19.16:31:29 zfs set compression=lz4 zpool 2023-02-19.16:41:45 zpool scrub zpool 2023-02-19.17:00:57 zpool replace zpool /scratch/disk_1.img /scratch/bigger_disk_1.img 2023-02-19.17:01:34 zpool scrub zpool 2023-02-19.17:01:42 zpool replace zpool /scratch/disk_2.img /scratch/bigger_disk_2.img 2023-02-19.17:01:46 zpool replace zpool /scratch/disk_3.img /scratch/bigger_disk_3.img ```
ZFS
Tips and tricks
## Tips and tricks ### Create an Archiso image with ZFS support Follow the [Archiso](../en/Archiso.html "Archiso") steps for creating a fully functional Arch Linux live CD/DVD/USB image. To include ZFS support in the image, you can either build your choice of PKGBUILDs from the AUR or include prebuilt packages from one of the [unofficial user repositories](../en/Unofficial_user_repositories.html "Unofficial user repositories"). #### Using self-built ZFS packages from the AUR Build the ZFS packages you want by following the [normal procedures](../en/Arch_User_Repository.html#Build_the_package "Arch User Repository"). If you are unsure, [zfs-dkms](https://aur.archlinux.org/packages/zfs-dkms/)AUR and [zfs-utils](https://aur.archlinux.org/packages/zfs-utils/)AUR are likely to be compatible with the widest range of other modifications to the Archiso image you may wish to perform. Proceed to set up [a custom local repository](../en/Pacman/Tips_and_tricks.html#Custom_local_repository "Pacman/Tips and tricks"). [Include the resulting repository](../en/Archiso.html#Custom_local_repository "Archiso") in the Pacman configuration of your new profile. Include the built packages in the list of packages to be installed. The example below presumes you want to include only the [zfs-dkms](https://aur.archlinux.org/packages/zfs-dkms/)AUR and [zfs-utils](https://aur.archlinux.org/packages/zfs-utils/)AUR packages. ``` packages.x86_64 ``` ``` ... zfs-dkms zfs-utils ``` If you include any [DKMS](../en/Dynamic_Kernel_Module_Support.html "DKMS") packages, make sure you also include headers for any kernels you are including in the ISO ([linux-headers](https://archlinux.org/packages/?name=linux-headers) for the default kernel). #### Using the archzfs unofficial user repository Add the [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") unofficial user repository to `pacman.conf` in your new Archiso profile. Add the `archzfs-linux` group to the list of packages to be installed (the `archzfs` repository provides packages for the x86\_64 architecture only). ``` packages.x86_64 ``` ``` ... archzfs-linux ``` **Note:** If you later have problems running modprobe zfs, you should include the linux-headers in the packages.x86\_64. #### Finishing up Regardless of where you source your ZFS packages from, you should finish by [building the ISO](../en/Archiso.html#Build_the_ISO "Archiso"). ### Automatic snapshots #### zrepl The [zrepl](https://aur.archlinux.org/packages/zrepl/)AUR package provides a ZFS automatic replication service, which could also be used as a snapshotting service much like [snapper](../en/Snapper.html "Snapper"). For details on how to configure the zrepl daemon, see the zrepl [documentation](https://zrepl.github.io/). The configuration file should be located at `/etc/zrepl/zrepl.yml`. Then, run `zrepl configcheck` to make sure that the syntax of the config file is correct. Finally, enable `zrepl.service`. #### sanoid [sanoid](https://aur.archlinux.org/packages/sanoid/)AUR is a policy-driven tool for taking snapshots. Sanoid also includes `syncoid`, which is for replicating snapshots. It comes with systemd services and a timer. Sanoid only prunes snapshots on the local system. To prune snapshots on the remote system, run sanoid there as well with prune options. Either use the `--prune-snapshots` command line option or use the `--cron` command line option together with the `autoprune = yes` and `autosnap = no` configuration options. #### ZFS Automatic Snapshot Service for Linux **Note:** [zfs-auto-snapshot-git](https://aur.archlinux.org/packages/zfs-auto-snapshot-git/)AUR has not seen any updates since 2019, and the functionality is extremely limited. You are advised to switch to a newer tool like [zrepl](https://aur.archlinux.org/packages/zrepl/)AUR. The [zfs-auto-snapshot-git](https://aur.archlinux.org/packages/zfs-auto-snapshot-git/)AUR package provides a shell script to automate the management of snapshots, with each named by date and label (hourly, daily, etc), giving quick and convenient snapshotting of all ZFS datasets. The package also installs cron tasks for quarter-hourly, hourly, daily, weekly, and monthly snapshots. Optionally adjust the `--keep parameter` from the defaults depending on how far back the snapshots are to go (the monthly script by default keeps data for up to a year). To prevent a dataset from being snapshotted at all, set `com.sun:auto-snapshot=false` on it. Likewise, set more fine-grained control as well by label, if, for example, no monthlies are to be kept on a snapshot, for example, set `com.sun:auto-snapshot:monthly=false`. **Note:** zfs-auto-snapshot-git will not create snapshots during [scrubbing](#Scrubbing). It is possible to override this by [editing provided systemd unit](../en/Systemd.html#Editing_provided_units "Systemd") and removing `--skip-scrub` from `ExecStart` line. Consequences not known, someone please edit. Once the package has been installed, [enable and start the selected timers](../en/Systemd/Timers.html "Systemd/Timers") (`zfs-auto-snapshot-{frequent,daily,weekly,monthly}.timer`). ### Creating a share ZFS has support for creating shares by [NFS](../en/NFS.html "NFS") or [SMB](../en/Samba.html "SMB"). #### NFS Make sure [NFS](../en/NFS.html "NFS") has been installed/configured, note there is no need to edit the `/etc/exports` file. For sharing over NFS the services `nfs-server.service` and `zfs-share.service` should be [started](../en/Help:Reading.html#Control_of_systemd_units "Start"). To make a pool available on the network: ``` # zfs set sharenfs=on nameofzpool ``` To make a dataset available on the network: ``` # zfs set sharenfs=on nameofzpool/nameofdataset ``` To enable read/write access for a specific ip-range(s): ``` # zfs set sharenfs="[email protected]/24,[email protected]/24" nameofzpool/nameofdataset ``` To check if the dataset is exported successfully: ``` # showmount -e `hostname` ``` ``` Export list for hostname: /path/of/dataset 192.168.1.100/24 ``` To view the current loaded exports state in more detail, use: ``` # exportfs -v ``` ``` /path/of/dataset 192.168.1.100/24(sync,wdelay,hide,no_subtree_check,mountpoint,sec=sys,rw,secure,no_root_squash,no_all_squash) ``` To view the current NFS share list by ZFS: ``` # zfs get sharenfs ``` #### SMB **Note:** SMB functionality is very limited. The usershare path must be `/var/lib/samba/usershares` and the only supported sharesmb options are `on` and `off`. Enabling guest access via `sharesmb=guest_ok=y` is not supported. When sharing through SMB, using `usershares` in `/etc/samba/smb.conf` will allow ZFS to setup and create the shares. See [Samba#Enable Usershares](../en/Samba.html#Enable_Usershares "Samba") for details. ``` /etc/samba/smb.conf ``` ``` [global] usershare path = /var/lib/samba/usershares usershare max shares = 100 usershare allow guests = yes usershare owner only = no ``` Create and set permissions on the user directory as root ``` # mkdir /var/lib/samba/usershares # chmod +t /var/lib/samba/usershares ``` To make a pool available on the network: ``` # zfs set sharesmb=on nameofzpool ``` To make a dataset available on the network: ``` # zfs set sharesmb=on nameofzpool/nameofdataset ``` To check if the dataset is exported successfully: ``` # smbclient -L localhost -U% ``` ``` Sharename Type Comment --------- ---- ------- IPC$ IPC IPC Service (SMB Server Name) nameofzpool_nameofdataset Disk Comment: path/of/dataset SMB1 disabled -- no workgroup available ``` To view the current SMB share list by ZFS: ``` # zfs get sharesmb ``` ### Encryption in ZFS using dm-crypt Before [OpenZFS version 0.8.0](https://github.com/openzfs/zfs/releases/tag/zfs-0.8.0), ZFS did not support encryption directly (See [#Native encryption](#Native_encryption)). Instead, zpools can be created on [dm-crypt](../en/Dm-crypt.html "Dm-crypt") block devices. Since the zpool is created on the plain-text abstraction, it is possible to have the data encrypted while having all the advantages of ZFS like deduplication, compression, and data robustness. Furthermore, utilizing dm-crypt will encrypt the zpools metadata, which the native encryption can inherently not provide.[\[10\]](https://openzfs.github.io/openzfs-docs/man/8/zfs-change-key.8.html#Encryption) dm-crypt, possibly via LUKS, creates devices in `/dev/mapper` and their name is fixed. So you just need to change `zpool create` commands to point to that names. The idea is configuring the system to create the `/dev/mapper` block devices and import the zpools from there. Since zpools can be created in multiple devices (raid, mirroring, striping, ...), it is important all the devices are encrypted otherwise the protection might be partially lost. For example, an encrypted zpool can be created using plain dm-crypt (without LUKS) with: ``` # cryptsetup --hash=sha512 --cipher=twofish-xts-plain64 --offset=0 \ --key-file=/dev/sdZ --key-size=512 open --type=plain /dev/sdX enc # zpool create zroot /dev/mapper/enc ``` In the case of a root filesystem pool, the `mkinitcpio.conf` HOOKS line will enable the keyboard for the password, create the devices, and load the pools. It will contain something like: ``` HOOKS="... keyboard encrypt zfs ..." ``` Since the `/dev/mapper/enc` name is fixed no import errors will occur. Creating encrypted zpools works fine. But if you need encrypted directories, for example to protect your users' homes, ZFS loses some functionality. ZFS will see the encrypted data, not the plain-text abstraction, so compression and deduplication will not work. The reason is that encrypted data has always high entropy making compression ineffective and even from the same input you get different output (thanks to salting) making deduplication impossible. To reduce the unnecessary overhead it is possible to create a sub-filesystem for each encrypted directory and use [eCryptfs](../en/ECryptfs.html "ECryptfs") on it. For example to have an encrypted home: (the two passwords, encryption and login, must be the same) ``` # zfs create -o compression=off -o dedup=off -o mountpoint=/home/<username> <zpool>/<username> # useradd -m <username> # passwd <username> # ecryptfs-migrate-home -u <username> <log in user and complete the procedure with ecryptfs-unwrap-passphrase> ``` ### Emergency chroot repair with archzfs To get into the ZFS filesystem from live system for maintenance, there are two options: 1. Build custom archiso with ZFS as described in [#Create an Archiso image with ZFS support](#Create_an_Archiso_image_with_ZFS_support). 2. Boot the latest official archiso and bring up the network. Then enable [archzfs](../en/Unofficial_user_repositories.html#archzfs "Unofficial user repositories") repository inside the live system as usual, sync the pacman package database and install the *archzfs-archiso-linux* package. To start the recovery, load the ZFS kernel modules: ``` # modprobe zfs ``` Import the pool: ``` # zpool import -a -R /mnt ``` Mount the boot partition and EFI system partition (if any): ``` # mount /dev/sda2 /mnt/boot # mount /dev/sda1 /mnt/efi ``` Chroot into the ZFS filesystem: ``` # arch-chroot /mnt /bin/bash ``` Check the kernel version: ``` # pacman -Qi linux # uname -r ``` uname will show the kernel version of the archiso. If they are different, run depmod (in the chroot) with the correct kernel version of the chroot installation: ``` # depmod -a 3.6.9-1-ARCH (version gathered from pacman -Qi linux but using the matching kernel modules directory name under the chroot's /lib/modules) ``` This will load the correct kernel modules for the kernel version installed in the chroot installation. [Regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs"). There should be no errors. ### Bind mount Here a bind mount from /mnt/zfspool to /srv/nfs4/music is created. The configuration ensures that the zfs pool is ready before the bind mount is created. #### fstab See [systemd.mount(5)](https://man.archlinux.org/man/systemd.mount.5) for more information on how systemd converts fstab into mount unit files with [systemd-fstab-generator(8)](https://man.archlinux.org/man/systemd-fstab-generator.8). ``` /etc/fstab ``` ``` /mnt/zfspool /srv/nfs4/music none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0 ``` ### Monitoring / Mailing on Events See [ZED: The ZFS Event Daemon](https://ramsdenj.com/2016/08/29/arch-linux-on-zfs-part-3-followup.html) for more information. An email forwarder, such as [S-nail](../en/S-nail.html "S-nail"), is required to accomplish this. Test it to be sure it is working correctly. Uncomment the following in the configuration file: ``` /etc/zfs/zed.d/zed.rc ``` ``` ZED_EMAIL_ADDR="root" ZED_EMAIL_PROG="mailx" ZED_NOTIFY_VERBOSE=0 ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@" ``` Update 'root' in `ZED_EMAIL_ADDR="root"` to the email address you want to receive notifications at. If you are keeping your mailrc in your home directory, you can tell mail to get it from there by setting `MAILRC`: ``` /etc/zfs/zed.d/zed.rc ``` ``` export MAILRC=/home/<user>/.mailrc ``` This works because ZED sources this file, so `mailx` sees this environment variable. If you want to receive an email no matter the state of your pool, you will want to set `ZED_NOTIFY_VERBOSE=1`. You will need to do this temporary to test. [Start](../en/Help:Reading.html#Control_of_systemd_units "Start") and [enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") `zfs-zed.service`. With `ZED_NOTIFY_VERBOSE=1`, you can test by running a scrub as root: `zpool scrub <pool-name>`. ### Wrap shell commands in pre & post snapshots Since it is so cheap to make a snapshot, we can use this as a measure of security for sensitive commands such as system and package upgrades. If we make a snapshot before, and one after, we can later diff these snapshots to find out what changed on the filesystem after the command executed. Furthermore we can also rollback in case the outcome was not desired. #### znp E.g.: ``` # zfs snapshot -r zroot@pre # pacman -Syu # zfs snapshot -r zroot@post # zfs diff zroot@pre zroot@post # zfs rollback zroot@pre ``` A utility that automates the creation of pre and post snapshots around a shell command is [znp](https://gist.github.com/erikw/eeec35be33e847c211acd886ffb145d5). E.g.: ``` # znp pacman -Syu # znp find / -name "something*" -delete ``` and you would get snapshots created before and after the supplied command, and also output of the commands logged to file for future reference so we know what command created the diff seen in a pair of pre/post snapshots. ### Remote unlocking of ZFS encrypted root As of [PR #261](https://github.com/archzfs/archzfs/pull/261), `archzfs` supports SSH unlocking of natively-encrypted ZFS datasets. This section describes how to use this feature, and is largely based on [dm-crypt/Specialties#Busybox based initramfs (built with mkinitcpio)](../en/Dm-crypt/Specialties.html#Busybox_based_initramfs_\(built_with_mkinitcpio\) "Dm-crypt/Specialties"). 1. Install [mkinitcpio-netconf](https://archlinux.org/packages/?name=mkinitcpio-netconf) to provide hooks for setting up early user space networking. 2. Choose an SSH server to use in early user space. The options are [mkinitcpio-tinyssh](https://archlinux.org/packages/?name=mkinitcpio-tinyssh) or [mkinitcpio-dropbear](https://archlinux.org/packages/?name=mkinitcpio-dropbear), and are mutually exclusive. 1. If using [mkinitcpio-tinyssh](https://archlinux.org/packages/?name=mkinitcpio-tinyssh), it is also recommended to install [tinyssh](https://archlinux.org/packages/?name=tinyssh) or [tinyssh-convert-git](https://aur.archlinux.org/packages/tinyssh-convert-git/)AUR. This tool converts an existing OpenSSH hostkey to the TinySSH key format, preserving the key fingerprint and avoiding connection warnings. The TinySSH and Dropbear mkinitcpio install scripts will automatically convert existing hostkeys when generating a new initcpio image. 3. Decide whether to use an existing OpenSSH key or generate a new one (recommended) for the host that will be connecting to and unlocking the encrypted ZFS machine. Copy the public key into `/etc/tinyssh/root_key` or `/etc/dropbear/root_key`. When generating the initcpio image, this file will be added to `authorized_keys` for the root user and is only valid in the initrd environment. 4. Add the `ip=` [kernel parameter](../en/Kernel_parameters.html "Kernel parameter") to your boot loader configuration. The `ip` string is [highly configurable](https://docs.kernel.org/admin-guide/nfs/nfsroot.html). A simple DHCP example is shown below. ``` ip=:::::eth0:dhcp ``` 5. Edit `/etc/mkinitcpio.conf` to include the `netconf`, `dropbear` or `tinyssh`, and `zfsencryptssh` hooks before the `zfs` hook: ``` HOOKS=(... netconf <tinyssh>|<dropbear> zfsencryptssh zfs ...) ``` 6. [Regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs"). 7. Reboot and try it out! #### Changing the SSH server port By default, [mkinitcpio-tinyssh](https://archlinux.org/packages/?name=mkinitcpio-tinyssh) and [mkinitcpio-dropbear](https://archlinux.org/packages/?name=mkinitcpio-dropbear) listen on port `22`. You may wish to change this. For **TinySSH**, copy `/usr/lib/initcpio/hooks/tinyssh` to `/etc/initcpio/hooks/tinyssh`, and find/modify the following line in the `run_hook()` function: ``` /etc/initcpio/hooks/tinyssh ``` ``` /usr/bin/tcpserver -HRDl0 0.0.0.0 <new_port> /usr/sbin/tinysshd -v /etc/tinyssh/sshkeydir & ``` For **Dropbear**, copy `/usr/lib/initcpio/hooks/dropbear` to `/etc/initcpio/hooks/dropbear`, and find/modify the following line in the `run_hook()` function: ``` /etc/initcpio/hooks/tinyssh ``` ``` /usr/sbin/dropbear -E -s -j -k -p <new_port> ``` [Regenerate the initramfs](../en/Mkinitcpio.html#Image_creation_and_activation "Regenerate the initramfs"). #### Unlocking from a Windows machine using PuTTY/Plink First, we need to use `puttygen.exe` to import and convert the OpenSSH key generated earlier into PuTTY's *.ppk* private key format. Let us call it `zfs_unlock.ppk` for this example. The mkinitcpio-netconf process above does not setup a shell (nor do we need need one). However, because there is no shell, PuTTY will immediately close after a successful connection. This can be disabled in the PuTTY SSH configuration (*Connection > SSH > \[X] Do not start a shell or command at all*), but it still does not allow us to see stdout or enter the encryption passphrase. Instead, we use `plink.exe` with the following parameters: ``` plink.exe -ssh -l root -i c:\path\to\zfs_unlock.ppk <hostname> ``` The plink command can be put into a batch script for ease of use.
ZFS
See also
## See also * [Aaron Toponce's 17-part blog on ZFS](https://pthree.org/2012/12/04/zfs-administration-part-i-vdevs/) * [OpenZFS releases](https://zfsonlinux.org/) * [OpenZFS FAQ](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html) * [FreeBSD Handbook - The Z File System](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs.html) * [Oracle Solaris ZFS Administration Guide](https://docs.oracle.com/cd/E19253-01/819-5461/index.html) * [ZFS Best Practices Guide](https://web.archive.org/web/20161028084224/http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide) * [ZFS Troubleshooting Guide](https://docs.oracle.com/cd/E23823_01/html/819-5461/gavwg.html) * [How Pingdom uses ZFS to back up 5TB of MySQL data every day](https://web.archive.org/web/20171213164254/http://royal.pingdom.com/2013/06/04/zfs-backup/) * [Tutorial on adding the modules to a custom kernel](https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bhow-to%5D-add-zfs-to-the-linux-kernel-4175514510/) * [How to create cross platform ZFS disks under Linux](https://github.com/danboid/creating-ZFS-disks-under-Linux) * [How-To: Using ZFS Encryption at Rest in OpenZFS (ZFS on Linux, ZFS on FreeBSD, …)](https://blog.heckel.xyz/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/) * [Archzfs iso download page: Frequently updated and downloadable archzfs linux iso with full OpenZFS support since 2016](https://archzfs.leibelt.de/) [Categories](../Special:Categories.html "Special:Categories"): * [File systems](../en/Category:File_systems.html "Category:File systems") * [Oracle](../en/Category:Oracle.html "Category:Oracle") Hidden categories: * [Pages or sections flagged with Template:Style](../en/Category:Pages_or_sections_flagged_with_Template:Style.html "Category:Pages or sections flagged with Template:Style") * [Pages or sections flagged with Template:Accuracy](../en/Category:Pages_or_sections_flagged_with_Template:Accuracy.html "Category:Pages or sections flagged with Template:Accuracy") - Retrieved from "<https://wiki.archlinux.org/index.php?title=ZFS&oldid=808845>" - This page was last edited on 20 May 2024, at 16:02. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
ZNC
Intro
# ZNC \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Znc "Znc – 日本語") From ArchWiki Related articles * [PsyBNC](../en/ArchWiki:Archive.html "PsyBNC") [ZNC](https://wiki.znc.in/ZNC) is an advanced IRC bouncer that is left connected so an IRC client can disconnect/reconnect without losing the chat session.
ZNC
Installation
## Installation **Note:** If you previously installed znc (version <1.9) and used `/var/lib/znc/.znc/` you will need to `mv /var/lib/znc/.znc/ /var/lib/znc/` and edit the contents of znc.conf to use the new directory. Alternatively [override the unit](../en/Systemd.html#Replacement_unit_files "Override the unit") to use the old path in `ExecStart`. [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [znc](https://archlinux.org/packages/?name=znc) package. The installation script will create a group and user **znc**. The default home directory for this user is `/var/lib/znc` and shell is `/usr/bin/nologin`. Generate ZNC configuration [as the znc user](../en/Help:Reading.html#Root,_regular_user_or_another_user "Help:Reading"): ``` [znc]$ znc --makeconf --datadir /var/lib/znc ``` Go through the wizard and setup your preferences. [Start/enable](../en/Help:Reading.html#Control_of_systemd_units "Start/enable") `znc.service`.
ZNC
Configuration
## Configuration Though you can choose to modify your configuration files manually, this requires shutting down the server first. To load a module when `znc.service` starts, add `LoadModule = <modulename>` to the configuration file: `/var/lib/znc/configs/znc.conf`. **Warning:** Do not edit `/var/lib/znc/configs/znc.conf` while ZNC is running. There is a good chance you will lose your configuration. Use the *webadmin* or *controlpanel* modules, which are included in the package, to change settings on-the-fly. ### Webadmin Module If you enabled the web admin module, you can access it at `http://yourhostname:port`, the znc port number is the same as you defined for connecting to the bouncer. ### Control Panel Module If you enabled the control panel module, `/msg *controlpanel help` for a list of settings while you are connected to the server.
ZNC
See also
## See also * [ZNC's website](https://wiki.znc.in/ZNC) * [ZNC modules](https://wiki.znc.in/Modules#Module_List) [Category](../Special:Categories.html "Special:Categories"): * [Internet Relay Chat](../en/Category:Internet_Relay_Chat.html "Category:Internet Relay Chat") - Retrieved from "<https://wiki.archlinux.org/index.php?title=ZNC&oldid=803649>" - This page was last edited on 16 March 2024, at 16:46. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
ZTE MF 823 (Megafon M100-3) 4G Modem
Intro
# ZTE MF 823 (Megafon M100-3) 4G Modem \[ ] 2 languages * [日本語](https://wiki.archlinux.jp/index.php/ZTE_MF_823_\(Megafon_M100-3\)_4G_%E3%83%A2%E3%83%87%E3%83%A0 "ZTE MF 823 (Megafon M100-3) 4G モデム – 日本語") * [Русский](../ru/ZTE_MF_823_\(Megafon_M100-3\)_4G_Modem.html "ZTE MF 823 (Megafon M100-3) 4G Modem – русский") From ArchWiki
ZTE MF 823 (Megafon M100-3) 4G Modem
Preparations
## Preparations As described bellow, [usb\_modeswitch](https://archlinux.org/packages/?name=usb_modeswitch) will likely comes out handy. [Install](../en/Help:Reading.html#Installation_of_packages "Install") it.
ZTE MF 823 (Megafon M100-3) 4G Modem
Device Identification
## Device Identification Examine the output of `lsusb`. When the device is switched to an 1405 product code you will get: ``` $ Bus 002 Device 018: ID 19d2:1405 ZTE WCDMA Technologies MSM ``` Here are the USB product codes for this device: * 1225 Default mode in which the device looks like a USB Mass Storage Device with CD-ROM inteface, and a card reader. Corresponds to AT+ZCDRUN=9+AT+ZCDRUN=F - 1403 A Communication mode in which the device has an [wikipedia:RNDIS](https://en.wikipedia.org/wiki/RNDIS "wikipedia:RNDIS") like interface in addition to the card reader interface. The [non recommended](https://cateee.net/lkddb/web-lkddb/USB_NET_RNDIS_HOST.html) [kernel module](../en/Kernel_module.html "Kernel module") rndis\_host might handle such an interface. Corresponds to AT+ZCDRUN=8+AT+ZCDRUN=F. * 1405 A communication mode in which the device has a [wikipedia:USB communications device class](https://en.wikipedia.org/wiki/USB_communications_device_class "wikipedia:USB communications device class") interface in addition to the card reader interface. Communications Device Class (CDC) should work in Linux. The cdc\_ether kernel module is required. This mode will be the one `usb_modeswitch` will switch the device into. - 0016 Download Mode. Under the name of ZTE., but simply a mode where available diagnostic port and two command (analog modem port and PC UI devices Huawei). Corresponds to AT+ZCDRUN=E * 0076 "real" Download Mode. Includes a standard for devices running QC methods. If your modem does not appear as 19d2:1405 (or 1403), check the [USB 3G Modem#Mode switching](../en/Mobile_broadband_modem.html#Mode_switching "USB 3G Modem") article.
ZTE MF 823 (Megafon M100-3) 4G Modem
Ethernet Connection Established
## Ethernet Connection Established When the device has an Ethernet interface the usual [Network configuration](../en/Network_configuration.html "Network configuration") programs should handle it. When they are, you will see that the LED (Blue - 2G/3G or Green - 4G) on modem is not blinking. To establish a connection, the following link (CGI command) should be entered in a browser: <http://192.168.0.1/goform/goform_set_cmd_process?goformId=CONNECT_NETWORK> To avoid entering this link every time, switch the device to auto-connection mode: <http://192.168.0.1/goform/goform_set_cmd_process?goformId=SET_CONNECTION_MODE&ConnectionMode=auto_dial> If you are setting up internet using a [command-line shell](../en/Command-line_shell.html "Command-line shell") you should make request with referrer, as in: ``` curl --header "Referer: http://192.168.0.1/index.html" http://192.168.0.1/goform/goform_set_cmd_process?goformId=CONNECT_NETWORK ``` otherwise you will get response {"result":"faulure"}
ZTE MF 823 (Megafon M100-3) 4G Modem
Commands
## Commands CGI command for 2G/3G/4G mode selection: ``` http://192.168.0.1/goform/goform_set_cmd_process?goformId=SET_BEARER_PREFERENCE&BearerPreference= ``` following options available after "=" sign (case-sensetive) ``` NETWORK_auto WCDMA_preferred GSM_preferred Only_GSM Only_WCDMA Only_LTE WCDMA_AND_GSM WCDMA_AND_LTE GSM_AND_LTE ``` This should be followed by the **NETWORK CONNECT** CGI command given before. To switch the modem to **FACTORY mode** (**WARNING! Unable to recieve further CGI commands, connection will be lost!**), issue this link: ``` http://192.168.0.1/goform/goform_process?goformId=MODE_SWITCH&switchCmd=FACTORY ``` You may then need to run the following command (as root) in order to access the AT command serial port: ``` # echo 0x19d2 0x16 > /sys/module/usbserial/drivers/usb-serial:generic/new_id ``` The port should appear as `/dev/ttyUSBn`, e.g. `/dev/ttyUSB1`. When you discover the command port, you can use your favourite serial terminal emulation program to control the device. The commands below may be especially useful (here shown with [modem-cmd](//github.com/imZack/modem-cmd)): ``` # modem-cmd /dev/ttyUSB1 AT+ZCDRUN=8 # switch to 1403 mode (RNDIS) # modem-cmd /dev/ttyUSB1 AT+ZCDRUN=9 # switch to 1225 mode (default) # modem-cmd /dev/ttyUSB1 AT+ZCDRUN=F # exit DOWNLOAD mode and switch to selected mode (RNDIS or default) ```
ZTE MF 823 (Megafon M100-3) 4G Modem
Telnet Connection
## Telnet Connection The modem is available for [telnet](../en/Telnet.html "Telnet") connection: ``` telnet 192.168.0.1 login: root password: zte9x15 ``` As you can see, the modem has an embeded Linux system inside. You can even install some ARM-base packages (mc, nano...) or change something in Web-menu. Explore it carefully!
ZTE MF 823 (Megafon M100-3) 4G Modem
Possible usage with product code 1403
## Possible usage with product code 1403 For some reason this device can get stuck in mode 0016 and fails to switch to any other mode. I was unsuccessful in trying to switch modes using `usb_modeswitch` or sending AT commands to /dev/ttyUSB0 on various Linux systems. I successfully managed to change modes from 0016 to 1403 using Mac OSX. I was then able to use the dongle on Linux. In mode 0016 on OSX you will see the follow interfaces: ``` /dev/tty.ZTEUSBATPort_ /dev/tty.ZTEUSBModem_ /dev/tty.ZTEUSBDIAGPort_ ``` You can switch modes to 1403 by sending AT commands to the USBModem\_ port by doing: ``` screen /dev/tty.ZTEUSBModem_ 9600 >>ATI Manufacturer: ZTE CORPORATION Model: MF823 Revision: MF823_T03 IMEI: 866948013728723 +GCAP: +CGSM >>AT+CREG? +CREG: 0,1 OK >>AT+COPS? +COPS: 0,0,"Telstra Mobile",7 OK >>AT+ZCDRUN=8+AT+ZCDRUN=F exit download mode result(0:FAIL 1:SUCCESS):1 OK ``` Now the device should act as a ethernet interface no matter which system you plug it into.
ZTE MF 823 (Megafon M100-3) 4G Modem
See also
## See also [whirlpool.net.au](https://forums.whirlpool.net.au/archive/2212748) - Linux & Serial Diags [gsmforum.ru](https://www.gsmforum.ru/threads/188925-ZTE-MF823-%D0%B8-%D0%B2%D1%81%D1%91-%D1%87%D1%82%D0%BE-%D1%81-%D0%BD%D0%B8%D0%BC-%D1%81%D0%B2%D1%8F%D0%B7%D0%B0%D0%BD%D0%BE?p=934477\&viewfull=1#post934477) - ZTE MF823 thread (in Russian) [Category](../Special:Categories.html "Special:Categories"): * [Modems](../en/Category:Modems.html "Category:Modems") - Retrieved from "<https://wiki.archlinux.org/index.php?title=ZTE_MF_823_(Megafon_M100-3)_4G_Modem&oldid=698610>" - This page was last edited on 8 October 2021, at 22:21. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Zabbix
Intro
# Zabbix \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Zabbix "Zabbix – 日本語") From ArchWiki [Zabbix](https://zabbix.com) is a full-featured monitoring solution for larger networks. It can discover all kind of networking devices using different methods, check machine states and applications, sending pre-defined alarm messages and visualize complex data correlations.
Zabbix
Server setup
## Server setup ### Installation #### Server Installation Install the [zabbix-server](https://archlinux.org/packages/?name=zabbix-server) package. This includes the necessary scripts for use with MariaDB or PostgreSQL. #### Database Installation Install either the [mariadb](https://archlinux.org/packages/?name=mariadb) package or the [postgresql](https://archlinux.org/packages/?name=postgresql) package. #### Frontend Installation Install the [zabbix-frontend-php](https://archlinux.org/packages/?name=zabbix-frontend-php) package. You should choose a web server with PHP support, e.g.: * [Apache HTTP Server](../en/Apache_HTTP_Server.html "Apache HTTP Server") * [Lighttpd](../en/Lighttpd.html "Lighttpd") * [nginx](../en/Nginx.html "Nginx") You can also choose one of the servers found in [Category:Web server](../en/Category:Web_server.html "Category:Web server"). ### Configuration Symlink the Zabbix web application directory to your http document root, e.g.: ``` $ ln -s /usr/share/webapps/zabbix /srv/http/zabbix ``` To get Apache working out-of-the-box, you need to enable PHP integration: * see [Using php-fpm and mod\_proxy\_fcgi](../en/Apache_HTTP_Server.html#Using_php-fpm_and_mod_proxy_fcgi "Apache HTTP Server") Adjust following variables in `/etc/php/php.ini`: ``` extension=bcmath extension=gd extension=sockets extension=mysqli extension=gettext post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = "UTC" ``` **Tip:** If using [php-fpm and mod\_proxy\_fcgi](../en/Apache_HTTP_Server.html#Using_php-fpm_and_mod_proxy_fcgi "Apache HTTP Server"), you may need to [restart](../en/Help:Reading.html#Control_of_systemd_units "Restart") `php-fpm.service`. ### Database Initialization #### MariaDB In this example, we create on localhost a MariaDB database called `zabbix` for the user `zabbix` identified by the password `test` and then import the database templates. This connection will be later used by the Zabbix server and web application. **Note:** On a production system, the password should be changed to something more secure. If your MariaDB installation uses a `root` account with a password, use the following: ``` $ mariadb -u root -p -e "create database zabbix character set utf8 collate utf8_bin" $ mariadb -u root -p -e "grant all on zabbix.* to zabbix@localhost identified by 'test'" ``` If your MariaDB installation uses a `root` account without a password, use the following: ``` # mariadb -e "create database zabbix character set utf8 collate utf8_bin" # mariadb -e "grant all on zabbix.* to zabbix@localhost identified by 'test'" ``` Use the following to import the database templates: ``` $ mariadb -u zabbix -p -D zabbix < /usr/share/zabbix-server/mysql/schema.sql $ mariadb -u zabbix -p -D zabbix < /usr/share/zabbix-server/mysql/images.sql $ mariadb -u zabbix -p -D zabbix < /usr/share/zabbix-server/mysql/data.sql ``` #### PostgreSQL For PostgreSQL, these commands will create a database `zabbix` for user `zabbix`, which are the default settings in `zabbix_server.conf`, then import the schema and initial data: ``` $ createuser zabbix $ createdb zabbix -O zabbix $ cat /usr/share/zabbix-server/postgresql/{schema,images,data}.sql | psql -U zabbix -d zabbix ``` ### Database Configuration Now edit `/etc/zabbix/zabbix_server.conf` with the database settings: ``` /etc/zabbix/zabbix_server.conf ``` ``` DBName=zabbix DBUser=zabbix DBPassword=test LogType=system ``` ### ICMP/ping discovery To use ICMP discovery (e.g. ping) in Zabbix, [install](../en/Help:Reading.html#Installation_of_packages "Install") the [fping](https://archlinux.org/packages/?name=fping) package. ### Starting If you are using MariaDB, [enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") and [start](../en/Help:Reading.html#Control_of_systemd_units "Start") the `zabbix-server-mysql.service` unit, or if you are using PostgreSQL, the `zabbix-server-pgsql.service` unit. Access Zabbix via your local web server, e.g.: <http://localhost/zabbix/>, and start the installation wizard. The default username is `Admin` and password `zabbix`. See appendix for a link to the official documentation, which explains all further steps in using it.
Zabbix
Agent setup
## Agent setup ### Installation Install [zabbix-agent](https://archlinux.org/packages/?name=zabbix-agent) for each monitoring target, including your monitoring server where [zabbix-server](https://archlinux.org/packages/?name=zabbix-server) is installed. [zabbix-server](https://archlinux.org/packages/?name=zabbix-server) no longer includes `zabbix-agent`. ### Configuration Simply edit the `zabbix_agentd.conf` and replace the server variable with the IP of your monitoring server. Only servers from this/these IP will be allowed to access the agent. ``` Server=<IP of Zabbix server> ServerActive=<IP of Zabbix server> ``` Further make sure the port `10050` on your device being monitored is not blocked and is properly forwarded. ### Starting [Enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") and [start](../en/Help:Reading.html#Control_of_systemd_units "Start") the `zabbix-agent.service` unit.
Zabbix
Tips and tricks
## Tips and tricks ### Debugging a Zabbix agent On the client site, you can check the state of an item like this: ``` $ zabbix_agentd -t hdd.smart[sda,Temperature_Celsius] ``` On the server/monitoring site, try this: ``` $ zabbix_get -s host -k hdd.smart[sda,Temperature_Celsius] ``` ### Monitor Arch Linux system updates Here is an approach on how to monitor your Arch Linux clients for available system update using a custom `UserParameter`: ``` /etc/zabbix/zabbix_agentd.conf ``` ``` Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf ``` ``` /etc/zabbix/zabbix_agentd.conf.d/archlinuxupdates.conf ``` ``` UserParameter=archlinuxupdates,checkupdates | wc -l ``` You have to restart `zabbix-agentd` to apply the new configuration. The keyword for the item you later use in the web frontend is `archlinuxupdates`. It returns an integer representing the count of available updates.
Zabbix
Troubleshooting
## Troubleshooting ### Error "Specified key was too long; max key length is 767 bytes" While importing the databases, you might get this error message. In order to solve this, you will have to change the code page configuration for your MariaDB database: [MariaDB#Using UTF8MB4](../en/MariaDB.html#Using_UTF8MB4 "MariaDB").
Zabbix
See also
## See also * [Official manual](https://www.zabbix.com/documentation/) * [Zabbix Share](https://share.zabbix.com/) – Zabbix templates, modules & more [Category](../Special:Categories.html "Special:Categories"): * [Network monitoring](../en/Category:Network_monitoring.html "Category:Network monitoring") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Zabbix&oldid=787620>" - This page was last edited on 15 September 2023, at 08:16. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
zathura
Intro
# zathura \[ ] 3 languages * [Suomi](../fi/Zathura.html "Zathura – suomi") * [日本語](https://wiki.archlinux.jp/index.php/Zathura "Zathura – 日本語") * [Português](../pt/Zathura.html "Zathura – português") From ArchWiki [zathura](https://en.wikipedia.org/wiki/Zathura_\(document_viewer\) "w:Zathura (document viewer)") is a highly customizable document viewer with vi-styled keybindings. It provides a minimalistic and space-saving interface. Users interact with zathura primarily with the keyboard. Different file formats are supported through plugins. Support is available for [PDF, PS, DjVu](../en/PDF,_PS_and_DjVu.html "PDF, PS and DjVu") and [comic book](https://en.wikipedia.org/wiki/Comic_book_archive "w:Comic book archive") files.
zathura
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [zathura](https://archlinux.org/packages/?name=zathura) package along with the desired optional dependencies: * [zathura-cb](https://archlinux.org/packages/?name=zathura-cb) — Comic book support * [zathura-djvu](https://archlinux.org/packages/?name=zathura-djvu) — DjVu support * [zathura-pdf-mupdf](https://archlinux.org/packages/?name=zathura-pdf-mupdf) — EPUB, PDF and XPS support based on [MuPDF](../en/MuPDF.html "MuPDF") * [zathura-pdf-poppler](https://archlinux.org/packages/?name=zathura-pdf-poppler) — PDF support based on [Poppler](https://en.wikipedia.org/wiki/Poppler_\(software\) "wikipedia:Poppler (software)") * [zathura-ps](https://archlinux.org/packages/?name=zathura-ps) — PostScript support
zathura
Features
## Features zathura automatically reloads documents. When working in compiled documents such as those written in LaTeX, zathura will refresh the output whenever compilation takes place. zathura has the option of enabling inverse search (using "synctex"). zathura can adjust the document to page-fit (`a`) or to fit width (`s`), and it can rotate pages (`r`). It can view pages side-by-side (`d`) and has a fullscreen mode. Pages can also be recolored to have a black background and white foreground (`C-r`). Most of vi's movement/scrolling commands are supported. Links can be followed by clicking them. Additionally, one can press `f` to highlight all links on the page and assign them a number, typing the number of the link and pressing enter will then jump to the link's location. If `F` is used, only the location of the link will be shown in the status bar. zathura can search for text and copy text to the primary X selection. It supports bookmarks and can open encrypted files. The behavior and appearance of zathura can be customised using a configuration file. zathura has the ability to execute external shell commands. It can be opened in tabs using tabbed. zathura provides an optional sandbox mode by using seccomp filter to provide a hardened runtime environment.
zathura
Tips and tricks
## Tips and tricks Commands may be entered directly into zathura by pressing `:`, just like in vi. ### Enable copy to clipboard ``` ~/.config/zathura/zathurarc ``` ``` set selection-clipboard clipboard ``` ### Side-by-side mode Press `d` to toggle side-by-side mode. In side-by-side mode, to view odd pages on the left side, enter the command `set first-page-column 1:1` into zathura. This is particularly useful for reading two-page illustrations or music scans where typesetting optimizes page-turning on certain pages. ``` ~/.config/zathura/zathurarc ``` ``` map D set "first-page-column 1:1" map <C-d> set "first-page-column 1:2" ``` ### Titlebar and statusbar tweaks See [zathurarc(5)](https://man.archlinux.org/man/zathurarc.5). ### Tabbed zathura You can open zathura in tabs using `tabbed`. ``` tabbed -c zathura -e ``` However, if you are using a window manager which provides a tabbed layout, you can just make use of those, e.g. tabbed layouts in [i3](../en/I3.html "I3"). ### Page number offset Many editions of printed books only start counting page numbering at the beginning of the text. However, Zathura counts all pages of the PDF, including pages some editions do not: the front cover, edition notice, the initial couple of blank pages, etc. For this reason, Zathura's page numbering is sometimes misaligned with the edition, which makes it a hassle to follow page numbers used by the table of contents, or citations. The command `:offset <number>` will make Zathura take into account an offset when jumping to a page number (by typing `<number>G`, the command `:<number>` will not mind the offset [\[1\]](https://git.pwmt.org/pwmt/zathura/-/issues/76#note_589)). *For example*, a given book begins counting its pages on the PDF's 17th page (so on page 17, the index is 1; on 18 it is 2, and so on). On setting `:offset 16`, `245G` will jump to the 261st page of the PDF rather than the 245th. ### Enable Sandbox zathura has a sandbox mode that provides a secure environment by using a strict seccomp filter. The mode can be set in `zathurarc` like this: ``` set sandbox strict ``` Some features are disabled when using strict sandbox mode, such as writing files, printing and bookmarks ### Make zathura the default pdf viewer Ensures, for example, that [xdg-open(1)](https://man.archlinux.org/man/xdg-open.1) will open pdf files with zathura. First, ensure a [desktop entry](../en/Desktop_entries.html "Desktop entry") for zathura exists at `/usr/share/applications/org.pwmt.zathura.desktop`. If it does not, download the desktop entry from [from the zathura repo](https://github.com/pwmt/zathura/blob/develop/data/org.pwmt.zathura.desktop.in) to `/usr/share/applications/org.pwmt.zathura.desktop`. Then, set zathura as default using [xdg-mime(1)](https://man.archlinux.org/man/xdg-mime.1) ``` $ xdg-mime default org.pwmt.zathura.desktop application/pdf ``` ### Read Microsoft Office/LibreOffice documents within zathura The [zaread-git](https://aur.archlinux.org/packages/zaread-git/)AUR script allows for opening Microsoft Office/[LibreOffice](../en/LibreOffice.html "LibreOffice") documents with zathura. To use it, run ``` $ zaread /path/to/document.docx ``` ### Emacs keymap Zathura uses vi-like key map by default. Emacs key bindings need to be separately configured. An example can be found [here](https://web.archive.org/web/20220815064614/https://gist.github.com/ne9z/8778d614b90b85dfe8f6b698ad758f36).
zathura
Troubleshooting
## Troubleshooting ### Huge memory usage with Poppler According to [issue 88](https://git.pwmt.org/pwmt/zathura/-/issues/88), switching to [zathura-pdf-mupdf](https://archlinux.org/packages/?name=zathura-pdf-mupdf) from [zathura-pdf-poppler](https://archlinux.org/packages/?name=zathura-pdf-poppler) may solve the problem. However, if you are searching in a large document, a lot of memory will [still be used](https://zathura.pwmt.narkive.com/Tly3Pvcm/zathura-memory-usage#post5).
zathura
See also
## See also * [zathura website](https://pwmt.org/projects/zathura/) * [Poppler website](https://poppler.freedesktop.org/) * [zathura(1) § MOUSE AND KEY BINDINGS](https://man.archlinux.org/man/zathura.1#MOUSE_AND_KEY_BINDINGS) [Category](../Special:Categories.html "Special:Categories"): * [Office](../en/Category:Office.html "Category:Office") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Zathura&oldid=803747>" - This page was last edited on 17 March 2024, at 13:06. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Zeitgeist
Intro
# Zeitgeist \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Zeitgeist "Zeitgeist – 日本語") From ArchWiki [Zeitgeist](https://zeitgeist.freedesktop.org/) is a service which logs user activities and events, anywhere from files opened to websites visited or conversations held via email and more. It makes this information readily available for other applications to use in the form of timelines and statistics. See the [Wikipedia article](https://en.wikipedia.org/wiki/Zeitgeist_\(framework\) "wikipedia:Zeitgeist (framework)") for a more detailed description of Zeitgeist itself.
Zeitgeist
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [zeitgeist](https://archlinux.org/packages/?name=zeitgeist) package, which includes the daemon and the datahub. The daemon receives metadata from data sources, and provides them to applications using D-Bus. The datahub provides passive plugins which insert events into Zeitgeist. To configure what gets logged by Zeitgeist, install [activity-log-manager](https://archlinux.org/packages/?name=activity-log-manager) which provides a graphical user interface where you can filter out specific folders, file types, and applications. To monitor and inspect Zeitgeist's log at a low level, install [zeitgeist-explorer](https://archlinux.org/packages/?name=zeitgeist-explorer) which provides a graphical user interface where you can see the events logged in real-time just like Wireshark. ### Data providers The following applications are just a few examples of software able to send metadata to Zeitgeist. In some cases this functionality must be enabled manually. * [pantheon-code](https://archlinux.org/packages/?name=pantheon-code) * [pantheon-files](https://archlinux.org/packages/?name=pantheon-files) * [pantheon-music](https://archlinux.org/packages/?name=pantheon-music) * [Zim](../en/Zim.html "Zim") ### Applications The following applications can be used to browse or search for recent activity using the Zeitgeist engine: * **GNOME Activity Journal** — Browse a chronological log of your activities and easily find files, contacts, etc. - <https://launchpad.net/gnome-activity-journal> || [gnome-activity-journal](https://aur.archlinux.org/packages/gnome-activity-journal/)AUR * **Recent Events applet (Cairo-Dock plugin)** — Applet for [Cairo-Dock](../en/Cairo-Dock.html "Cairo-Dock") using Zeitgeist. - <https://www.glx-dock.org/>\[[dead link](https://en.wikipedia.org/wiki/Wikipedia:Link_rot "wikipedia:Wikipedia:Link rot") 2024-03-03 ⓘ] || [cairo-dock-plug-ins](https://archlinux.org/packages/?name=cairo-dock-plug-ins) * **Synapse** — Semantic launcher written in Vala that you can use to start applications as well as find and access relevant documents and files by making use of the Zeitgeist engine. - <https://launchpad.net/synapse-project> || [synapse](https://archlinux.org/packages/?name=synapse)
Zeitgeist
See also
## See also * **Catfish** — Versatile file searching tool. Can be powered by Zeitgeist. - <https://docs.xfce.org/apps/catfish/start> || [catfish](https://archlinux.org/packages/?name=catfish) [Category](../Special:Categories.html "Special:Categories"): * [Search](../en/Category:Search.html "Category:Search") Hidden category: * [Pages with dead links](../en/Category:Pages_with_dead_links.html "Category:Pages with dead links") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Zeitgeist&oldid=805790>" - This page was last edited on 12 April 2024, at 18:39. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
ZeroNet
Intro
# ZeroNet \[ ] 2 languages * [日本語](https://wiki.archlinux.jp/index.php/ZeroNet "ZeroNet – 日本語") * [中文(简体)](https://wiki.archlinuxcn.org/wiki/ZeroNet "ZeroNet – 中文(简体)") From ArchWiki [ZeroNet](https://zeronet.io/) gives access to "open, free and uncensorable websites, using Bitcoin cryptography and the BitTorrent network".
ZeroNet
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [zeronet](https://aur.archlinux.org/packages/zeronet/)AUR package. The latest development version is also available in the [zeronet-git](https://aur.archlinux.org/packages/zeronet-git/)AUR package
ZeroNet
Configuration
## Configuration ### Starting To start ZeroNet [start/enable](../en/Help:Reading.html#Control_of_systemd_units "Start/enable") `zeronet.service`. ### Tor By default, ZeroNet uses clearnet and Tor if available. To enable Tor support you first need to install [Tor](../en/Tor.html "Tor"). Then, give ZeroNet access to control Tor using the following instructions. ``` # usermod -a -G tor zeronet ``` [Append](../en/Help:Reading.html#Append,_add,_create,_edit "Append") or edit the following options in `/etc/tor/torrc`: ``` /etc/tor/torrc ``` ``` ControlPort 9051 DataDirectoryGroupReadable 1 CacheDirectoryGroupReadable 1 CookieAuthentication 1 CookieAuthFileGroupReadable 1 CookieAuthFile /var/lib/tor/control_auth_cookie ``` You may also want to [start/enable](../en/Help:Reading.html#Control_of_systemd_units "Start/enable") `tor.service`. Check the Tor file permissions: ``` # stat -c %a /var/lib/tor ``` This should print `750`. if not, run ``` # chmod 0750 /var/lib/tor ``` To force all ZeroNet connections through Tor, append to your `/etc/zeronet.conf` file ``` /etc/zeronet.conf ``` ``` tor = always ```
ZeroNet
Creating ZeroNet sites
## Creating ZeroNet sites All operations, including editing ZeroNet site files, should be done as user `zeronet`. Use `--config_file` to specify the configuration file. `/etc/zeronet.conf` use `/var/lib/zeronet` as data directory by default. For example: ``` [zeronet]$ python zeronet.py --config_file /etc/zeronet.conf ``` All sites you create will have their initial data folder setup in `/var/lib/zeronet/address`. For more information on how to create a Zite, please follow the guidelines on the [ZeroNet FAQ](https://zeronet.readthedocs.io/en/latest/using_zeronet/create_new_site/).
ZeroNet
See also
## See also * [Official ZeroNet website](https://zeronet.io/) * [ZeroNet - Read the Docs](https://zeronet.readthedocs.io/en/latest/) [Category](../Special:Categories.html "Special:Categories"): * [Internet applications](../en/Category:Internet_applications.html "Category:Internet applications") - Retrieved from "<https://wiki.archlinux.org/index.php?title=ZeroNet&oldid=792145>" - This page was last edited on 10 November 2023, at 12:39. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
ZeroTier
Intro
# ZeroTier \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/ZeroTier "ZeroTier – 日本語") From ArchWiki ZeroTier is a cross-platform and easy to use virtual LAN / Hamachi alternative, also available on Android, iOS, Mac, and Windows. A GUI is only available on Mac and Windows according to the developers. **Note:** Since [this commit](https://github.com/zerotier/ZeroTierOne/commit/52a166a71f4e0124c7b22123884911338aa0d698) ZeroTier switched to the [Business Source License](https://mariadb.com/fr/bsl11/). Last GPLv3 version of ZeroTier is [1.4.2](https://github.com/zerotier/ZeroTierOne/releases/tag/1.4.2)
ZeroTier
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") the [zerotier-one](https://archlinux.org/packages/?name=zerotier-one) package.
ZeroTier
Configuration
## Configuration You will need to create an account over at [My ZeroTier](https://my.zerotier.com/) and create a network and select your desired options, such as support for IPv4 or IPv6 or both. Keep note of the network ID of the newly-created network as you will be needing it later on. Leave the page for the network that you will use open, as you will need to authorize each computer or device that you connect, and also verify that they get an IP. To begin [start](../en/Help:Reading.html#Control_of_systemd_units "Start") `zerotier-one.service`, if one would like it to start at boot [enable](../en/Help:Reading.html#Control_of_systemd_units "Enable") `zerotier-one.service`. To find out your computer id, which will be a 10-digit hexadecimal number similar to 89e92ceee5, run: ``` # zerotier-cli info ``` ``` 200 info 89e92ceee5 1.2.4 ONLINE ``` where 89e92ceee5 is address and 1.2.4 is the version, followed by its status. Next you will need to join a network: ``` # zerotier-cli join network_id ``` The network ID is a 16-digit hexadecimal number like 8056c2e21c000001 which you can get on the Networks page. Back on the network page at my.zerotier, scroll down to the Members section where you should see all addresses that have joined. To authorize each computer or device, check the left-most checkbox and verify that it is given an IP address (this may take 10 or 20 seconds). You may need to run [dhcpcd](../en/Dhcpcd.html "Dhcpcd") to acquire the new IP address locally. To verify that all devices can see each other you can [ping](../en/Network_configuration.html#Ping "Ping") each address using its associated IP, like so: ``` $ ping 192.168.192.91 ``` ``` PING 192.168.192.91 (192.168.192.91) 56(84) bytes of data. 64 bytes from 192.168.192.91: icmp_req=1 ttl=53 time=52.9 ms ... ``` One can also see connected peers by running: ``` # zerotier-cli listpeers ``` ``` 200 listpeers <ztaddr> <path> <latency> <version> <role> 200 listpeers 12ac4a1e71 87.98.218.130/30883;12;12;1.00 589 1.2.5 LEAF 200 listpeers 8841408a2e 159.203.2.154/9993;13262;13220;1.00 127 1.1.5 PLANET 200 listpeers 9d219039f3 159.203.97.171/9993;13241;3218;1.00 63 1.1.5 PLANET ... ``` and see a list of networks the computer is connected to by running: ``` # zerotier-cli listnetworks ```
ZeroTier
Manual configuration
## Manual configuration Manual configuration can be achieved by creating the file `local.conf` in the program's home directory `/var/lib/zerotier-one`. This allows you to set various configuration options, such as restricting the service to specific interfaces, or enforcing use of a different port. This file **must** be valid JSON as it can be re-written by zerotier-one. Below is an example `local.conf` which stops zerotier-one using docker and bridged interfaces: ``` local.conf ``` ``` { "settings": { "interfacePrefixBlacklist": [ "docker", "br-" ] } } ``` More information on the available configuration items is available on the [program's GitHub repository](https://github.com/zerotier/ZeroTierOne/tree/master/service#local-configuration-file).
ZeroTier
Troubleshooting
## Troubleshooting ### Devices in virtual network not reachable Check the [unit status](../en/Help:Reading.html#Control_of_systemd_units "Unit status") of `zerotier-one.service`. If you see following error, the [TUN/TAP](https://docs.kernel.org/networking/tuntap.html) kernel module is probably not loaded: ``` ERROR: unable to configure virtual network port: could not open TUN/TAP device: No such file or directory ``` A reboot should resolve the issue. [Category](../Special:Categories.html "Special:Categories"): * [Virtual Private Network](../en/Category:Virtual_Private_Network.html "Category:Virtual Private Network") - Retrieved from "<https://wiki.archlinux.org/index.php?title=ZeroTier&oldid=777988>" - This page was last edited on 14 May 2023, at 05:41. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Zettlr
Intro
# Zettlr \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Zettlr "Zettlr – 日本語") From ArchWiki Zettlr is a cross-platform markdown editor for writing articles, ebooks, and general content. It is inspired by the [Zettelkasten](https://en.wikipedia.org/wiki/Zettelkasten "wikipedia:Zettelkasten") system for note-taking and personal knowledge management. It supports autocorrection, snippets, localization, math formulae, citations, presentations (through reveal.js framework), and custom templates.
Zettlr
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") [zettlr](https://archlinux.org/packages/?name=zettlr). In case you want the latest git version, it can be installed with [zettlr-git](https://aur.archlinux.org/packages/zettlr-git/)AUR. ### LaTeX Zettlr makes use of [pandoc-cli](https://archlinux.org/packages/?name=pandoc-cli) for exporting from the default markdown to plenty of different formats. That includes PDFs but the exporting is limited to not overtly-complex files. For more elaborate PDFs and better control on the final output, a LaTeX distribution like [texlive-latex](https://archlinux.org/packages/?name=texlive-latex) is an advised optional dependency.
Zettlr
Usage
## Usage Depending on which package you have installed, launch Zettlr either with `zettlr` or `Zettlr`.
Zettlr
Configuration
## Configuration At first start a directory will be copied into your local Documents directory containing a tutorial. You may follow it by opening the files inside or delete it in case you want to start using Zettlr right away. Nearly everything can be configured using the menus and the toolbar's buttons. For reference, check an [explanation](https://docs.zettlr.com/en/reference/settings/) of all the settings. The configuration files are located at `$XDG_CONFIG_HOME/Zettlr/`.
Zettlr
Features
## Features ### Snippets Zettlr supports snippets since version 2.0. They allow you to define chunks of text that you need to type often or dynamic variables. Snippets follow the syntax of TextMate and can be then shared with other editors supporting it as well (like VisualStudio Code). A partial list of snippets is available on the [documentation](https://docs.zettlr.com/en/core/snippets/). ### Citations Zettlr comes with support for citations with the citeproc-js library, similar to [pandoc-cli](https://archlinux.org/packages/?name=pandoc-cli)'s citeproc-engine or Zotero. Both CLJSON and BibTex citation formats are supported. For a full tutorial on how to use citations in Zettlr, refer to the relative chapter in the [documentation](https://docs.zettlr.com/en/academic/citations/). ### Projects To facilitate the exporting to PDF or other formats of multiple, connected, files, Zettlr uses Projects. Directories where the files of text are present can be converted to Projects' directories by right-clicking on them in the sidebar and selecting "Enable project" from their proprieties. ### Spell Checking and Custom Dictionaries Spell checking is supported and enabled by default in Zettlr. Moreover, custom dictionaries in the form of a pair of \`.dic\` and \`.aff\` files can be added in the preferences. A pretty comprehensive list of dictionaries can be downloaded from [this Github page](https://github.com/wooorm/dictionaries). The supported languages are [here](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
Zettlr
Tips and Tricks
## Tips and Tricks ### AutoCorrect Autocorrection is supported by default in Zettlr. Some definitions are already present at installation; others can be added in the preferences. Zettlr supports two autocorrection modes: Word and LibreOffice. The first is more aggressive and automatically attempt to replace words and punctuation that it finds wrong. LibreOffice requires instead the user to press `Space` or `Enter` to accept a correction. ### MagicQuotes MagicQuotes are a feature to use typographically correct quotation marks instead of the default `'` or `"`. The desired quotation marks can be either chosen from a dropdown menu or pre-selected according to the language with a button. MagicQuotes are automatically enabled if AutoCorrect is. If it is not desired, but the latter is, set the quotation marks to either `'` or `"` so the change will have no effect. ### YAML Frontmatter A default YAML frontmatter can be set by starting a file with three dashes (---) and everything till the closing three dashes will be considered the frontmatter. Further info can be obtained at the [official documentation](https://docs.zettlr.com/en/core/yaml-frontmatter/) ### Pomodoro Timer Zettlr comes with an integrated Pomodoro Timer, for those who want to write according to the [Pomodoro technique](https://francescocirillo.com/pages/pomodoro-technique)\[[dead link](https://en.wikipedia.org/wiki/Wikipedia:Link_rot "wikipedia:Wikipedia:Link rot") 2024-01-13 ⓘ], the length of the work, break and short break phases can be selected directly from the button on the toolbar. A set of sound effects to signal the end of each phase is also shipped with Zettlr. ### Readability A series of indexes of readability is included in Zettlr to analyze the clarity and difficulty of the text of each article. Depending on the type of content you are writing, you can check the [Dale-Chall Readability Formula](https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula "wikipedia:Dale–Chall readability formula"), the [Gunning fog index](https://en.wikipedia.org/wiki/Gunning_fog_index "wikipedia:Gunning fog index"), the [Coleman-Liau index](https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index "wikipedia:Coleman–Liau index"), or the [Automated Readability Index](https://en.wikipedia.org/wiki/Automated_readability_index "wikipedia:Automated readability index") (ARI)
Zettlr
See also
## See also The [Official documentation](https://docs.zettlr.com/en) [Category](../Special:Categories.html "Special:Categories"): * [Text editors](../en/Category:Text_editors.html "Category:Text editors") Hidden category: * [Pages with dead links](../en/Category:Pages_with_dead_links.html "Category:Pages with dead links") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Zettlr&oldid=807517>" - This page was last edited on 5 May 2024, at 09:24. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Zig
Intro
# Zig \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Zig "Zig – 日本語") From ArchWiki From [Wikipedia](https://en.wikipedia.org/wiki/Zig_\(programming_language\) "wikipedia:Zig (programming language)"): * [Zig](https://ziglang.org/) is an imperative, general-purpose, statically typed, compiled system programming language designed by Andrew Kelley. It is intended to be a replacement for the [C](../en/C.html "C") programming language, with the goals of being even smaller and simpler to program in while also offering modern features, new optimizations and a variety of safety mechanisms while not as demanding of runtime safety as seen in other languages.
Zig
Installation
## Installation [Install](../en/Help:Reading.html#Installation_of_packages "Install") [zig](https://archlinux.org/packages/?name=zig), or [zig-git](https://aur.archlinux.org/packages/zig-git/)AUR for the latest development version. [zls](https://archlinux.org/packages/?name=zls) provides the [Zig Language Server](https://github.com/zigtools/zls), a [Language Server Protocol](https://en.wikipedia.org/wiki/Language_Server_Protocol "wikipedia:Language Server Protocol") implementation.
Zig
Usage
## Usage ### Zig Build System The Zig Build System provides a cross-platform, dependency-free way to declare the logic required to build a project. See [\[1\]](https://ziglang.org/documentation/master/#Zig-Build-System). ### Cross compiling See [\[2\]](https://ziglang.org/learn/overview/#cross-compiling-is-a-first-class-use-case). For the latest list of supported targets, see [\[3\]](https://ziglang.org/download/0.11.0/release-notes.html#Support-Table).
Zig
See also
## See also * [Official website](https://ziglang.org/) * [Wikipedia article](https://en.wikipedia.org/wiki/Zig_\(programming_language\) "wikipedia:Zig (programming language)") * [Language Reference](https://ziglang.org/documentation/master/) * [Standard Library Documentation](https://ziglang.org/documentation/master/std/) * [Example programs](https://zigbyexample.github.io/) * [Tutorial](https://ziglearn.org/) * [Zig on Exercism](https://exercism.org/tracks/zig) [Category](../Special:Categories.html "Special:Categories"): * [Programming languages](../en/Category:Programming_languages.html "Category:Programming languages") - Retrieved from "<https://wiki.archlinux.org/index.php?title=Zig&oldid=786022>" - This page was last edited on 23 August 2023, at 15:13. - Content is available under [GNU Free Documentation License 1.3 or later](https://www.gnu.org/copyleft/fdl.html) unless otherwise noted. * [Privacy policy](https://terms.archlinux.org/docs/privacy-policy/) * [About ArchWiki](../en/ArchWiki:About.html) * [Disclaimers](../en/ArchWiki:General_disclaimer.html) * [Code of conduct](https://terms.archlinux.org/docs/code-of-conduct/ "archlinux-service-agreements:code-of-conduct") * [Terms of service](https://terms.archlinux.org/docs/terms-of-service/ "archlinux-service-agreements:terms-of-service") - [![GNU Free Documentation License 1.3 or later](/resources/assets/licenses/gnu-fdl.png)](https://www.gnu.org/copyleft/fdl.html) - ![](/resources/assets/poweredby_mediawiki_88x31.png) * Toggle limited content width
Zim
Intro
# Zim \[ ] 1 language * [日本語](https://wiki.archlinux.jp/index.php/Zim "Zim – 日本語") From ArchWiki From [Wikipedia](https://en.wikipedia.org/wiki/ZIM_\(file_format\) "wikipedia:ZIM (file format)"), ZIM is an open file format that stores wiki content for offline usage. It is also the name of a graphical text editor used to edit this format.
Zim
Installation
## Installation * [zim](https://archlinux.org/packages/?name=zim): GUI editor * [zim-git](https://aur.archlinux.org/packages/zim-git/)AUR: latest developer git version. * [Kiwix](https://en.wikipedia.org/wiki/Kiwix "wikipedia:Kiwix"): offline ZIM viewer designed primarily for reading Wikis installed via [kiwix-desktop](https://archlinux.org/packages/?name=kiwix-desktop). The project includes mobile versions and an [online library](https://library.kiwix.org/) of free ZIM files. * [Web archives](https://github.com/birros/web-archives) * [goldendict-ng](https://aur.archlinux.org/packages/goldendict-ng/)AUR: designed for dictionary use. Console-based: * [zim-tools](https://archlinux.org/packages/?name=zim-tools) * [kiwix-tools](https://archlinux.org/packages/?name=kiwix-tools): CLI reading by server requests instead of downloading the whole ZIM database.
Zim
Usage
## Usage Zim can be used to: * Keep an archive of notes * Take notes during meetings or lectures * Organize task lists * Draft blog entries and emails * Do brainstorming This [screencast](https://www.youtube.com/watch?v=yBZpWgzO9Ps) provides an overview about the basic functionality.