https://wiki.archlinux.org/api.php?action=feedcontributions&user=Xuanruiqi&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:23:12ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=ZFS&diff=653076ZFS2021-02-21T22:08:10Z<p>Xuanruiqi: Warn about old tools</p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Oracle]]<br />
[[ja:ZFS]]<br />
[[pt:ZFS]]<br />
[[zh-hans:ZFS]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related|ZFS/Virtual disks}}<br />
{{Related|Installing Arch Linux on ZFS}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:ZFS|ZFS]] is an advanced filesystem created by [[Wikipedia:Sun Microsystems|Sun Microsystems]] (now owned by Oracle) and released for OpenSolaris in November 2005.<br />
<br />
Features of ZFS include: pooled storage (integrated volume management – zpool), [[Wikipedia:Copy-on-write|Copy-on-write]], [[Wikipedia:Snapshot (computer storage)|snapshots]], data integrity verification and automatic repair (scrubbing), [[Wikipedia:RAID-Z|RAID-Z]], a maximum [[Wikipedia:Exabyte|16 exabyte]] file size, and a maximum 256 quadrillion [[Wikipedia:Zettabyte|zettabyte]] storage with no limit on number of filesystems (datasets) or files[http://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/index.html]. ZFS is licensed under the [[Wikipedia:CDDL|Common Development and Distribution License]] (CDDL).<br />
<br />
Described as [https://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/ "The last word in filesystems"], ZFS is stable, fast, secure, and future-proof. Being licensed under the CDDL, and thus incompatible with GPL, it is not possible for ZFS to be distributed along with 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 [http://zfsonlinux.org/ zfsonlinux.org] (ZOL).<br />
<br />
ZOL is a project funded by the [https://www.llnl.gov/ Lawrence Livermore National Laboratory] to develop a native Linux kernel module for its massive storage requirements and super computers.<br />
<br />
{{Note|<br />
Due to potential legal incompatibilities between CDDL license of ZFS code and GPL of the Linux kernel ([https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/ ],[[wikipedia:Common_Development_and_Distribution_License#GPL_compatibility|CDDL-GPL]],[[wikipedia:ZFS#Linux|ZFS in Linux]]) - ZFS development is not supported by the kernel.<br />
<br />
As a result:<br />
<br />
* ZFSonLinux project must keep up with Linux kernel versions. After making stable ZFSonLinux release - Arch ZFS maintainers release them.<br />
* This situation sometimes locks down the normal rolling update process by unsatisfied dependencies because the new kernel version, proposed by update, is unsupported by ZFSonLinux.<br />
}}<br />
<br />
== Installation ==<br />
<br />
=== General ===<br />
<br />
{{Warning|Unless you use the [[dkms]] versions of these packages, the ZFS and SPL kernel modules are tied to a specific kernel version. It would not be possible to apply any kernel updates until updated packages are uploaded to AUR or the [[Unofficial user repositories#archzfs|archzfs]] repository.}}<br />
<br />
{{Tip| You can [[downgrade]] your linux version to the one from [[Unofficial user repositories#archzfs|archzfs]] repo if your current kernel is newer.}}<br />
<br />
Install from the [[Unofficial user repositories#archzfs|archzfs]] repository or alternatively the [[Arch User Repository]]:<br />
<br />
* {{AUR|zfs-linux}} for [http://zfsonlinux.org/ stable] releases.<br />
* {{AUR|zfs-linux-git}} for [https://github.com/zfsonlinux/zfs/releases development] releases (with support of newer kernel versions).<br />
* {{AUR|zfs-linux-lts}} for stable releases for LTS kernels.<br />
* {{AUR|zfs-linux-lts-git}} for development releases for LTS kernels.<br />
* {{AUR|zfs-linux-hardened}} for stable releases for hardened kernels.<br />
* {{AUR|zfs-linux-hardened-git}} for development releases for hardened kernels.<br />
* {{AUR|zfs-linux-zen}} for stable releases for zen kernels.<br />
* {{AUR|zfs-linux-zen-git}} for development releases for zen kernels.<br />
* {{AUR|zfs-dkms}} for versions with dynamic kernel module support.<br />
* {{AUR|zfs-dkms-git}} for development releases for versions with dynamic kernel module support.<br />
<br />
These branches have (according to them) dependency on the {{ic|zfs-utils}} package.<br />
<br />
Test the installation by issuing {{ic|zpool status}} on the command line. If an "insmod" error is produced, try {{ic|depmod -a}}.<br />
<br />
=== Root on ZFS ===<br />
<br />
See [[Install_Arch_Linux_on_ZFS#Installation|Installation]].<br />
<br />
=== DKMS ===<br />
<br />
Users can make use of DKMS [[Dynamic Kernel Module Support]] to rebuild the ZFS modules automatically with every kernel upgrade. <br />
<br />
Install {{AUR|zfs-dkms}} or {{AUR|zfs-dkms-git}} and apply the post-install instructions given by these packages.<br />
<br />
{{Tip|Add an {{ic|IgnorePkg}} entry to [[pacman.conf]] to prevent these packages from upgrading when doing a regular update.}}<br />
<br />
== Experimenting with ZFS ==<br />
<br />
Users wishing to experiment with ZFS on ''virtual block devices'' (known in ZFS terms as VDEVs) which can be simple files like {{ic|~/zfs0.img}} {{ic|~/zfs1.img}} {{ic|~/zfs2.img}} etc. with no possibility of real data loss are encouraged to see the [[Experimenting with ZFS]] article. Common tasks like building a RAIDZ array, purposefully corrupting data and recovering it, snapshotting datasets, etc. are covered.<br />
<br />
== Configuration ==<br />
<br />
ZFS is considered a "zero administration" filesystem by its creators; therefore, configuring ZFS is very straight forward. Configuration is done primarily with two commands: {{ic|zfs}} and {{ic|zpool}}.<br />
<br />
=== Automatic Start ===<br />
<br />
Currently, by default, the kernel module is not loaded at boot (see more details in https://github.com/zfsonlinux/zfs/issues/6083). To automatically load {{Ic|zfs}} module on boot, see [[Kernel module#Automatic module loading with systemd]].<br />
<br />
For ZFS to live by its "zero administration" namesake, {{Ic|zfs-import-cache.service}} must be enabled to import the pools and {{Ic|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 {{ic|/etc/fstab}}. {{Ic|zfs-import-cache.service}} imports the zfs pools reading the file {{ic|/etc/zfs/zpool.cache}}.<br />
<br />
For each [[#Importing a pool created by id|imported pool]] you want automatically imported by {{Ic|zfs-import-cache.service}} execute:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache <pool><br />
<br />
{{Note|Beginning with ZOL version 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 [https://github.com/archzfs/archzfs/issues/72 https://github.com/archzfs/archzfs/issues/72] for more information.}}<br />
<br />
Enable the relevant service and target so the pools are automatically imported at boot time:<br />
<br />
# systemctl enable zfs-import-cache<br />
# systemctl enable zfs-import.target<br />
<br />
To mount the ZFS filesystems, you have 2 choices:<br />
* Enable the [[#Using zfs-mount.service|zfs-mount.service]]<br />
* Using [[#Using zfs-mount-generator|zfs-mount-generator]]<br />
<br />
==== Using zfs-mount.service ====<br />
<br />
In order to mount ZFS filesystems automatically on boot you need to enable the following services and targets:<br />
<br />
# systemctl enable zfs-mount<br />
# systemctl enable zfs.target<br />
<br />
==== Using zfs-mount-generator ====<br />
<br />
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 {{Ic|zfs-mount.service}}. To do that, you need to:<br />
<br />
# Create the {{Ic|/etc/zfs/zfs-list.cache}} directory.<br />
# 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.) {{bc|# ln -s /usr/lib/zfs/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d}}<br />
# Enable and start the ZFS Event Daemon. This service is responsible for running the script in the previous step. {{bc|# systemctl enable zfs-zed.service<br># systemctl enable zfs.target<br># systemctl start zfs-zed.service}}<br />
# You need to create an empty file named after your pool in {{Ic|/etc/zfs/zfs-list.cache}}. The ZEDLET will only update the list of filesystems if the file for the pool already exists. {{bc|# touch /etc/zfs/zfs-list.cache/<pool-name>}}<br />
# Check the contents of {{Ic|/etc/zfs/zfs-list.cache/<pool-name>}}. If it is empty, make sure that the {{Ic|zfs-zed.service}} is running and just change the canmount property of any of your ZFS filesystem by running: {{bc|1=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 {{Ic|/etc/zfs/zfs-list.cache}}. If the file in {{Ic|/etc/zfs/zfs-list.cache}} is updated, you can set the {{Ic|canmount}} property of the filesystem back by running: {{bc|1=zfs set canmount=on zroot/fs1}}<br />
You need to add a file in {{Ic|/etc/zfs/zfs-list.cache}} for each ZFS pool in your system. Make sure the pools are imported by enabling {{Ic|zfs-import-cache.service}} and {{Ic|zfs-import.target}} as [[#Automatic Start|explained above]].<br />
<br />
== Storage pools ==<br />
<br />
It is not necessary to partition the drives before creating the ZFS filesystem. It is recommended to point ZFS at an entire disk (ie. {{ic|/dev/sdx}} rather than {{ic|/dev/sdx1}}), which will [https://www.reddit.com/r/zfs/comments/667na0/zfs_on_raw_or_gpt/dgh0l9t/ automatically create a GPT partition table] 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.<br />
<br />
{{Note|If some or all device have been used in a software RAID set it is paramount to [[mdadm#Prepare the devices|erase any old RAID configuration information]].}}<br />
<br />
{{Warning|For [[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 [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?], [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks 1.15 How does ZFS on Linux handle Advanced Format disks?], and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].}}<br />
<br />
=== Identify disks ===<br />
<br />
[https://github.com/zfsonlinux/zfs/wiki/faq#selecting-dev-names-when-creating-a-pool ZFS on Linux] recommends using device IDs when creating ZFS storage pools of less than 10 devices. Use [[Persistent block device naming#by-id and by-path]] to identify the list of drives to be used for ZFS pool. <br />
<br />
The disk IDs should look similar to the following:<br />
<br />
{{hc|$ ls -lh /dev/disk/by-id/|<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JKRR -> ../../sdc<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JTM1 -> ../../sde<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KBP8 -> ../../sdd<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KDGY -> ../../sdb}}<br />
<br />
{{Warning|If you create zpools using device names (e.g. {{ic|/dev/sda}},{{ic|/dev/sdb}},...) ZFS might not be able to detect zpools intermittently on boot.}}<br />
<br />
==== Using GPT labels ====<br />
<br />
{{Style|Missing references to [[Persistent block device naming]], it is useless to explain the differences (or even what they are) here.}}<br />
<br />
Disk labels and UUID can also be used for ZFS mounts by using [[GUID Partition Table|GPT]] partitions. ZFS drives have labels but Linux is unable to read them at boot. Unlike [[Master Boot Record|MBR]] 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.<br />
<br />
Use [[GUID Partition Table|gdisk]] 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]] allowing large data pools to be labeled in an organized fashion.<br />
<br />
Drives partitioned with GPT have labels and UUID that look like this. <br />
<br />
{{hc|$ ls -l /dev/disk/by-partlabel|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata1 -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata2 -> ../../sdc1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 zfsl2arc -> ../../sda1}}<br />
<br />
{{hc|$ ls -l /dev/disk/by-partuuid|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 148c462c-7819-431a-9aba-5bf42bb5a34e -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 4f95da30-b2fb-412b-9090-fc349993df56 -> ../../sda1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 e5ccef58-5adf-4094-81a7-3bac846a885f -> ../../sdc1}}<br />
<br />
{{Tip|To minimize typing and copy/paste errors, set a local variable with the target PARTUUID: {{ic|<nowiki>$ UUID=$(lsblk --noheadings --output PARTUUID /dev/sd</nowiki>''XY''<nowiki>)</nowiki>}} }}<br />
<br />
=== Creating ZFS pools ===<br />
<br />
To create a ZFS pool:<br />
<br />
# zpool create -f -m <mount> <pool> [raidz(2|3)|mirror] <ids><br />
<br />
{{Tip|One may want to read [[#Advanced Format disks]] first as it may be recommend to set {{ic|ashift}} on pool creation.}}<br />
<br />
* '''create''': subcommand to create the pool.<br />
<br />
* '''-f''': Force creating the pool. This is to overcome the "EFI label error". See [[#Does not contain an EFI label]].<br />
<br />
* '''-m''': The mount point of the pool. If this is not specified, then the pool will be mounted to {{ic|/<pool>}}.<br />
<br />
* '''pool''': This is the name of the pool.<br />
<br />
* '''raidz(2|3)|mirror''': This is the type of virtual device that will be created from the pool of devices, raidz is a single disk of parity, raidz2 for 2 disks of parity and raidz3 for 3 disks of parity, similar to raid5 and raid6. 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.<br />
<br />
* '''ids''': The [[Persistent_block_device_naming#by-id_and_by-path|ID's]] of the drives or partitions that to include into the pool.<br />
<br />
Create pool with single raidz vdev:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
Create pool with two mirror vdevs:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== Advanced Format disks ====<br />
<br />
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, {{ic|<nowiki>-o ashift=12</nowiki>}} should always be specified during pool creation. See the [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks ZFS on Linux FAQ] for more details.<br />
<br />
{{Tip|Use {{man|8|blockdev}} (part of {{Pkg|util-linux}}) to print the sector size reported by the device's ioctls: {{ic|blockdev --getpbsz /dev/sd''XY''}} as the root user.}}<br />
<br />
Create pool with ashift=12 and single raidz vdev:<br />
<br />
# zpool create -f -o ashift=12 -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== GRUB-compatible pool creation ====<br />
<br />
{{note|This section frequently goes out of date with updates to GRUB and ZFS. Consult the manual pages for the most up-to-date information.}}<br />
<br />
By default, ''zpool create'' enables all features on a pool. If {{ic|/boot}} resides on ZFS when using [[GRUB]] you must only enable features supported by GRUB otherwise GRUB will not be able to read the pool. GRUB 2.02 supports the read-write features {{ic|lz4_compress}}, {{ic|hole_birth}}, {{ic|embedded_data}}, {{ic|extensible_dataset}}, and {{ic|large_blocks}}; this is not suitable for all the features of ZFSonLinux 0.8.0, and must have unsupported features disabled. We can explicitly name features to enable with the {{ic|-d}} argument to {{ic|zpool create}}, which disables all features by default.<br />
<br />
You can create a pool with only the compatible features enabled:<br />
<br />
# zpool create -d -o feature@allocation_classes=enabled \<br />
-o feature@async_destroy=enabled \<br />
-o feature@bookmarks=enabled \<br />
-o feature@embedded_data=enabled \<br />
-o feature@empty_bpobj=enabled \<br />
-o feature@enabled_txg=enabled \<br />
-o feature@extensible_dataset=enabled \<br />
-o feature@filesystem_limits=enabled \<br />
-o feature@hole_birth=enabled \<br />
-o feature@large_blocks=enabled \<br />
-o feature@lz4_compress=enabled \<br />
-o feature@project_quota=enabled \<br />
-o feature@resilver_defer=enabled \<br />
-o feature@spacemap_histogram=enabled \<br />
-o feature@spacemap_v2=enabled \<br />
-o feature@userobj_accounting=enabled \<br />
-o feature@zpool_checkpoint=enabled \<br />
$POOL_NAME $VDEVS<br />
<br />
=== Verifying pool status ===<br />
<br />
If the command is successful, there will be no output. Using the [[mount]] command will show that the pool is mounted. Using {{ic|zpool status}} will show that the pool has been created:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: ONLINE<br />
scan: none requested<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata ONLINE 0 0 0<br />
-0 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JKRR-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1-part1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
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.<br />
<br />
=== Importing a pool created by id ===<br />
<br />
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.<br />
<br />
{{Warning|Do not run {{ic|zpool import ''pool''}}! This will import your pools using {{ic|/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.}}<br />
<br />
Adapt one of the following commands to import your pool so that pool imports retain the persistence they were created with:<br />
<br />
# zpool import -d /dev/disk/by-id bigdata<br />
# zpool import -d /dev/disk/by-partlabel bigdata<br />
# zpool import -d /dev/disk/by-partuuid bigdata<br />
<br />
{{Note|Use the {{ic|-l}} flag when importing a pool that contains [[#Native encryption|encrypted datasets keys]]:<br />
# zpool import -l -d /dev/disk/by-id bigdata<br />
}}<br />
<br />
Finally check the state of the pool:<br />
<br />
# zpool status -v bigdata<br />
<br />
=== Destroy a storage pool ===<br />
<br />
ZFS makes it easy to destroy a mounted storage pool, removing all metadata about the ZFS device.<br />
<br />
{{Warning|This command destroys '''any data''' containing in the pool and/or dataset.}}<br />
<br />
To destroy the pool:<br />
# zpool destroy <pool><br />
<br />
To destroy a dataset:<br />
# zfs destroy <pool>/<dataset><br />
<br />
And now when checking the status:<br />
<br />
{{hc|# zpool status|<br />
no pools available<br />
}}<br />
<br />
=== Exporting a storage pool ===<br />
<br />
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 {{ic|-f}} argument, but this is considered bad form.<br />
<br />
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 {{ic|zfs_force&#61;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"]].<br />
<br />
To export a pool:<br />
<br />
# zpool export <pool><br />
<br />
=== Extending an existing zpool ===<br />
<br />
A device (a partition or a disk) can be added to an existing zpool:<br />
<br />
# zpool add <pool> <device-id><br />
<br />
To import a pool which consists of multiple devices:<br />
<br />
# zpool import -d <device-id-1> -d <device-id-2> <pool><br />
<br />
or simply:<br />
<br />
# zpool import -d /dev/disk-by-id/ <pool><br />
<br />
=== Renaming a zpool ===<br />
<br />
Renaming a zpool that is already created is accomplished in 2 steps:<br />
<br />
# zpool export oldname<br />
# zpool import oldname newname<br />
<br />
=== Setting a different mount point ===<br />
<br />
The mount point for a given zpool can be moved at will with one command:<br />
# zfs set mountpoint=/foo/bar poolname<br />
<br />
== Creating datasets ==<br />
<br />
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:<br />
<br />
# zfs create <nameofzpool>/<nameofdataset><br />
<br />
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:<br />
<br />
# zfs set quota=20G <nameofzpool>/<nameofdataset>/<directory><br />
<br />
To see all the commands available in ZFS, see {{man|8|zfs|url=}} or {{man|8|zpool|url=}}.<br />
<br />
=== Native encryption ===<br />
<br />
ZFS offers the following supported encryption options: {{ic|aes-128-ccm}}, {{ic|aes-192-ccm}}, {{ic|aes-256-ccm}}, {{ic|aes-128-gcm}}, {{ic|aes-192-gcm}} and {{ic|aes-256-gcm}}. When encryption is set to {{ic|on}}, {{ic|aes-256-gcm}} will be used.<br />
<br />
The following keyformats are supported: {{ic|passphrase}}, {{ic|raw}}, {{ic|hex}}.<br />
<br />
One can also specify/increase the default iterations of PBKDF2 when using {{ic|passphrase}} with {{ic|-o pbkdf2iters <n>}}, although it may increase the decryption time.<br />
<br />
{{Note|<br />
* 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 {{AUR|zfs-linux-git}}, {{AUR|zfs-dkms-git}} 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.<br />
* The default encryption suite was changed from {{ic|aes-256-ccm}} to {{ic|aes-256-gcm}} in the 0.8.4 release.<br />
* To import a pool with keys, one needs to specify the {{ic|-l}} flag, without this flag encrypted datasets will be left unavailable until the keys are loaded. See [[#Importing a pool created by id]].}}<br />
<br />
To create a dataset including native encryption with a passphrase, use:<br />
<br />
# zfs create -o encryption=on -o keyformat=passphrase <nameofzpool>/<nameofdataset><br />
<br />
To use a key instead of using a passphrase:<br />
<br />
# dd if=/dev/random of=/path/to/key bs=1 count=32<br />
# zfs create -o encryption=on -o keyformat=raw -o keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
To verify the key location:<br />
# zfs get keylocation <nameofzpool>/<nameofdataset><br />
<br />
To change the key location:<br />
<br />
# zfs set keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
You can also manually load the keys by using one of the following commands:<br />
<br />
# zfs load-key <nameofzpool>/<nameofdataset> # load key for a specific dataset<br />
# zfs load-key -a # load all keys<br />
# zfs load-key -r zpool/dataset # load all keys in a dataset<br />
<br />
To mount the created encrypted dataset:<br />
<br />
# zfs mount <nameofzpool>/<nameofdataset><br />
<br />
==== Unlock at boot time: systemd ====<br />
It is possible to automatically unlock a pool dataset on boot time by using a [[systemd]] unit. For example create the following service to unlock any specific dataset: <br />
<br />
{{hc|/etc/systemd/system/zfs-load-key@.service|2=<br />
[Unit]<br />
Description=Load %I encryption keys<br />
Before=systemd-user-sessions.service<br />
After=zfs-import.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/bash -c 'until (systemd-ask-password "Encrypted ZFS password for %I" --no-tty <nowiki>|</nowiki> zfs load-key %I); do echo "Try again!"; done'<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] the service for each encrypted dataset, e.g. {{ic|systemctl enable zfs-load-key@pool0-dataset0}} as the root user. Note the use of {{ic|-}}, which is an escaped {{ic|/}} in systemd unit definitions. See {{ic|systemd-escape(1)}} for more info.<br />
{{Note|The {{ic|1=Before=systemd-user-sessions.service}} ensures that systemd-ask-password is invoked before the local IO devices are handed over to the [[desktop environment]].}}<br />
<br />
An alternative is to load all possible keys:<br />
<br />
{{hc|/etc/systemd/system/zfs-load-key.service|2=<br />
[Unit]<br />
Description=Load encryption keys<br />
DefaultDependencies=no<br />
After=zfs-import.target<br />
Before=zfs-mount.service<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/zfs load-key -a<br />
StandardInput=tty-force<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-load-key.service}}.<br />
<br />
==== Unlock at login time: PAM ====<br />
If you are not encrypting the root volume, but only the home volume or a user-specific volume, another idea is to [https://blog.trifork.com/2020/05/22/linux-homedir-encryption/ wait until login to decrypt it]. 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.<br />
<br />
First set the mountpoint to legacy to avoid having it mounted by {{ic|zfs mount -a}}:<br />
{{bc|1=zfs set mountpoint=legacy zroot/data/home}}<br />
Ensure that it's in /etc/fstab so that {{ic|mount /home}} will work:<br />
{{hc|/etc/fstab|zroot/data/home /home zfs rw,xattr,posixacl,noauto 0 0}}<br />
<br />
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 /sbin/mount-zfs-homedir<br />
{{hc|/sbin/mount-zfs-homedir|2=<br />
#!/bin/bash<br />
<br />
# simplified from https://talldanestale.dk/2020/04/06/zfs-and-homedir-encryption/<br />
<br />
set -eu<br />
<br />
# Password is given to us via stdin, save it in a variable for later<br />
PASS=$(cat -)<br />
<br />
VOLNAME="zroot/data/home"<br />
<br />
# Unlock and mount the volume<br />
zfs load-key "$VOLNAME" <<< "$PASS" {{!}}{{!}} continue<br />
zfs mount "$VOLNAME" {{!}}{{!}} true # ignore errors<br />
}}<br />
<br />
don't forget {{ic|chmod a+x /sbin/mount-zfs-homedir}}; then get PAM to run it by adding the following line to /etc/pam.d/system-auth:<br />
<br />
{{hc|/etc/pam.d/system-auth|auth optional pam_exec.so expose_authtok /sbin/mount-zfs-homedir}}<br />
<br />
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 isn't mounted, if you log in via ssh, you must use the default password authentication the first time rather than relying on {{ic|~/.ssh/authorized_keys}}.<br />
<br />
If you want to have separate volumes for each user, each encrypted with the user's password, try the [https://blog.trifork.com/2020/05/22/linux-homedir-encryption/ linked method].<br />
<br />
=== Swap volume ===<br />
<br />
{{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 https://github.com/zfsonlinux/zfs/issues/7734}}<br />
{{Warning|Swap on zvol does not support resume from hibernation, attempt to resume will [[User:M0p/Root_on_ZFS_Native_Encryption#Resume_from_ZFS_will_corrupt_the_pool|result in pool corruption]]{{Broken section link}}. }}<br />
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 {{ic|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.<br />
<br />
Create a 8 GiB zfs volume:<br />
<br />
# zfs create -V 8G -b $(getconf PAGESIZE) -o compression=zle \<br />
-o logbias=throughput -o sync=always\<br />
-o primarycache=metadata -o secondarycache=none \<br />
-o com.sun:auto-snapshot=false <pool>/swap<br />
<br />
Prepare it as swap partition:<br />
<br />
# mkswap -f /dev/zvol/<pool>/swap<br />
# swapon /dev/zvol/<pool>/swap<br />
<br />
To make it permanent, edit {{ic|/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.<br />
<br />
Add a line to {{ic|/etc/fstab}}:<br />
<br />
/dev/zvol/<pool>/swap none swap discard 0 0<br />
<br />
=== Access Control Lists ===<br />
<br />
To use [[ACL]] on a dataset:<br />
<br />
# zfs set acltype=posixacl <nameofzpool>/<nameofdataset><br />
# zfs set xattr=sa <nameofzpool>/<nameofdataset><br />
<br />
Setting {{ic|xattr}} is recommended for performance reasons [https://github.com/zfsonlinux/zfs/issues/170#issuecomment-27348094].<br />
<br />
It may be preferable to enable ACL on the zpool as datasets will inherit the ACL parameters. Setting {{ic|1=aclinherit=passthrough}} may be wanted as the default mode is {{ic|restricted}} [https://docs.oracle.com/cd/E19120-01/open.solaris/817-2271/gbaaz/index.html]:<br />
<br />
# zfs set aclinherit=passthrough <nameofzpool><br />
# zfs set acltype=posixacl <nameofzpool><br />
# zfs set xattr=sa <nameofzpool><br />
<br />
=== Databases ===<br />
<br />
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.<br />
<br />
Most RDBMSes work in 8KiB-sized blocks by default. Although the block size is tunable for [[MySQL|MySQL/MariaDB]], [[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:<br />
<br />
# zfs set recordsize=8K <pool>/postgres<br />
<br />
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:<br />
<br />
# zfs set primarycache=metadata <pool>/postgres<br />
<br />
If your pool has no configured log devices, ZFS reserves space on the pool's data disks for its intent log (the ZIL). ZFS uses this 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. Setting this for non-database file systems, or for pools with configured log devices, can actually ''negatively'' impact the performance, so beware:<br />
<br />
# zfs set logbias=throughput <pool>/postgres<br />
<br />
These can also be done at file system creation time, for example:<br />
<br />
# zfs create -o recordsize=8K \<br />
-o primarycache=metadata \<br />
-o mountpoint=/var/lib/postgres \<br />
-o logbias=throughput \<br />
<pool>/postgres<br />
<br />
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.<br />
<br />
=== /tmp ===<br />
<br />
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 {{ic|fsync}} or {{ic|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.<br />
<br />
# zfs set sync=disabled <pool>/tmp<br />
<br />
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:<br />
<br />
# zfs set setuid=off <pool>/tmp<br />
# zfs set devices=off <pool>/tmp<br />
<br />
Combining all of these for a create command would be as follows:<br />
<br />
# zfs create -o setuid=off -o devices=off -o sync=disabled -o mountpoint=/tmp <pool>/tmp<br />
<br />
Please note, also, that if you want /tmp on ZFS, you will need to mask (disable) [[systemd]]'s automatic tmpfs-backed /tmp, else ZFS will be unable to mount your dataset at boot-time or import-time:<br />
<br />
# systemctl mask tmp.mount<br />
<br />
== Tuning ==<br />
<br />
=== General ===<br />
<br />
ZFS pools and datasets can be further adjusted using parameters.<br />
<br />
{{Note|All settable properties, with the exception of quotas and reservations, inherit their value from the parent dataset.}}<br />
<br />
To retrieve the current pool parameter status:<br />
<br />
# zfs get all <pool><br />
<br />
To retrieve the current dataset parameter status:<br />
<br />
# zfs get all <pool>/<dataset><br />
<br />
To disable access time (atime), which is enabled by default:<br />
<br />
# zfs set atime=off <pool><br />
<br />
To disable access time (atime) on a particular dataset:<br />
<br />
# zfs set atime=off <pool>/<dataset><br />
<br />
An alternative to turning off atime completely, {{ic|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 {{ic|1=atime=off}} and {{ic|1=atime=on}}. This property ''only'' takes effect if {{ic|atime}} is {{ic|on}}:<br />
<br />
# zfs set atime=on <pool><br />
# zfs set relatime=on <pool><br />
<br />
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 [http://open-zfs.org/wiki/Performance_tuning#Compression OpenZFS Wiki] for more details.<br />
<br />
To enable compression:<br />
<br />
# zfs set compression=on <pool><br />
<br />
To reset a property of a pool and/or dataset to it's default state, use {{ic|zfs inherit}}:<br />
<br />
# zfs inherit -rS atime <pool><br />
# zfs inherit -rS atime <pool>/<dataset><br />
<br />
{{Warning|Using the {{ic|-r}} flag will recursively reset all datasets of the zpool.}}<br />
<br />
=== Scrubbing ===<br />
<br />
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.<br />
<br />
To scrub a pool:<br />
<br />
# zpool scrub <pool><br />
<br />
To cancel a running scrub:<br />
<br />
# zpool scrub -s <pool><br />
<br />
==== How often should I do this? ====<br />
<br />
From the Oracle blog post [https://blogs.oracle.com/wonders-of-zfs-storage/disk-scrub-why-and-when-v2 Disk Scrub - Why and When?]:<br />
<br />
: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.<br />
<br />
:* 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.<br />
:* 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.<br />
:* 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.<br />
<br />
: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.<br />
<br />
In the [https://pthree.org/2012/12/11/zfs-administration-part-vi-scrub-and-resilver/ ZFS Administration Guide] by Aaron Toponce, he advises to scrub consumer disks once a week.<br />
<br />
==== Start with a service or timer ====<br />
Using a [[systemd]] timer/service it is possible to automatically scrub pools.<br />
<br />
To perform scrubbing monthly on a particular pool:<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.timer|2=<br />
[Unit]<br />
Description=Monthly zpool scrub on %i<br />
<br />
[Timer]<br />
OnCalendar=monthly<br />
AccuracySec=1h<br />
Persistent=true<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.service|2=<br />
[Unit]<br />
Description=zpool scrub on %i<br />
<br />
[Service]<br />
Nice=19<br />
IOSchedulingClass=idle<br />
KillSignal=SIGINT<br />
ExecStart=/usr/bin/zpool scrub %i<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-scrub@''pool-to-scrub''.timer}} unit for monthly scrubbing the specified zpool.<br />
<br />
=== SSD Caching ===<br />
<br />
You can add SSD devices as a write intent log (external ZIL or SLOG) and also as a layer 2 adaptive replacement cache (L2ARC). The process to add them is very similar to adding a new VDEV.<br />
<br />
All of the below references to device-id are the IDs from {{ic|/dev/disk/by-id/*}}.<br />
<br />
==== SLOG ====<br />
<br />
To add a mirrored SLOG:<br />
<br />
# zpool add <pool> log mirror <device-id-1> <device-id-2><br />
<br />
Or to add a single device SLOG (unsafe):<br />
<br />
# zpool add <pool> log <device-id><br />
<br />
Because the SLOG 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 SLOG is only used for sync writes, so may not provide any performance improvement.<br />
<br />
==== L2ARC ====<br />
<br />
To add L2ARC:<br />
<br />
# zpool add <pool> cache <device-id><br />
<br />
Because every block cached in L2ARC uses a small amount of memory, it is generally only useful in workloads where the amount of hot data is *bigger* than the maximum amount of memory that can fit in the computer, but small enough to fit into L2ARC. It is also cleared at reboot and is only a read cache, so redundancy is unnecessary. Un-intuitively, L2ARC can actually harm performance since it takes memory away from ARC.<br />
<br />
=== ZVOLs ===<br />
<br />
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).<br />
<br />
==== RAIDZ and Advanced Format physical disks ====<br />
<br />
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.<br />
<br />
See [https://github.com/zfsonlinux/zfs/issues/1807 ZFS on Linux issue #1807 for details]<br />
<br />
=== I/O Scheduler ===<br />
<br />
While ZFS is expected to work well with modern schedulers including {{ic|deadline}}, {{ic|mq-deadline}}, {{ic|noop}}, and {{ic|none}}, experimenting with [[Improving_performance#Changing_I/O_scheduler|manually setting]] the I/O scheduler on ZFS disks may yield performance gains.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Creating a zpool fails ===<br />
<br />
If the following error occurs then it can be fixed.<br />
<br />
# the kernel failed to rescan the partition table: 16<br />
# cannot label 'sdc': try using parted(8) and then provide a specific slice: -1<br />
<br />
One reason this can occur is because [https://github.com/zfsonlinux/zfs/issues/2582 ZFS expects pool creation to take less than 1 second]. 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.<br />
<br />
# parted /dev/sda rm 1<br />
# parted /dev/sda rm 1<br />
# dd if=/dev/zero of=/dev/sdb bs=512 count=1<br />
# zpool labelclear /dev/sda<br />
<br />
A brute force creation can be attempted over and over again, and with some luck the ZPool creation will take less than 1 second.<br />
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.<br />
<br />
# dd if=/dev/sda of=/dev/null<br />
<br />
This can be done with multiple drives by saving the above command for each drive to a file on separate lines and running <br />
<br />
# cat $FILE | parallel<br />
<br />
Then run ZPool creation at the same time.<br />
<br />
=== ZFS is using too much RAM ===<br />
<br />
By default, ZFS caches file operations ([[wikipedia:Adaptive replacement cache|ARC]]) using up to two-thirds of available system memory on the host. To adjust the ARC size, add the following to the [[Kernel parameters]] list:<br />
<br />
zfs.zfs_arc_max=536870912 # (for 512MiB)<br />
<br />
In case that the default value of {{ic|zfs_arc_min}} (1/32 of system memory) is higher than the specified {{ic|zfs_arc_max}} it is needed to add also the following to the [[Kernel parameters]] list:<br />
<br />
zfs.zfs_arc_min=268435456 # (for 256MiB, needs to be lower than zfs.zfs_arc_max)<br />
<br />
For a more detailed description, as well as other configuration options, see [http://wiki.gentoo.org/wiki/ZFS#ARC gentoo-wiki:zfs#arc].<br />
<br />
=== Does not contain an EFI label ===<br />
<br />
The following error will occur when attempting to create a zfs filesystem,<br />
<br />
/dev/disk/by-id/<id> does not contain an EFI label but it may contain partition<br />
<br />
The way to overcome this is to use {{ic|-f}} with the zfs create command.<br />
<br />
=== No hostid found ===<br />
<br />
An error that occurs at boot with the following lines appearing before initscript output:<br />
<br />
ZFS: No hostid found on kernel command line or /etc/hostid.<br />
<br />
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]] in the boot loader. For example, adding {{ic|1=spl.spl_hostid=0x00bab10c}}.<br />
<br />
The other solution is to make sure that there is a hostid in {{ic|/etc/hostid}}, and then [[regenerate the initramfs]] image. Which will copy the hostid into the initramfs image.<br />
<br />
=== Pool cannot be found while booting from SAS/SCSI devices ===<br />
<br />
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.<br />
<br />
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 {{ic|/etc/modprobe.d/zfs.conf}}:<br />
<br />
{{hc|1=/etc/modprobe.d/zfs.conf|2=<br />
options scsi_mod scan=sync<br />
}}<br />
<br />
Afterwards, [[regenerate the initramfs]].<br />
<br />
This works because the zfs hook will copy the file at {{ic|/etc/modprobe.d/zfs.conf}} into the initcpio which will then be used at build time.<br />
<br />
=== On boot the zfs pool does not mount stating: "pool may be in use from other system" ===<br />
<br />
==== Unexported pool ====<br />
<br />
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]].<br />
<br />
Once inside the chroot environment, load the ZFS module and force import the zpool,<br />
<br />
# zpool import -a -f<br />
<br />
now export the pool:<br />
<br />
# zpool export <pool><br />
<br />
To see the available pools, use,<br />
<br />
# zpool status<br />
<br />
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 [http://osdir.com/ml/zfs-discuss/2011-06/msg00227.html Re: Howto zpool import/export automatically? - msg#00227]{{Dead link|2020|04|03|status=404}}.<br />
<br />
If ZFS complains about "pool may be in use" after every reboot, properly export pool as described above, and then [[regenerate the initramfs]] in normally booted system.<br />
<br />
==== Incorrect hostid ====<br />
<br />
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.<br />
<br />
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.<br />
<br />
Boot using zfs_force and write down the hostid. This one is just an example.<br />
<br />
{{hc|$ hostid|<br />
0a0af0f8<br />
}}<br />
<br />
This number have to be added to the [[kernel parameters]] as {{ic|1=spl.spl_hostid=0x0a0af0f8}}. Another solution is writing the hostid inside the initram image, see the [[Installing Arch Linux on ZFS#After the first boot|installation guide]]{{Broken section link}} explanation about this.<br />
<br />
Users can always ignore the check adding {{ic|1=zfs_force=1}} in the [[kernel parameters]], but it is not advisable as a permanent solution.<br />
<br />
=== Devices have different sector alignment ===<br />
<br />
Once a drive has become faulted it should be replaced A.S.A.P. with an identical drive.<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -f<br />
<br />
but in this instance, the following error is produced:<br />
<br />
cannot replace ata-ST3000DM001-9YN166_S1F0KDGY with ata-ST3000DM001-1CH166_W1F478BD: devices have different sector alignment<br />
<br />
ZFS uses the ashift option to adjust for physical block size. When replacing the faulted disk, ZFS is attempting to use {{ic|<nowiki>ashift=12</nowiki>}}, but the faulted disk is using a different ashift (probably {{ic|<nowiki>ashift=9</nowiki>}}) and this causes the resulting error. <br />
<br />
For Advanced Format Disks with 4KB blocksize, an ashift of 12 is recommended for best performance. See [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?] and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].<br />
<br />
Use zdb to find the ashift of the zpool: {{ic|zdb | grep ashift}}, then use the {{ic|-o}} argument to set the ashift of the replacement drive:<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -o ashift=9 -f<br />
<br />
Check the zpool status for confirmation:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: DEGRADED<br />
status: One or more devices is currently being resilvered. The pool will<br />
continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
scan: resilver in progress since Mon Jun 16 11:16:28 2014<br />
10.3G scanned out of 5.90T at 81.7M/s, 20h59m to go<br />
2.57G resilvered, 0.17% done<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata DEGRADED 0 0 0<br />
raidz1-0 DEGRADED 0 0 0<br />
replacing-0 OFFLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY OFFLINE 0 0 0<br />
ata-ST3000DM001-1CH166_W1F478BD ONLINE 0 0 0 (resilvering)<br />
ata-ST3000DM001-9YN166_S1F0JKRR ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
=== Pool resilvering stuck/restarting/slow? ===<br />
<br />
According to the ZFSonLinux github it 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<br />
<br />
=== Fix slow boot caused by failed import of unavailable pools in the initramfs zpool.cache ===<br />
<br />
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.<br />
<br />
If you notice ZFS trying to import unavailable pools at boot, first run:<br />
<br />
$ zdb -C<br />
<br />
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:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache zroot<br />
<br />
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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Embed the archzfs packages into an archiso ===<br />
<br />
Follow the [[Archiso]] steps for creating a fully functional Arch Linux live CD/DVD/USB image.<br />
<br />
Enable the [[Unofficial user repositories#archzfs|archzfs]] repository:<br />
<br />
{{hc|~/archlive/pacman.conf|<nowiki><br />
...<br />
[archzfs]<br />
Server = http://archzfs.com/$repo/x86_64<br />
SigLevel = Optional TrustAll<br />
</nowiki>}}<br />
<br />
Add the {{ic|archzfs-linux}} group to the list of packages to be installed (the {{ic|archzfs}} repository provides packages for the x86_64 architecture only).<br />
<br />
{{hc|~/archlive/packages.x86_64|<br />
...<br />
archzfs-linux<br />
}}<br />
<br />
Complete [[Archiso#Build_the_ISO|Build the ISO]] to finally build the iso.<br />
<br />
{{Note|If you later have problems running modprobe zfs, you should include the linux-headers in the packages.x86_64. }}<br />
<br />
=== Automatic snapshots ===<br />
<br />
==== zrepl ====<br />
<br />
The {{AUR|zrepl}} package from the [[AUR]] provides a ZFS automatic replication service, which could also be used as a snapshotting service much like [[snapper]].<br />
<br />
For details on how to configure the zrepl daemon, see the zrepl [https://zrepl.github.io/ documentation]. The configuration file should be located at {{ic|/etc/zrepl/zrepl.yml}}. Then, run {{ic|zrepl configcheck}} to make sure that the syntax of the config file is correct. Finally, enable {{ic|zrepl.service}}.<br />
<br />
==== bieaz ====<br />
<br />
{{AUR|bieaz}} is a boot environment manager. It supports GRUB integration, separate boot pool on {{ic|/boot}} and arbitrary system container names {{ic|rpool_uniq/a/b/c/sysdataset}}. {{ic|bieaz}} requires a properly configured system dataset layout, see [https://gitlab.com/m_zhou/bieaz/-/blob/master/README.md documentation]. A compatible [[User:M0p/Root_on_ZFS_Native_Encryption|Arch on ZFS installation guide]] is available.<br />
<br />
{{aur|rozb3-pac}} is a pacman hook using {{aur|bieaz}}.<br />
<br />
==== ZFS Automatic Snapshot Service for Linux ====<br />
{{Note| {{AUR|zfs-auto-snapshot-git}} has not seen any updates since 2019, and the functionality is extremely limited. You are advised to switch to a newer tool like {{AUR|zrepl}}. }}<br />
<br />
The {{AUR|zfs-auto-snapshot-git}} package from [[AUR]] 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 {{ic|--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).<br />
<br />
To prevent a dataset from being snapshotted at all, set {{ic|1=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 {{ic|1=com.sun:auto-snapshot:monthly=false}}.<br />
<br />
{{Note|zfs-auto-snapshot-git will not create snapshots during [[#Scrubbing|scrubbing]]. It is possible to override this by [[Systemd#Editing provided units|editing provided systemd unit]] and removing {{ic|--skip-scrub}} from {{ic|ExecStart}} line. Consequences not known, someone please edit.}}<br />
<br />
Once the package has been installed, [[systemd/Timers|enable and start the selected timers]] ({{ic|<nowiki>zfs-auto-snapshot-{frequent,daily,weekly,monthly}.timer</nowiki>}}).<br />
<br />
==== ZFS Snapshot Manager ====<br />
{{Note| {{AUR|zfs-snap-manager}} has not seen any updates since 2019, and the last release was in 2017. You are advised to switch to to a newer tool like {{AUR|zrepl}}. }}<br />
<br />
The {{AUR|zfs-snap-manager}} package from [[AUR]] provides a python service that takes daily snapshots from a configurable set of ZFS datasets and cleans them out in a [[wikipedia:Backup rotation scheme#Grandfather-father-son|"Grandfather-father-son"]] scheme. It can be configured to e.g. keep 7 daily, 5 weekly, 3 monthly and 2 yearly snapshots. <br />
<br />
The package also supports configurable replication to other machines running ZFS by means of {{ic|zfs send}} and {{ic|zfs receive}}. If the destination machine runs this package as well, it could be configured to keep these replicated snapshots for a longer time. This allows a setup where a source machine has only a few daily snapshots locally stored, while on a remote storage server a much longer retention is available.<br />
<br />
=== Creating a share ===<br />
<br />
ZFS has support for creating shares by [[NFS]] or [[SMB]].<br />
<br />
==== NFS ====<br />
<br />
Make sure [[NFS]] has been installed/configured, note there is no need to edit the {{ic|/etc/exports}} file. For sharing over NFS the services {{ic|nfs-server.service}} and {{ic|zfs-share.service}} should be [[start|started]].<br />
<br />
To make a pool available on the network:<br />
<br />
# zfs set sharenfs=on ''nameofzpool''<br />
<br />
To make a dataset available on the network:<br />
<br />
# zfs set sharenfs=on ''nameofzpool''/''nameofdataset''<br />
<br />
To enable read/write access for a specific ip-range(s):<br />
<br />
# zfs set sharenfs="rw=@192.168.1.100/24,rw=@10.0.0.0/24" ''nameofzpool''/''nameofdataset''<br />
<br />
To check if the dataset is exported successful:<br />
<br />
{{hc|# showmount -e `hostname`|<br />
Export list for hostname:<br />
/path/of/dataset 192.168.1.100/24<br />
}}<br />
<br />
To view the current loaded exports state in more detail, use:<br />
<br />
{{hc|# exportfs -v|2=<br />
''/path/of/dataset''<br />
192.168.1.100/24(sync,wdelay,hide,no_subtree_check,mountpoint,sec=sys,rw,secure,no_root_squash,no_all_squash)<br />
}}<br />
<br />
To view the current NFS share list by ZFS:<br />
<br />
# zfs get sharenfs<br />
<br />
==== SMB ====<br />
<br />
When sharing through SMB, using {{ic|usershares}} in {{ic|/etc/samba/smb.conf}} will allow ZFS to setup and create the shares.<br />
<br />
{{bc|1=<br />
# [global]<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = no<br />
}}<br />
<br />
Create and set permissions on the user directory as root<br />
<br />
# mkdir /var/lib/samba/usershares<br />
# chmod +t /var/lib/samba/usershares<br />
<br />
To make a pool available on the network:<br />
<br />
# zfs set sharesmb=on ''nameofzpool''<br />
<br />
To make a dataset available on the network:<br />
<br />
# zfs set sharesmb=on ''nameofzpool''/''nameofdataset''<br />
<br />
To check if the dataset is exported successfully:<br />
<br />
{{hc|# smbclient -L localhost -U%|<br />
Sharename Type Comment<br />
--------- ---- -------<br />
IPC$ IPC IPC Service (SMB Server Name)<br />
''nameofzpool''_''nameofdataset'' Disk Comment: path/of/dataset<br />
SMB1 disabled -- no workgroup available<br />
}}<br />
<br />
To view the current SMB share list by ZFS:<br />
<br />
# zfs get sharesmb<br />
<br />
=== Encryption in ZFS using dm-crypt ===<br />
<br />
The stable release version of ZFS on Linux used to not support encryption directly (now it's available, see [[#Native encryption]]), but zpools can be created on 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.<br />
<br />
dm-crypt, possibly via LUKS, creates devices in {{ic|/dev/mapper}} and their name is fixed. So you just need to change {{ic|zpool create}} commands to point to that names. The idea is configuring the system to create the {{ic|/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.<br />
<br />
For example, an encrypted zpool can be created using plain dm-crypt (without LUKS) with:<br />
<br />
# cryptsetup --hash=sha512 --cipher=twofish-xts-plain64 --offset=0 \<br />
--key-file=/dev/sdZ --key-size=512 open --type=plain /dev/sdX enc<br />
# zpool create zroot /dev/mapper/enc<br />
<br />
In the case of a root filesystem pool, the {{ic|mkinitcpio.conf}} HOOKS line will enable the keyboard for the password, create the devices, and load the pools. It will contain something like:<br />
<br />
HOOKS="... keyboard encrypt zfs ..."<br />
<br />
Since the {{ic|/dev/mapper/enc}} name is fixed no import errors will occur.<br />
<br />
Creating encrypted zpools works fine. But if you need encrypted directories, for example to protect your users' homes, ZFS loses some functionality.<br />
<br />
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]] on it.<br />
<br />
For example to have an encrypted home: (the two passwords, encryption and login, must be the same)<br />
<br />
# zfs create -o compression=off -o dedup=off -o mountpoint=/home/<username> <zpool>/<username><br />
# useradd -m <username><br />
# passwd <username><br />
# ecryptfs-migrate-home -u <username><br />
<log in user and complete the procedure with ecryptfs-unwrap-passphrase><br />
<br />
=== Emergency chroot repair with archzfs ===<br />
<br />
To get into the ZFS filesystem from live system for maintenance, there are two options:<br />
<br />
# Build custom archiso with ZFS as described in [[#Embed the archzfs packages into an archiso]].<br />
# Boot the latest official archiso and bring up the network. Then enable [[Unofficial_user_repositories#archzfs|archzfs]] repository inside the live system as usual, sync the pacman package database and install the ''archzfs-archiso-linux'' package.<br />
<br />
To start the recovery, load the ZFS kernel modules:<br />
<br />
# modprobe zfs<br />
<br />
Import the pool:<br />
<br />
# zpool import -a -R /mnt<br />
<br />
Mount the boot partitions (if any):<br />
<br />
# mount /dev/sda2 /mnt/boot<br />
# mount /dev/sda1 /mnt/boot/efi<br />
<br />
Chroot into the ZFS filesystem:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
Check the kernel version:<br />
<br />
# pacman -Qi linux<br />
# uname -r<br />
<br />
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:<br />
<br />
# 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)<br />
<br />
This will load the correct kernel modules for the kernel version installed in the chroot installation.<br />
<br />
[[Regenerate the initramfs]]. There should be no errors.<br />
<br />
=== Bind mount ===<br />
<br />
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.<br />
<br />
==== fstab ====<br />
<br />
See [https://www.freedesktop.org/software/systemd/man/systemd.mount.html systemd.mount] for more information on how systemd converts fstab into mount unit files with [https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html systemd-fstab-generator].<br />
<br />
{{hc|/etc/fstab|<nowiki><br />
/mnt/zfspool /srv/nfs4/music none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0<br />
</nowiki>}}<br />
<br />
=== Monitoring / Mailing on Events ===<br />
<br />
See [https://ramsdenj.com/2016/08/29/arch-linux-on-zfs-part-3-followup.html ZED: The ZFS Event Daemon] for more information.<br />
<br />
An email forwarder, such as [[S-nail]], is required to accomplish this. Test it to be sure it is working correctly.<br />
<br />
Uncomment the following in the configuration file:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|<nowiki><br />
ZED_EMAIL_ADDR="root"<br />
ZED_EMAIL_PROG="mailx"<br />
ZED_NOTIFY_VERBOSE=0<br />
ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"<br />
</nowiki>}}<br />
<br />
Update 'root' in {{ic|1=ZED_EMAIL_ADDR="root"}} to the email address you want to receive notifications at.<br />
<br />
If you are keeping your mailrc in your home directory, you can tell mail to get it from there by setting {{ic|MAILRC}}:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|2=<br />
export MAILRC=/home/<user>/.mailrc<br />
}}<br />
<br />
This works because ZED sources this file, so {{ic|mailx}} sees this environment variable.<br />
<br />
If you want to receive an email no matter the state of your pool, you will want to set {{ic|1=ZED_NOTIFY_VERBOSE=1}}. You will need to do this temporary to test.<br />
<br />
[[Start]] and [[enable]] {{ic|zfs-zed.service}}.<br />
<br />
With {{ic|1=ZED_NOTIFY_VERBOSE=1}}, you can test by running a scrub as root: {{ic|1=zpool scrub <pool-name>}}.<br />
<br />
=== Wrap shell commands in pre & post snapshots ===<br />
<br />
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.<br />
<br />
==== rozb3-pac ====<br />
{{aur|rozb3-pac}} is a pacman hook supporting ZFS boot environments. It depends on {{aur|bieaz}}, a ZFS boot environment manager ported from [https://github.com/vermaden/beadm FreeBSD beadm].<br />
<br />
{{aur|rozb3-pac}} is based on {{pkg|snap-pac}}.<br />
<br />
==== znp ====<br />
E.g.:<br />
<br />
# zfs snapshot -r zroot@pre<br />
# pacman -Syu<br />
# zfs snapshot -r zroot@post<br />
# zfs diff zroot@pre zroot@post <br />
# zfs rollback zroot@pre<br />
<br />
A utility that automates the creation of pre and post snapshots around a shell command is [https://gist.github.com/erikw/eeec35be33e847c211acd886ffb145d5 znp].<br />
<br />
E.g.:<br />
<br />
# znp pacman -Syu<br />
# znp find / -name "something*" -delete<br />
<br />
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.<br />
<br />
=== Remote unlocking of ZFS encrypted root ===<br />
<br />
As of [https://github.com/archzfs/archzfs/pull/261 PR #261], {{ic|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#Remote unlocking (hooks: netconf, dropbear, tinyssh, ppp)]].<br />
<br />
#Install {{Pkg|mkinitcpio-netconf}} to provide hooks for setting up early user space networking.<br />
#Choose an SSH server to use in early user space. The options are {{Pkg|mkinitcpio-tinyssh}} or {{Pkg|mkinitcpio-dropbear}}, and are mutually exclusive.<br />
##If using {{Pkg|mkinitcpio-tinyssh}}, it is also recommended to install {{Pkg|tinyssh-convert}} or {{AUR|tinyssh-convert-git}}. 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.<br />
#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 {{ic|/etc/tinyssh/root_key}} or {{ic|/etc/dropbear/root_key}}. When generating the initcpio image, this file will be added to {{ic|authorized_keys}} for the root user and is only valid in the initrd environment.<br />
#Add the {{ic|1=ip=}} [[kernel parameter]] to your boot loader configuration. The {{ic|ip}} string is [https://www.kernel.org/doc/html/latest/admin-guide/nfs/nfsroot.html highly configurable]. A simple DHCP example is shown below.{{bc|1=ip=:::::eth0:dhcp}}<br />
#Edit {{ic|/etc/mkinitcpio.conf}} to include the {{ic|netconf}}, {{ic|dropbear}} or {{ic|tinyssh}}, and {{ic|zfsencryptssh}} hooks before the {{ic|zfs}} hook:{{bc|1=HOOKS=(... netconf <tinyssh>{{!}}<dropbear> zfsencryptssh zfs ...)}}<br />
#[[Regenerate the initramfs]].<br />
#Reboot and try it out!<br />
<br />
====Changing the SSH server port====<br />
<br />
By default, {{Pkg|mkinitcpio-tinyssh}} and {{Pkg|mkinitcpio-dropbear}} listen on port {{ic|22}}. You may wish to change this.<br />
<br />
For '''TinySSH''', copy {{ic|/usr/lib/initcpio/hooks/tinyssh}} to {{ic|/etc/initcpio/hooks/tinyssh}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/bin/tcpserver -HRDl0 0.0.0.0 <new_port> /usr/sbin/tinysshd -v /etc/tinyssh/sshkeydir &<br />
}}<br />
<br />
For '''Dropbear''', copy {{ic|/usr/lib/initcpio/hooks/dropbear}} to {{ic|/etc/initcpio/hooks/dropbear}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/sbin/dropbear -E -s -j -k -p <new_port><br />
}}<br />
<br />
[[Regenerate the initramfs]].<br />
<br />
==== Unlocking from a Windows machine using PuTTY/Plink ====<br />
<br />
First, we need to use {{ic|puttygen.exe}} to import and convert the OpenSSH key generated earlier into PuTTY's ''.ppk'' private key format. Let us call it {{ic|zfs_unlock.ppk}} for this example.<br />
<br />
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 {{ic|plink.exe}} with the following parameters:<br />
<br />
plink.exe -ssh -l root -i c:\path\to\zfs_unlock.ppk <hostname><br />
<br />
The plink command can be put into a batch script for ease of use.<br />
<br />
== See also ==<br />
<br />
* [https://pthree.org/2012/12/04/zfs-administration-part-i-vdevs/ Aaron Toponce's 17-part blog on ZFS]<br />
* [http://zfsonlinux.org/ ZFS on Linux]<br />
* [https://github.com/zfsonlinux/zfs/wiki/faq ZFS on Linux FAQ]<br />
* [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs.html FreeBSD Handbook - The Z File System]<br />
* [https://docs.oracle.com/cd/E19253-01/819-5461/index.html Oracle Solaris ZFS Administration Guide]<br />
* [https://web.archive.org/web/20161028084224/http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide ZFS Best Practices Guide]<br />
* [https://docs.oracle.com/cd/E23823_01/html/819-5461/gavwg.html ZFS Troubleshooting Guide]<br />
* [http://royal.pingdom.com/2013/06/04/zfs-backup/ How Pingdom uses ZFS to back up 5TB of MySQL data every day]<br />
* [https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bhow-to%5D-add-zfs-to-the-linux-kernel-4175514510/ Tutorial on adding the modules to a custom kernel]<br />
* [https://github.com/danboid/creating-ZFS-disks-under-Linux How to create cross platform ZFS disks under Linux]<br />
* [https://blog.heckel.xyz/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/ How-To: Using ZFS Encryption at Rest in OpenZFS (ZFS on Linux, ZFS on FreeBSD, …)]</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Intel_C%2B%2B&diff=647207Intel C++2020-12-26T18:09:10Z<p>Xuanruiqi: Intel has discontinued Parallel Studio XE and replaced it with the oneAPI Base & HPC Toolkit. The instructions here no longer apply.</p>
<hr />
<div>[[Category:Development]]<br />
[[Category:Package development]]<br />
[[it:Intel C++]]<br />
[[ja:Intel C++]]<br />
[[zh-hans:Intel C++]]<br />
{{Related articles start}}<br />
{{Related|Programming languages}}<br />
{{Related|Creating packages}}<br />
{{Related|Makepkg}}<br />
{{Related articles end}}<br />
<br />
{{Out of date|Intel has discontinued Parallel Studio XE and replaced it with the oneAPI Base & HPC Toolkit. The instructions here no longer apply.}}<br />
<br />
Installation and basic usage of Intel [https://software.intel.com/content/www/us/en/develop/tools/performance-libraries.html Performance Libraries] and [https://software.intel.com/content/www/us/en/develop/tools.html other tools] for Linux on Arch. They are included in the [https://software.intel.com/content/www/us/en/develop/tools/parallel-studio-xe.html Intel Parallel Studio XE] (formerly Intel C++ Composer XE or Intel C++ Compiler Professional Edition).<br />
<br />
Some libraries and tools are free and open source, other require a license file which can be obtained upon registration.<br />
<br />
== Free libraries ==<br />
<br />
* {{Pkg|intel-mkl}}, {{Pkg|intel-mkl-static}} - [https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library.html Intel Math Kernel Library] ([https://software.intel.com/content/www/us/en/develop/articles/intel-math-kernel-library-license-faq.html ISSL] license)<br />
* {{Pkg|tbb}} - free and open source release of [https://software.intel.com/content/www/us/en/develop/tools/threading-building-blocks.html Intel Threading Building Blocks] (Apache 2.0 license)<br />
<br />
== Intel Parallel Studio XE ==<br />
<br />
[https://software.intel.com/content/www/us/en/develop/tools/parallel-studio-xe.html Intel Parallel Studio XE] packages are available in the [[AUR]]. The PKGBUILD uses a free download link, but a license file needs to be obtained in order to actually use (most of) the packages. Intel offers a free license for [https://software.intel.com/content/www/us/en/develop/articles/open-source-contributor-faq.html open-source contributors], [https://software.intel.com/en-us/qualify-for-free-software/student students], [https://software.intel.com/en-us/qualify-for-free-software/academicresearcher researchers], and [https://software.intel.com/en-us/qualify-for-free-software/educator educators]. The requisite license file is emailed to users upon [https://software.intel.com/en-us/qualify-for-free-software/opensourcecontributor registration] and should be copied into the {{ic|$startdir}} prior to building the packages.<br />
<br />
The [https://aur.archlinux.org/pkgbase/intel-parallel-studio-xe intel-parallel-studio-xe] PKGBUILD assembles 10 split packages:<br />
<br />
* {{AUR|intel-common-libs}} - Intel base libraries<br />
* {{AUR|intel-openmp}} - Intel OpenMP Library<br />
* {{AUR|intel-compiler-base}} - [https://software.intel.com/content/www/us/en/develop/tools/compilers/c-compilers.html Intel C/C++ Compiler]<br />
* {{AUR|intel-fortran-compiler}} - [https://software.intel.com/content/www/us/en/develop/tools/compilers/fortran-compilers.html Intel Fortran Compiler]<br />
* {{AUR|intel-ipp}} - [https://software.intel.com/content/www/us/en/develop/tools/integrated-performance-primitives.html Intel Integrated Performance Primitives]<br />
* {{AUR|intel-mpi}} - [https://software.intel.com/content/www/us/en/develop/tools/mpi-library.html Intel MPI Library]<br />
* {{AUR|intel-tbb_psxe}} - [https://software.intel.com/content/www/us/en/develop/tools/threading-building-blocks.html Intel Threading Building Blocks]<br />
* {{AUR|intel-advisor}} - [https://software.intel.com/content/www/us/en/develop/tools/advisor.html Intel Advisor]<br />
* {{AUR|intel-vtune-profiler}} - [https://software.intel.com/content/www/us/en/develop/tools/vtune-profiler.html Intel VTune Profiler]<br />
* {{AUR|intel-inspector}} - [https://software.intel.com/content/www/us/en/develop/tools/inspector.html Intel Inspector]<br />
<br />
== Using icc with makepkg ==<br />
<br />
{{Out of date|Information is from the time before {{AUR|intel-common-libs}} was created. {{AUR|intel-openmp}} does not depend on {{AUR|intel-compiler-base}}, so the compiled packages probably do not need to depend on the compiler package.}}<br />
<br />
{{Note|<br />
* Packages that have been compiled by icc will depend on the associated libs contained in the '''intel-openmp''' package in order to run. Since '''intel-openmp''' depends on '''intel-compiler-base''', users '''must''' have both packages installed at all times!<br />
* Not every package will successfully compile with icc without heavy modifications to the underlying source.<br />
}}<br />
<br />
There is currently no official guide to using icc with makepkg. This section is meant to capture various methods suggested by users. Please make a new sub-section with your suggested method titled as such.<br />
<br />
=== Method 1 (12/08/2012) ===<br />
<br />
Modify {{ic|/etc/makepkg.conf}} inserting the following code ''under'' the existing line defining '''CXXFLAGS''' to enable makepkg to use icc. No special switches are needed when calling makepkg to build.<br />
<br />
{{bc|1=_CC=icc<br />
if [ $_CC = "icc" ]; then<br />
export CC="icc"<br />
export CXX="icpc"<br />
export CFLAGS="-march=native -O3 -no-prec-div -fno-alias -pipe"<br />
export CXXFLAGS="${CFLAGS}"<br />
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"<br />
export AR="xiar"<br />
export LD="xild"<br />
fi}}<br />
<br />
{{Note|<br />
* To toggle between the native gcc and icc, simple comment or uncomment the newly created '''_CC''' variable.<br />
* In some case the compilation method described above fails and the compilation will be performed with ''gcc'', so you should test if yours application has been effectively compiled with ''icc''.}}<br />
<br />
=== Method 2 ===<br />
<br />
Insert the following code anywhere near the top of the PKGBUILD:<br />
<br />
groups=('modified')<br />
export CC="icc"<br />
export CXX="icpc"<br />
export CFLAGS="-march=native -O3 -no-prec-div -fno-alias -pipe"<br />
export CXXFLAGS="-march=native -O3 -no-prec-div -fno-alias -pipe"<br />
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"<br />
export AR="xiar"<br />
export LD="xild"<br />
<br />
{{Note|1=The use of {{ic|1=groups=('modified')}} is explained further in [[Arch Build System#Preserve modified packages]]. You can delete this line if necessary. However, remember that the package will be replaced with the GCC version every time it is upgraded.}}<br />
<br />
Add {{ic|intel-openmp}} and {{ic|intel-compiler-base}} to the {{ic|depends}} array.<br />
<br />
{{Note|To test if your package has been really compiled with icc, observe the build output and watch if it is using the ''icc'' or ''icpc'' command.}}<br />
<br />
== icc CFLAGS ==<br />
<br />
In general, icc supports many of the same CFLAGS gcc supports and is also pretty tolerant to gcc flags it cannot use. In most cases it will happily ignore the flag warning the user and moving on. For an exhaustive list and explanation of available compiler flags, consult the icc manpage or better yet by invoking the compiler with the help flag:<br />
icc --help<br />
<br />
=== -xX ===<br />
<br />
Use to generate specialized code to run exclusively on processors supporting it. If unsure which option to use, simply inspect the '''flags''' section of {{ic|/proc/cpuinfo}}. In the example below, '''SSE4.1''' would be the correct selection:<br />
<br />
{{hc|$ grep -m 1 flags /proc/cpuinfo|<br />
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush <br />
dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs <br />
bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr<br />
pdcm sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority<br />
}}<br />
<br />
* -xHost<br />
* -xSSE2<br />
* -xSSE3<br />
* -xSSSE3<br />
* -xSSE4.1<br />
* -xSSE4.2<br />
* -xAVX<br />
* -xCORE-AVX-I<br />
* -xSSSE3_ATOM<br />
<br />
{{Tip|Use the '''-xHost''' flag if unsure what your specific processor supports.}}<br />
<br />
=== -Ox ===<br />
<br />
Same behavior as gcc. x is one of the following options:<br />
* 0 - disables optimizations<br />
* 1 - optimize for maximum speed, but disable some optimizations which increase code size for a small speed benefit<br />
* 2 - optimize for maximum speed (DEFAULT)<br />
* 3 - optimize for maximum speed and enable more aggressive optimizations that may not improve performance on some programs (recommended for math intensive looping programs)<br />
<br />
=== -w ===<br />
<br />
Similar to the gcc:<br />
* -w - disable all warnings (recommended for the package compilation)<br />
* -Wbrief - print brief one-line diagnostics<br />
* -Wall - enable all warnings<br />
* -Werror - force warnings to be reported as errors<br />
<br />
== Software compiled with Intel C / C++ ==<br />
<br />
In the following table we report a list of packages from the official repository that we have tried to compile with the intel C/C++ compiler. The compilation should be done by using the PKGBUILD from ABS.<br />
<br />
{| class="wikitable sortable collapsible" border="1" border="1"<br />
|-style="background: #ffdead;" <br />
! Application || Method 1 || Comments<br />
<br />
|-<br />
| '''xvidcore''' || style="background: Lime" | OK ||<br />
|-<br />
| '''kdebase''' || style="background: Lime" | OK ||<br />
|-<br />
| '''conky 1.9.0''' || style="background: Lime" | OK ||<br />
|-<br />
| '''nginx 1.4.2''' || style="background: Lime" | OK ||<br />
|-<br />
| '''gzip 1.6''' || style="background: Lime" | OK ||<br />
|-<br />
| '''xz''' || style="background: Lime" | OK ||<br />
|-<br />
| '''lz4''' || style="background: GreenYellow" | OK || We must edit the PKGBUILD.<br />
|-<br />
| '''minetest''' || style="background: Lime" | OK ||<br />
|-<br />
| '''opus''' || style="background: Lime" | OK ||<br />
|-<br />
| '''zlib 1.2.8''' || style="background: yellow" | Not recommended || Causes bugs in some apps, like tightvnc<br />
|-<br />
| '''Gimp 2.8 / 2.9 ''' || style="background: Lime" | OK ||<br />
|-<br />
| '''Pacman 4.0.3''' || style="background: Lime" | OK ||<br />
|-<br />
| '''x264''' || style="background: Lime" | OK ||<br />
|-<br />
| '''MySql''' || style="background: Lime" | OK ||<br />
|-<br />
| '''SqlLite''' || style="background: Lime" | OK ||<br />
|-<br />
| '''lame''' || style="background: Lime" | OK ||<br />
|-<br />
| '''xaos''' || style="background: Lime" | OK ||<br />
|-<br />
| '''gegl''' || style="background: Lime" | OK ||<br />
|-<br />
| '''VLC''' || style="background: Tomato" | Unsuccessful || There is some problem with the compiler flags<br />
|-<br />
| '''bzip2''' || style="background: Tomato" | Unsuccessful || There is some problem with the compiler flags<br />
|-<br />
| '''mplayer''' || style="background: pink" | Out of date || Does not recognize the Intel compiler<br />
|-<br />
| '''optipng''' || style="background: GreenYellow" | OK || Comment out LD=xild in makepkg.conf<br />
|-<br />
| '''python-numpy''' || style="background: GreenYellow" | OK || We must edit the PKGBUILD. {{AUR|python-numpy-mkl}}<br />
|-<br />
| '''python-scipy''' || style="background: GreenYellow" | OK || We must edit the PKGBUILD. {{AUR|python-scipy-mkl}}<br />
|-<br />
| '''Qt''' || style="background: GreenYellow" | OK || We must add the option ''-platform linux-icc-64 (or 32)'' in the configure command <br />
|-<br />
| '''systemd''' || style="background: red" | Fail ||undefined reference to `server_dispatch_message'<br />
|}<br />
<br />
'''Legend:'''<br />
{|<br />
|-<br />
| style="background: Lime" | OK || The compilation with ICC works!<br />
|-<br />
| style="background: GreenYellow" | OK || The compilation works but is needed an editing of the PKGBUILD<br />
|-<br />
| style="background: Tomato" | Unsuccessful || The compilation may work, but there are some compilations errors.<br />
|-<br />
| style="background: yellow" | Not recommended || The compilation works, but is not recommended <br />
|-<br />
| style="background: red" | Fail || It is impossible to compile the PKG with ICC.<br />
|-<br />
| style="background: pink" | Out of date || It is unsuccessful or fails with older CFLAGS.<br />
|}</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=ZFS&diff=622390ZFS2020-06-27T18:40:29Z<p>Xuanruiqi: Fix typo (zfs -> zrepl)</p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Oracle]]<br />
[[ja:ZFS]]<br />
[[pt:ZFS]]<br />
[[zh-hans:ZFS]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related|ZFS/Virtual disks}}<br />
{{Related|Installing Arch Linux on ZFS}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:ZFS|ZFS]] is an advanced filesystem created by [[Wikipedia:Sun Microsystems|Sun Microsystems]] (now owned by Oracle) and released for OpenSolaris in November 2005. <br />
<br />
Features of ZFS include: pooled storage (integrated volume management – zpool), [[Wikipedia:Copy-on-write|Copy-on-write]], [[Wikipedia:Snapshot (computer storage)|snapshots]], data integrity verification and automatic repair (scrubbing), [[Wikipedia:RAID-Z|RAID-Z]], a maximum [[Wikipedia:Exabyte|16 Exabyte]] file size, and a maximum 256 Quadrillion [[Wikipedia:Zettabyte|Zettabytes]] storage with no limit on number of filesystems (datasets) or files[http://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/index.html]. ZFS is licensed under the [[Wikipedia:CDDL|Common Development and Distribution License]] (CDDL).<br />
<br />
Described as [http://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/ "The last word in filesystems"] ZFS is stable, fast, secure, and future-proof. Being licensed under the CDDL, and thus incompatible with GPL, it is not possible for ZFS to be distributed along with 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 [http://zfsonlinux.org/ zfsonlinux.org] (ZOL).<br />
<br />
ZOL is a project funded by the [https://www.llnl.gov/ Lawrence Livermore National Laboratory] to develop a native Linux kernel module for its massive storage requirements and super computers.<br />
<br />
{{Note|<br />
Due to potential legal incompatibilities between CDDL license of ZFS code and GPL of the Linux kernel ([https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/ ],[[wikipedia:Common_Development_and_Distribution_License#GPL_compatibility|CDDL-GPL]],[[wikipedia:ZFS#Linux|ZFS in Linux]]) - ZFS development is not supported by the kernel.<br />
<br />
As a result:<br />
<br />
* ZFSonLinux project must keep up with Linux kernel versions. After making stable ZFSonLinux release - Arch ZFS maintainers release them.<br />
* This situation sometimes locks down the normal rolling update process by unsatisfied dependencies because the new kernel version, proposed by update, is unsupported by ZFSonLinux.<br />
}}<br />
<br />
== Installation ==<br />
<br />
=== General ===<br />
<br />
{{Warning|Unless you use the [[dkms]] versions of these packages, the ZFS and SPL kernel modules are tied to a specific kernel version. It would not be possible to apply any kernel updates until updated packages are uploaded to AUR or the [[Unofficial user repositories#archzfs|archzfs]] repository.}}<br />
<br />
{{Tip| You can [[downgrade]] your linux version to the one from [[Unofficial user repositories#archzfs|archzfs]] repo if your current kernel is newer.}}<br />
<br />
Install from the [[Unofficial user repositories#archzfs|archzfs]] repository or alternatively the [[Arch User Repository]]:<br />
<br />
* {{AUR|zfs-linux}} for [http://zfsonlinux.org/ stable] releases.<br />
* {{AUR|zfs-linux-git}} for [https://github.com/zfsonlinux/zfs/releases development] releases (with support of newer kernel versions).<br />
* {{AUR|zfs-linux-lts}} for stable releases for LTS kernels.<br />
* {{AUR|zfs-linux-lts-git}} for development releases for LTS kernels.<br />
* {{AUR|zfs-linux-hardened}} for stable releases for hardened kernels.<br />
* {{AUR|zfs-linux-hardened-git}} for development releases for hardened kernels.<br />
* {{AUR|zfs-linux-zen}} for stable releases for zen kernels.<br />
* {{AUR|zfs-linux-zen-git}} for development releases for zen kernels.<br />
* {{AUR|zfs-dkms}} for versions with dynamic kernel module support.<br />
* {{AUR|zfs-dkms-git}} for development releases for versions with dynamic kernel module support.<br />
<br />
These branches have (according to them) dependencies on the {{ic|zfs-utils}}, {{ic|spl}}, {{ic|spl-utils}} packages. SPL (Solaris Porting Layer) is a Linux Kernel module implementing Solaris APIs for ZFS compatibility.<br />
<br />
Test the installation by issuing {{ic|zpool status}} on the command line. If an "insmod" error is produced, try {{ic|depmod -a}}.<br />
<br />
=== Root on ZFS ===<br />
<br />
See [[Install_Arch_Linux_on_ZFS#Installation|Installation]].<br />
<br />
=== DKMS ===<br />
<br />
Users can make use of DKMS [[Dynamic Kernel Module Support]] to rebuild the ZFS modules automatically with every kernel upgrade. <br />
<br />
Install {{AUR|zfs-dkms}} or {{AUR|zfs-dkms-git}} and apply the post-install instructions given by these packages.<br />
<br />
{{Tip|Add an {{ic|IgnorePkg}} entry to [[pacman.conf]] to prevent these packages from upgrading when doing a regular update.}}<br />
<br />
== Experimenting with ZFS ==<br />
<br />
Users wishing to experiment with ZFS on ''virtual block devices'' (known in ZFS terms as VDEVs) which can be simple files like {{ic|~/zfs0.img}} {{ic|~/zfs1.img}} {{ic|~/zfs2.img}} etc. with no possibility of real data loss are encouraged to see the [[Experimenting with ZFS]] article. Common tasks like building a RAIDZ array, purposefully corrupting data and recovering it, snapshotting datasets, etc. are covered.<br />
<br />
== Configuration ==<br />
<br />
ZFS is considered a "zero administration" filesystem by its creators; therefore, configuring ZFS is very straight forward. Configuration is done primarily with two commands: {{ic|zfs}} and {{ic|zpool}}.<br />
<br />
=== Automatic Start ===<br />
<br />
Currently, by default, the kernel module is not loaded at boot (see more details in https://github.com/zfsonlinux/zfs/issues/6083). To automatically load {{Ic|zfs}} module on boot, see [[Kernel module#Automatic module loading with systemd]].<br />
<br />
For ZFS to live by its "zero administration" namesake, {{Ic|zfs-import-cache.service}} must be enabled to import the pools and {{Ic|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 {{ic|/etc/fstab}}. {{Ic|zfs-import-cache.service}} imports the zfs pools reading the file {{ic|/etc/zfs/zpool.cache}}.<br />
<br />
For each [[#Importing a pool created by id|imported pool]] you want automatically imported by {{Ic|zfs-import-cache.service}} execute:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache <pool><br />
<br />
{{Note|Beginning with ZOL version 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 [https://github.com/archzfs/archzfs/issues/72 https://github.com/archzfs/archzfs/issues/72] for more information.}}<br />
<br />
Enable the relevant service and target so the pools are automatically imported at boot time:<br />
<br />
# systemctl enable zfs-import-cache<br />
# systemctl enable zfs-import.target<br />
<br />
To mount the ZFS filesystems, you have 2 choices:<br />
* Enable the [[#Using zfs-mount.service|zfs-mount.service]]<br />
* Using [[#Using zfs-mount-generator|zfs-mount-generator]]<br />
<br />
==== Using zfs-mount.service ====<br />
<br />
In order to mount ZFS filesystems automatically on boot you need to enable the following services and targets:<br />
<br />
# systemctl enable zfs-mount<br />
# systemctl enable zfs.target<br />
<br />
==== Using zfs-mount-generator ====<br />
<br />
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 {{Ic|zfs-mount.service}}. To do that, you need to:<br />
<br />
# Create the {{Ic|/etc/zfs/zfs-list.cache}} directory.<br />
# Enable the ZFS Event Daemon(ZED) script (called a ZEDLET) required to create a list of mountable ZFS filesystems. {{bc|# ln -s /usr/lib/zfs/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d}}<br />
# Enable and start the ZFS Event Daemon. This service is responsible for running the script in the previous step. {{bc|# systemctl enable zfs-zed.service<br># systemctl enable zfs.target<br># systemctl start zfs-zed.service}}<br />
# You need to create an empty file named after your pool in {{Ic|/etc/zfs/zfs-list.cache}}. The ZEDLET will only update the list of filesystems if the file for the pool already exists. {{bc|# touch /etc/zfs/zfs-list.cache/<pool-name>}}<br />
# Check the contents of {{Ic|/etc/zfs/zfs-list.cache/<pool-name>}}. If it is empty, make sure that the {{Ic|zfs-zed.service}} is running and just change the canmount property of any of your ZFS filesystem by running: {{bc|1=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 {{Ic|/etc/zfs/zfs-list.cache}}. If the file in {{Ic|/etc/zfs/zfs-list.cache}} is updated, you can set the {{Ic|canmount}} property of the filesystem back by running: {{bc|1=zfs set canmount=on zroot/fs1}}<br />
You need to add a file in {{Ic|/etc/zfs/zfs-list.cache}} for each ZFS pool in your system. Make sure the pools are imported by enabling {{Ic|zfs-import-cache.service}} and {{Ic|zfs-import.target}} as [[#Automatic Start|explained above]].<br />
<br />
== Storage pools ==<br />
<br />
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 [https://www.reddit.com/r/zfs/comments/667na0/zfs_on_raw_or_gpt/dgh0l9t/ automatically create a GPT partition table] 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.<br />
<br />
{{Note|If some or all device have been used in a software RAID set it is paramount to [[mdadm#Prepare the devices|erase any old RAID configuration information]].}}<br />
<br />
{{Warning|For [[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 [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?], [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks 1.15 How does ZFS on Linux handle Advanced Format disks?], and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].}}<br />
<br />
=== Identify disks ===<br />
<br />
[https://github.com/zfsonlinux/zfs/wiki/faq#selecting-dev-names-when-creating-a-pool ZFS on Linux] recommends using device IDs when creating ZFS storage pools of less than 10 devices. Use [[Persistent block device naming#by-id and by-path]] to identify the list of drives to be used for ZFS pool. <br />
<br />
The disk IDs should look similar to the following:<br />
<br />
{{hc|$ ls -lh /dev/disk/by-id/|<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JKRR -> ../../sdc<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JTM1 -> ../../sde<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KBP8 -> ../../sdd<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KDGY -> ../../sdb}}<br />
<br />
{{Warning|If you create zpools using device names (e.g. {{ic|/dev/sda}},{{ic|/dev/sdb}},...) ZFS might not be able to detect zpools intermittently on boot.}}<br />
<br />
==== Using GPT labels ====<br />
<br />
{{Style|Missing references to [[Persistent block device naming]], it is useless to explain the differences (or even what they are) here.}}<br />
<br />
Disk labels and UUID can also be used for ZFS mounts by using [[GUID Partition Table|GPT]] partitions. ZFS drives have labels but Linux is unable to read them at boot. Unlike [[Master Boot Record|MBR]] 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.<br />
<br />
Use [[GUID Partition Table|gdisk]] 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]] allowing large data pools to be labeled in an organized fashion.<br />
<br />
Drives partitioned with GPT have labels and UUID that look like this. <br />
<br />
{{hc|$ ls -l /dev/disk/by-partlabel|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata1 -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata2 -> ../../sdc1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 zfsl2arc -> ../../sda1}}<br />
<br />
{{hc|$ ls -l /dev/disk/by-partuuid|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 148c462c-7819-431a-9aba-5bf42bb5a34e -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 4f95da30-b2fb-412b-9090-fc349993df56 -> ../../sda1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 e5ccef58-5adf-4094-81a7-3bac846a885f -> ../../sdc1}}<br />
<br />
{{Tip|To minimize typing and copy/paste errors, set a local variable with the target PARTUUID: {{ic|<nowiki>$ UUID=$(lsblk --noheadings --output PARTUUID /dev/sd</nowiki>''XY''<nowiki>)</nowiki>}} }}<br />
<br />
=== Creating ZFS pools ===<br />
<br />
To create a ZFS pool:<br />
<br />
# zpool create -f -m <mount> <pool> [raidz(2|3)|mirror] <ids><br />
<br />
{{Tip|One may want to read [[#Advanced Format disks]] first as it may be recommend to set {{ic|ashift}} on pool creation.}}<br />
<br />
* '''create''': subcommand to create the pool.<br />
<br />
* '''-f''': Force creating the pool. This is to overcome the "EFI label error". See [[#Does not contain an EFI label]].<br />
<br />
* '''-m''': The mount point of the pool. If this is not specified, then the pool will be mounted to {{ic|/<pool>}}.<br />
<br />
* '''pool''': This is the name of the pool.<br />
<br />
* '''raidz(2|3)|mirror''': This is the type of virtual device that will be created from the pool of devices, raidz is a single disk of parity, raidz2 for 2 disks of parity and raidz3 for 3 disks of parity, similar to raid5 and raid6. 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.<br />
<br />
* '''ids''': The [[Persistent_block_device_naming#by-id_and_by-path|ID's]] of the drives or partitions that to include into the pool.<br />
<br />
Create pool with single raidz vdev:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
Create pool with two mirror vdevs:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== Advanced Format disks ====<br />
<br />
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, {{ic|<nowiki>-o ashift=12</nowiki>}} should always be specified during pool creation. See the [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks ZFS on Linux FAQ] for more details.<br />
<br />
{{Tip|Use {{man|8|blockdev}} (part of {{Pkg|util-linux}}) to print the sector size reported by the device's ioctls: {{ic|blockdev --getpbsz /dev/sd''XY''}} as the root user.}}<br />
<br />
Create pool with ashift=12 and single raidz vdev:<br />
<br />
# zpool create -f -o ashift=12 -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== GRUB-compatible pool creation ====<br />
<br />
{{note|This section frequently goes out of date with updates to GRUB and ZFS. Consult the manual pages for the most up-to-date information.}}<br />
<br />
By default, ''zpool create'' enables all features on a pool. If {{ic|/boot}} resides on ZFS when using [[GRUB]] you must only enable features supported by GRUB otherwise GRUB will not be able to read the pool. GRUB 2.02 supports the read-write features {{ic|lz4_compress}}, {{ic|hole_birth}}, {{ic|embedded_data}}, {{ic|extensible_dataset}}, and {{ic|large_blocks}}; this is not suitable for all the features of ZFSonLinux 0.8.0, and must have unsupported features disabled. We can explicitly name features to enable with the {{ic|-d}} argument to {{ic|zpool create}}, which disables all features by default.<br />
<br />
You can create a pool with only the compatible features enabled:<br />
<br />
# zpool create -d -o feature@allocation_classes=enabled \<br />
-o feature@async_destroy=enabled \<br />
-o feature@bookmarks=enabled \<br />
-o feature@embedded_data=enabled \<br />
-o feature@empty_bpobj=enabled \<br />
-o feature@enabled_txg=enabled \<br />
-o feature@extensible_dataset=enabled \<br />
-o feature@filesystem_limits=enabled \<br />
-o feature@hole_birth=enabled \<br />
-o feature@large_blocks=enabled \<br />
-o feature@lz4_compress=enabled \<br />
-o feature@project_quota=enabled \<br />
-o feature@resilver_defer=enabled \<br />
-o feature@spacemap_histogram=enabled \<br />
-o feature@spacemap_v2=enabled \<br />
-o feature@userobj_accounting=enabled \<br />
-o feature@zpool_checkpoint=enabled \<br />
$POOL_NAME $VDEVS<br />
<br />
=== Verifying pool status ===<br />
<br />
If the command is successful, there will be no output. Using the [[mount]] command will show that the pool is mounted. Using {{ic|zpool status}} will show that the pool has been created:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: ONLINE<br />
scan: none requested<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata ONLINE 0 0 0<br />
-0 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JKRR-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1-part1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
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.<br />
<br />
=== Importing a pool created by id ===<br />
<br />
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.<br />
<br />
{{Warning|Do not run {{ic|zpool import ''pool''}}! This will import your pools using {{ic|/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, which harkens back to a time when PCs would not boot when a floppy disk was left in a machine.}}<br />
<br />
Adapt one of the following commands to import your pool so that pool imports retain the persistence they were created with:<br />
<br />
# zpool import -d /dev/disk/by-id bigdata<br />
# zpool import -d /dev/disk/by-partlabel bigdata<br />
# zpool import -d /dev/disk/by-partuuid bigdata<br />
<br />
{{Note|Use the {{ic|-l}} flag when importing a pool that contains [[#Native encryption|encrypted datasets keys]]:<br />
# zpool import -l -d /dev/disk/by-id bigdata<br />
}}<br />
<br />
Finally check the state of the pool:<br />
<br />
# zpool status -v bigdata<br />
<br />
=== Destroy a storage pool ===<br />
<br />
ZFS makes it easy to destroy a mounted storage pool, removing all metadata about the ZFS device.<br />
<br />
{{Warning|This command destroys '''any data''' containing in the pool and/or dataset.}}<br />
<br />
To destroy the pool:<br />
# zpool destroy <pool><br />
<br />
To destroy a dataset:<br />
# zfs destroy <pool>/<dataset><br />
<br />
And now when checking the status:<br />
<br />
{{hc|# zpool status|<br />
no pools available<br />
}}<br />
<br />
=== Exporting a storage pool ===<br />
<br />
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 {{ic|-f}} argument, but this is considered bad form.<br />
<br />
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 {{ic|zfs_force&#61;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"]]<br />
<br />
To export a pool:<br />
<br />
# zpool export <pool><br />
<br />
=== Extending an existing zpool ===<br />
<br />
A device (a partition or a disk) can be added to an existing zpool:<br />
<br />
# zpool add <pool> <device-id><br />
<br />
To import a pool which consists of multiple devices:<br />
<br />
# zpool import -d <device-id-1> -d <device-id-2> <pool><br />
<br />
or simply:<br />
<br />
# zpool import -d /dev/disk-by-id/ <pool><br />
<br />
=== Renaming a zpool ===<br />
<br />
Renaming a zpool that is already created is accomplished in 2 steps:<br />
<br />
# zpool export oldname<br />
# zpool import oldname newname<br />
<br />
=== Setting a different mount point ===<br />
<br />
The mount point for a given zpool can be moved at will with one command:<br />
# zfs set mountpoint=/foo/bar poolname<br />
<br />
== Creating datasets ==<br />
<br />
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:<br />
<br />
# zfs create <nameofzpool>/<nameofdataset><br />
<br />
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:<br />
<br />
# zfs set quota=20G <nameofzpool>/<nameofdataset>/<directory><br />
<br />
To see all the commands available in ZFS, see {{man|8|zfs|url=}} or {{man|8|zpool|url=}}.<br />
<br />
=== Native encryption ===<br />
<br />
ZFS offers the following supported encryption options: {{ic|aes-128-ccm}}, {{ic|aes-192-ccm}}, {{ic|aes-256-ccm}}, {{ic|aes-128-gcm}}, {{ic|aes-192-gcm}} and {{ic|aes-256-gcm}}. When encryption is set to {{ic|on}}, {{ic|aes-256-gcm}} will be used.<br />
<br />
The following keyformats are supported: {{ic|passphrase}}, {{ic|raw}}, {{ic|hex}}.<br />
<br />
One can also specify/increase the default iterations of PBKDF2 when using {{ic|passphrase}} with {{ic|-o pbkdf2iters <n>}}, although it may increase the decryption time.<br />
<br />
{{Note|<br />
* 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 {{AUR|zfs-linux-git}}, {{AUR|zfs-dkms-git}} 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.<br />
* The default encryption suite was changed from {{ic|aes-256-ccm}} to {{ic|aes-256-gcm}} in the 0.8.4 release.<br />
* To import a pool with keys, one needs to specify the {{ic|-l}} flag, without this flag encrypted datasets will be left unavailable until the keys are loaded. See [[#Importing a pool created by id]].}}<br />
<br />
To create a dataset including native encryption with a passphrase, use:<br />
<br />
# zfs create -o encryption=on -o keyformat=passphrase <nameofzpool>/<nameofdataset><br />
<br />
To use a key instead of using a passphrase:<br />
<br />
# dd if=/dev/random of=/path/to/key bs=1 count=32<br />
# zfs create -o encryption=on -o keyformat=raw -o keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
To verify the key location:<br />
# zfs get keylocation <nameofzpool>/<nameofdataset><br />
<br />
To change the key location:<br />
<br />
# zfs set keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
You can also manually load the keys by using one of the following commands:<br />
<br />
# zfs load-key <nameofzpool>/<nameofdataset> # load key for a specific dataset<br />
# zfs load-key -a # load all keys<br />
# zfs load-key -r zpool/dataset # load all keys in a dataset<br />
<br />
To mount the created encrypted dataset:<br />
<br />
# zfs mount <nameofzpool>/<nameofdataset><br />
<br />
==== Unlock at boot time ====<br />
It is possible to automatically unlock a pool dataset on boot time by using a [[systemd]] unit. For example create the following service to unlock any specific dataset: <br />
<br />
{{hc|/etc/systemd/system/zfs-load-key@.service|2=<br />
[Unit]<br />
Description=Load %I encryption keys<br />
Before=systemd-user-sessions.service<br />
After=zfs-import.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/bash -c 'until (systemd-ask-password "Encrypted ZFS password for %I" --no-tty <nowiki>|</nowiki> zfs load-key %I); do echo "Try again!"; done'<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] the service for each encrypted dataset, e.g. {{ic|systemctl enable zfs-load-key@pool0-dataset0}} as the root user. Note the use of {{ic|-}}, which is an escaped {{ic|/}} in systemd unit definitions. See {{ic|systemd-escape(1)}} for more info.<br />
{{Note|The {{ic|1=Before=systemd-user-sessions.service}} ensures that systemd-ask-password is invoked before the local IO devices are handed over to the [[desktop environment]].}}<br />
<br />
An alternative is to load all possible keys:<br />
<br />
{{hc|/etc/systemd/system/zfs-load-key.service|2=<br />
[Unit]<br />
Description=Load encryption keys<br />
DefaultDependencies=no<br />
After=zfs-import.target<br />
Before=zfs-mount.service<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/bash -c '/usr/bin/zfs load-key -a'<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-load-key.service}}.<br />
<br />
=== Swap volume ===<br />
<br />
{{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 https://github.com/zfsonlinux/zfs/issues/7734}}<br />
<br />
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 {{ic|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.<br />
<br />
Create a 8 GiB zfs volume:<br />
<br />
# zfs create -V 8G -b $(getconf PAGESIZE) \<br />
-o logbias=throughput -o sync=always\<br />
-o primarycache=metadata \<br />
-o com.sun:auto-snapshot=false <pool>/swap<br />
<br />
Prepare it as swap partition:<br />
<br />
# mkswap -f /dev/zvol/<pool>/swap<br />
# swapon /dev/zvol/<pool>/swap<br />
<br />
To make it permanent, edit {{ic|/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.<br />
<br />
Add a line to {{ic|/etc/fstab}}:<br />
<br />
/dev/zvol/<pool>/swap none swap discard 0 0<br />
<br />
=== Access Control Lists ===<br />
<br />
To use [[ACL]] on a dataset:<br />
<br />
# zfs set acltype=posixacl <nameofzpool>/<nameofdataset><br />
# zfs set xattr=sa <nameofzpool>/<nameofdataset><br />
<br />
Setting {{ic|xattr}} is recommended for performance reasons [https://github.com/zfsonlinux/zfs/issues/170#issuecomment-27348094].<br />
<br />
It may be preferable to enable ACL on the zpool as datasets will inherit the ACL parameters. Setting {{ic|1=aclinherit=passthrough}} may be wanted as the default mode is {{ic|restricted}} [https://docs.oracle.com/cd/E19120-01/open.solaris/817-2271/gbaaz/index.html]:<br />
<br />
# zfs set aclinherit=passthrough <nameofzpool><br />
# zfs set acltype=posixacl <nameofzpool><br />
# zfs set xattr=sa <nameofzpool><br />
<br />
=== Databases ===<br />
<br />
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.<br />
<br />
Most RDBMSes work in 8KiB-sized blocks by default. Although the block size is tunable for [[MySQL|MySQL/MariaDB]], [[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:<br />
<br />
# zfs set recordsize=8K <pool>/postgres<br />
<br />
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:<br />
<br />
# zfs set primarycache=metadata <pool>/postgres<br />
<br />
If your pool has no configured log devices, ZFS reserves space on the pool's data disks for its intent log (the ZIL). ZFS uses this 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. Setting this for non-database file systems, or for pools with configured log devices, can actually ''negatively'' impact the performance, so beware:<br />
<br />
# zfs set logbias=throughput <pool>/postgres<br />
<br />
These can also be done at file system creation time, for example:<br />
<br />
# zfs create -o recordsize=8K \<br />
-o primarycache=metadata \<br />
-o mountpoint=/var/lib/postgres \<br />
-o logbias=throughput \<br />
<pool>/postgres<br />
<br />
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.<br />
<br />
=== /tmp ===<br />
<br />
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 {{ic|fsync}} or {{ic|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.<br />
<br />
# zfs set sync=disabled <pool>/tmp<br />
<br />
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:<br />
<br />
# zfs set setuid=off <pool>/tmp<br />
# zfs set devices=off <pool>/tmp<br />
<br />
Combining all of these for a create command would be as follows:<br />
<br />
# zfs create -o setuid=off -o devices=off -o sync=disabled -o mountpoint=/tmp <pool>/tmp<br />
<br />
Please note, also, that if you want /tmp on ZFS, you will need to mask (disable) [[systemd]]'s automatic tmpfs-backed /tmp, else ZFS will be unable to mount your dataset at boot-time or import-time:<br />
<br />
# systemctl mask tmp.mount<br />
<br />
== Tuning ==<br />
<br />
=== General ===<br />
<br />
ZFS pools and datasets can be further adjusted using parameters.<br />
<br />
{{Note|All settable properties, with the exception of quotas and reservations, inherit their value from the parent dataset.}}<br />
<br />
To retrieve the current pool parameter status:<br />
<br />
# zfs get all <pool><br />
<br />
To retrieve the current dataset parameter status:<br />
<br />
# zfs get all <pool>/<dataset><br />
<br />
To disable access time (atime), which is enabled by default:<br />
<br />
# zfs set atime=off <pool><br />
<br />
To disable access time (atime) on a particular dataset:<br />
<br />
# zfs set atime=off <pool>/<dataset><br />
<br />
An alternative to turning off atime completely, {{ic|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 {{ic|1=atime=off}} and {{ic|1=atime=on}}. This property ''only'' takes effect if {{ic|atime}} is {{ic|on}}:<br />
<br />
# zfs set atime=on <pool><br />
# zfs set relatime=on <pool><br />
<br />
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 [http://open-zfs.org/wiki/Performance_tuning#Compression OpenZFS Wiki] for more details. <br />
<br />
To enable compression:<br />
<br />
# zfs set compression=on <pool><br />
<br />
To reset a property of a pool and/or dataset to it's default state, use {{ic|zfs inherit}}:<br />
<br />
# zfs inherit -rS atime <pool><br />
# zfs inherit -rS atime <pool>/<dataset><br />
<br />
{{Warning|Using the {{ic|-r}} flag will recursively reset all datasets of the zpool.}}<br />
<br />
=== Scrubbing ===<br />
<br />
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.<br />
<br />
To scrub a pool:<br />
<br />
# zpool scrub <pool><br />
<br />
To cancel a running scrub:<br />
<br />
# zpool scrub -s <pool><br />
<br />
==== How often should I do this? ====<br />
<br />
From the Oracle blog post [https://blogs.oracle.com/wonders-of-zfs-storage/disk-scrub-why-and-when-v2 Disk Scrub - Why and When?]:<br />
<br />
: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.<br />
<br />
:* 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.<br />
:* 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.<br />
:* 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.<br />
<br />
: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.<br />
<br />
In the [https://pthree.org/2012/12/11/zfs-administration-part-vi-scrub-and-resilver/ ZFS Administration Guide] by Aaron Toponce, he advises to scrub consumer disks once a week.<br />
<br />
==== Start with a service or timer ====<br />
Using a [[systemd]] timer/service it is possible to automatically scrub pools.<br />
<br />
To perform scrubbing monthly on a particular pool:<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.timer|2=<br />
[Unit]<br />
Description=Monthly zpool scrub on %i<br />
<br />
[Timer]<br />
OnCalendar=monthly<br />
AccuracySec=1h<br />
Persistent=true<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.service|2=<br />
[Unit]<br />
Description=zpool scrub on %i<br />
<br />
[Service]<br />
Nice=19<br />
IOSchedulingClass=idle<br />
KillSignal=SIGINT<br />
ExecStart=/usr/bin/zpool scrub %i<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-scrub@''pool-to-scrub''.timer}} unit for monthly scrubbing the specified zpool.<br />
<br />
=== SSD Caching ===<br />
<br />
You can add SSD devices as a write intent log (external ZIL or SLOG) and also as a layer 2 adaptive replacement cache (L2ARC). The process to add them is very similar to adding a new VDEV.<br />
<br />
All of the below references to device-id are the IDs from {{ic|/dev/disk/by-id/*}}.<br />
<br />
==== SLOG ====<br />
<br />
To add a mirrored SLOG:<br />
<br />
# zpool add <pool> log mirror <device-id-1> <device-id-2><br />
<br />
Or to add a single device SLOG (unsafe):<br />
<br />
# zpool add <pool> log <device-id><br />
<br />
Because the SLOG 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 SLOG is only used for sync writes, so may not provide any performance improvement.<br />
<br />
==== L2ARC ====<br />
<br />
To add L2ARC:<br />
<br />
# zpool add <pool> cache <device-id><br />
<br />
Because every block cached in L2ARC uses a small amount of memory, it is generally only useful in workloads where the amount of hot data is *bigger* than the maximum amount of memory that can fit in the computer, but small enough to fit into L2ARC. It is also cleared at reboot and is only a read cache, so redundancy is unnecessary. Un-intuitively, L2ARC can actually harm performance since it takes memory away from ARC.<br />
<br />
=== ZVOLs ===<br />
<br />
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).<br />
<br />
==== RAIDZ and Advanced Format physical disks ====<br />
<br />
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.<br />
<br />
See [https://github.com/zfsonlinux/zfs/issues/1807 ZFS on Linux issue #1807 for details]<br />
<br />
=== I/O Scheduler ===<br />
<br />
When the pool is imported, for whole disk vdevs, the block device I/O scheduler is set to {{ic|zfs_vdev_scheduler}} [https://github.com/zfsonlinux/zfs/wiki/ZFS-on-Linux-Module-Parameters#zfs_vdev_scheduler]. The most common schedulers are: ''noop'', ''cfq'', ''bfq'', and ''deadline''.<br />
<br />
In some cases, the scheduler is not changeable using this method. Known schedulers that cannot be changed are: ''scsi_mq'' and ''none''. In these cases, the scheduler is unchanged and an error message can be reported to logs. [[Improving_performance#Changing_I/O_scheduler|Manually setting]] one of the common schedulers used by {{ic|zfs_vdev_scheduler}} can result in more consistent performance.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Creating a zpool fails ===<br />
<br />
If the following error occurs then it can be fixed.<br />
<br />
# the kernel failed to rescan the partition table: 16<br />
# cannot label 'sdc': try using parted(8) and then provide a specific slice: -1<br />
<br />
One reason this can occur is because [https://github.com/zfsonlinux/zfs/issues/2582 ZFS expects pool creation to take less than 1 second]. 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.<br />
<br />
# parted /dev/sda rm 1<br />
# parted /dev/sda rm 1<br />
# dd if=/dev/zero of=/dev/sdb bs=512 count=1<br />
# zpool labelclear /dev/sda<br />
<br />
A brute force creation can be attempted over and over again, and with some luck the ZPool creation will take less than 1 second.<br />
Once 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.<br />
<br />
# dd if=/dev/sda of=/dev/null<br />
<br />
This can be done with multiple drives by saving the above command for each drive to a file on separate lines and running <br />
<br />
# cat $FILE | parallel<br />
<br />
Then run ZPool creation at the same time.<br />
<br />
=== ZFS is using too much RAM ===<br />
<br />
By default, ZFS caches file operations ([[wikipedia:Adaptive replacement cache|ARC]]) using up to two-thirds of available system memory on the host. To adjust the ARC size, add the following to the [[Kernel parameters]] list:<br />
<br />
zfs.zfs_arc_max=536870912 # (for 512MB)<br />
<br />
For a more detailed description, as well as other configuration options, see [http://wiki.gentoo.org/wiki/ZFS#ARC gentoo-wiki:zfs#arc].<br />
<br />
=== Does not contain an EFI label ===<br />
<br />
The following error will occur when attempting to create a zfs filesystem,<br />
<br />
/dev/disk/by-id/<id> does not contain an EFI label but it may contain partition<br />
<br />
The way to overcome this is to use {{ic|-f}} with the zfs create command.<br />
<br />
=== No hostid found ===<br />
<br />
An error that occurs at boot with the following lines appearing before initscript output:<br />
<br />
ZFS: No hostid found on kernel command line or /etc/hostid.<br />
<br />
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]] in the boot loader. For example, adding {{ic|1=spl.spl_hostid=0x00bab10c}}.<br />
<br />
The other solution is to make sure that there is a hostid in {{ic|/etc/hostid}}, and then [[regenerate the initramfs]] image. Which will copy the hostid into the initramfs image.<br />
<br />
=== Pool cannot be found while booting from SAS/SCSI devices ===<br />
<br />
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.<br />
<br />
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 {{ic|/etc/modprobe.d/zfs.conf}}:<br />
<br />
{{hc|1=/etc/modprobe.d/zfs.conf|2=<br />
options scsi_mod scan=sync<br />
}}<br />
<br />
Afterwards, [[regenerate the initramfs]].<br />
<br />
This works because the zfs hook will copy the file at {{ic|/etc/modprobe.d/zfs.conf}} into the initcpio which will then be used at build time.<br />
<br />
=== On boot the zfs pool does not mount stating: "pool may be in use from other system" ===<br />
<br />
==== Unexported pool ====<br />
<br />
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]].<br />
<br />
Once inside the chroot environment, load the ZFS module and force import the zpool,<br />
<br />
# zpool import -a -f<br />
<br />
now export the pool:<br />
<br />
# zpool export <pool><br />
<br />
To see the available pools, use,<br />
<br />
# zpool status<br />
<br />
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 [http://osdir.com/ml/zfs-discuss/2011-06/msg00227.html Re: Howto zpool import/export automatically? - msg#00227]{{Dead link|2020|04|03|status=404}}.<br />
<br />
If ZFS complains about "pool may be in use" after every reboot, properly export pool as described above, and then [[regenerate the initramfs]] in normally booted system.<br />
<br />
==== Incorrect hostid ====<br />
<br />
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.<br />
<br />
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.<br />
<br />
Boot using zfs_force and write down the hostid. This one is just an example.<br />
<br />
{{hc|$ hostid|<br />
0a0af0f8<br />
}}<br />
<br />
This number have to be added to the [[kernel parameters]] as {{ic|1=spl.spl_hostid=0x0a0af0f8}}. Another solution is writing the hostid inside the initram image, see the [[Installing Arch Linux on ZFS#After the first boot|installation guide]]{{Broken section link}} explanation about this.<br />
<br />
Users can always ignore the check adding {{ic|1=zfs_force=1}} in the [[kernel parameters]], but it is not advisable as a permanent solution.<br />
<br />
=== Devices have different sector alignment ===<br />
<br />
Once a drive has become faulted it should be replaced A.S.A.P. with an identical drive.<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -f<br />
<br />
but in this instance, the following error is produced:<br />
<br />
cannot replace ata-ST3000DM001-9YN166_S1F0KDGY with ata-ST3000DM001-1CH166_W1F478BD: devices have different sector alignment<br />
<br />
ZFS uses the ashift option to adjust for physical block size. When replacing the faulted disk, ZFS is attempting to use {{ic|<nowiki>ashift=12</nowiki>}}, but the faulted disk is using a different ashift (probably {{ic|<nowiki>ashift=9</nowiki>}}) and this causes the resulting error. <br />
<br />
For Advanced Format Disks with 4KB blocksize, an ashift of 12 is recommended for best performance. See [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?] and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].<br />
<br />
Use zdb to find the ashift of the zpool: {{ic|zdb | grep ashift}}, then use the {{ic|-o}} argument to set the ashift of the replacement drive:<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -o ashift=9 -f<br />
<br />
Check the zpool status for confirmation:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: DEGRADED<br />
status: One or more devices is currently being resilvered. The pool will<br />
continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
scan: resilver in progress since Mon Jun 16 11:16:28 2014<br />
10.3G scanned out of 5.90T at 81.7M/s, 20h59m to go<br />
2.57G resilvered, 0.17% done<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata DEGRADED 0 0 0<br />
raidz1-0 DEGRADED 0 0 0<br />
replacing-0 OFFLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY OFFLINE 0 0 0<br />
ata-ST3000DM001-1CH166_W1F478BD ONLINE 0 0 0 (resilvering)<br />
ata-ST3000DM001-9YN166_S1F0JKRR ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
=== Pool resilvering stuck/restarting/slow? ===<br />
<br />
According to the ZFSonLinux github it 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<br />
<br />
=== Fix slow boot caused by failed import of unavailable pools in the initramfs zpool.cache ===<br />
<br />
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.<br />
<br />
If you notice ZFS trying to import unavailable pools at boot, first run:<br />
<br />
$ zdb -C<br />
<br />
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:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache zroot<br />
<br />
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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Embed the archzfs packages into an archiso ===<br />
<br />
Follow the [[Archiso]] steps for creating a fully functional Arch Linux live CD/DVD/USB image.<br />
<br />
Enable the [[Unofficial user repositories#archzfs|archzfs]] repository:<br />
<br />
{{hc|~/archlive/pacman.conf|<nowiki><br />
...<br />
[archzfs]<br />
Server = http://archzfs.com/$repo/x86_64<br />
SigLevel = Optional TrustAll<br />
</nowiki>}}<br />
<br />
Add the {{ic|archzfs-linux}} group to the list of packages to be installed (the {{ic|archzfs}} repository provides packages for the x86_64 architecture only).<br />
<br />
{{hc|~/archlive/packages.x86_64|<br />
...<br />
archzfs-linux<br />
}}<br />
<br />
Complete [[Archiso#Build_the_ISO|Build the ISO]] to finally build the iso.<br />
<br />
{{Note|If you later have problems running modprobe zfs, you should include the linux-headers in the packages.x86_64. }}<br />
<br />
=== Automatic snapshots ===<br />
<br />
==== ZFS Automatic Snapshot Service for Linux ====<br />
<br />
The {{AUR|zfs-auto-snapshot-git}} package from [[AUR]] 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 {{ic|--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).<br />
<br />
To prevent a dataset from being snapshotted at all, set {{ic|1=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 {{ic|1=com.sun:auto-snapshot:monthly=false}}.<br />
<br />
{{Note|zfs-auto-snapshot-git will not create snapshots during [[#Scrubbing|scrubbing]]. It is possible to override this by editing provided systemd unit ([[Systemd#Editing provided units]]) and removing `--skip-scrub` from `ExecStart` line. Consequences not known, someone please edit.}}<br />
<br />
Once the package has been installed, [[systemd/Timers|enable and start the selected timers]] ({{ic|<nowiki>zfs-auto-snapshot-{frequent,daily,weekly,monthly}.timer</nowiki>}}).<br />
<br />
==== ZFS Snapshot Manager ====<br />
<br />
The {{AUR|zfs-snap-manager}} package from [[AUR]] provides a python service that takes daily snapshots from a configurable set of ZFS datasets and cleans them out in a [[wikipedia:Backup rotation scheme#Grandfather-father-son|"Grandfather-father-son"]] scheme. It can be configured to e.g. keep 7 daily, 5 weekly, 3 monthly and 2 yearly snapshots. <br />
<br />
The package also supports configurable replication to other machines running ZFS by means of {{ic|zfs send}} and {{ic|zfs receive}}. If the destination machine runs this package as well, it could be configured to keep these replicated snapshots for a longer time. This allows a setup where a source machine has only a few daily snapshots locally stored, while on a remote storage server a much longer retention is available.<br />
<br />
==== zrepl ====<br />
<br />
The {{AUR|zrepl}} package from the [[AUR]] provides a ZFS automatic replication service, which could also be used as a snapshotting service much like {{Pkg|snapper}}.<br />
<br />
For details on how to configure the zrepl daemon, see the zrepl [https://zrepl.github.io/ documentation]. The configuration file should be located at {{ic|/etc/zrepl/zrepl.yml}}. Then, run {{ic|zrepl configcheck}} to make sure that the syntax of the config file is correct. Finally, enable {{ic|zrepl.service}}.<br />
<br />
=== Creating a share ===<br />
<br />
ZFS has support for creating shares by SMB or [[NFS]].<br />
<br />
==== NFS ====<br />
<br />
Make sure [[NFS]] has been installed/configured, note there is no need to edit the {{ic|/etc/exports}} file. For sharing over NFS the services {{ic|nfs-server.service}} and {{ic|zfs-share.service}} should be [[start|started]].<br />
<br />
To make a pool available on the network:<br />
<br />
# zfs set sharenfs=on <nameofzpool><br />
<br />
To make a dataset available on the network:<br />
<br />
# zfs set sharenfs=on <nameofzpool>/<nameofdataset><br />
<br />
To enable read/write access for a specific ip-range(s):<br />
<br />
# zfs set sharenfs="rw=@192.168.1.100/24,rw=@10.0.0.0/24" <nameofzpool>/<nameofdataset><br />
<br />
To check if the dataset is exported successful:<br />
<br />
{{hc|# showmount -e `hostname`|<br />
Export list for hostname:<br />
/path/of/dataset 192.168.1.100/24<br />
}}<br />
<br />
To view the current loaded exports state in more detail, use:<br />
<br />
{{hc|# exportfs -v|2=<br />
/path/of/dataset<br />
192.168.1.100/24(sync,wdelay,hide,no_subtree_check,mountpoint,sec=sys,rw,secure,no_root_squash,no_all_squash)<br />
}}<br />
<br />
==== SMB ====<br />
<br />
When sharing smb shares configuring usershares in your smb.conf will allow ZFS to setup and create the shares.<br />
<br />
{{bc|1=<br />
# [global]<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = no<br />
}}<br />
<br />
Create and set permissions on the user directory as root<br />
<br />
# mkdir /var/lib/samba/usershares<br />
# chmod +t /var/lib/samba/usershares<br />
<br />
=== Encryption in ZFS using dm-crypt ===<br />
<br />
The stable release version of ZFS on Linux used to not support encryption directly (now it's available, see [[#Native encryption]]), but zpools can be created on 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.<br />
<br />
dm-crypt, possibly via LUKS, creates devices in {{ic|/dev/mapper}} and their name is fixed. So you just need to change {{ic|zpool create}} commands to point to that names. The idea is configuring the system to create the {{ic|/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.<br />
<br />
For example, an encrypted zpool can be created using plain dm-crypt (without LUKS) with:<br />
<br />
# cryptsetup --hash=sha512 --cipher=twofish-xts-plain64 --offset=0 \<br />
--key-file=/dev/sdZ --key-size=512 open --type=plain /dev/sdX enc<br />
# zpool create zroot /dev/mapper/enc<br />
<br />
In the case of a root filesystem pool, the {{ic|mkinitcpio.conf}} HOOKS line will enable the keyboard for the password, create the devices, and load the pools. It will contain something like:<br />
<br />
HOOKS="... keyboard encrypt zfs ..."<br />
<br />
Since the {{ic|/dev/mapper/enc}} name is fixed no import errors will occur.<br />
<br />
Creating encrypted zpools works fine. But if you need encrypted directories, for example to protect your users' homes, ZFS loses some functionality.<br />
<br />
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]] on it.<br />
<br />
For example to have an encrypted home: (the two passwords, encryption and login, must be the same)<br />
<br />
# zfs create -o compression=off -o dedup=off -o mountpoint=/home/<username> <zpool>/<username><br />
# useradd -m <username><br />
# passwd <username><br />
# ecryptfs-migrate-home -u <username><br />
<log in user and complete the procedure with ecryptfs-unwrap-passphrase><br />
<br />
=== Emergency chroot repair with archzfs ===<br />
<br />
To get into the ZFS filesystem from live system for maintenance, there are two options:<br />
<br />
# Build custom archiso with ZFS as described in [[#Embed the archzfs packages into an archiso]].<br />
# Boot the latest official archiso and bring up the network. Then enable [[Unofficial_user_repositories#archzfs|archzfs]] repository inside the live system as usual, sync the pacman package database and install the ''archzfs-archiso-linux'' package.<br />
<br />
To start the recovery, load the ZFS kernel modules:<br />
<br />
# modprobe zfs<br />
<br />
Import the pool:<br />
<br />
# zpool import -a -R /mnt<br />
<br />
Mount the boot partitions (if any):<br />
<br />
# mount /dev/sda2 /mnt/boot<br />
# mount /dev/sda1 /mnt/boot/efi<br />
<br />
Chroot into the ZFS filesystem:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
Check the kernel version:<br />
<br />
# pacman -Qi linux<br />
# uname -r<br />
<br />
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:<br />
<br />
# 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)<br />
<br />
This will load the correct kernel modules for the kernel version installed in the chroot installation.<br />
<br />
[[Regenerate the initramfs]]. There should be no errors.<br />
<br />
=== Bind mount ===<br />
<br />
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.<br />
<br />
==== fstab ====<br />
<br />
See [http://www.freedesktop.org/software/systemd/man/systemd.mount.html systemd.mount] for more information on how systemd converts fstab into mount unit files with [http://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html systemd-fstab-generator].<br />
<br />
{{hc|/etc/fstab|<nowiki><br />
/mnt/zfspool /srv/nfs4/music none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0<br />
</nowiki>}}<br />
<br />
=== Monitoring / Mailing on Events ===<br />
<br />
See [https://ramsdenj.com/2016/08/29/arch-linux-on-zfs-part-3-followup.html ZED: The ZFS Event Daemon] for more information.<br />
<br />
An email forwarder, such as [[S-nail]] (installed as part of {{Pkg|base}}), is required to accomplish this. Test it to be sure it is working correctly.<br />
<br />
Uncomment the following in the configuration file:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|<nowiki><br />
ZED_EMAIL_ADDR="root"<br />
ZED_EMAIL_PROG="mailx"<br />
ZED_NOTIFY_VERBOSE=0<br />
ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"<br />
</nowiki>}}<br />
<br />
Update 'root' in {{ic|1=ZED_EMAIL_ADDR="root"}} to the email address you want to receive notifications at.<br />
<br />
If you are keeping your mailrc in your home directory, you can tell mail to get it from there by setting {{ic|MAILRC}}:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|2=<br />
export MAILRC=/home/<user>/.mailrc<br />
}}<br />
<br />
This works because ZED sources this file, so {{ic|mailx}} sees this environment variable.<br />
<br />
If you want to receive an email no matter the state of your pool, you will want to set {{ic|1=ZED_NOTIFY_VERBOSE=1}}. You will need to do this temporary to test.<br />
<br />
[[Start]] and [[enable]] {{ic|zfs-zed.service}}.<br />
<br />
With {{ic|1=ZED_NOTIFY_VERBOSE=1}}, you can test by running a scrub as root: {{ic|1=zpool scrub <pool-name>}}.<br />
<br />
=== Wrap shell commands in pre & post snapshots ===<br />
<br />
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.<br />
<br />
E.g.:<br />
<br />
# zfs snapshot -r zroot@pre<br />
# pacman -Syu<br />
# zfs snapshot -r zroot@post<br />
# zfs diff zroot@pre zroot@post <br />
# zfs rollback zroot@pre<br />
<br />
A utility that automates the creation of pre and post snapshots around a shell command is [https://gist.github.com/erikw/eeec35be33e847c211acd886ffb145d5 znp].<br />
<br />
E.g.:<br />
<br />
# znp pacman -Syu<br />
# znp find / -name "something*" -delete<br />
<br />
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.<br />
<br />
=== Remote unlocking of ZFS encrypted root ===<br />
<br />
As of [https://github.com/archzfs/archzfs/pull/261 PR #261], {{ic|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#Remote unlocking (hooks: netconf, dropbear, tinyssh, ppp)]].<br />
<br />
#Install {{Pkg|mkinitcpio-netconf}} to provide hooks for setting up early user space networking.<br />
#Choose an SSH server to use in early user space. The options are {{Pkg|mkinitcpio-tinyssh}} or {{Pkg|mkinitcpio-dropbear}}, and are mutually exclusive.<br />
##If using {{Pkg|mkinitcpio-tinyssh}}, it is also recommended to install {{Pkg|tinyssh-convert}} or {{AUR|tinyssh-convert-git}}. 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.<br />
#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 {{ic|/etc/tinyssh/root_key}} or {{ic|/etc/dropbear/root_key}}. When generating the initcpio image, this file will be added to {{ic|authorized_keys}} for the root user and is only valid in the initrd environment.<br />
#Add the {{ic|1=ip=}} [[kernel parameter]] to your boot loader configuration. The {{ic|ip}} string is [https://www.kernel.org/doc/html/latest/admin-guide/nfs/nfsroot.html highly configurable]. A simple DHCP example is shown below.{{bc|1=ip=:::::eth0:dhcp}}<br />
#Edit {{ic|/etc/mkinitcpio.conf}} to include the {{ic|netconf}}, {{ic|dropbear}} or {{ic|tinyssh}}, and {{ic|zfsencryptssh}} hooks before the {{ic|zfs}} hook:{{bc|1=HOOKS=(... netconf <tinyssh>{{!}}<dropbear> zfsencryptssh zfs ...)}}<br />
#[[Regenerate the initramfs]].<br />
#Reboot and try it out!<br />
<br />
====Changing the SSH server port====<br />
<br />
By default, {{Pkg|mkinitcpio-tinyssh}} and {{Pkg|mkinitcpio-dropbear}} listen on port {{ic|22}}. You may wish to change this.<br />
<br />
For '''TinySSH''', copy {{ic|/usr/lib/initcpio/hooks/tinyssh}} to {{ic|/etc/initcpio/hooks/tinyssh}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/bin/tcpserver -HRDl0 0.0.0.0 <new_port> /usr/sbin/tinysshd -v /etc/tinyssh/sshkeydir &<br />
}}<br />
<br />
For '''Dropbear''', copy {{ic|/usr/lib/initcpio/hooks/dropbear}} to {{ic|/etc/initcpio/hooks/dropbear}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/sbin/dropbear -E -s -j -k -p <new_port><br />
}}<br />
<br />
[[Regenerate the initramfs]].<br />
<br />
==== Unlocking from a Windows machine using PuTTY/Plink ====<br />
<br />
First, we need to use {{ic|puttygen.exe}} to import and convert the OpenSSH key generated earlier into PuTTY's ''.ppk'' private key format. Let us call it {{ic|zfs_unlock.ppk}} for this example.<br />
<br />
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 {{ic|plink.exe}} with the following parameters:<br />
<br />
plink.exe -ssh -l root -i c:\path\to\zfs_unlock.ppk <hostname><br />
<br />
The plink command can be put into a batch script for ease of use.<br />
<br />
== See also ==<br />
<br />
* [https://pthree.org/2012/12/04/zfs-administration-part-i-vdevs/ Aaron Toponce's 17-part blog on ZFS]<br />
* [http://zfsonlinux.org/ ZFS on Linux]<br />
* [https://github.com/zfsonlinux/zfs/wiki/faq ZFS on Linux FAQ]<br />
* [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs.html FreeBSD Handbook -- The Z File System]<br />
* [https://docs.oracle.com/cd/E19253-01/819-5461/index.html Oracle Solaris ZFS Administration Guide]<br />
* [http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide Solaris Internals -- ZFS Troubleshooting Guide]{{Dead link|2020|04|03|status=domain name not resolved}}<br />
* [http://royal.pingdom.com/2013/06/04/zfs-backup/ How Pingdom uses ZFS to back up 5TB of MySQL data every day]<br />
* [https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bhow-to%5D-add-zfs-to-the-linux-kernel-4175514510/ Tutorial on adding the modules to a custom kernel]<br />
* [https://github.com/danboid/creating-ZFS-disks-under-Linux How to create cross platform ZFS disks under Linux]<br />
* [https://blog.heckel.xyz/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/ How-To: Using ZFS Encryption at Rest in OpenZFS (ZFS on Linux, ZFS on FreeBSD, …)]</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=ZFS&diff=622389ZFS2020-06-27T18:39:22Z<p>Xuanruiqi: Add zrepl, which could be used as a snapshotting service</p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Oracle]]<br />
[[ja:ZFS]]<br />
[[pt:ZFS]]<br />
[[zh-hans:ZFS]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related|ZFS/Virtual disks}}<br />
{{Related|Installing Arch Linux on ZFS}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:ZFS|ZFS]] is an advanced filesystem created by [[Wikipedia:Sun Microsystems|Sun Microsystems]] (now owned by Oracle) and released for OpenSolaris in November 2005. <br />
<br />
Features of ZFS include: pooled storage (integrated volume management – zpool), [[Wikipedia:Copy-on-write|Copy-on-write]], [[Wikipedia:Snapshot (computer storage)|snapshots]], data integrity verification and automatic repair (scrubbing), [[Wikipedia:RAID-Z|RAID-Z]], a maximum [[Wikipedia:Exabyte|16 Exabyte]] file size, and a maximum 256 Quadrillion [[Wikipedia:Zettabyte|Zettabytes]] storage with no limit on number of filesystems (datasets) or files[http://docs.oracle.com/cd/E19253-01/819-5461/zfsover-2/index.html]. ZFS is licensed under the [[Wikipedia:CDDL|Common Development and Distribution License]] (CDDL).<br />
<br />
Described as [http://web.archive.org/web/20060428092023/http://www.sun.com/2004-0914/feature/ "The last word in filesystems"] ZFS is stable, fast, secure, and future-proof. Being licensed under the CDDL, and thus incompatible with GPL, it is not possible for ZFS to be distributed along with 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 [http://zfsonlinux.org/ zfsonlinux.org] (ZOL).<br />
<br />
ZOL is a project funded by the [https://www.llnl.gov/ Lawrence Livermore National Laboratory] to develop a native Linux kernel module for its massive storage requirements and super computers.<br />
<br />
{{Note|<br />
Due to potential legal incompatibilities between CDDL license of ZFS code and GPL of the Linux kernel ([https://sfconservancy.org/blog/2016/feb/25/zfs-and-linux/ ],[[wikipedia:Common_Development_and_Distribution_License#GPL_compatibility|CDDL-GPL]],[[wikipedia:ZFS#Linux|ZFS in Linux]]) - ZFS development is not supported by the kernel.<br />
<br />
As a result:<br />
<br />
* ZFSonLinux project must keep up with Linux kernel versions. After making stable ZFSonLinux release - Arch ZFS maintainers release them.<br />
* This situation sometimes locks down the normal rolling update process by unsatisfied dependencies because the new kernel version, proposed by update, is unsupported by ZFSonLinux.<br />
}}<br />
<br />
== Installation ==<br />
<br />
=== General ===<br />
<br />
{{Warning|Unless you use the [[dkms]] versions of these packages, the ZFS and SPL kernel modules are tied to a specific kernel version. It would not be possible to apply any kernel updates until updated packages are uploaded to AUR or the [[Unofficial user repositories#archzfs|archzfs]] repository.}}<br />
<br />
{{Tip| You can [[downgrade]] your linux version to the one from [[Unofficial user repositories#archzfs|archzfs]] repo if your current kernel is newer.}}<br />
<br />
Install from the [[Unofficial user repositories#archzfs|archzfs]] repository or alternatively the [[Arch User Repository]]:<br />
<br />
* {{AUR|zfs-linux}} for [http://zfsonlinux.org/ stable] releases.<br />
* {{AUR|zfs-linux-git}} for [https://github.com/zfsonlinux/zfs/releases development] releases (with support of newer kernel versions).<br />
* {{AUR|zfs-linux-lts}} for stable releases for LTS kernels.<br />
* {{AUR|zfs-linux-lts-git}} for development releases for LTS kernels.<br />
* {{AUR|zfs-linux-hardened}} for stable releases for hardened kernels.<br />
* {{AUR|zfs-linux-hardened-git}} for development releases for hardened kernels.<br />
* {{AUR|zfs-linux-zen}} for stable releases for zen kernels.<br />
* {{AUR|zfs-linux-zen-git}} for development releases for zen kernels.<br />
* {{AUR|zfs-dkms}} for versions with dynamic kernel module support.<br />
* {{AUR|zfs-dkms-git}} for development releases for versions with dynamic kernel module support.<br />
<br />
These branches have (according to them) dependencies on the {{ic|zfs-utils}}, {{ic|spl}}, {{ic|spl-utils}} packages. SPL (Solaris Porting Layer) is a Linux Kernel module implementing Solaris APIs for ZFS compatibility.<br />
<br />
Test the installation by issuing {{ic|zpool status}} on the command line. If an "insmod" error is produced, try {{ic|depmod -a}}.<br />
<br />
=== Root on ZFS ===<br />
<br />
See [[Install_Arch_Linux_on_ZFS#Installation|Installation]].<br />
<br />
=== DKMS ===<br />
<br />
Users can make use of DKMS [[Dynamic Kernel Module Support]] to rebuild the ZFS modules automatically with every kernel upgrade. <br />
<br />
Install {{AUR|zfs-dkms}} or {{AUR|zfs-dkms-git}} and apply the post-install instructions given by these packages.<br />
<br />
{{Tip|Add an {{ic|IgnorePkg}} entry to [[pacman.conf]] to prevent these packages from upgrading when doing a regular update.}}<br />
<br />
== Experimenting with ZFS ==<br />
<br />
Users wishing to experiment with ZFS on ''virtual block devices'' (known in ZFS terms as VDEVs) which can be simple files like {{ic|~/zfs0.img}} {{ic|~/zfs1.img}} {{ic|~/zfs2.img}} etc. with no possibility of real data loss are encouraged to see the [[Experimenting with ZFS]] article. Common tasks like building a RAIDZ array, purposefully corrupting data and recovering it, snapshotting datasets, etc. are covered.<br />
<br />
== Configuration ==<br />
<br />
ZFS is considered a "zero administration" filesystem by its creators; therefore, configuring ZFS is very straight forward. Configuration is done primarily with two commands: {{ic|zfs}} and {{ic|zpool}}.<br />
<br />
=== Automatic Start ===<br />
<br />
Currently, by default, the kernel module is not loaded at boot (see more details in https://github.com/zfsonlinux/zfs/issues/6083). To automatically load {{Ic|zfs}} module on boot, see [[Kernel module#Automatic module loading with systemd]].<br />
<br />
For ZFS to live by its "zero administration" namesake, {{Ic|zfs-import-cache.service}} must be enabled to import the pools and {{Ic|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 {{ic|/etc/fstab}}. {{Ic|zfs-import-cache.service}} imports the zfs pools reading the file {{ic|/etc/zfs/zpool.cache}}.<br />
<br />
For each [[#Importing a pool created by id|imported pool]] you want automatically imported by {{Ic|zfs-import-cache.service}} execute:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache <pool><br />
<br />
{{Note|Beginning with ZOL version 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 [https://github.com/archzfs/archzfs/issues/72 https://github.com/archzfs/archzfs/issues/72] for more information.}}<br />
<br />
Enable the relevant service and target so the pools are automatically imported at boot time:<br />
<br />
# systemctl enable zfs-import-cache<br />
# systemctl enable zfs-import.target<br />
<br />
To mount the ZFS filesystems, you have 2 choices:<br />
* Enable the [[#Using zfs-mount.service|zfs-mount.service]]<br />
* Using [[#Using zfs-mount-generator|zfs-mount-generator]]<br />
<br />
==== Using zfs-mount.service ====<br />
<br />
In order to mount ZFS filesystems automatically on boot you need to enable the following services and targets:<br />
<br />
# systemctl enable zfs-mount<br />
# systemctl enable zfs.target<br />
<br />
==== Using zfs-mount-generator ====<br />
<br />
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 {{Ic|zfs-mount.service}}. To do that, you need to:<br />
<br />
# Create the {{Ic|/etc/zfs/zfs-list.cache}} directory.<br />
# Enable the ZFS Event Daemon(ZED) script (called a ZEDLET) required to create a list of mountable ZFS filesystems. {{bc|# ln -s /usr/lib/zfs/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d}}<br />
# Enable and start the ZFS Event Daemon. This service is responsible for running the script in the previous step. {{bc|# systemctl enable zfs-zed.service<br># systemctl enable zfs.target<br># systemctl start zfs-zed.service}}<br />
# You need to create an empty file named after your pool in {{Ic|/etc/zfs/zfs-list.cache}}. The ZEDLET will only update the list of filesystems if the file for the pool already exists. {{bc|# touch /etc/zfs/zfs-list.cache/<pool-name>}}<br />
# Check the contents of {{Ic|/etc/zfs/zfs-list.cache/<pool-name>}}. If it is empty, make sure that the {{Ic|zfs-zed.service}} is running and just change the canmount property of any of your ZFS filesystem by running: {{bc|1=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 {{Ic|/etc/zfs/zfs-list.cache}}. If the file in {{Ic|/etc/zfs/zfs-list.cache}} is updated, you can set the {{Ic|canmount}} property of the filesystem back by running: {{bc|1=zfs set canmount=on zroot/fs1}}<br />
You need to add a file in {{Ic|/etc/zfs/zfs-list.cache}} for each ZFS pool in your system. Make sure the pools are imported by enabling {{Ic|zfs-import-cache.service}} and {{Ic|zfs-import.target}} as [[#Automatic Start|explained above]].<br />
<br />
== Storage pools ==<br />
<br />
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 [https://www.reddit.com/r/zfs/comments/667na0/zfs_on_raw_or_gpt/dgh0l9t/ automatically create a GPT partition table] 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.<br />
<br />
{{Note|If some or all device have been used in a software RAID set it is paramount to [[mdadm#Prepare the devices|erase any old RAID configuration information]].}}<br />
<br />
{{Warning|For [[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 [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?], [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks 1.15 How does ZFS on Linux handle Advanced Format disks?], and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].}}<br />
<br />
=== Identify disks ===<br />
<br />
[https://github.com/zfsonlinux/zfs/wiki/faq#selecting-dev-names-when-creating-a-pool ZFS on Linux] recommends using device IDs when creating ZFS storage pools of less than 10 devices. Use [[Persistent block device naming#by-id and by-path]] to identify the list of drives to be used for ZFS pool. <br />
<br />
The disk IDs should look similar to the following:<br />
<br />
{{hc|$ ls -lh /dev/disk/by-id/|<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JKRR -> ../../sdc<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0JTM1 -> ../../sde<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KBP8 -> ../../sdd<br />
lrwxrwxrwx 1 root root 9 Aug 12 16:26 ata-ST3000DM001-9YN166_S1F0KDGY -> ../../sdb}}<br />
<br />
{{Warning|If you create zpools using device names (e.g. {{ic|/dev/sda}},{{ic|/dev/sdb}},...) ZFS might not be able to detect zpools intermittently on boot.}}<br />
<br />
==== Using GPT labels ====<br />
<br />
{{Style|Missing references to [[Persistent block device naming]], it is useless to explain the differences (or even what they are) here.}}<br />
<br />
Disk labels and UUID can also be used for ZFS mounts by using [[GUID Partition Table|GPT]] partitions. ZFS drives have labels but Linux is unable to read them at boot. Unlike [[Master Boot Record|MBR]] 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.<br />
<br />
Use [[GUID Partition Table|gdisk]] 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]] allowing large data pools to be labeled in an organized fashion.<br />
<br />
Drives partitioned with GPT have labels and UUID that look like this. <br />
<br />
{{hc|$ ls -l /dev/disk/by-partlabel|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata1 -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 zfsdata2 -> ../../sdc1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 zfsl2arc -> ../../sda1}}<br />
<br />
{{hc|$ ls -l /dev/disk/by-partuuid|<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 148c462c-7819-431a-9aba-5bf42bb5a34e -> ../../sdd1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:59 4f95da30-b2fb-412b-9090-fc349993df56 -> ../../sda1<br />
lrwxrwxrwx 1 root root 10 Apr 30 01:44 e5ccef58-5adf-4094-81a7-3bac846a885f -> ../../sdc1}}<br />
<br />
{{Tip|To minimize typing and copy/paste errors, set a local variable with the target PARTUUID: {{ic|<nowiki>$ UUID=$(lsblk --noheadings --output PARTUUID /dev/sd</nowiki>''XY''<nowiki>)</nowiki>}} }}<br />
<br />
=== Creating ZFS pools ===<br />
<br />
To create a ZFS pool:<br />
<br />
# zpool create -f -m <mount> <pool> [raidz(2|3)|mirror] <ids><br />
<br />
{{Tip|One may want to read [[#Advanced Format disks]] first as it may be recommend to set {{ic|ashift}} on pool creation.}}<br />
<br />
* '''create''': subcommand to create the pool.<br />
<br />
* '''-f''': Force creating the pool. This is to overcome the "EFI label error". See [[#Does not contain an EFI label]].<br />
<br />
* '''-m''': The mount point of the pool. If this is not specified, then the pool will be mounted to {{ic|/<pool>}}.<br />
<br />
* '''pool''': This is the name of the pool.<br />
<br />
* '''raidz(2|3)|mirror''': This is the type of virtual device that will be created from the pool of devices, raidz is a single disk of parity, raidz2 for 2 disks of parity and raidz3 for 3 disks of parity, similar to raid5 and raid6. 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.<br />
<br />
* '''ids''': The [[Persistent_block_device_naming#by-id_and_by-path|ID's]] of the drives or partitions that to include into the pool.<br />
<br />
Create pool with single raidz vdev:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
Create pool with two mirror vdevs:<br />
<br />
# zpool create -f -m /mnt/data bigdata \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
mirror \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== Advanced Format disks ====<br />
<br />
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, {{ic|<nowiki>-o ashift=12</nowiki>}} should always be specified during pool creation. See the [https://github.com/zfsonlinux/zfs/wiki/faq#advanced-format-disks ZFS on Linux FAQ] for more details.<br />
<br />
{{Tip|Use {{man|8|blockdev}} (part of {{Pkg|util-linux}}) to print the sector size reported by the device's ioctls: {{ic|blockdev --getpbsz /dev/sd''XY''}} as the root user.}}<br />
<br />
Create pool with ashift=12 and single raidz vdev:<br />
<br />
# zpool create -f -o ashift=12 -m /mnt/data bigdata \<br />
raidz \<br />
ata-ST3000DM001-9YN166_S1F0KDGY \<br />
ata-ST3000DM001-9YN166_S1F0JKRR \<br />
ata-ST3000DM001-9YN166_S1F0KBP8 \<br />
ata-ST3000DM001-9YN166_S1F0JTM1<br />
<br />
==== GRUB-compatible pool creation ====<br />
<br />
{{note|This section frequently goes out of date with updates to GRUB and ZFS. Consult the manual pages for the most up-to-date information.}}<br />
<br />
By default, ''zpool create'' enables all features on a pool. If {{ic|/boot}} resides on ZFS when using [[GRUB]] you must only enable features supported by GRUB otherwise GRUB will not be able to read the pool. GRUB 2.02 supports the read-write features {{ic|lz4_compress}}, {{ic|hole_birth}}, {{ic|embedded_data}}, {{ic|extensible_dataset}}, and {{ic|large_blocks}}; this is not suitable for all the features of ZFSonLinux 0.8.0, and must have unsupported features disabled. We can explicitly name features to enable with the {{ic|-d}} argument to {{ic|zpool create}}, which disables all features by default.<br />
<br />
You can create a pool with only the compatible features enabled:<br />
<br />
# zpool create -d -o feature@allocation_classes=enabled \<br />
-o feature@async_destroy=enabled \<br />
-o feature@bookmarks=enabled \<br />
-o feature@embedded_data=enabled \<br />
-o feature@empty_bpobj=enabled \<br />
-o feature@enabled_txg=enabled \<br />
-o feature@extensible_dataset=enabled \<br />
-o feature@filesystem_limits=enabled \<br />
-o feature@hole_birth=enabled \<br />
-o feature@large_blocks=enabled \<br />
-o feature@lz4_compress=enabled \<br />
-o feature@project_quota=enabled \<br />
-o feature@resilver_defer=enabled \<br />
-o feature@spacemap_histogram=enabled \<br />
-o feature@spacemap_v2=enabled \<br />
-o feature@userobj_accounting=enabled \<br />
-o feature@zpool_checkpoint=enabled \<br />
$POOL_NAME $VDEVS<br />
<br />
=== Verifying pool status ===<br />
<br />
If the command is successful, there will be no output. Using the [[mount]] command will show that the pool is mounted. Using {{ic|zpool status}} will show that the pool has been created:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: ONLINE<br />
scan: none requested<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata ONLINE 0 0 0<br />
-0 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JKRR-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8-part1 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1-part1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
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.<br />
<br />
=== Importing a pool created by id ===<br />
<br />
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.<br />
<br />
{{Warning|Do not run {{ic|zpool import ''pool''}}! This will import your pools using {{ic|/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, which harkens back to a time when PCs would not boot when a floppy disk was left in a machine.}}<br />
<br />
Adapt one of the following commands to import your pool so that pool imports retain the persistence they were created with:<br />
<br />
# zpool import -d /dev/disk/by-id bigdata<br />
# zpool import -d /dev/disk/by-partlabel bigdata<br />
# zpool import -d /dev/disk/by-partuuid bigdata<br />
<br />
{{Note|Use the {{ic|-l}} flag when importing a pool that contains [[#Native encryption|encrypted datasets keys]]:<br />
# zpool import -l -d /dev/disk/by-id bigdata<br />
}}<br />
<br />
Finally check the state of the pool:<br />
<br />
# zpool status -v bigdata<br />
<br />
=== Destroy a storage pool ===<br />
<br />
ZFS makes it easy to destroy a mounted storage pool, removing all metadata about the ZFS device.<br />
<br />
{{Warning|This command destroys '''any data''' containing in the pool and/or dataset.}}<br />
<br />
To destroy the pool:<br />
# zpool destroy <pool><br />
<br />
To destroy a dataset:<br />
# zfs destroy <pool>/<dataset><br />
<br />
And now when checking the status:<br />
<br />
{{hc|# zpool status|<br />
no pools available<br />
}}<br />
<br />
=== Exporting a storage pool ===<br />
<br />
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 {{ic|-f}} argument, but this is considered bad form.<br />
<br />
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 {{ic|zfs_force&#61;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"]]<br />
<br />
To export a pool:<br />
<br />
# zpool export <pool><br />
<br />
=== Extending an existing zpool ===<br />
<br />
A device (a partition or a disk) can be added to an existing zpool:<br />
<br />
# zpool add <pool> <device-id><br />
<br />
To import a pool which consists of multiple devices:<br />
<br />
# zpool import -d <device-id-1> -d <device-id-2> <pool><br />
<br />
or simply:<br />
<br />
# zpool import -d /dev/disk-by-id/ <pool><br />
<br />
=== Renaming a zpool ===<br />
<br />
Renaming a zpool that is already created is accomplished in 2 steps:<br />
<br />
# zpool export oldname<br />
# zpool import oldname newname<br />
<br />
=== Setting a different mount point ===<br />
<br />
The mount point for a given zpool can be moved at will with one command:<br />
# zfs set mountpoint=/foo/bar poolname<br />
<br />
== Creating datasets ==<br />
<br />
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:<br />
<br />
# zfs create <nameofzpool>/<nameofdataset><br />
<br />
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:<br />
<br />
# zfs set quota=20G <nameofzpool>/<nameofdataset>/<directory><br />
<br />
To see all the commands available in ZFS, see {{man|8|zfs|url=}} or {{man|8|zpool|url=}}.<br />
<br />
=== Native encryption ===<br />
<br />
ZFS offers the following supported encryption options: {{ic|aes-128-ccm}}, {{ic|aes-192-ccm}}, {{ic|aes-256-ccm}}, {{ic|aes-128-gcm}}, {{ic|aes-192-gcm}} and {{ic|aes-256-gcm}}. When encryption is set to {{ic|on}}, {{ic|aes-256-gcm}} will be used.<br />
<br />
The following keyformats are supported: {{ic|passphrase}}, {{ic|raw}}, {{ic|hex}}.<br />
<br />
One can also specify/increase the default iterations of PBKDF2 when using {{ic|passphrase}} with {{ic|-o pbkdf2iters <n>}}, although it may increase the decryption time.<br />
<br />
{{Note|<br />
* 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 {{AUR|zfs-linux-git}}, {{AUR|zfs-dkms-git}} 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.<br />
* The default encryption suite was changed from {{ic|aes-256-ccm}} to {{ic|aes-256-gcm}} in the 0.8.4 release.<br />
* To import a pool with keys, one needs to specify the {{ic|-l}} flag, without this flag encrypted datasets will be left unavailable until the keys are loaded. See [[#Importing a pool created by id]].}}<br />
<br />
To create a dataset including native encryption with a passphrase, use:<br />
<br />
# zfs create -o encryption=on -o keyformat=passphrase <nameofzpool>/<nameofdataset><br />
<br />
To use a key instead of using a passphrase:<br />
<br />
# dd if=/dev/random of=/path/to/key bs=1 count=32<br />
# zfs create -o encryption=on -o keyformat=raw -o keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
To verify the key location:<br />
# zfs get keylocation <nameofzpool>/<nameofdataset><br />
<br />
To change the key location:<br />
<br />
# zfs set keylocation=file:///path/to/key <nameofzpool>/<nameofdataset><br />
<br />
You can also manually load the keys by using one of the following commands:<br />
<br />
# zfs load-key <nameofzpool>/<nameofdataset> # load key for a specific dataset<br />
# zfs load-key -a # load all keys<br />
# zfs load-key -r zpool/dataset # load all keys in a dataset<br />
<br />
To mount the created encrypted dataset:<br />
<br />
# zfs mount <nameofzpool>/<nameofdataset><br />
<br />
==== Unlock at boot time ====<br />
It is possible to automatically unlock a pool dataset on boot time by using a [[systemd]] unit. For example create the following service to unlock any specific dataset: <br />
<br />
{{hc|/etc/systemd/system/zfs-load-key@.service|2=<br />
[Unit]<br />
Description=Load %I encryption keys<br />
Before=systemd-user-sessions.service<br />
After=zfs-import.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/bash -c 'until (systemd-ask-password "Encrypted ZFS password for %I" --no-tty <nowiki>|</nowiki> zfs load-key %I); do echo "Try again!"; done'<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] the service for each encrypted dataset, e.g. {{ic|systemctl enable zfs-load-key@pool0-dataset0}} as the root user. Note the use of {{ic|-}}, which is an escaped {{ic|/}} in systemd unit definitions. See {{ic|systemd-escape(1)}} for more info.<br />
{{Note|The {{ic|1=Before=systemd-user-sessions.service}} ensures that systemd-ask-password is invoked before the local IO devices are handed over to the [[desktop environment]].}}<br />
<br />
An alternative is to load all possible keys:<br />
<br />
{{hc|/etc/systemd/system/zfs-load-key.service|2=<br />
[Unit]<br />
Description=Load encryption keys<br />
DefaultDependencies=no<br />
After=zfs-import.target<br />
Before=zfs-mount.service<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/bash -c '/usr/bin/zfs load-key -a'<br />
<br />
[Install]<br />
WantedBy=zfs-mount.service<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-load-key.service}}.<br />
<br />
=== Swap volume ===<br />
<br />
{{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 https://github.com/zfsonlinux/zfs/issues/7734}}<br />
<br />
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 {{ic|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.<br />
<br />
Create a 8 GiB zfs volume:<br />
<br />
# zfs create -V 8G -b $(getconf PAGESIZE) \<br />
-o logbias=throughput -o sync=always\<br />
-o primarycache=metadata \<br />
-o com.sun:auto-snapshot=false <pool>/swap<br />
<br />
Prepare it as swap partition:<br />
<br />
# mkswap -f /dev/zvol/<pool>/swap<br />
# swapon /dev/zvol/<pool>/swap<br />
<br />
To make it permanent, edit {{ic|/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.<br />
<br />
Add a line to {{ic|/etc/fstab}}:<br />
<br />
/dev/zvol/<pool>/swap none swap discard 0 0<br />
<br />
=== Access Control Lists ===<br />
<br />
To use [[ACL]] on a dataset:<br />
<br />
# zfs set acltype=posixacl <nameofzpool>/<nameofdataset><br />
# zfs set xattr=sa <nameofzpool>/<nameofdataset><br />
<br />
Setting {{ic|xattr}} is recommended for performance reasons [https://github.com/zfsonlinux/zfs/issues/170#issuecomment-27348094].<br />
<br />
It may be preferable to enable ACL on the zpool as datasets will inherit the ACL parameters. Setting {{ic|1=aclinherit=passthrough}} may be wanted as the default mode is {{ic|restricted}} [https://docs.oracle.com/cd/E19120-01/open.solaris/817-2271/gbaaz/index.html]:<br />
<br />
# zfs set aclinherit=passthrough <nameofzpool><br />
# zfs set acltype=posixacl <nameofzpool><br />
# zfs set xattr=sa <nameofzpool><br />
<br />
=== Databases ===<br />
<br />
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.<br />
<br />
Most RDBMSes work in 8KiB-sized blocks by default. Although the block size is tunable for [[MySQL|MySQL/MariaDB]], [[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:<br />
<br />
# zfs set recordsize=8K <pool>/postgres<br />
<br />
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:<br />
<br />
# zfs set primarycache=metadata <pool>/postgres<br />
<br />
If your pool has no configured log devices, ZFS reserves space on the pool's data disks for its intent log (the ZIL). ZFS uses this 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. Setting this for non-database file systems, or for pools with configured log devices, can actually ''negatively'' impact the performance, so beware:<br />
<br />
# zfs set logbias=throughput <pool>/postgres<br />
<br />
These can also be done at file system creation time, for example:<br />
<br />
# zfs create -o recordsize=8K \<br />
-o primarycache=metadata \<br />
-o mountpoint=/var/lib/postgres \<br />
-o logbias=throughput \<br />
<pool>/postgres<br />
<br />
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.<br />
<br />
=== /tmp ===<br />
<br />
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 {{ic|fsync}} or {{ic|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.<br />
<br />
# zfs set sync=disabled <pool>/tmp<br />
<br />
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:<br />
<br />
# zfs set setuid=off <pool>/tmp<br />
# zfs set devices=off <pool>/tmp<br />
<br />
Combining all of these for a create command would be as follows:<br />
<br />
# zfs create -o setuid=off -o devices=off -o sync=disabled -o mountpoint=/tmp <pool>/tmp<br />
<br />
Please note, also, that if you want /tmp on ZFS, you will need to mask (disable) [[systemd]]'s automatic tmpfs-backed /tmp, else ZFS will be unable to mount your dataset at boot-time or import-time:<br />
<br />
# systemctl mask tmp.mount<br />
<br />
== Tuning ==<br />
<br />
=== General ===<br />
<br />
ZFS pools and datasets can be further adjusted using parameters.<br />
<br />
{{Note|All settable properties, with the exception of quotas and reservations, inherit their value from the parent dataset.}}<br />
<br />
To retrieve the current pool parameter status:<br />
<br />
# zfs get all <pool><br />
<br />
To retrieve the current dataset parameter status:<br />
<br />
# zfs get all <pool>/<dataset><br />
<br />
To disable access time (atime), which is enabled by default:<br />
<br />
# zfs set atime=off <pool><br />
<br />
To disable access time (atime) on a particular dataset:<br />
<br />
# zfs set atime=off <pool>/<dataset><br />
<br />
An alternative to turning off atime completely, {{ic|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 {{ic|1=atime=off}} and {{ic|1=atime=on}}. This property ''only'' takes effect if {{ic|atime}} is {{ic|on}}:<br />
<br />
# zfs set atime=on <pool><br />
# zfs set relatime=on <pool><br />
<br />
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 [http://open-zfs.org/wiki/Performance_tuning#Compression OpenZFS Wiki] for more details. <br />
<br />
To enable compression:<br />
<br />
# zfs set compression=on <pool><br />
<br />
To reset a property of a pool and/or dataset to it's default state, use {{ic|zfs inherit}}:<br />
<br />
# zfs inherit -rS atime <pool><br />
# zfs inherit -rS atime <pool>/<dataset><br />
<br />
{{Warning|Using the {{ic|-r}} flag will recursively reset all datasets of the zpool.}}<br />
<br />
=== Scrubbing ===<br />
<br />
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.<br />
<br />
To scrub a pool:<br />
<br />
# zpool scrub <pool><br />
<br />
To cancel a running scrub:<br />
<br />
# zpool scrub -s <pool><br />
<br />
==== How often should I do this? ====<br />
<br />
From the Oracle blog post [https://blogs.oracle.com/wonders-of-zfs-storage/disk-scrub-why-and-when-v2 Disk Scrub - Why and When?]:<br />
<br />
: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.<br />
<br />
:* 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.<br />
:* 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.<br />
:* 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.<br />
<br />
: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.<br />
<br />
In the [https://pthree.org/2012/12/11/zfs-administration-part-vi-scrub-and-resilver/ ZFS Administration Guide] by Aaron Toponce, he advises to scrub consumer disks once a week.<br />
<br />
==== Start with a service or timer ====<br />
Using a [[systemd]] timer/service it is possible to automatically scrub pools.<br />
<br />
To perform scrubbing monthly on a particular pool:<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.timer|2=<br />
[Unit]<br />
Description=Monthly zpool scrub on %i<br />
<br />
[Timer]<br />
OnCalendar=monthly<br />
AccuracySec=1h<br />
Persistent=true<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{hc|/etc/systemd/system/zfs-scrub@.service|2=<br />
[Unit]<br />
Description=zpool scrub on %i<br />
<br />
[Service]<br />
Nice=19<br />
IOSchedulingClass=idle<br />
KillSignal=SIGINT<br />
ExecStart=/usr/bin/zpool scrub %i<br />
}}<br />
<br />
[[Enable]]/[[start]] {{ic|zfs-scrub@''pool-to-scrub''.timer}} unit for monthly scrubbing the specified zpool.<br />
<br />
=== SSD Caching ===<br />
<br />
You can add SSD devices as a write intent log (external ZIL or SLOG) and also as a layer 2 adaptive replacement cache (L2ARC). The process to add them is very similar to adding a new VDEV.<br />
<br />
All of the below references to device-id are the IDs from {{ic|/dev/disk/by-id/*}}.<br />
<br />
==== SLOG ====<br />
<br />
To add a mirrored SLOG:<br />
<br />
# zpool add <pool> log mirror <device-id-1> <device-id-2><br />
<br />
Or to add a single device SLOG (unsafe):<br />
<br />
# zpool add <pool> log <device-id><br />
<br />
Because the SLOG 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 SLOG is only used for sync writes, so may not provide any performance improvement.<br />
<br />
==== L2ARC ====<br />
<br />
To add L2ARC:<br />
<br />
# zpool add <pool> cache <device-id><br />
<br />
Because every block cached in L2ARC uses a small amount of memory, it is generally only useful in workloads where the amount of hot data is *bigger* than the maximum amount of memory that can fit in the computer, but small enough to fit into L2ARC. It is also cleared at reboot and is only a read cache, so redundancy is unnecessary. Un-intuitively, L2ARC can actually harm performance since it takes memory away from ARC.<br />
<br />
=== ZVOLs ===<br />
<br />
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).<br />
<br />
==== RAIDZ and Advanced Format physical disks ====<br />
<br />
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.<br />
<br />
See [https://github.com/zfsonlinux/zfs/issues/1807 ZFS on Linux issue #1807 for details]<br />
<br />
=== I/O Scheduler ===<br />
<br />
When the pool is imported, for whole disk vdevs, the block device I/O scheduler is set to {{ic|zfs_vdev_scheduler}} [https://github.com/zfsonlinux/zfs/wiki/ZFS-on-Linux-Module-Parameters#zfs_vdev_scheduler]. The most common schedulers are: ''noop'', ''cfq'', ''bfq'', and ''deadline''.<br />
<br />
In some cases, the scheduler is not changeable using this method. Known schedulers that cannot be changed are: ''scsi_mq'' and ''none''. In these cases, the scheduler is unchanged and an error message can be reported to logs. [[Improving_performance#Changing_I/O_scheduler|Manually setting]] one of the common schedulers used by {{ic|zfs_vdev_scheduler}} can result in more consistent performance.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Creating a zpool fails ===<br />
<br />
If the following error occurs then it can be fixed.<br />
<br />
# the kernel failed to rescan the partition table: 16<br />
# cannot label 'sdc': try using parted(8) and then provide a specific slice: -1<br />
<br />
One reason this can occur is because [https://github.com/zfsonlinux/zfs/issues/2582 ZFS expects pool creation to take less than 1 second]. 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.<br />
<br />
# parted /dev/sda rm 1<br />
# parted /dev/sda rm 1<br />
# dd if=/dev/zero of=/dev/sdb bs=512 count=1<br />
# zpool labelclear /dev/sda<br />
<br />
A brute force creation can be attempted over and over again, and with some luck the ZPool creation will take less than 1 second.<br />
Once 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.<br />
<br />
# dd if=/dev/sda of=/dev/null<br />
<br />
This can be done with multiple drives by saving the above command for each drive to a file on separate lines and running <br />
<br />
# cat $FILE | parallel<br />
<br />
Then run ZPool creation at the same time.<br />
<br />
=== ZFS is using too much RAM ===<br />
<br />
By default, ZFS caches file operations ([[wikipedia:Adaptive replacement cache|ARC]]) using up to two-thirds of available system memory on the host. To adjust the ARC size, add the following to the [[Kernel parameters]] list:<br />
<br />
zfs.zfs_arc_max=536870912 # (for 512MB)<br />
<br />
For a more detailed description, as well as other configuration options, see [http://wiki.gentoo.org/wiki/ZFS#ARC gentoo-wiki:zfs#arc].<br />
<br />
=== Does not contain an EFI label ===<br />
<br />
The following error will occur when attempting to create a zfs filesystem,<br />
<br />
/dev/disk/by-id/<id> does not contain an EFI label but it may contain partition<br />
<br />
The way to overcome this is to use {{ic|-f}} with the zfs create command.<br />
<br />
=== No hostid found ===<br />
<br />
An error that occurs at boot with the following lines appearing before initscript output:<br />
<br />
ZFS: No hostid found on kernel command line or /etc/hostid.<br />
<br />
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]] in the boot loader. For example, adding {{ic|1=spl.spl_hostid=0x00bab10c}}.<br />
<br />
The other solution is to make sure that there is a hostid in {{ic|/etc/hostid}}, and then [[regenerate the initramfs]] image. Which will copy the hostid into the initramfs image.<br />
<br />
=== Pool cannot be found while booting from SAS/SCSI devices ===<br />
<br />
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.<br />
<br />
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 {{ic|/etc/modprobe.d/zfs.conf}}:<br />
<br />
{{hc|1=/etc/modprobe.d/zfs.conf|2=<br />
options scsi_mod scan=sync<br />
}}<br />
<br />
Afterwards, [[regenerate the initramfs]].<br />
<br />
This works because the zfs hook will copy the file at {{ic|/etc/modprobe.d/zfs.conf}} into the initcpio which will then be used at build time.<br />
<br />
=== On boot the zfs pool does not mount stating: "pool may be in use from other system" ===<br />
<br />
==== Unexported pool ====<br />
<br />
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]].<br />
<br />
Once inside the chroot environment, load the ZFS module and force import the zpool,<br />
<br />
# zpool import -a -f<br />
<br />
now export the pool:<br />
<br />
# zpool export <pool><br />
<br />
To see the available pools, use,<br />
<br />
# zpool status<br />
<br />
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 [http://osdir.com/ml/zfs-discuss/2011-06/msg00227.html Re: Howto zpool import/export automatically? - msg#00227]{{Dead link|2020|04|03|status=404}}.<br />
<br />
If ZFS complains about "pool may be in use" after every reboot, properly export pool as described above, and then [[regenerate the initramfs]] in normally booted system.<br />
<br />
==== Incorrect hostid ====<br />
<br />
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.<br />
<br />
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.<br />
<br />
Boot using zfs_force and write down the hostid. This one is just an example.<br />
<br />
{{hc|$ hostid|<br />
0a0af0f8<br />
}}<br />
<br />
This number have to be added to the [[kernel parameters]] as {{ic|1=spl.spl_hostid=0x0a0af0f8}}. Another solution is writing the hostid inside the initram image, see the [[Installing Arch Linux on ZFS#After the first boot|installation guide]]{{Broken section link}} explanation about this.<br />
<br />
Users can always ignore the check adding {{ic|1=zfs_force=1}} in the [[kernel parameters]], but it is not advisable as a permanent solution.<br />
<br />
=== Devices have different sector alignment ===<br />
<br />
Once a drive has become faulted it should be replaced A.S.A.P. with an identical drive.<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -f<br />
<br />
but in this instance, the following error is produced:<br />
<br />
cannot replace ata-ST3000DM001-9YN166_S1F0KDGY with ata-ST3000DM001-1CH166_W1F478BD: devices have different sector alignment<br />
<br />
ZFS uses the ashift option to adjust for physical block size. When replacing the faulted disk, ZFS is attempting to use {{ic|<nowiki>ashift=12</nowiki>}}, but the faulted disk is using a different ashift (probably {{ic|<nowiki>ashift=9</nowiki>}}) and this causes the resulting error. <br />
<br />
For Advanced Format Disks with 4KB blocksize, an ashift of 12 is recommended for best performance. See [https://github.com/zfsonlinux/zfs/wiki/faq#performance-considerations 1.10 What’s going on with performance?] and [http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks ZFS and Advanced Format disks].<br />
<br />
Use zdb to find the ashift of the zpool: {{ic|zdb | grep ashift}}, then use the {{ic|-o}} argument to set the ashift of the replacement drive:<br />
<br />
# zpool replace bigdata ata-ST3000DM001-9YN166_S1F0KDGY ata-ST3000DM001-1CH166_W1F478BD -o ashift=9 -f<br />
<br />
Check the zpool status for confirmation:<br />
<br />
{{hc|# zpool status -v|<br />
pool: bigdata<br />
state: DEGRADED<br />
status: One or more devices is currently being resilvered. The pool will<br />
continue to function, possibly in a degraded state.<br />
action: Wait for the resilver to complete.<br />
scan: resilver in progress since Mon Jun 16 11:16:28 2014<br />
10.3G scanned out of 5.90T at 81.7M/s, 20h59m to go<br />
2.57G resilvered, 0.17% done<br />
config:<br />
<br />
NAME STATE READ WRITE CKSUM<br />
bigdata DEGRADED 0 0 0<br />
raidz1-0 DEGRADED 0 0 0<br />
replacing-0 OFFLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KDGY OFFLINE 0 0 0<br />
ata-ST3000DM001-1CH166_W1F478BD ONLINE 0 0 0 (resilvering)<br />
ata-ST3000DM001-9YN166_S1F0JKRR ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0KBP8 ONLINE 0 0 0<br />
ata-ST3000DM001-9YN166_S1F0JTM1 ONLINE 0 0 0<br />
<br />
errors: No known data errors<br />
}}<br />
<br />
=== Pool resilvering stuck/restarting/slow? ===<br />
<br />
According to the ZFSonLinux github it 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<br />
<br />
=== Fix slow boot caused by failed import of unavailable pools in the initramfs zpool.cache ===<br />
<br />
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.<br />
<br />
If you notice ZFS trying to import unavailable pools at boot, first run:<br />
<br />
$ zdb -C<br />
<br />
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:<br />
<br />
# zpool set cachefile=/etc/zfs/zpool.cache zroot<br />
<br />
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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Embed the archzfs packages into an archiso ===<br />
<br />
Follow the [[Archiso]] steps for creating a fully functional Arch Linux live CD/DVD/USB image.<br />
<br />
Enable the [[Unofficial user repositories#archzfs|archzfs]] repository:<br />
<br />
{{hc|~/archlive/pacman.conf|<nowiki><br />
...<br />
[archzfs]<br />
Server = http://archzfs.com/$repo/x86_64<br />
SigLevel = Optional TrustAll<br />
</nowiki>}}<br />
<br />
Add the {{ic|archzfs-linux}} group to the list of packages to be installed (the {{ic|archzfs}} repository provides packages for the x86_64 architecture only).<br />
<br />
{{hc|~/archlive/packages.x86_64|<br />
...<br />
archzfs-linux<br />
}}<br />
<br />
Complete [[Archiso#Build_the_ISO|Build the ISO]] to finally build the iso.<br />
<br />
{{Note|If you later have problems running modprobe zfs, you should include the linux-headers in the packages.x86_64. }}<br />
<br />
=== Automatic snapshots ===<br />
<br />
==== ZFS Automatic Snapshot Service for Linux ====<br />
<br />
The {{AUR|zfs-auto-snapshot-git}} package from [[AUR]] 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 {{ic|--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).<br />
<br />
To prevent a dataset from being snapshotted at all, set {{ic|1=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 {{ic|1=com.sun:auto-snapshot:monthly=false}}.<br />
<br />
{{Note|zfs-auto-snapshot-git will not create snapshots during [[#Scrubbing|scrubbing]]. It is possible to override this by editing provided systemd unit ([[Systemd#Editing provided units]]) and removing `--skip-scrub` from `ExecStart` line. Consequences not known, someone please edit.}}<br />
<br />
Once the package has been installed, [[systemd/Timers|enable and start the selected timers]] ({{ic|<nowiki>zfs-auto-snapshot-{frequent,daily,weekly,monthly}.timer</nowiki>}}).<br />
<br />
==== ZFS Snapshot Manager ====<br />
<br />
The {{AUR|zfs-snap-manager}} package from [[AUR]] provides a python service that takes daily snapshots from a configurable set of ZFS datasets and cleans them out in a [[wikipedia:Backup rotation scheme#Grandfather-father-son|"Grandfather-father-son"]] scheme. It can be configured to e.g. keep 7 daily, 5 weekly, 3 monthly and 2 yearly snapshots. <br />
<br />
The package also supports configurable replication to other machines running ZFS by means of {{ic|zfs send}} and {{ic|zfs receive}}. If the destination machine runs this package as well, it could be configured to keep these replicated snapshots for a longer time. This allows a setup where a source machine has only a few daily snapshots locally stored, while on a remote storage server a much longer retention is available.<br />
<br />
==== zrepl ====<br />
<br />
The {{AUR|zrepl}} package from the [[AUR]] provides a ZFS automatic replication service, which could also be used as a snapshotting service much like {{Pkg|snapper}}.<br />
<br />
For details on how to configure the zrepl daemon, see the zrepl [https://zrepl.github.io/ documentation]. The configuration file should be located at {{ic|/etc/zrepl/zrepl.yml}}. Then, run {{ic|zrepl configcheck}} to make sure that the syntax of the config file is correct. Finally, enable {{ic|zfs.service}}.<br />
<br />
=== Creating a share ===<br />
<br />
ZFS has support for creating shares by SMB or [[NFS]].<br />
<br />
==== NFS ====<br />
<br />
Make sure [[NFS]] has been installed/configured, note there is no need to edit the {{ic|/etc/exports}} file. For sharing over NFS the services {{ic|nfs-server.service}} and {{ic|zfs-share.service}} should be [[start|started]].<br />
<br />
To make a pool available on the network:<br />
<br />
# zfs set sharenfs=on <nameofzpool><br />
<br />
To make a dataset available on the network:<br />
<br />
# zfs set sharenfs=on <nameofzpool>/<nameofdataset><br />
<br />
To enable read/write access for a specific ip-range(s):<br />
<br />
# zfs set sharenfs="rw=@192.168.1.100/24,rw=@10.0.0.0/24" <nameofzpool>/<nameofdataset><br />
<br />
To check if the dataset is exported successful:<br />
<br />
{{hc|# showmount -e `hostname`|<br />
Export list for hostname:<br />
/path/of/dataset 192.168.1.100/24<br />
}}<br />
<br />
To view the current loaded exports state in more detail, use:<br />
<br />
{{hc|# exportfs -v|2=<br />
/path/of/dataset<br />
192.168.1.100/24(sync,wdelay,hide,no_subtree_check,mountpoint,sec=sys,rw,secure,no_root_squash,no_all_squash)<br />
}}<br />
<br />
==== SMB ====<br />
<br />
When sharing smb shares configuring usershares in your smb.conf will allow ZFS to setup and create the shares.<br />
<br />
{{bc|1=<br />
# [global]<br />
# usershare path = /var/lib/samba/usershares<br />
# usershare max shares = 100<br />
# usershare allow guests = yes<br />
# usershare owner only = no<br />
}}<br />
<br />
Create and set permissions on the user directory as root<br />
<br />
# mkdir /var/lib/samba/usershares<br />
# chmod +t /var/lib/samba/usershares<br />
<br />
=== Encryption in ZFS using dm-crypt ===<br />
<br />
The stable release version of ZFS on Linux used to not support encryption directly (now it's available, see [[#Native encryption]]), but zpools can be created on 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.<br />
<br />
dm-crypt, possibly via LUKS, creates devices in {{ic|/dev/mapper}} and their name is fixed. So you just need to change {{ic|zpool create}} commands to point to that names. The idea is configuring the system to create the {{ic|/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.<br />
<br />
For example, an encrypted zpool can be created using plain dm-crypt (without LUKS) with:<br />
<br />
# cryptsetup --hash=sha512 --cipher=twofish-xts-plain64 --offset=0 \<br />
--key-file=/dev/sdZ --key-size=512 open --type=plain /dev/sdX enc<br />
# zpool create zroot /dev/mapper/enc<br />
<br />
In the case of a root filesystem pool, the {{ic|mkinitcpio.conf}} HOOKS line will enable the keyboard for the password, create the devices, and load the pools. It will contain something like:<br />
<br />
HOOKS="... keyboard encrypt zfs ..."<br />
<br />
Since the {{ic|/dev/mapper/enc}} name is fixed no import errors will occur.<br />
<br />
Creating encrypted zpools works fine. But if you need encrypted directories, for example to protect your users' homes, ZFS loses some functionality.<br />
<br />
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]] on it.<br />
<br />
For example to have an encrypted home: (the two passwords, encryption and login, must be the same)<br />
<br />
# zfs create -o compression=off -o dedup=off -o mountpoint=/home/<username> <zpool>/<username><br />
# useradd -m <username><br />
# passwd <username><br />
# ecryptfs-migrate-home -u <username><br />
<log in user and complete the procedure with ecryptfs-unwrap-passphrase><br />
<br />
=== Emergency chroot repair with archzfs ===<br />
<br />
To get into the ZFS filesystem from live system for maintenance, there are two options:<br />
<br />
# Build custom archiso with ZFS as described in [[#Embed the archzfs packages into an archiso]].<br />
# Boot the latest official archiso and bring up the network. Then enable [[Unofficial_user_repositories#archzfs|archzfs]] repository inside the live system as usual, sync the pacman package database and install the ''archzfs-archiso-linux'' package.<br />
<br />
To start the recovery, load the ZFS kernel modules:<br />
<br />
# modprobe zfs<br />
<br />
Import the pool:<br />
<br />
# zpool import -a -R /mnt<br />
<br />
Mount the boot partitions (if any):<br />
<br />
# mount /dev/sda2 /mnt/boot<br />
# mount /dev/sda1 /mnt/boot/efi<br />
<br />
Chroot into the ZFS filesystem:<br />
<br />
# arch-chroot /mnt /bin/bash<br />
<br />
Check the kernel version:<br />
<br />
# pacman -Qi linux<br />
# uname -r<br />
<br />
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:<br />
<br />
# 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)<br />
<br />
This will load the correct kernel modules for the kernel version installed in the chroot installation.<br />
<br />
[[Regenerate the initramfs]]. There should be no errors.<br />
<br />
=== Bind mount ===<br />
<br />
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.<br />
<br />
==== fstab ====<br />
<br />
See [http://www.freedesktop.org/software/systemd/man/systemd.mount.html systemd.mount] for more information on how systemd converts fstab into mount unit files with [http://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html systemd-fstab-generator].<br />
<br />
{{hc|/etc/fstab|<nowiki><br />
/mnt/zfspool /srv/nfs4/music none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0<br />
</nowiki>}}<br />
<br />
=== Monitoring / Mailing on Events ===<br />
<br />
See [https://ramsdenj.com/2016/08/29/arch-linux-on-zfs-part-3-followup.html ZED: The ZFS Event Daemon] for more information.<br />
<br />
An email forwarder, such as [[S-nail]] (installed as part of {{Pkg|base}}), is required to accomplish this. Test it to be sure it is working correctly.<br />
<br />
Uncomment the following in the configuration file:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|<nowiki><br />
ZED_EMAIL_ADDR="root"<br />
ZED_EMAIL_PROG="mailx"<br />
ZED_NOTIFY_VERBOSE=0<br />
ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"<br />
</nowiki>}}<br />
<br />
Update 'root' in {{ic|1=ZED_EMAIL_ADDR="root"}} to the email address you want to receive notifications at.<br />
<br />
If you are keeping your mailrc in your home directory, you can tell mail to get it from there by setting {{ic|MAILRC}}:<br />
<br />
{{hc|/etc/zfs/zed.d/zed.rc|2=<br />
export MAILRC=/home/<user>/.mailrc<br />
}}<br />
<br />
This works because ZED sources this file, so {{ic|mailx}} sees this environment variable.<br />
<br />
If you want to receive an email no matter the state of your pool, you will want to set {{ic|1=ZED_NOTIFY_VERBOSE=1}}. You will need to do this temporary to test.<br />
<br />
[[Start]] and [[enable]] {{ic|zfs-zed.service}}.<br />
<br />
With {{ic|1=ZED_NOTIFY_VERBOSE=1}}, you can test by running a scrub as root: {{ic|1=zpool scrub <pool-name>}}.<br />
<br />
=== Wrap shell commands in pre & post snapshots ===<br />
<br />
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.<br />
<br />
E.g.:<br />
<br />
# zfs snapshot -r zroot@pre<br />
# pacman -Syu<br />
# zfs snapshot -r zroot@post<br />
# zfs diff zroot@pre zroot@post <br />
# zfs rollback zroot@pre<br />
<br />
A utility that automates the creation of pre and post snapshots around a shell command is [https://gist.github.com/erikw/eeec35be33e847c211acd886ffb145d5 znp].<br />
<br />
E.g.:<br />
<br />
# znp pacman -Syu<br />
# znp find / -name "something*" -delete<br />
<br />
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.<br />
<br />
=== Remote unlocking of ZFS encrypted root ===<br />
<br />
As of [https://github.com/archzfs/archzfs/pull/261 PR #261], {{ic|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#Remote unlocking (hooks: netconf, dropbear, tinyssh, ppp)]].<br />
<br />
#Install {{Pkg|mkinitcpio-netconf}} to provide hooks for setting up early user space networking.<br />
#Choose an SSH server to use in early user space. The options are {{Pkg|mkinitcpio-tinyssh}} or {{Pkg|mkinitcpio-dropbear}}, and are mutually exclusive.<br />
##If using {{Pkg|mkinitcpio-tinyssh}}, it is also recommended to install {{Pkg|tinyssh-convert}} or {{AUR|tinyssh-convert-git}}. 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.<br />
#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 {{ic|/etc/tinyssh/root_key}} or {{ic|/etc/dropbear/root_key}}. When generating the initcpio image, this file will be added to {{ic|authorized_keys}} for the root user and is only valid in the initrd environment.<br />
#Add the {{ic|1=ip=}} [[kernel parameter]] to your boot loader configuration. The {{ic|ip}} string is [https://www.kernel.org/doc/html/latest/admin-guide/nfs/nfsroot.html highly configurable]. A simple DHCP example is shown below.{{bc|1=ip=:::::eth0:dhcp}}<br />
#Edit {{ic|/etc/mkinitcpio.conf}} to include the {{ic|netconf}}, {{ic|dropbear}} or {{ic|tinyssh}}, and {{ic|zfsencryptssh}} hooks before the {{ic|zfs}} hook:{{bc|1=HOOKS=(... netconf <tinyssh>{{!}}<dropbear> zfsencryptssh zfs ...)}}<br />
#[[Regenerate the initramfs]].<br />
#Reboot and try it out!<br />
<br />
====Changing the SSH server port====<br />
<br />
By default, {{Pkg|mkinitcpio-tinyssh}} and {{Pkg|mkinitcpio-dropbear}} listen on port {{ic|22}}. You may wish to change this.<br />
<br />
For '''TinySSH''', copy {{ic|/usr/lib/initcpio/hooks/tinyssh}} to {{ic|/etc/initcpio/hooks/tinyssh}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/bin/tcpserver -HRDl0 0.0.0.0 <new_port> /usr/sbin/tinysshd -v /etc/tinyssh/sshkeydir &<br />
}}<br />
<br />
For '''Dropbear''', copy {{ic|/usr/lib/initcpio/hooks/dropbear}} to {{ic|/etc/initcpio/hooks/dropbear}}, and find/modify the following line in the {{ic|run_hook()}} function:<br />
<br />
{{hc|/etc/initcpio/hooks/tinyssh|<br />
/usr/sbin/dropbear -E -s -j -k -p <new_port><br />
}}<br />
<br />
[[Regenerate the initramfs]].<br />
<br />
==== Unlocking from a Windows machine using PuTTY/Plink ====<br />
<br />
First, we need to use {{ic|puttygen.exe}} to import and convert the OpenSSH key generated earlier into PuTTY's ''.ppk'' private key format. Let us call it {{ic|zfs_unlock.ppk}} for this example.<br />
<br />
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 {{ic|plink.exe}} with the following parameters:<br />
<br />
plink.exe -ssh -l root -i c:\path\to\zfs_unlock.ppk <hostname><br />
<br />
The plink command can be put into a batch script for ease of use.<br />
<br />
== See also ==<br />
<br />
* [https://pthree.org/2012/12/04/zfs-administration-part-i-vdevs/ Aaron Toponce's 17-part blog on ZFS]<br />
* [http://zfsonlinux.org/ ZFS on Linux]<br />
* [https://github.com/zfsonlinux/zfs/wiki/faq ZFS on Linux FAQ]<br />
* [https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs.html FreeBSD Handbook -- The Z File System]<br />
* [https://docs.oracle.com/cd/E19253-01/819-5461/index.html Oracle Solaris ZFS Administration Guide]<br />
* [http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide Solaris Internals -- ZFS Troubleshooting Guide]{{Dead link|2020|04|03|status=domain name not resolved}}<br />
* [http://royal.pingdom.com/2013/06/04/zfs-backup/ How Pingdom uses ZFS to back up 5TB of MySQL data every day]<br />
* [https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bhow-to%5D-add-zfs-to-the-linux-kernel-4175514510/ Tutorial on adding the modules to a custom kernel]<br />
* [https://github.com/danboid/creating-ZFS-disks-under-Linux How to create cross platform ZFS disks under Linux]<br />
* [https://blog.heckel.xyz/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/ How-To: Using ZFS Encryption at Rest in OpenZFS (ZFS on Linux, ZFS on FreeBSD, …)]</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Talk:Dracut&diff=618309Talk:Dracut2020-06-04T23:47:19Z<p>Xuanruiqi: Fix AUR link</p>
<hr />
<div>== Recommend {{AUR|rebuild-initramfs-dracut}}? ==<br />
<br />
Disclosure: I'm the author of this package.<br />
<br />
Unlike {{ic|mkinitcpio}} which has {{ic|-P}} and {{ic|-p}}, in dracut you'd have to type the command by hand. I wrote a script to fix this situation and have put it on the AUR after having used it personally for some time: {{AUR|rebuild-initramfs-dracut}}.<br />
<br />
I'm certainly biased, but I think it wouldn't be a bad idea to mention this on the Wiki page as a "replacement" for {{ic|mkinitcpio -P}}. [[User:Xuanruiqi|Xuanruiqi]] ([[User talk:Xuanruiqi|talk]]) 23:42, 4 June 2020 (UTC)<br />
<br />
== Early microcode loading for Intel CPUs ==<br />
<br />
Currently, it seems that dracut does not recognize the Arch way of shipping Intel microcode. It expects microcode in their original format, rather than processed by {{ic|iucode-tools}}. See the filelist: https://fedora.pkgs.org/31/fedora-x86_64/microcode_ctl-2.1-32.fc31.x86_64.rpm.html [[User:Hexchain|Hexchain]] ([[User talk:Hexchain|talk]]) 15:51, 21 December 2019 (UTC)<br />
: What do you mean by 'expects microcode in original format' and 'processed by icode-tools'? I use dracut for several months and have no issue with intel-ucode. Providing 'intel-ucode.img' to 'initrd' command (in grub) seems to be sufficient ('kernel: microcode: microcode updated early to revision 0x2f, date = 2019-02-17'). [[User:Mxfm|Mxfm]] ([[User talk:Mxfm|talk]]) 05:14, 23 December 2019 (UTC)<br />
:: dracut has an {{ic|early-microcode}} option to package microcode directly into initrd, without the need to load another initrd. This can be useful with {{ic|--uefi}}, which packages kernel + initramfs + cmdline into one single UEFI application for EFISTUB (especially on some broken firmware that does not recognize UEFI cmdline parameters, like the Dell XPS 9360 ones), or secure boot. dracut looks for microcode under {{ic|/lib/firmware/intel-ucode}} and expects them to be in their original form (See [https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/tree/master/intel-ucode]). The current {{ic|intel-ucode}} package already packaged all microcode files into one single initrd with {{ic|iucode-tools}}, which is not supported by this specific dracut feature. [[User:Hexchain|Hexchain]] ([[User talk:Hexchain|talk]]) 10:00, 23 December 2019 (UTC)<br />
::: I see. Perhaps file a bug report? [[User:Mxfm|Mxfm]] ([[User talk:Mxfm|talk]]) 15:55, 25 December 2019 (UTC)<br />
: I have opened a feature request. -[https://bugs.archlinux.org/task/65475 FS#65475] [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 01:46, 13 February 2020 (UTC)<br />
: It appears dracut now supports the {{ic|/boot/*.img}} scheme for microcode natively. - https://github.com/dracutdevs/dracut/pull/699 - [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:09, 13 February 2020 (UTC)<br />
<br />
== What is the reason for {{ic|--no-hostonly-cmdline}}? ==<br />
<br />
What is the reasoning behind including the option {{ic|--no-hostonly-cmdline}} in the example {{ic|dracut-install.sh}} script?<br />
<br />
Is it to encourage the user to configure the kernel command line from the bootloader configuration rather than embedding in the initcpio?<br />
- [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:33, 5 February 2020 (UTC)<br />
<br />
: This might be a good question to ask grazzolini on IRC; he gave me the script to post. You can see it in this commit: "Add grazzolini's draft dracut script" https://wiki.archlinux.org/index.php?title=User:Krathalan&diff=prev&oldid=586226 [[User:Krathalan|Krathalan]] ([[User talk:Krathalan|talk]]) 16:06, 5 February 2020 (UTC)<br />
<br />
:: I found out that if you do not use {{ic|--no-hostonly-cmdline}} then {{ic|dracut(8)}} may duplicate some kernel parameters, such as automatically create {{ic|1=rd.luks.uuid=<UUID>}} in {{ic|etc/cmdline.d/90crypt.conf}} on the initramfs; when, in fact, they are already specified elsewhere (e.g. in {{ic|dracut.conf(5)}} as the {{ic|kernel_cmdline}} option or the kernel parameters defined in the boot loader configuration). - [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:31, 15 February 2020 (UTC)<br />
<br />
== Unified kernel image ==<br />
<br />
The {{ic|--uefi}} option seems to successfully create a unified kernel image, but I can't figure out a sane way to set kernel parameters. Presumably they should be set in {{ic|/etc/cmdline.d/}}, but I can't get it to work.<br />
<br />
* Without any options in {{ic|/etc/dracut.conf.d/*.conf}} the unified kernel image does not have any kernel parameters. In simple setups booting is still possible thanks to [[systemd#GPT partition automounting|systemd-gpt-auto-generator]].<br />
* With {{ic|1=hostonly="yes"}} in {{ic|/etc/dracut.conf.d/*.conf}} the unified kernel image contains some sort of autodetected kernel parameters and the resulting binary only contains the modules for the running system.<br />
<br />
Below are the pacman hooks which I'm using.<br />
<br />
-- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 12:35, 30 March 2020 (UTC)<br />
<br />
:{{ic|/etc/cmdline.d}} is relative to the initdir and needs to be copied into into it first, e.g. via {{ic|--install}}. dracut then showed the proper cmdline in its output, at least when i used {{ic|--hostonly-cmdline}}. I haven't yet managed to get it to boot, though.<br />
:--[[User:Lobachevsky|Lobachevsky]] ([[User talk:Lobachevsky|talk]]) 17:51, 29 May 2020 (UTC)<br />
:Update: The problem was me trying to use zstd as compression, which did not work, but xz does. I haven't tested without {{ic|--hostonly-cmdline}} yet, but the combinations {{ic|--hostonly-cmdline --install /etc/cmdline.d/mycmdline.conf}} produced a bootable UEFI binary.<br />
:[[User:Lobachevsky|Lobachevsky]] ([[User talk:Lobachevsky|talk]]) 15:05, 1 June 2020 (UTC)<br />
<br />
=== Unified kernel image hooks ===<br />
<br />
{{hc|/etc/pacman.d/hooks/90-dracut-install-uki.hook|2=<br />
[Trigger]<br />
Type = Path<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/lib/modules/*/pkgbase<br />
<br />
[Action]<br />
Description = Generating unified kernel images (with dracut!)...<br />
When = PostTransaction<br />
Exec = /usr/local/bin/dracut-install-uki.sh<br />
NeedsTargets<br />
}}<br />
<br />
{{hc|/usr/local/bin/dracut-install-uki.sh|2=<br />
#!/usr/bin/env bash<br />
<br />
ESP_MOUNTPOINT="''esp''"<br />
<br />
[[ ! -e "${ESP_MOUNTPOINT}/EFI/Linux" ]] && mkdir -p -- "${ESP_MOUNTPOINT}/EFI/Linux"<br />
<br />
while read -r package_file_path_line; do<br />
if [[ "$package_file_path_line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then<br />
read -r pkgbase < "/${package_file_path_line}"<br />
kver="${package_file_path_line#'usr/lib/modules/'}"<br />
kver="${kver%'/pkgbase'}"<br />
<br />
dracut --force --uefi --uefi-stub /usr/lib/systemd/boot/efi/linuxx64.efi.stub "${ESP_MOUNTPOINT}/EFI/Linux/Arch-${pkgbase}.efi" --kver "$kver"<br />
fi<br />
done<br />
}}<br />
<br />
== dracut.cmdline and LVM on LUKS ==<br />
<br />
It seems that setting kernel command line arguments in {{ic|/etc/cmdline.d/}} has no effect if the root partition is encrypted.<br />
<br />
Perhaps these files would normally be parsed while booting before mounting the rootfs.<br />
<br />
[[User:Summerer|Summerer]] ([[User talk:Summerer|talk]]) 09:25, 18 April 2020 (UTC)</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=User:Xuanruiqi&diff=618308User:Xuanruiqi2020-06-04T23:46:34Z<p>Xuanruiqi: Created page with "Hello, I am xuanruiqi. I am: * [https://aur.archlinux.org/account/xuanruiqi/ xuanruiqi] on the AUR; * [https://www.xuanruiqi.com] on the world wide web; * email me at: [mail..."</p>
<hr />
<div>Hello, I am xuanruiqi. I am: <br />
<br />
* [https://aur.archlinux.org/account/xuanruiqi/ xuanruiqi] on the AUR;<br />
* [https://www.xuanruiqi.com] on the world wide web;<br />
* email me at: [mailto:me@xuanruiqi.com me@xuanruiqi.com].</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Talk:Dracut&diff=618307Talk:Dracut2020-06-04T23:42:54Z<p>Xuanruiqi: Propose to ecommend rebuild-initramfs-dracut</p>
<hr />
<div>== Recommend {{ic|rebuild-initramfs-dracut}}? ==<br />
<br />
Disclosure: I'm the author of this package.<br />
<br />
Unlike {{ic|mkinitcpio}} which has {{ic|-P}} and {{ic|-p}}, in dracut you'd have to type the command by hand. I wrote a script to fix this situation and have put it on the AUR after having used it personally for some time: https://aur.archlinux.org/packages/rebuild-initramfs-dracut/.<br />
<br />
I'm certainly biased, but I think it wouldn't be a bad idea to mention this on the Wiki page as a "replacement" for {{ic|mkinitcpio -P}}. [[User:Xuanruiqi|Xuanruiqi]] ([[User talk:Xuanruiqi|talk]]) 23:42, 4 June 2020 (UTC)<br />
<br />
== Early microcode loading for Intel CPUs ==<br />
<br />
Currently, it seems that dracut does not recognize the Arch way of shipping Intel microcode. It expects microcode in their original format, rather than processed by {{ic|iucode-tools}}. See the filelist: https://fedora.pkgs.org/31/fedora-x86_64/microcode_ctl-2.1-32.fc31.x86_64.rpm.html [[User:Hexchain|Hexchain]] ([[User talk:Hexchain|talk]]) 15:51, 21 December 2019 (UTC)<br />
: What do you mean by 'expects microcode in original format' and 'processed by icode-tools'? I use dracut for several months and have no issue with intel-ucode. Providing 'intel-ucode.img' to 'initrd' command (in grub) seems to be sufficient ('kernel: microcode: microcode updated early to revision 0x2f, date = 2019-02-17'). [[User:Mxfm|Mxfm]] ([[User talk:Mxfm|talk]]) 05:14, 23 December 2019 (UTC)<br />
:: dracut has an {{ic|early-microcode}} option to package microcode directly into initrd, without the need to load another initrd. This can be useful with {{ic|--uefi}}, which packages kernel + initramfs + cmdline into one single UEFI application for EFISTUB (especially on some broken firmware that does not recognize UEFI cmdline parameters, like the Dell XPS 9360 ones), or secure boot. dracut looks for microcode under {{ic|/lib/firmware/intel-ucode}} and expects them to be in their original form (See [https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/tree/master/intel-ucode]). The current {{ic|intel-ucode}} package already packaged all microcode files into one single initrd with {{ic|iucode-tools}}, which is not supported by this specific dracut feature. [[User:Hexchain|Hexchain]] ([[User talk:Hexchain|talk]]) 10:00, 23 December 2019 (UTC)<br />
::: I see. Perhaps file a bug report? [[User:Mxfm|Mxfm]] ([[User talk:Mxfm|talk]]) 15:55, 25 December 2019 (UTC)<br />
: I have opened a feature request. -[https://bugs.archlinux.org/task/65475 FS#65475] [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 01:46, 13 February 2020 (UTC)<br />
: It appears dracut now supports the {{ic|/boot/*.img}} scheme for microcode natively. - https://github.com/dracutdevs/dracut/pull/699 - [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:09, 13 February 2020 (UTC)<br />
<br />
== What is the reason for {{ic|--no-hostonly-cmdline}}? ==<br />
<br />
What is the reasoning behind including the option {{ic|--no-hostonly-cmdline}} in the example {{ic|dracut-install.sh}} script?<br />
<br />
Is it to encourage the user to configure the kernel command line from the bootloader configuration rather than embedding in the initcpio?<br />
- [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:33, 5 February 2020 (UTC)<br />
<br />
: This might be a good question to ask grazzolini on IRC; he gave me the script to post. You can see it in this commit: "Add grazzolini's draft dracut script" https://wiki.archlinux.org/index.php?title=User:Krathalan&diff=prev&oldid=586226 [[User:Krathalan|Krathalan]] ([[User talk:Krathalan|talk]]) 16:06, 5 February 2020 (UTC)<br />
<br />
:: I found out that if you do not use {{ic|--no-hostonly-cmdline}} then {{ic|dracut(8)}} may duplicate some kernel parameters, such as automatically create {{ic|1=rd.luks.uuid=<UUID>}} in {{ic|etc/cmdline.d/90crypt.conf}} on the initramfs; when, in fact, they are already specified elsewhere (e.g. in {{ic|dracut.conf(5)}} as the {{ic|kernel_cmdline}} option or the kernel parameters defined in the boot loader configuration). - [[User:Neurognostic|Neurognostic]] ([[User talk:Neurognostic|talk]]) 04:31, 15 February 2020 (UTC)<br />
<br />
== Unified kernel image ==<br />
<br />
The {{ic|--uefi}} option seems to successfully create a unified kernel image, but I can't figure out a sane way to set kernel parameters. Presumably they should be set in {{ic|/etc/cmdline.d/}}, but I can't get it to work.<br />
<br />
* Without any options in {{ic|/etc/dracut.conf.d/*.conf}} the unified kernel image does not have any kernel parameters. In simple setups booting is still possible thanks to [[systemd#GPT partition automounting|systemd-gpt-auto-generator]].<br />
* With {{ic|1=hostonly="yes"}} in {{ic|/etc/dracut.conf.d/*.conf}} the unified kernel image contains some sort of autodetected kernel parameters and the resulting binary only contains the modules for the running system.<br />
<br />
Below are the pacman hooks which I'm using.<br />
<br />
-- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 12:35, 30 March 2020 (UTC)<br />
<br />
:{{ic|/etc/cmdline.d}} is relative to the initdir and needs to be copied into into it first, e.g. via {{ic|--install}}. dracut then showed the proper cmdline in its output, at least when i used {{ic|--hostonly-cmdline}}. I haven't yet managed to get it to boot, though.<br />
:--[[User:Lobachevsky|Lobachevsky]] ([[User talk:Lobachevsky|talk]]) 17:51, 29 May 2020 (UTC)<br />
:Update: The problem was me trying to use zstd as compression, which did not work, but xz does. I haven't tested without {{ic|--hostonly-cmdline}} yet, but the combinations {{ic|--hostonly-cmdline --install /etc/cmdline.d/mycmdline.conf}} produced a bootable UEFI binary.<br />
:[[User:Lobachevsky|Lobachevsky]] ([[User talk:Lobachevsky|talk]]) 15:05, 1 June 2020 (UTC)<br />
<br />
=== Unified kernel image hooks ===<br />
<br />
{{hc|/etc/pacman.d/hooks/90-dracut-install-uki.hook|2=<br />
[Trigger]<br />
Type = Path<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/lib/modules/*/pkgbase<br />
<br />
[Action]<br />
Description = Generating unified kernel images (with dracut!)...<br />
When = PostTransaction<br />
Exec = /usr/local/bin/dracut-install-uki.sh<br />
NeedsTargets<br />
}}<br />
<br />
{{hc|/usr/local/bin/dracut-install-uki.sh|2=<br />
#!/usr/bin/env bash<br />
<br />
ESP_MOUNTPOINT="''esp''"<br />
<br />
[[ ! -e "${ESP_MOUNTPOINT}/EFI/Linux" ]] && mkdir -p -- "${ESP_MOUNTPOINT}/EFI/Linux"<br />
<br />
while read -r package_file_path_line; do<br />
if [[ "$package_file_path_line" == 'usr/lib/modules/'+([^/])'/pkgbase' ]]; then<br />
read -r pkgbase < "/${package_file_path_line}"<br />
kver="${package_file_path_line#'usr/lib/modules/'}"<br />
kver="${kver%'/pkgbase'}"<br />
<br />
dracut --force --uefi --uefi-stub /usr/lib/systemd/boot/efi/linuxx64.efi.stub "${ESP_MOUNTPOINT}/EFI/Linux/Arch-${pkgbase}.efi" --kver "$kver"<br />
fi<br />
done<br />
}}<br />
<br />
== dracut.cmdline and LVM on LUKS ==<br />
<br />
It seems that setting kernel command line arguments in {{ic|/etc/cmdline.d/}} has no effect if the root partition is encrypted.<br />
<br />
Perhaps these files would normally be parsed while booting before mounting the rootfs.<br />
<br />
[[User:Summerer|Summerer]] ([[User talk:Summerer|talk]]) 09:25, 18 April 2020 (UTC)</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories&diff=576999Unofficial user repositories2019-07-07T19:34:37Z<p>Xuanruiqi: xuanrui: add upstream page</p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Lists]]<br />
[[ja:非公式ユーザーリポジトリ]]<br />
[[zh-hans:Unofficial user repositories]]<br />
{{Related articles start}}<br />
{{Related|pacman-key}}<br />
{{Related|Official repositories}}<br />
{{Related articles end}}<br />
This article lists binary repositories freely created and shared by the community, often providing pre-built versions of PKGBUILDS found in the [[AUR]].<br />
<br />
In order to use these repositories, add them to {{ic|/etc/pacman.conf}}, as explained in [[pacman#Repositories and mirrors]]. If a repository is signed, you must obtain and locally sign the associated key, as explained in [[Pacman-key#Adding unofficial keys]].<br />
<br />
If you want to create your own custom repository, follow [[pacman tips#Custom local repository]].<br />
<br />
{{Warning|The official Arch Linux Developers and the Trusted Users do not perform tests of any sort to verify the contents of these repositories. You must decide whether to trust their maintainers and you take full responsibility for any consequences of using any unofficial repository.}}<br />
<br />
== Adding your repository to this page ==<br />
<br />
If you have your own repository, please add it to this page, so that all the other users will know where to find your packages. Please keep the following rules when adding new repositories:<br />
<br />
* Keep the lists in alphabetical order.<br />
* Include some information about the maintainer: include at least a (nick)name and some form of contact information (web site, email address, user page on ArchWiki or the forums, etc.).<br />
* If the repository is of the ''signed'' variety, please include a key-id, possibly using it as the anchor for a link to its keyserver; if the key is not on a keyserver, include a link to the key file.<br />
* Include some short description (e.g. the category of packages provided in the repository).<br />
* If there is a page (either on ArchWiki or external) containing more information about the repository, include a link to it.<br />
* If possible, avoid using comments in code blocks. The formatted description is much more readable. Users who want some comments in their {{ic|pacman.conf}} can easily create it on their own.<br />
<br />
Some repositories may also have packages for architectures beside x86_64. The {{ic|$arch}} variable will be set automatically by pacman.<br />
<br />
== Signed ==<br />
<br />
=== andontie-aur ===<br />
<br />
* '''Maintainer:''' Holly M.<br />
* '''Description:''' A repo containing the most popular AUR packages, as well as some I use all the time. New packages can be requested on the upstream website.<br />
* '''Key-ID:''' EA50C866329648EE<br />
* '''Upstream page:''' https://aur.andontie.net<br />
<br />
{{bc|<nowiki><br />
[andontie-aur]<br />
Server = https://aur.andontie.net/$arch<br />
</nowiki>}}<br />
<br />
=== arcanisrepo ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#arcanis arcanis]<br />
* '''Description:''' A repository with some AUR packages including packages from VCS<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[arcanisrepo]<br />
Server = https://repo.arcanis.me/repo/$arch<br />
</nowiki>}}<br />
<br />
(It is also available via FTP with the same URL.)<br />
<br />
=== arch4edu ===<br />
<br />
* '''Maintainers:''' [https://github.com/petronny Jingbei Li (petronny)], and [https://github.com/arch4edu/arch4edu/graphs/contributors others]<br />
* '''Description:''' arch4edu is a community repository for Archlinux and ArchlinuxARM that strives to provide the latest versions of most software used by college students.<br />
* '''Git Repo:''' https://github.com/arch4edu/arch4edu<br />
* '''Issue tracking:''' https://github.com/arch4edu/arch4edu/issues for packaging issues, out-of-date notifications, package requests, and related questions<br />
* '''Mirrors:''' https://github.com/arch4edu/arch4edu/wiki/Add-arch4edu-to-your-Archlinux<br />
* '''Key-ID:''' 7931B6D628C8D3BA<br />
<br />
{{bc|<nowiki><br />
[arch4edu]<br />
Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch<br />
## or other mirrors in https://github.com/arch4edu/arch4edu/wiki/Add-arch4edu-to-your-Archlinux<br />
</nowiki>}}<br />
<br />
=== archlinuxcn ===<br />
<br />
* '''Maintainers:''' [https://plus.google.com/+PhoenixNemo/ Phoenix Nemo (phoenixlzx)], [https://www.archlinux.org/people/developers/#fyan Felix Yan (felixonmars, dev)], [https://twitter.com/lilydjwg lilydjwg], [https://www.archlinux.org/people/trusted-users/#farseerfc farseerfc (TU)], and [https://github.com/archlinuxcn/repo/graphs/contributors others]<br />
* '''Description:''' Packages by the Chinese Arch Linux community, all signed. Be aware that i686 packages are not fully maintained and tested, create an issue if you find some problems.<br />
* '''Git Repo:''' https://github.com/archlinuxcn/repo<br />
* '''Issue tracking:''' https://github.com/archlinuxcn/repo/issues for packaging issues, out-of-date notifications, package requests, and related questions<br />
* '''Mirrors:''' https://github.com/archlinuxcn/mirrorlist-repo (Mostly for users in mainland China), or install ''archlinuxcn-mirrorlist-git'' from the repo.<br />
* '''Key-ID:''' Once the repo is added, ''archlinuxcn-keyring'' package must be installed before any other so you do not get errors about PGP signatures. ''archlinuxcn-keyring'' package itself is signed by TU.<br />
<br />
{{bc|<nowiki><br />
[archlinuxcn]<br />
Server = http://repo.archlinuxcn.org/$arch<br />
## or use a CDN (beta)<br />
#Server = https://cdn.repo.archlinuxcn.org/$arch<br />
## or install archlinuxcn-mirrorlist-git and use the mirrorlist<br />
#Include = /etc/pacman.d/archlinuxcn-mirrorlist<br />
</nowiki>}}<br />
<br />
=== archstrike ===<br />
<br />
* '''Maintainer:''' [https://archstrike.org/team The ArchStrike Team]<br />
* '''Description:''' A repository for security professionals and enthusiasts<br />
* '''Upstream page:''' https://archstrike.org/<br />
* '''Key-ID:''' 9D5F1C051D146843CDA4858BDE64825E7CBC0D51<br />
<br />
{{Note|ArchStrike specific instructions can be found at https://archstrike.org/wiki/setup}}<br />
<br />
{{bc|<nowiki><br />
[archstrike]<br />
Server = https://mirror.archstrike.org/$arch/$repo<br />
</nowiki>}}<br />
<br />
=== archzfs ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/minextu Jan Houben (minextu)]<br />
* '''Description:''' Packages for ZFS on Arch Linux.<br />
* '''Upstream page:''' https://github.com/archzfs/archzfs<br />
* '''Key-ID:''' F75D9D76<br />
<br />
{{bc|<nowiki><br />
[archzfs]<br />
Server = http://archzfs.com/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== ashleyis ===<br />
<br />
* '''Maintainer:''' Ashley Towns ([https://aur.archlinux.org/account/ashleyis/ ashleyis])<br />
* '''Description:''' Debug versions of SDL, chipmunk, libtmx and other misc game libraries. also swift-lang and some other AUR packages <br />
* '''Key-ID:''' B1A4D311<br />
<br />
{{bc|<nowiki><br />
[ashleyis]<br />
Server = http://arch.ashleytowns.id.au/repo/$arch<br />
</nowiki>}}<br />
<br />
=== Bennix Repo ===<br />
<br />
* '''Maintainer:''' Ben P. Dorsi-Todaro ([https://techmeout.org Tech Me Out])<br />
* '''Description:''' Packages [http://ben-dorsi-todaro.com/ Ben P. Dorsi-Todaro] uses and aren't listed in repos, or packages built by [http://www.bigbenshosting.com/ Big Ben's Web Hosting] <br />
* '''Key-ID:''' F14BB858F6253DA0<br />
<br />
{{bc|<nowiki><br />
[bigben-repo]<br />
SigLevel = Optional TrustAll<br />
Server = http://bennix.net/bigben-repo/<br />
</nowiki>}}<br />
<br />
=== blackeagle-pre-community ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#idevolder Ike Devolder]<br />
* '''Description:''' testing of the by me maintaned packages before moving to ''community'' repository<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[blackeagle-pre-community]<br />
Server = https://repo.herecura.be/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== chaotic-aur ===<br />
<br />
* '''Maintainer:''' [https://github.com/pedrohlc PedroHLC]<br />
* '''Description:''' Auto builds AUR packages the maintainer uses, update them hourly (a few are daily). Hosted in São Carlos, SP, Brazil. x86_64 only.<br />
* '''Key-ID:''' [http://pool.sks-keyservers.net/pks/lookup?search=0x3056513887B78AEB&fingerprint=on&op=index], fingerprint {{ic|EF92 5EA6 0F33 D0CB 85C4 4AD1 3056 5138 87B7 8AEB }}<br />
* '''Note:''' See [https://lonewolf.pedrohlc.com/chaotic-aur maintainer's notes].<br />
{{bc|<nowiki><br />
[chaotic-aur]<br />
Server = http://lonewolf-builder.duckdns.org/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== catalyst ===<br />
<br />
* '''Maintainer:''' [[User:Vi0L0|Vi0l0]]<br />
* '''Description:''' ATI Catalyst proprietary drivers.<br />
* '''Key-ID:''' 653C3094<br />
<br />
{{bc|<nowiki><br />
[catalyst]<br />
Server = https://167.86.114.169/arch/catalyst/$arch<br />
</nowiki>}}<br />
<br />
=== catalyst-hd234k ===<br />
<br />
* '''Maintainer:''' [[User:Vi0L0|Vi0l0]]<br />
* '''Description:''' ATI Catalyst proprietary drivers.<br />
* '''Key-ID:''' 653C3094<br />
<br />
{{bc|<nowiki><br />
[catalyst-hd234k]<br />
Server = https://167.86.114.169/arch/catalyst-hd234k/$arch<br />
</nowiki>}}<br />
<br />
=== city ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#bgyorgy Balló György]<br />
* '''Description:''' Experimental/unpopular packages.<br />
* '''Upstream page:''' https://pkgbuild.com/~bgyorgy/city.html<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[city]<br />
Server = https://pkgbuild.com/~bgyorgy/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
=== coderkun-aur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/coderkun/ coderkun]<br />
* '''Description:''' AUR packages with random software. Supporting package deltas and package and database signing.<br />
* '''Upstream page:''' https://www.suruatoel.xyz/arch<br />
* '''Key-ID:''' 39E27199A6BEE374<br />
* '''Keyfile:''' [https://www.suruatoel.xyz/coderkun.asc https://www.suruatoel.xyz/coderkun.asc]<br />
<br />
{{bc|<nowiki><br />
[coderkun-aur]<br />
Server = http://arch.suruatoel.xyz/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== coderkun-aur-audio ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/coderkun/ coderkun]<br />
* '''Description:''' AUR packages with audio-related (realtime kernels, lv2-plugins, …) software. Supporting package deltas and package and database signing.<br />
* '''Upstream page:''' https://www.suruatoel.xyz/arch<br />
* '''Key-ID:''' 39E27199A6BEE374<br />
* '''Keyfile:''' [https://www.suruatoel.xyz/coderkun.key https://www.suruatoel.xyz/coderkun.key]<br />
<br />
{{bc|<nowiki><br />
[coderkun-aur-audio]<br />
Server = http://arch.suruatoel.xyz/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== devkitpro ===<br />
<br />
* '''Maintainer:''' [https://devkitpro.org/ wintermute]<br />
* '''Description:''' Provides Homebrew toolchains for the Nintendo Wii, Gamecube, DS, GBA, Gamepark gp32 and Nintendo Switch<br />
* '''Upstream page:''' https://devkitpro.org/wiki/devkitPro_pacman<br />
* '''Key-ID:''' F7FD5492264BB9D0<br />
<br />
{{Note|Repository has its own additional keyring at https://downloads.devkitpro.org/devkitpro-keyring-r1.787e015-2-any.pkg.tar.xz.}}<br />
<br />
{{bc|<nowiki><br />
[dkp-libs]<br />
Server = https://downloads.devkitpro.org/packages<br />
[dkp-linux]<br />
Server = https://downloads.devkitpro.org/packages/linux<br />
</nowiki>}}<br />
<br />
=== disastrousaur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/TheGoliath TheGoliath]<br />
* '''Description:''' Well known AUR package managers, many of the most popular packages available on the AUR, as well as those that I favor myself<br />
* '''Upstream page:''' https://mirror.repohost.de/disastrousaur<br />
* '''Key-ID:''' CBAE582A876533FD<br />
* '''Keyfile:''' [https://mirror.repohost.de/disastrousaur.key https://mirror.repohost.de/disastrousaur.key]<br />
{{Warning|disastrousaur and disastrousarm are undergoing restructuring (e.g. support for the aarch64 architecture and more). The repository itself will be available again under the disastrousaur name in the next week. Please make sure you have the URL changed accordingly as shown below. Sorry for causing any inconvenience. }}<br />
{{bc|<nowiki><br />
[disastrousaur]<br />
Server = https://mirror.repohost.de/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== dvzrv ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#dvzrv David Runge]<br />
* '''Description:''' [[Realtime kernel patchset]] (aka. {{AUR|linux-rt}} and {{AUR|linux-rt-lts}})<br />
* '''Key-ID:''' Not needed, as maintainer is a developer/TU<br />
<br />
{{bc|<nowiki><br />
[dvzrv]<br />
Server = https://pkgbuild.com/~dvzrv/repo/$arch<br />
</nowiki>}}<br />
<br />
=== eatabrick ===<br />
<br />
* '''Maintainer:''' bentglasstube<br />
* '''Description:''' Packages for software written by (and a few just compiled by) bentglasstube.<br />
<br />
{{bc|<nowiki><br />
[eatabrick]<br />
Server = http://repo.eatabrick.org/$arch<br />
</nowiki>}}<br />
<br />
=== eschwartz ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#eschwartz Eli Schwartz]<br />
* '''Description:''' Personal repo with AUR packages and some core packages from git (including glibc and pacman). Contains debug packages.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[eschwartz]<br />
Server = https://pkgbuild.com/~eschwartz/repo/$arch<br />
</nowiki>}}<br />
<br />
=== ffy00 ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#FFY00 Filipe Laíns]<br />
* '''Description:''' Personal repo. Contains some packages related to the D language.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[ffy00]<br />
Server = https://pkgbuild.com/~ffy00/repo<br />
</nowiki>}}<br />
<br />
=== fusion809 ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/fusion809|Brenton Horne]] (brentonhorne77 at gmail dot com).<br />
* '''Description:''' Provides a few AUR and other packages I like. Like CodeLite and bleeding-edge (latest release within 1 day of its release) GVim (GTK+2 interface).<br />
* '''Package list:''' http://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/x86_64/<br />
* '''Key-ID:''' 03264DDCD606DC98<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/x86_64/home_fusion809_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_fusion809_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/$arch<br />
</nowiki>}}<br />
<br />
=== gnome-devel ===<br />
<br />
* '''Maintainer:''' [https://plus.google.com/+AndresFernandezperonista Andres Fernandez], [https://plus.google.com/+FernandoFernandezBerel Fernando Fernandez]<br />
* '''Description:''' GNOME development releases. For testing purposes only.<br />
* '''Package list:''' https://softwareperonista.com.ar/repo/archlinux/gnome-devel/x86_64/<br />
* '''Key-ID:''' DDCE9FD63370080B<br />
<br />
{{Note|Must be put above {{ic|[testing]}} repository.}}<br />
<br />
{{bc|<nowiki><br />
[gnome-devel]<br />
Server = https://softwareperonista.com.ar/repo/archlinux/gnome-devel/$arch<br />
</nowiki>}}<br />
<br />
=== herecura ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#idevolder Ike Devolder]<br />
* '''Description:''' additional packages not found in the ''community'' repository<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[herecura]<br />
Server = https://repo.herecura.be/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== holo ===<br />
<br />
* '''Maintainer:''' Stefan Majewsky <holo-pacman@posteo.de> (please prefer to report issues at [https://github.com/majewsky/holo-pacman-repo/issues Github])<br />
* '''Description:''' Packages for [https://holocm.org Holo configuration management], including compatible plugins and tools.<br />
* '''Upstream page:''' https://github.com/majewsky/holo-pacman-repo<br />
* '''Package list:''' https://repo.holocm.org/archlinux/x86_64<br />
* '''Key-ID:''' 0xF7A9C9DC4631BD1A<br />
<br />
{{bc|<nowiki><br />
[holo]<br />
Server = https://repo.holocm.org/archlinux/x86_64<br />
</nowiki>}}<br />
<br />
=== ivasilev ===<br />
<br />
* '''Maintainer:''' [https://ivasilev.net Ianis G. Vasilev]<br />
* '''Description:''' A variety of packages, mostly my own software and AUR builds.<br />
* '''Upstream page:''' https://ivasilev.net/pacman<br />
* '''Key-ID:''' [https://pgp.mit.edu/pks/lookup?op=vindex&search=0xB77A3C8832838F1F80ADFD7E1D0507B417DAB671 17DAB671]<br />
<br />
{{bc|<nowiki><br />
[ivasilev]<br />
Server = https://ivasilev.net/pacman/$arch<br />
</nowiki>}}<br />
<br />
=== jlk ===<br />
<br />
* '''Maintainer:''' [[User:Lahwaacz|Jakub Klinkovský]]<br />
* '''Description:''' Various packages from the ABS and AUR. Modified packages are in the {{ic|modified}} group.<br />
* '''Upstream page:''' https://jlk.fjfi.cvut.cz/arch/repo/README.html<br />
* '''Key-ID:''' 932BA3FA0C86812A32D1F54DAB5964AEB9FEDDDC<br />
<br />
{{bc|<nowiki><br />
[jlk]<br />
Server = https://jlk.fjfi.cvut.cz/arch/repo<br />
</nowiki>}}<br />
<br />
=== llvm-svn ===<br />
<br />
* '''Maintainer:''' [[User:Kerberizer|Luchesar V. ILIEV (kerberizer)]]<br />
* '''Description:''' [https://aur.archlinux.org/pkgbase/llvm-svn llvm-svn] and [https://aur.archlinux.org/pkgbase/lib32-llvm-svn lib32-llvm-svn] from AUR: the LLVM compiler infrastructure, the Clang frontend, and the tools associated with it<br />
* '''Key-ID:''' [https://sks-keyservers.net/pks/lookup?op=vindex&search=0x76563F75679E4525&fingerprint=on&exact=on 0x76563F75679E4525], fingerprint {{ic|D16C F22D 27D1 091A 841C 4BE9 7656 3F75 679E 4525}}<br />
<br />
{{bc|<nowiki><br />
[llvm-svn]<br />
Server = https://repos.uni-plovdiv.net/archlinux/$repo/$arch<br />
</nowiki>}}<br />
=== lmrepo ===<br />
<br />
* '''Maintainer:''' [https://lukaszmoskala.pl Łukasz Moskała]<br />
* '''Description:''' AUR packages that I find usefull, including [https://aur.archlinux.org/packages/openrazer-meta openrazer]<br />
* '''Key-ID:''' [http://pool.sks-keyservers.net/pks/lookup?search=0x226981382B7115B2DF696B43C1F0BCD7CB0353DA&fingerprint=on&op=index 0x226981382B7115B2DF696B43C1F0BCD7CB0353DA], fingerprint {{ic|2269 8138 2B71 15B2 DF69 6B43 C1F0 BCD7 CB03 53DA}}<br />
<br />
{{bc|<nowiki><br />
[lmrepo]<br />
Server = http://arch.lukaszmoskala.pl<br />
</nowiki>}}<br />
=== markzz ===<br />
<br />
* '''Maintainer:''' [[User:Markzz|Mark Weiman (markzz)]]<br />
* '''Description:''' Packages that markzz maintains or uses on the AUR; this includes Linux with the vfio patchset ({{AUR|linux-vfio}} and {{AUR|linux-vfio-lts}}), and packages for analysis of network data.<br />
* '''Key ID:''' DEBB9EE4<br />
<br />
{{Note|If you want to add the key by installing the ''markzz-keyring'' package, temporarily add {{ic|1=SigLevel = Never}} into the repository section.}}<br />
<br />
{{bc|<nowiki><br />
[markzz]<br />
Server = https://repo.markzz.com/arch/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== maximbaz ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#maximbaz Maxim Baz]<br />
* '''Description:''' Personal repo with AUR packages.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[maximbaz]<br />
Server = https://pkgbuild.com/~maximbaz/repo/<br />
</nowiki>}}<br />
<br />
=== me176c ===<br />
<br />
* '''Maintainer:''' [https://github.com/lambdadroid lambdadroid]<br />
* '''Description:''' Packages for [[ASUS MeMO Pad 7 (ME176C(X))]]<br />
* '''Key-ID:''' 2B1138A8BB59D786A3BF42AAD996DA70572407FB<br />
<br />
{{bc|<nowiki><br />
[me176c]<br />
Server = https://me176c.uber.space/archlinux<br />
</nowiki>}}<br />
<br />
=== miffe ===<br />
<br />
* '''Maintainer:''' [https://bbs.archlinux.org/profile.php?id=4059 miffe]<br />
* '''Description:''' AUR packages maintained by miffe, e.g. linux-mainline<br />
* '''Key ID:''' 313F5ABD<br />
<br />
{{bc|<nowiki><br />
[miffe]<br />
Server = https://arch.miffe.org/$arch/<br />
</nowiki>}}<br />
<br />
=== mikelpint ===<br />
<br />
* '''Maintainer:''' [[User:Mikelpint|Mikel Pintado (Mikelpint)]]<br />
* '''Description:''' Packages that mikelpint maintains in the AUR.<br />
* '''Key ID:''' 5CA78FC65B189E2B<br />
<br />
{{bc|<nowiki><br />
[mikelpint]<br />
Server = https://mikelpint.github.io/repository/archlinux/repo<br />
</nowiki>}}<br />
<br />
=== Minerva W Science ===<br />
<br />
* '''Maintainer:''' Minerva W<br />
* '''Description:''' [[OpenFOAM]] packages.<br />
* '''Key-ID:''' 3FF21B78117507DA<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/Minerva_W:/Science/Arch_Extra/x86_64/home_Minerva_W_Science_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_Minerva_W_Science_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/Minerva_W:/Science/Arch_Extra/$arch <br />
</nowiki>}}<br />
<br />
=== mobile ===<br />
<br />
* '''Maintainer:''' [https://keybase.io/farwayer farwayer]<br />
* '''Description:''' React Native and Android development<br />
* '''Upstream page:''' https://keybase.pub/farwayer/arch/mobile/<br />
* '''Key ID:''' 7943315502A936D7<br />
<br />
{{bc|<nowiki><br />
[mobile]<br />
Server = https://farwayer.keybase.pub/arch/$repo<br />
</nowiki>}}<br />
<br />
=== nah ===<br />
<br />
* '''Maintainer:''' [https://yeah.nah.nz phillid]<br />
* '''Description:''' Pre-built versions of the (slow-to-build) graph-tool python libraries, mingw-w64<br />
* '''Key ID:''' 7BF3D17D0884BF5B<br />
<br />
{{bc|<nowiki><br />
[nah]<br />
Server = https://repo.nah.nz/$repo<br />
</nowiki>}}<br />
<br />
=== origincode ===<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/OriginCode OriginCode]<br />
* '''Description:''' A few staging or testing packages from [[#archlinuxcn]], and some daily use packages.<br />
* '''Key-ID:''' 0A5BAD445D80C1CC & 62BF97502AE10D22<br />
<br />
{{bc|<nowiki><br />
[origincode]<br />
Server = https://repo.origincode.me/repo/$arch<br />
</nowiki>}}<br />
<br />
=== pkgbuilder ===<br />
<br />
* '''Maintainer:''' [https://chriswarrick.com/ Chris Warrick]<br />
* '''Description:''' A repository for PKGBUILDer, a Python AUR helper.<br />
* '''Upstream page:''' https://github.com/Kwpolska/pkgbuilder<br />
* '''Key-ID:''' 5EAAEA16<br />
<br />
{{bc|<nowiki><br />
[pkgbuilder]<br />
Server = https://pkgbuilder-repo.chriswarrick.com/<br />
</nowiki>}}<br />
<br />
=== post-factum kernels ===<br />
<br />
* '''Maintainer''': [https://aur.archlinux.org/account/post-factum Oleksandr Natalenko aka post-factum]<br />
* '''Upstream page''': https://gitlab.com/post-factum/pf-kernel/wikis/README<br />
* '''Description''': [[Kernel#Major_patchsets|pf-kernel]] packages by its developer, post-factum<br />
* '''Key-ID:''': 95C357D2AF5DA89D<br />
* '''Keyfile''': https://download.opensuse.org/repositories/home:/post-factum:/kernels/Arch/x86_64/home_post-factum_kernels_Arch.key<br />
<br />
{{bc|<nowiki><br />
[home_post-factum_kernels_Arch]<br />
Server = https://download.opensuse.org/repositories/home:/post-factum:/kernels/Arch/$arch<br />
</nowiki>}}<br />
<br />
=== QOwnNotes ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/pbek Patrizio Bekerle] (pbek), QOwnNotes author<br />
* '''Description:''' QOwnNotes is a open source notepad and todo list manager with markdown support and [[ownCloud]] integration.<br />
* '''Key-ID:''' FFC43FC94539B8B0<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/pbek:/QOwnNotes/Arch_Extra/x86_64/home_pbek_QOwnNotes_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_pbek_QOwnNotes_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/pbek:/QOwnNotes/Arch_Extra/$arch<br />
</nowiki>}}<br />
<br />
=== qt-debug ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/The-Compiler The Compiler]<br />
* '''Description:''' Qt/PyQt builds with debug symbols<br />
* '''Upstream page:''' https://github.com/qutebrowser/qt-debug-pkgbuild<br />
* '''Key-ID:''' D6A1C70FE80A0C82<br />
<br />
{{bc|<nowiki><br />
[qt-debug]<br />
Server = https://qutebrowser.org/qt-debug/$arch<br />
</nowiki>}}<br />
<br />
=== quarry ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#anatolik anatolik]<br />
* '''Description:''' Arch binary repository for [http://rubygems.org/ Rubygems] packages. See [https://bbs.archlinux.org/viewtopic.php?id=182729 forum announcement] for more information.<br />
* '''Sources:''' https://github.com/anatol/quarry<br />
* '''Key-ID:''' Not needed, as maintainer is a developer<br />
<br />
{{bc|<nowiki><br />
[quarry]<br />
Server = https://pkgbuild.com/~anatolik/quarry/x86_64/<br />
</nowiki>}}<br />
<br />
=== repo-ck ===<br />
<br />
Kernel and modules with Brain Fuck Scheduler and all the goodies in the ck1 patch set.<br />
<br />
See [[/Repo-ck]].<br />
<br />
=== seblu ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#seblu Sébastien Luttringer]<br />
* '''Description:''' All seblu useful pre-built packages, some homemade (linux-seblu-meta, zfs-dkms, spotify, masterpdfeditor, etc).<br />
* '''Key-ID:''' Not required, as maintainer is a Developer<br />
<br />
{{bc|<nowiki><br />
[seblu]<br />
Server = https://al.seblu.net/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== seiichiro ===<br />
<br />
* '''Maintainer:''' [https://www.seiichiro0185.org Stefan Brand (seiichiro0185)]<br />
* '''Description:''' AUR-packages I use frequently<br />
* '''Key-ID:''' 805517CC<br />
<br />
{{bc|<nowiki><br />
[seiichiro]<br />
Server = https://www.seiichiro0185.org/repo/$arch<br />
</nowiki>}}<br />
<br />
=== sergej-repo ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#spupykin Sergej Pupykin]<br />
* '''Description:''' psi-plus, owncloud-git, ziproxy, android, MySQL, and other stuff. Some packages also available for armv7h.<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[sergej-repo]<br />
Server = http://repo.p5n.pp.ru/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
=== siosm-aur ===<br />
<br />
* '''Maintainer:''' [https://tim.siosm.fr/about/ Timothee Ravier]<br />
* '''Description:''' packages also available in the Arch User Repository, sometimes with minor fixes<br />
* '''Upstream page:''' https://tim.siosm.fr/repositories/<br />
* '''Key-ID:''' 78688F83<br />
<br />
{{bc|<nowiki><br />
[siosm-aur]<br />
Server = http://siosm.fr/repo/$repo/<br />
</nowiki>}}<br />
<br />
=== sublime-text ===<br />
<br />
* '''Maintainer:''' Sublime Text developer<br />
* '''Description:''' Sublime Text editor packages from developer's repository<br />
* '''Upstream page:''' https://www.sublimetext.com/docs/3/linux_repositories.html#pacman<br />
* '''Key-ID:''' 8A8F901A<br />
<br />
{{bc|<nowiki><br />
[sublime-text]<br />
Server = https://download.sublimetext.com/arch/stable/x86_64<br />
</nowiki>}}<br />
<br />
=== subtitlecomposer ===<br />
<br />
* '''Maintainer:''' Mladen Milinkovic (maxrd2)<br />
* '''Description:''' Subtitle Composer stable and nightly builds<br />
* '''Upstream page:''' https://github.com/maxrd2/subtitlecomposer<br />
* '''Key-ID:''' EF9D9B26<br />
<br />
{{bc|<nowiki><br />
[subtitlecomposer]<br />
Server = https://smoothware.net/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== trinity ===<br />
<br />
* '''Maintainer:''' Michael J. Manley <mmanley@ntge.net><br />
* '''Description:''' [[Trinity]] Desktop Environment<br />
* '''Key-ID:''' 5F710C1E<br />
<br />
{{bc|<nowiki><br />
[trinity]<br />
Server = https://repo.nasutek.com/arch/contrib/trinity/x86_64<br />
</nowiki>}}<br />
<br />
=== ungoo ===<br />
<br />
* '''Maintainer:''' [[User:Scrumplex|Sefa Eyeoglu]] <contact@scrumplex.net> (https://scrumplex.net)<br />
* '''Description:''' Latest ungoogled-chromium build<br />
* '''Upstream page:''' https://arch.scrumplex.net/ungoo<br />
* '''Key-ID:''' AF1FB107E188CB979A94FD7FC10411294912A422<br />
<br />
{{bc|<nowiki><br />
[ungoo]<br />
Server = https://arch.scrumplex.net/$repo/os/x86_64<br />
</nowiki>}}<br />
<br />
=== Webkit2Gtk-unstable ===<br />
<br />
* '''Maintainer:''' [[User:Mrmariusz|Mariusz Wojcik]]<br />
* '''Description:''' Latest Webkit2Gtk build for early adopters.<br />
* '''Upstream Page:''' https://webkitgtk.org/<br />
* '''Key-ID:''' 346854B5<br />
<br />
{{bc|<nowiki><br />
[home_mrmariusz_ArchLinux]<br />
Server = https://download.opensuse.org/repositories/home:/mrmariusz/ArchLinux/$arch<br />
</nowiki>}}<br />
<br />
=== xuanrui ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/xuanruiqi Xuanrui Qi (xuanruiqi)]<br />
* '''Description:''' xuanruiqi's own packages and frequently-used packages, mainly of interest to functional programmers.<br />
* '''Upstream Page:''' https://www.xuanruiqi.com/linux.html<br />
* '''Key-ID:''' 6E06FBC8<br />
<br />
{{bc|<nowiki><br />
[xuanrui]<br />
Server = https://arch.xuanruiqi.com/repo<br />
</nowiki>}}<br />
<br />
=== xyne-x86_64 ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#xyne Xyne]<br />
* '''Description:''' A repository for Xyne's own projects.<br />
* '''Upstream page:''' http://xyne.archlinux.ca/projects/<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[xyne-x86_64]<br />
# Server = https://xyne.archlinux.ca/repos/xyne # It returns error 404 or 406 (varying). Use the line below:<br />
Server = http://xyne.archlinux.ca/bin/repo.php?file=<br />
</nowiki>}}<br />
<br />
=== home-thaodan ===<br />
<br />
* '''Maintainer''': [https://aur.archlinux.org/account/Thaodan Thaodan]<br />
* '''Upstream page''': https://gitlab.com/Thaodan/linux-pf<br />
* '''Description''': [[Kernel#Major_patchsets|pf-kernel]] and other packages by pf-kernel fork developer, Thaodan<br />
* '''Gitlab Project''': https://gitlab.com/Thaodan/repo-home-thaodan-repo<br />
* '''Key-ID:''': BBFE2FD421597395E4FC8C8DF6C85FEE79D661A4<br />
<br />
{{bc|<nowiki><br />
[home-thaodan]<br />
Server = https://thaodan.de/public/archlinux/home-thaodan/$arch<br />
</nowiki>}}<br />
<br />
== Unsigned ==<br />
<br />
{{Note|Users will need to add the following to these entries: {{ic|1=SigLevel = PackageOptional}}}}<br />
<br />
=== alucryd ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Various packages Maxime Gauduin maintains (or not) in the AUR.<br />
<br />
{{bc|<nowiki><br />
[alucryd]<br />
Server = https://pkgbuild.com/~alucryd/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== alucryd-multilib ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Various packages needed to run Steam without its runtime environment.<br />
<br />
{{bc|<nowiki><br />
[alucryd-multilib]<br />
Server = https://pkgbuild.com/~alucryd/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== andrwe ===<br />
<br />
* '''Maintainer:''' Andrwe Lord Weber<br />
* '''Description:''' contains programs I'm using on many systems<br />
* '''Upstream page:''' http://andrwe.org/linux/repository<br />
<br />
{{bc|<nowiki><br />
[andrwe]<br />
Server = http://repo.andrwe.org/$arch<br />
</nowiki>}}<br />
<br />
<br />
=== archgeotux ===<br />
<br />
* '''Maintainer:''' Samuel Mesa<br />
* '''Description:''' Geospatial and geographic information system applications<br />
* '''Upstream page:''' https://archgeotux.sourceforge.io/<br />
<br />
{{bc|<nowiki><br />
[archgeotux]<br />
Server = https://downloads.sourceforge.net/project/archgeotux/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxfr ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:'''<br />
* '''Upstream page:''' http://afur.archlinux.fr<br />
<br />
{{bc|<nowiki><br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxgr ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:''' many interesting packages provided by the Hellenic (Greek) Arch Linux community<br />
<br />
{{bc|<nowiki><br />
[archlinuxgr]<br />
Server = http://archlinuxgr.tiven.org/archlinux/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxgr-kde4 ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:''' KDE4 packages (plasmoids, themes etc) provided by the Hellenic (Greek) Arch Linux community<br />
<br />
{{bc|<nowiki><br />
[archlinuxgr-kde4]<br />
Server = http://archlinuxgr.tiven.org/archlinux-kde4/$arch<br />
</nowiki>}}<br />
<br />
=== craftdestiny ===<br />
<br />
* '''Maintainer:''' [https://craftdestiny.ovh LinuxVieLoisir]<br />
* '''Description:''' A Craft Destiny repository is there to avoid long compilation on some software. It also adds some very useful additional software.<br />
<br />
{{bc|<nowiki><br />
[craftdestiny]<br />
Server = https://miroir.craftdestiny.ovh/archlinux-repo/<br />
</nowiki>}}<br />
<br />
=== dx37essentials ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/DragonX256 DragonX256]<br />
* '''Description:''' Personal repository. Contains packages from AUR, which I using every day.<br />
* '''Git repo:''' https://gitlab.com/DX37/dx37essentials<br />
* '''Upstream page:''' https://dx37.gitlab.io/dx37essentials<br />
<br />
{{bc|<nowiki><br />
[dx37essentials]<br />
Server = https://dx37.gitlab.io/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== heftig ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#heftig Jan Steffens]<br />
* '''Description:''' Includes pulseaudio-git, pavucontrol-git, and firefox-developer-edition<br />
* '''Upstream page:''' https://bbs.archlinux.org/viewtopic.php?id=117157<br />
<br />
{{bc|<nowiki><br />
[heftig]<br />
Server = https://pkgbuild.com/~heftig/repo/$arch<br />
</nowiki>}}<br />
<br />
<br />
=== jkanetwork ===<br />
<br />
* '''Maintainer:''' kprkpr <kevin01010 at gmail dot com><br />
* '''Maintainer:''' Joselucross <jlgarrido97 at gmail dot com><br />
* '''Description:''' Packages of AUR like pimagizer,stepmania,yaourt,linux-mainline,wps-office,grub-customizer,some IDE.. Open for all that wants to contribute<br />
* '''Upstream page:''' http://repo.jkanetwork.com/<br />
<br />
{{bc|<nowiki><br />
[jkanetwork]<br />
Server = http://repo.jkanetwork.com/repo/$repo/<br />
</nowiki>}}<br />
<br />
=== mesa-git ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#lcarlier Laurent Carlier]<br />
* '''Description:''' Mesa git builds for the ''testing'' and ''multilib-testing'' repositories<br />
<br />
{{bc|<nowiki><br />
[mesa-git]<br />
Server = https://pkgbuild.com/~lcarlier/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== minzord===<br />
<br />
* '''Maintainer:''' Minzord<br />
* '''Description:''' A Minzord repository is there to avoid long compilation on some software. It also adds some very useful additional software.<br />
<br />
{{bc|<nowiki><br />
[minzord]<br />
Server = https://minzordos.000webhostapp.com/Repo/<br />
</nowiki>}}<br />
<br />
=== oracle ===<br />
<br />
* '''Maintainer:''' [[User:Malvineous]]<br />
* '''Description:''' [[Oracle Database client]] and associated tools, built from AUR packages and hosted on AWS S3 using [https://github.com/Malvineous/archlinux-pacman-repo Makefile scripts].<br />
* '''Conditions:''' By using this repository you agree to the [http://www.oracle.com/technetwork/licenses/instant-client-lic-152016.html Oracle Technology Network Development and Distribution License Terms for Instant Client].<br />
{{bc|<nowiki><br />
[oracle]<br />
Server = http://linux.shikadi.net/arch/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== ownstuff ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/Martchus Martchus]<br />
* '''Description:''' A lot of packages from the AUR, e.g. a great number of mingw-w64 packages, fonts, Perl modules, tools like {{AUR|tageditor}}, {{AUR|syncthingtray}}, {{AUR|subtitlecomposer}} and {{AUR|qmplay2}}<br />
* '''Upstream page''': https://github.com/Martchus/PKGBUILDs (sources beside the AUR) and https://martchus.no-ip.biz/repoindex (package browser/search)<br />
<br />
{{bc|<nowiki><br />
[ownstuff-testing]<br />
Server = https://martchus.no-ip.biz/repo/arch/$repo/os/$arch<br />
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch<br />
<br />
[ownstuff]<br />
Server = https://martchus.no-ip.biz/repo/arch/$repo/os/$arch<br />
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
{{Note|The testing repository is supposed to be used together with the official testing repositories.}}<br />
<br />
=== pantheon ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Repository containing Pantheon-related packages<br />
<br />
{{bc|<nowiki><br />
[pantheon]<br />
Server = https://pkgbuild.com/~alucryd/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== pietma ===<br />
<br />
* '''Maintainer:''' MartiMcFly <martimcfly@autorisation.de><br />
* '''Description:''' Arch User Repository packages [https://aur.archlinux.org/packages/?K=martimcfly&SeB=m I create or maintain.].<br />
* '''Upstream page:''' http://pietma.com/tag/aur/<br />
<br />
{{bc|<nowiki><br />
[pietma]<br />
Server = http://repository.pietma.com/nexus/content/repositories/archlinux/$arch/$repo<br />
</nowiki>}}<br />
<br />
=== pnsft-pur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/ponsfoot ponsfoot]<br />
* '''Description:''' Japanese input method packages Mozc (vanilla) and libkkc<br />
<br />
{{bc|<nowiki><br />
[pnsft-pur]<br />
Server = https://osdn.net/projects/ponsfoot-aur/storage/pur/x86_64/<br />
</nowiki>}}</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Unofficial_user_repositories&diff=576995Unofficial user repositories2019-07-07T19:02:10Z<p>Xuanruiqi: Add xuanrui repository</p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Lists]]<br />
[[ja:非公式ユーザーリポジトリ]]<br />
[[zh-hans:Unofficial user repositories]]<br />
{{Related articles start}}<br />
{{Related|pacman-key}}<br />
{{Related|Official repositories}}<br />
{{Related articles end}}<br />
This article lists binary repositories freely created and shared by the community, often providing pre-built versions of PKGBUILDS found in the [[AUR]].<br />
<br />
In order to use these repositories, add them to {{ic|/etc/pacman.conf}}, as explained in [[pacman#Repositories and mirrors]]. If a repository is signed, you must obtain and locally sign the associated key, as explained in [[Pacman-key#Adding unofficial keys]].<br />
<br />
If you want to create your own custom repository, follow [[pacman tips#Custom local repository]].<br />
<br />
{{Warning|The official Arch Linux Developers and the Trusted Users do not perform tests of any sort to verify the contents of these repositories. You must decide whether to trust their maintainers and you take full responsibility for any consequences of using any unofficial repository.}}<br />
<br />
== Adding your repository to this page ==<br />
<br />
If you have your own repository, please add it to this page, so that all the other users will know where to find your packages. Please keep the following rules when adding new repositories:<br />
<br />
* Keep the lists in alphabetical order.<br />
* Include some information about the maintainer: include at least a (nick)name and some form of contact information (web site, email address, user page on ArchWiki or the forums, etc.).<br />
* If the repository is of the ''signed'' variety, please include a key-id, possibly using it as the anchor for a link to its keyserver; if the key is not on a keyserver, include a link to the key file.<br />
* Include some short description (e.g. the category of packages provided in the repository).<br />
* If there is a page (either on ArchWiki or external) containing more information about the repository, include a link to it.<br />
* If possible, avoid using comments in code blocks. The formatted description is much more readable. Users who want some comments in their {{ic|pacman.conf}} can easily create it on their own.<br />
<br />
Some repositories may also have packages for architectures beside x86_64. The {{ic|$arch}} variable will be set automatically by pacman.<br />
<br />
== Signed ==<br />
<br />
=== andontie-aur ===<br />
<br />
* '''Maintainer:''' Holly M.<br />
* '''Description:''' A repo containing the most popular AUR packages, as well as some I use all the time. New packages can be requested on the upstream website.<br />
* '''Key-ID:''' EA50C866329648EE<br />
* '''Upstream page:''' https://aur.andontie.net<br />
<br />
{{bc|<nowiki><br />
[andontie-aur]<br />
Server = https://aur.andontie.net/$arch<br />
</nowiki>}}<br />
<br />
=== arcanisrepo ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#arcanis arcanis]<br />
* '''Description:''' A repository with some AUR packages including packages from VCS<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[arcanisrepo]<br />
Server = https://repo.arcanis.me/repo/$arch<br />
</nowiki>}}<br />
<br />
(It is also available via FTP with the same URL.)<br />
<br />
=== arch4edu ===<br />
<br />
* '''Maintainers:''' [https://github.com/petronny Jingbei Li (petronny)], and [https://github.com/arch4edu/arch4edu/graphs/contributors others]<br />
* '''Description:''' arch4edu is a community repository for Archlinux and ArchlinuxARM that strives to provide the latest versions of most software used by college students.<br />
* '''Git Repo:''' https://github.com/arch4edu/arch4edu<br />
* '''Issue tracking:''' https://github.com/arch4edu/arch4edu/issues for packaging issues, out-of-date notifications, package requests, and related questions<br />
* '''Mirrors:''' https://github.com/arch4edu/arch4edu/wiki/Add-arch4edu-to-your-Archlinux<br />
* '''Key-ID:''' 7931B6D628C8D3BA<br />
<br />
{{bc|<nowiki><br />
[arch4edu]<br />
Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch<br />
## or other mirrors in https://github.com/arch4edu/arch4edu/wiki/Add-arch4edu-to-your-Archlinux<br />
</nowiki>}}<br />
<br />
=== archlinuxcn ===<br />
<br />
* '''Maintainers:''' [https://plus.google.com/+PhoenixNemo/ Phoenix Nemo (phoenixlzx)], [https://www.archlinux.org/people/developers/#fyan Felix Yan (felixonmars, dev)], [https://twitter.com/lilydjwg lilydjwg], [https://www.archlinux.org/people/trusted-users/#farseerfc farseerfc (TU)], and [https://github.com/archlinuxcn/repo/graphs/contributors others]<br />
* '''Description:''' Packages by the Chinese Arch Linux community, all signed. Be aware that i686 packages are not fully maintained and tested, create an issue if you find some problems.<br />
* '''Git Repo:''' https://github.com/archlinuxcn/repo<br />
* '''Issue tracking:''' https://github.com/archlinuxcn/repo/issues for packaging issues, out-of-date notifications, package requests, and related questions<br />
* '''Mirrors:''' https://github.com/archlinuxcn/mirrorlist-repo (Mostly for users in mainland China), or install ''archlinuxcn-mirrorlist-git'' from the repo.<br />
* '''Key-ID:''' Once the repo is added, ''archlinuxcn-keyring'' package must be installed before any other so you do not get errors about PGP signatures. ''archlinuxcn-keyring'' package itself is signed by TU.<br />
<br />
{{bc|<nowiki><br />
[archlinuxcn]<br />
Server = http://repo.archlinuxcn.org/$arch<br />
## or use a CDN (beta)<br />
#Server = https://cdn.repo.archlinuxcn.org/$arch<br />
## or install archlinuxcn-mirrorlist-git and use the mirrorlist<br />
#Include = /etc/pacman.d/archlinuxcn-mirrorlist<br />
</nowiki>}}<br />
<br />
=== archstrike ===<br />
<br />
* '''Maintainer:''' [https://archstrike.org/team The ArchStrike Team]<br />
* '''Description:''' A repository for security professionals and enthusiasts<br />
* '''Upstream page:''' https://archstrike.org/<br />
* '''Key-ID:''' 9D5F1C051D146843CDA4858BDE64825E7CBC0D51<br />
<br />
{{Note|ArchStrike specific instructions can be found at https://archstrike.org/wiki/setup}}<br />
<br />
{{bc|<nowiki><br />
[archstrike]<br />
Server = https://mirror.archstrike.org/$arch/$repo<br />
</nowiki>}}<br />
<br />
=== archzfs ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/minextu Jan Houben (minextu)]<br />
* '''Description:''' Packages for ZFS on Arch Linux.<br />
* '''Upstream page:''' https://github.com/archzfs/archzfs<br />
* '''Key-ID:''' F75D9D76<br />
<br />
{{bc|<nowiki><br />
[archzfs]<br />
Server = http://archzfs.com/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== ashleyis ===<br />
<br />
* '''Maintainer:''' Ashley Towns ([https://aur.archlinux.org/account/ashleyis/ ashleyis])<br />
* '''Description:''' Debug versions of SDL, chipmunk, libtmx and other misc game libraries. also swift-lang and some other AUR packages <br />
* '''Key-ID:''' B1A4D311<br />
<br />
{{bc|<nowiki><br />
[ashleyis]<br />
Server = http://arch.ashleytowns.id.au/repo/$arch<br />
</nowiki>}}<br />
<br />
=== Bennix Repo ===<br />
<br />
* '''Maintainer:''' Ben P. Dorsi-Todaro ([https://techmeout.org Tech Me Out])<br />
* '''Description:''' Packages [http://ben-dorsi-todaro.com/ Ben P. Dorsi-Todaro] uses and aren't listed in repos, or packages built by [http://www.bigbenshosting.com/ Big Ben's Web Hosting] <br />
* '''Key-ID:''' F14BB858F6253DA0<br />
<br />
{{bc|<nowiki><br />
[bigben-repo]<br />
SigLevel = Optional TrustAll<br />
Server = http://bennix.net/bigben-repo/<br />
</nowiki>}}<br />
<br />
=== blackeagle-pre-community ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#idevolder Ike Devolder]<br />
* '''Description:''' testing of the by me maintaned packages before moving to ''community'' repository<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[blackeagle-pre-community]<br />
Server = https://repo.herecura.be/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== chaotic-aur ===<br />
<br />
* '''Maintainer:''' [https://github.com/pedrohlc PedroHLC]<br />
* '''Description:''' Auto builds AUR packages the maintainer uses, update them hourly (a few are daily). Hosted in São Carlos, SP, Brazil. x86_64 only.<br />
* '''Key-ID:''' [http://pool.sks-keyservers.net/pks/lookup?search=0x3056513887B78AEB&fingerprint=on&op=index], fingerprint {{ic|EF92 5EA6 0F33 D0CB 85C4 4AD1 3056 5138 87B7 8AEB }}<br />
* '''Note:''' See [https://lonewolf.pedrohlc.com/chaotic-aur maintainer's notes].<br />
{{bc|<nowiki><br />
[chaotic-aur]<br />
Server = http://lonewolf-builder.duckdns.org/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== catalyst ===<br />
<br />
* '''Maintainer:''' [[User:Vi0L0|Vi0l0]]<br />
* '''Description:''' ATI Catalyst proprietary drivers.<br />
* '''Key-ID:''' 653C3094<br />
<br />
{{bc|<nowiki><br />
[catalyst]<br />
Server = https://167.86.114.169/arch/catalyst/$arch<br />
</nowiki>}}<br />
<br />
=== catalyst-hd234k ===<br />
<br />
* '''Maintainer:''' [[User:Vi0L0|Vi0l0]]<br />
* '''Description:''' ATI Catalyst proprietary drivers.<br />
* '''Key-ID:''' 653C3094<br />
<br />
{{bc|<nowiki><br />
[catalyst-hd234k]<br />
Server = https://167.86.114.169/arch/catalyst-hd234k/$arch<br />
</nowiki>}}<br />
<br />
=== city ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#bgyorgy Balló György]<br />
* '''Description:''' Experimental/unpopular packages.<br />
* '''Upstream page:''' https://pkgbuild.com/~bgyorgy/city.html<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[city]<br />
Server = https://pkgbuild.com/~bgyorgy/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
=== coderkun-aur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/coderkun/ coderkun]<br />
* '''Description:''' AUR packages with random software. Supporting package deltas and package and database signing.<br />
* '''Upstream page:''' https://www.suruatoel.xyz/arch<br />
* '''Key-ID:''' 39E27199A6BEE374<br />
* '''Keyfile:''' [https://www.suruatoel.xyz/coderkun.asc https://www.suruatoel.xyz/coderkun.asc]<br />
<br />
{{bc|<nowiki><br />
[coderkun-aur]<br />
Server = http://arch.suruatoel.xyz/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== coderkun-aur-audio ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/coderkun/ coderkun]<br />
* '''Description:''' AUR packages with audio-related (realtime kernels, lv2-plugins, …) software. Supporting package deltas and package and database signing.<br />
* '''Upstream page:''' https://www.suruatoel.xyz/arch<br />
* '''Key-ID:''' 39E27199A6BEE374<br />
* '''Keyfile:''' [https://www.suruatoel.xyz/coderkun.key https://www.suruatoel.xyz/coderkun.key]<br />
<br />
{{bc|<nowiki><br />
[coderkun-aur-audio]<br />
Server = http://arch.suruatoel.xyz/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== devkitpro ===<br />
<br />
* '''Maintainer:''' [https://devkitpro.org/ wintermute]<br />
* '''Description:''' Provides Homebrew toolchains for the Nintendo Wii, Gamecube, DS, GBA, Gamepark gp32 and Nintendo Switch<br />
* '''Upstream page:''' https://devkitpro.org/wiki/devkitPro_pacman<br />
* '''Key-ID:''' F7FD5492264BB9D0<br />
<br />
{{Note|Repository has its own additional keyring at https://downloads.devkitpro.org/devkitpro-keyring-r1.787e015-2-any.pkg.tar.xz.}}<br />
<br />
{{bc|<nowiki><br />
[dkp-libs]<br />
Server = https://downloads.devkitpro.org/packages<br />
[dkp-linux]<br />
Server = https://downloads.devkitpro.org/packages/linux<br />
</nowiki>}}<br />
<br />
=== disastrousaur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/TheGoliath TheGoliath]<br />
* '''Description:''' Well known AUR package managers, many of the most popular packages available on the AUR, as well as those that I favor myself<br />
* '''Upstream page:''' https://mirror.repohost.de/disastrousaur<br />
* '''Key-ID:''' CBAE582A876533FD<br />
* '''Keyfile:''' [https://mirror.repohost.de/disastrousaur.key https://mirror.repohost.de/disastrousaur.key]<br />
{{Warning|disastrousaur and disastrousarm are undergoing restructuring (e.g. support for the aarch64 architecture and more). The repository itself will be available again under the disastrousaur name in the next week. Please make sure you have the URL changed accordingly as shown below. Sorry for causing any inconvenience. }}<br />
{{bc|<nowiki><br />
[disastrousaur]<br />
Server = https://mirror.repohost.de/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== dvzrv ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#dvzrv David Runge]<br />
* '''Description:''' [[Realtime kernel patchset]] (aka. {{AUR|linux-rt}} and {{AUR|linux-rt-lts}})<br />
* '''Key-ID:''' Not needed, as maintainer is a developer/TU<br />
<br />
{{bc|<nowiki><br />
[dvzrv]<br />
Server = https://pkgbuild.com/~dvzrv/repo/$arch<br />
</nowiki>}}<br />
<br />
=== eatabrick ===<br />
<br />
* '''Maintainer:''' bentglasstube<br />
* '''Description:''' Packages for software written by (and a few just compiled by) bentglasstube.<br />
<br />
{{bc|<nowiki><br />
[eatabrick]<br />
Server = http://repo.eatabrick.org/$arch<br />
</nowiki>}}<br />
<br />
=== eschwartz ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#eschwartz Eli Schwartz]<br />
* '''Description:''' Personal repo with AUR packages and some core packages from git (including glibc and pacman). Contains debug packages.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[eschwartz]<br />
Server = https://pkgbuild.com/~eschwartz/repo/$arch<br />
</nowiki>}}<br />
<br />
=== ffy00 ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#FFY00 Filipe Laíns]<br />
* '''Description:''' Personal repo. Contains some packages related to the D language.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[ffy00]<br />
Server = https://pkgbuild.com/~ffy00/repo<br />
</nowiki>}}<br />
<br />
=== fusion809 ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/fusion809|Brenton Horne]] (brentonhorne77 at gmail dot com).<br />
* '''Description:''' Provides a few AUR and other packages I like. Like CodeLite and bleeding-edge (latest release within 1 day of its release) GVim (GTK+2 interface).<br />
* '''Package list:''' http://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/x86_64/<br />
* '''Key-ID:''' 03264DDCD606DC98<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/x86_64/home_fusion809_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_fusion809_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/fusion809/Arch_Extra/$arch<br />
</nowiki>}}<br />
<br />
=== gnome-devel ===<br />
<br />
* '''Maintainer:''' [https://plus.google.com/+AndresFernandezperonista Andres Fernandez], [https://plus.google.com/+FernandoFernandezBerel Fernando Fernandez]<br />
* '''Description:''' GNOME development releases. For testing purposes only.<br />
* '''Package list:''' https://softwareperonista.com.ar/repo/archlinux/gnome-devel/x86_64/<br />
* '''Key-ID:''' DDCE9FD63370080B<br />
<br />
{{Note|Must be put above {{ic|[testing]}} repository.}}<br />
<br />
{{bc|<nowiki><br />
[gnome-devel]<br />
Server = https://softwareperonista.com.ar/repo/archlinux/gnome-devel/$arch<br />
</nowiki>}}<br />
<br />
=== herecura ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#idevolder Ike Devolder]<br />
* '''Description:''' additional packages not found in the ''community'' repository<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[herecura]<br />
Server = https://repo.herecura.be/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== holo ===<br />
<br />
* '''Maintainer:''' Stefan Majewsky <holo-pacman@posteo.de> (please prefer to report issues at [https://github.com/majewsky/holo-pacman-repo/issues Github])<br />
* '''Description:''' Packages for [https://holocm.org Holo configuration management], including compatible plugins and tools.<br />
* '''Upstream page:''' https://github.com/majewsky/holo-pacman-repo<br />
* '''Package list:''' https://repo.holocm.org/archlinux/x86_64<br />
* '''Key-ID:''' 0xF7A9C9DC4631BD1A<br />
<br />
{{bc|<nowiki><br />
[holo]<br />
Server = https://repo.holocm.org/archlinux/x86_64<br />
</nowiki>}}<br />
<br />
=== ivasilev ===<br />
<br />
* '''Maintainer:''' [https://ivasilev.net Ianis G. Vasilev]<br />
* '''Description:''' A variety of packages, mostly my own software and AUR builds.<br />
* '''Upstream page:''' https://ivasilev.net/pacman<br />
* '''Key-ID:''' [https://pgp.mit.edu/pks/lookup?op=vindex&search=0xB77A3C8832838F1F80ADFD7E1D0507B417DAB671 17DAB671]<br />
<br />
{{bc|<nowiki><br />
[ivasilev]<br />
Server = https://ivasilev.net/pacman/$arch<br />
</nowiki>}}<br />
<br />
=== jlk ===<br />
<br />
* '''Maintainer:''' [[User:Lahwaacz|Jakub Klinkovský]]<br />
* '''Description:''' Various packages from the ABS and AUR. Modified packages are in the {{ic|modified}} group.<br />
* '''Upstream page:''' https://jlk.fjfi.cvut.cz/arch/repo/README.html<br />
* '''Key-ID:''' 932BA3FA0C86812A32D1F54DAB5964AEB9FEDDDC<br />
<br />
{{bc|<nowiki><br />
[jlk]<br />
Server = https://jlk.fjfi.cvut.cz/arch/repo<br />
</nowiki>}}<br />
<br />
=== llvm-svn ===<br />
<br />
* '''Maintainer:''' [[User:Kerberizer|Luchesar V. ILIEV (kerberizer)]]<br />
* '''Description:''' [https://aur.archlinux.org/pkgbase/llvm-svn llvm-svn] and [https://aur.archlinux.org/pkgbase/lib32-llvm-svn lib32-llvm-svn] from AUR: the LLVM compiler infrastructure, the Clang frontend, and the tools associated with it<br />
* '''Key-ID:''' [https://sks-keyservers.net/pks/lookup?op=vindex&search=0x76563F75679E4525&fingerprint=on&exact=on 0x76563F75679E4525], fingerprint {{ic|D16C F22D 27D1 091A 841C 4BE9 7656 3F75 679E 4525}}<br />
<br />
{{bc|<nowiki><br />
[llvm-svn]<br />
Server = https://repos.uni-plovdiv.net/archlinux/$repo/$arch<br />
</nowiki>}}<br />
=== lmrepo ===<br />
<br />
* '''Maintainer:''' [https://lukaszmoskala.pl Łukasz Moskała]<br />
* '''Description:''' AUR packages that I find usefull, including [https://aur.archlinux.org/packages/openrazer-meta openrazer]<br />
* '''Key-ID:''' [http://pool.sks-keyservers.net/pks/lookup?search=0x226981382B7115B2DF696B43C1F0BCD7CB0353DA&fingerprint=on&op=index 0x226981382B7115B2DF696B43C1F0BCD7CB0353DA], fingerprint {{ic|2269 8138 2B71 15B2 DF69 6B43 C1F0 BCD7 CB03 53DA}}<br />
<br />
{{bc|<nowiki><br />
[lmrepo]<br />
Server = http://arch.lukaszmoskala.pl<br />
</nowiki>}}<br />
=== markzz ===<br />
<br />
* '''Maintainer:''' [[User:Markzz|Mark Weiman (markzz)]]<br />
* '''Description:''' Packages that markzz maintains or uses on the AUR; this includes Linux with the vfio patchset ({{AUR|linux-vfio}} and {{AUR|linux-vfio-lts}}), and packages for analysis of network data.<br />
* '''Key ID:''' DEBB9EE4<br />
<br />
{{Note|If you want to add the key by installing the ''markzz-keyring'' package, temporarily add {{ic|1=SigLevel = Never}} into the repository section.}}<br />
<br />
{{bc|<nowiki><br />
[markzz]<br />
Server = https://repo.markzz.com/arch/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== maximbaz ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#maximbaz Maxim Baz]<br />
* '''Description:''' Personal repo with AUR packages.<br />
* '''Key-ID:''' Not needed, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[maximbaz]<br />
Server = https://pkgbuild.com/~maximbaz/repo/<br />
</nowiki>}}<br />
<br />
=== me176c ===<br />
<br />
* '''Maintainer:''' [https://github.com/lambdadroid lambdadroid]<br />
* '''Description:''' Packages for [[ASUS MeMO Pad 7 (ME176C(X))]]<br />
* '''Key-ID:''' 2B1138A8BB59D786A3BF42AAD996DA70572407FB<br />
<br />
{{bc|<nowiki><br />
[me176c]<br />
Server = https://me176c.uber.space/archlinux<br />
</nowiki>}}<br />
<br />
=== miffe ===<br />
<br />
* '''Maintainer:''' [https://bbs.archlinux.org/profile.php?id=4059 miffe]<br />
* '''Description:''' AUR packages maintained by miffe, e.g. linux-mainline<br />
* '''Key ID:''' 313F5ABD<br />
<br />
{{bc|<nowiki><br />
[miffe]<br />
Server = https://arch.miffe.org/$arch/<br />
</nowiki>}}<br />
<br />
=== mikelpint ===<br />
<br />
* '''Maintainer:''' [[User:Mikelpint|Mikel Pintado (Mikelpint)]]<br />
* '''Description:''' Packages that mikelpint maintains in the AUR.<br />
* '''Key ID:''' 5CA78FC65B189E2B<br />
<br />
{{bc|<nowiki><br />
[mikelpint]<br />
Server = https://mikelpint.github.io/repository/archlinux/repo<br />
</nowiki>}}<br />
<br />
=== Minerva W Science ===<br />
<br />
* '''Maintainer:''' Minerva W<br />
* '''Description:''' [[OpenFOAM]] packages.<br />
* '''Key-ID:''' 3FF21B78117507DA<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/Minerva_W:/Science/Arch_Extra/x86_64/home_Minerva_W_Science_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_Minerva_W_Science_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/Minerva_W:/Science/Arch_Extra/$arch <br />
</nowiki>}}<br />
<br />
=== mobile ===<br />
<br />
* '''Maintainer:''' [https://keybase.io/farwayer farwayer]<br />
* '''Description:''' React Native and Android development<br />
* '''Upstream page:''' https://keybase.pub/farwayer/arch/mobile/<br />
* '''Key ID:''' 7943315502A936D7<br />
<br />
{{bc|<nowiki><br />
[mobile]<br />
Server = https://farwayer.keybase.pub/arch/$repo<br />
</nowiki>}}<br />
<br />
=== nah ===<br />
<br />
* '''Maintainer:''' [https://yeah.nah.nz phillid]<br />
* '''Description:''' Pre-built versions of the (slow-to-build) graph-tool python libraries, mingw-w64<br />
* '''Key ID:''' 7BF3D17D0884BF5B<br />
<br />
{{bc|<nowiki><br />
[nah]<br />
Server = https://repo.nah.nz/$repo<br />
</nowiki>}}<br />
<br />
=== origincode ===<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/OriginCode OriginCode]<br />
* '''Description:''' A few staging or testing packages from [[#archlinuxcn]], and some daily use packages.<br />
* '''Key-ID:''' 0A5BAD445D80C1CC & 62BF97502AE10D22<br />
<br />
{{bc|<nowiki><br />
[origincode]<br />
Server = https://repo.origincode.me/repo/$arch<br />
</nowiki>}}<br />
<br />
=== pkgbuilder ===<br />
<br />
* '''Maintainer:''' [https://chriswarrick.com/ Chris Warrick]<br />
* '''Description:''' A repository for PKGBUILDer, a Python AUR helper.<br />
* '''Upstream page:''' https://github.com/Kwpolska/pkgbuilder<br />
* '''Key-ID:''' 5EAAEA16<br />
<br />
{{bc|<nowiki><br />
[pkgbuilder]<br />
Server = https://pkgbuilder-repo.chriswarrick.com/<br />
</nowiki>}}<br />
<br />
=== post-factum kernels ===<br />
<br />
* '''Maintainer''': [https://aur.archlinux.org/account/post-factum Oleksandr Natalenko aka post-factum]<br />
* '''Upstream page''': https://gitlab.com/post-factum/pf-kernel/wikis/README<br />
* '''Description''': [[Kernel#Major_patchsets|pf-kernel]] packages by its developer, post-factum<br />
* '''Key-ID:''': 95C357D2AF5DA89D<br />
* '''Keyfile''': https://download.opensuse.org/repositories/home:/post-factum:/kernels/Arch/x86_64/home_post-factum_kernels_Arch.key<br />
<br />
{{bc|<nowiki><br />
[home_post-factum_kernels_Arch]<br />
Server = https://download.opensuse.org/repositories/home:/post-factum:/kernels/Arch/$arch<br />
</nowiki>}}<br />
<br />
=== QOwnNotes ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/pbek Patrizio Bekerle] (pbek), QOwnNotes author<br />
* '''Description:''' QOwnNotes is a open source notepad and todo list manager with markdown support and [[ownCloud]] integration.<br />
* '''Key-ID:''' FFC43FC94539B8B0<br />
* '''Keyfile:''' https://download.opensuse.org/repositories/home:/pbek:/QOwnNotes/Arch_Extra/x86_64/home_pbek_QOwnNotes_Arch_Extra.key<br />
<br />
{{bc|<nowiki><br />
[home_pbek_QOwnNotes_Arch_Extra]<br />
Server = https://download.opensuse.org/repositories/home:/pbek:/QOwnNotes/Arch_Extra/$arch<br />
</nowiki>}}<br />
<br />
=== qt-debug ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/The-Compiler The Compiler]<br />
* '''Description:''' Qt/PyQt builds with debug symbols<br />
* '''Upstream page:''' https://github.com/qutebrowser/qt-debug-pkgbuild<br />
* '''Key-ID:''' D6A1C70FE80A0C82<br />
<br />
{{bc|<nowiki><br />
[qt-debug]<br />
Server = https://qutebrowser.org/qt-debug/$arch<br />
</nowiki>}}<br />
<br />
=== quarry ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#anatolik anatolik]<br />
* '''Description:''' Arch binary repository for [http://rubygems.org/ Rubygems] packages. See [https://bbs.archlinux.org/viewtopic.php?id=182729 forum announcement] for more information.<br />
* '''Sources:''' https://github.com/anatol/quarry<br />
* '''Key-ID:''' Not needed, as maintainer is a developer<br />
<br />
{{bc|<nowiki><br />
[quarry]<br />
Server = https://pkgbuild.com/~anatolik/quarry/x86_64/<br />
</nowiki>}}<br />
<br />
=== repo-ck ===<br />
<br />
Kernel and modules with Brain Fuck Scheduler and all the goodies in the ck1 patch set.<br />
<br />
See [[/Repo-ck]].<br />
<br />
=== seblu ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#seblu Sébastien Luttringer]<br />
* '''Description:''' All seblu useful pre-built packages, some homemade (linux-seblu-meta, zfs-dkms, spotify, masterpdfeditor, etc).<br />
* '''Key-ID:''' Not required, as maintainer is a Developer<br />
<br />
{{bc|<nowiki><br />
[seblu]<br />
Server = https://al.seblu.net/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== seiichiro ===<br />
<br />
* '''Maintainer:''' [https://www.seiichiro0185.org Stefan Brand (seiichiro0185)]<br />
* '''Description:''' AUR-packages I use frequently<br />
* '''Key-ID:''' 805517CC<br />
<br />
{{bc|<nowiki><br />
[seiichiro]<br />
Server = https://www.seiichiro0185.org/repo/$arch<br />
</nowiki>}}<br />
<br />
=== sergej-repo ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#spupykin Sergej Pupykin]<br />
* '''Description:''' psi-plus, owncloud-git, ziproxy, android, MySQL, and other stuff. Some packages also available for armv7h.<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[sergej-repo]<br />
Server = http://repo.p5n.pp.ru/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
=== siosm-aur ===<br />
<br />
* '''Maintainer:''' [https://tim.siosm.fr/about/ Timothee Ravier]<br />
* '''Description:''' packages also available in the Arch User Repository, sometimes with minor fixes<br />
* '''Upstream page:''' https://tim.siosm.fr/repositories/<br />
* '''Key-ID:''' 78688F83<br />
<br />
{{bc|<nowiki><br />
[siosm-aur]<br />
Server = http://siosm.fr/repo/$repo/<br />
</nowiki>}}<br />
<br />
=== sublime-text ===<br />
<br />
* '''Maintainer:''' Sublime Text developer<br />
* '''Description:''' Sublime Text editor packages from developer's repository<br />
* '''Upstream page:''' https://www.sublimetext.com/docs/3/linux_repositories.html#pacman<br />
* '''Key-ID:''' 8A8F901A<br />
<br />
{{bc|<nowiki><br />
[sublime-text]<br />
Server = https://download.sublimetext.com/arch/stable/x86_64<br />
</nowiki>}}<br />
<br />
=== subtitlecomposer ===<br />
<br />
* '''Maintainer:''' Mladen Milinkovic (maxrd2)<br />
* '''Description:''' Subtitle Composer stable and nightly builds<br />
* '''Upstream page:''' https://github.com/maxrd2/subtitlecomposer<br />
* '''Key-ID:''' EF9D9B26<br />
<br />
{{bc|<nowiki><br />
[subtitlecomposer]<br />
Server = https://smoothware.net/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== trinity ===<br />
<br />
* '''Maintainer:''' Michael J. Manley <mmanley@ntge.net><br />
* '''Description:''' [[Trinity]] Desktop Environment<br />
* '''Key-ID:''' 5F710C1E<br />
<br />
{{bc|<nowiki><br />
[trinity]<br />
Server = https://repo.nasutek.com/arch/contrib/trinity/x86_64<br />
</nowiki>}}<br />
<br />
=== ungoo ===<br />
<br />
* '''Maintainer:''' [[User:Scrumplex|Sefa Eyeoglu]] <contact@scrumplex.net> (https://scrumplex.net)<br />
* '''Description:''' Latest ungoogled-chromium build<br />
* '''Upstream page:''' https://arch.scrumplex.net/ungoo<br />
* '''Key-ID:''' AF1FB107E188CB979A94FD7FC10411294912A422<br />
<br />
{{bc|<nowiki><br />
[ungoo]<br />
Server = https://arch.scrumplex.net/$repo/os/x86_64<br />
</nowiki>}}<br />
<br />
=== Webkit2Gtk-unstable ===<br />
<br />
* '''Maintainer:''' [[User:Mrmariusz|Mariusz Wojcik]]<br />
* '''Description:''' Latest Webkit2Gtk build for early adopters.<br />
* '''Upstream Page:''' https://webkitgtk.org/<br />
* '''Key-ID:''' 346854B5<br />
<br />
{{bc|<nowiki><br />
[home_mrmariusz_ArchLinux]<br />
Server = https://download.opensuse.org/repositories/home:/mrmariusz/ArchLinux/$arch<br />
</nowiki>}}<br />
<br />
=== xuanrui ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/xuanruiqi Xuanrui Qi (xuanruiqi)]<br />
* '''Description:''' xuanruiqi's own packages and frequently-used packages, mainly of interest to functional programmers.<br />
* '''Key-ID:''' 6E06FBC8<br />
<br />
{{bc|<nowiki><br />
[xuanrui]<br />
Server = https://arch.xuanruiqi.com/repo<br />
</nowiki>}}<br />
<br />
=== xyne-x86_64 ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#xyne Xyne]<br />
* '''Description:''' A repository for Xyne's own projects.<br />
* '''Upstream page:''' http://xyne.archlinux.ca/projects/<br />
* '''Key-ID:''' Not required, as maintainer is a TU<br />
<br />
{{bc|<nowiki><br />
[xyne-x86_64]<br />
# Server = https://xyne.archlinux.ca/repos/xyne # It returns error 404 or 406 (varying). Use the line below:<br />
Server = http://xyne.archlinux.ca/bin/repo.php?file=<br />
</nowiki>}}<br />
<br />
=== home-thaodan ===<br />
<br />
* '''Maintainer''': [https://aur.archlinux.org/account/Thaodan Thaodan]<br />
* '''Upstream page''': https://gitlab.com/Thaodan/linux-pf<br />
* '''Description''': [[Kernel#Major_patchsets|pf-kernel]] and other packages by pf-kernel fork developer, Thaodan<br />
* '''Gitlab Project''': https://gitlab.com/Thaodan/repo-home-thaodan-repo<br />
* '''Key-ID:''': BBFE2FD421597395E4FC8C8DF6C85FEE79D661A4<br />
<br />
{{bc|<nowiki><br />
[home-thaodan]<br />
Server = https://thaodan.de/public/archlinux/home-thaodan/$arch<br />
</nowiki>}}<br />
<br />
== Unsigned ==<br />
<br />
{{Note|Users will need to add the following to these entries: {{ic|1=SigLevel = PackageOptional}}}}<br />
<br />
=== alucryd ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Various packages Maxime Gauduin maintains (or not) in the AUR.<br />
<br />
{{bc|<nowiki><br />
[alucryd]<br />
Server = https://pkgbuild.com/~alucryd/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== alucryd-multilib ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Various packages needed to run Steam without its runtime environment.<br />
<br />
{{bc|<nowiki><br />
[alucryd-multilib]<br />
Server = https://pkgbuild.com/~alucryd/$repo/x86_64<br />
</nowiki>}}<br />
<br />
=== andrwe ===<br />
<br />
* '''Maintainer:''' Andrwe Lord Weber<br />
* '''Description:''' contains programs I'm using on many systems<br />
* '''Upstream page:''' http://andrwe.org/linux/repository<br />
<br />
{{bc|<nowiki><br />
[andrwe]<br />
Server = http://repo.andrwe.org/$arch<br />
</nowiki>}}<br />
<br />
<br />
=== archgeotux ===<br />
<br />
* '''Maintainer:''' Samuel Mesa<br />
* '''Description:''' Geospatial and geographic information system applications<br />
* '''Upstream page:''' https://archgeotux.sourceforge.io/<br />
<br />
{{bc|<nowiki><br />
[archgeotux]<br />
Server = https://downloads.sourceforge.net/project/archgeotux/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxfr ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:'''<br />
* '''Upstream page:''' http://afur.archlinux.fr<br />
<br />
{{bc|<nowiki><br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxgr ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:''' many interesting packages provided by the Hellenic (Greek) Arch Linux community<br />
<br />
{{bc|<nowiki><br />
[archlinuxgr]<br />
Server = http://archlinuxgr.tiven.org/archlinux/$arch<br />
</nowiki>}}<br />
<br />
=== archlinuxgr-kde4 ===<br />
<br />
* '''Maintainer:'''<br />
* '''Description:''' KDE4 packages (plasmoids, themes etc) provided by the Hellenic (Greek) Arch Linux community<br />
<br />
{{bc|<nowiki><br />
[archlinuxgr-kde4]<br />
Server = http://archlinuxgr.tiven.org/archlinux-kde4/$arch<br />
</nowiki>}}<br />
<br />
=== craftdestiny ===<br />
<br />
* '''Maintainer:''' [https://craftdestiny.ovh LinuxVieLoisir]<br />
* '''Description:''' A Craft Destiny repository is there to avoid long compilation on some software. It also adds some very useful additional software.<br />
<br />
{{bc|<nowiki><br />
[craftdestiny]<br />
Server = https://miroir.craftdestiny.ovh/archlinux-repo/<br />
</nowiki>}}<br />
<br />
=== dx37essentials ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/DragonX256 DragonX256]<br />
* '''Description:''' Personal repository. Contains packages from AUR, which I using every day.<br />
* '''Git repo:''' https://gitlab.com/DX37/dx37essentials<br />
* '''Upstream page:''' https://dx37.gitlab.io/dx37essentials<br />
<br />
{{bc|<nowiki><br />
[dx37essentials]<br />
Server = https://dx37.gitlab.io/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== heftig ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/developers/#heftig Jan Steffens]<br />
* '''Description:''' Includes pulseaudio-git, pavucontrol-git, and firefox-developer-edition<br />
* '''Upstream page:''' https://bbs.archlinux.org/viewtopic.php?id=117157<br />
<br />
{{bc|<nowiki><br />
[heftig]<br />
Server = https://pkgbuild.com/~heftig/repo/$arch<br />
</nowiki>}}<br />
<br />
<br />
=== jkanetwork ===<br />
<br />
* '''Maintainer:''' kprkpr <kevin01010 at gmail dot com><br />
* '''Maintainer:''' Joselucross <jlgarrido97 at gmail dot com><br />
* '''Description:''' Packages of AUR like pimagizer,stepmania,yaourt,linux-mainline,wps-office,grub-customizer,some IDE.. Open for all that wants to contribute<br />
* '''Upstream page:''' http://repo.jkanetwork.com/<br />
<br />
{{bc|<nowiki><br />
[jkanetwork]<br />
Server = http://repo.jkanetwork.com/repo/$repo/<br />
</nowiki>}}<br />
<br />
=== mesa-git ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#lcarlier Laurent Carlier]<br />
* '''Description:''' Mesa git builds for the ''testing'' and ''multilib-testing'' repositories<br />
<br />
{{bc|<nowiki><br />
[mesa-git]<br />
Server = https://pkgbuild.com/~lcarlier/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== minzord===<br />
<br />
* '''Maintainer:''' Minzord<br />
* '''Description:''' A Minzord repository is there to avoid long compilation on some software. It also adds some very useful additional software.<br />
<br />
{{bc|<nowiki><br />
[minzord]<br />
Server = https://minzordos.000webhostapp.com/Repo/<br />
</nowiki>}}<br />
<br />
=== oracle ===<br />
<br />
* '''Maintainer:''' [[User:Malvineous]]<br />
* '''Description:''' [[Oracle Database client]] and associated tools, built from AUR packages and hosted on AWS S3 using [https://github.com/Malvineous/archlinux-pacman-repo Makefile scripts].<br />
* '''Conditions:''' By using this repository you agree to the [http://www.oracle.com/technetwork/licenses/instant-client-lic-152016.html Oracle Technology Network Development and Distribution License Terms for Instant Client].<br />
{{bc|<nowiki><br />
[oracle]<br />
Server = http://linux.shikadi.net/arch/$repo/$arch/<br />
</nowiki>}}<br />
<br />
=== ownstuff ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/Martchus Martchus]<br />
* '''Description:''' A lot of packages from the AUR, e.g. a great number of mingw-w64 packages, fonts, Perl modules, tools like {{AUR|tageditor}}, {{AUR|syncthingtray}}, {{AUR|subtitlecomposer}} and {{AUR|qmplay2}}<br />
* '''Upstream page''': https://github.com/Martchus/PKGBUILDs (sources beside the AUR) and https://martchus.no-ip.biz/repoindex (package browser/search)<br />
<br />
{{bc|<nowiki><br />
[ownstuff-testing]<br />
Server = https://martchus.no-ip.biz/repo/arch/$repo/os/$arch<br />
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch<br />
<br />
[ownstuff]<br />
Server = https://martchus.no-ip.biz/repo/arch/$repo/os/$arch<br />
Server = https://ftp.f3l.de/~martchus/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
{{Note|The testing repository is supposed to be used together with the official testing repositories.}}<br />
<br />
=== pantheon ===<br />
<br />
* '''Maintainer:''' [https://www.archlinux.org/people/trusted-users/#alucryd Maxime Gauduin]<br />
* '''Description:''' Repository containing Pantheon-related packages<br />
<br />
{{bc|<nowiki><br />
[pantheon]<br />
Server = https://pkgbuild.com/~alucryd/$repo/$arch<br />
</nowiki>}}<br />
<br />
=== pietma ===<br />
<br />
* '''Maintainer:''' MartiMcFly <martimcfly@autorisation.de><br />
* '''Description:''' Arch User Repository packages [https://aur.archlinux.org/packages/?K=martimcfly&SeB=m I create or maintain.].<br />
* '''Upstream page:''' http://pietma.com/tag/aur/<br />
<br />
{{bc|<nowiki><br />
[pietma]<br />
Server = http://repository.pietma.com/nexus/content/repositories/archlinux/$arch/$repo<br />
</nowiki>}}<br />
<br />
=== pnsft-pur ===<br />
<br />
* '''Maintainer:''' [https://aur.archlinux.org/account/ponsfoot ponsfoot]<br />
* '''Description:''' Japanese input method packages Mozc (vanilla) and libkkc<br />
<br />
{{bc|<nowiki><br />
[pnsft-pur]<br />
Server = https://osdn.net/projects/ponsfoot-aur/storage/pur/x86_64/<br />
</nowiki>}}</div>Xuanruiqihttps://wiki.archlinux.org/index.php?title=Programming_languages&diff=560718Programming languages2018-12-29T03:07:22Z<p>Xuanruiqi: Added some new SML implmentations with Arch packages</p>
<hr />
<div>[[Category:Programming languages]]<br />
[[Category:Lists of software]]<br />
[[es:Programming languages]]<br />
[[ru:Programming languages]]<br />
[[ja:プログラミング言語]]<br />
This page attempts to list all [[Wikipedia:Programming language|programming languages]] with a compiler / interpreter packaged for Arch Linux.<br />
<br />
* [[Wikipedia:Assembly language|Assembly]] – ''as'' of {{Pkg|binutils}}, {{Pkg|fasm}}, {{Pkg|nasm}}, {{Pkg|yasm}}<br />
* [[Wikipedia:Ada (programming language)|Ada]] – [[GCC]]<br />
* [[AWK]]<br />
* [[Wikipedia:BASIC|BASIC]] – {{Pkg|freebasic}}<br />
** [[Gambas]]<br />
* [[C]] – [[GCC]], [[Clang]]<br />
** [[C++]] – [[GCC]], [[Clang]]<br />
** [[Wikipedia:C Sharp (programming language)|C#]] – [[Mono]]<br />
** [[Wikipedia:Objective-C|Objective-C]] – [[GCC]], [[Clang]]<br />
** [[Wikipedia:Vala (programming language)|Vala]] – {{Pkg|vala}}<br />
** [https://ziglang.org/ Zig] – {{AUR|zig}}<br />
* [[Crystal]]<br />
* [[D]]<br />
* [[Wikipedia:Dart (programming language)|Dart]] – {{Pkg|dart}}<br />
* [[Wikipedia:Forth (programming language)|Forth]] – {{AUR|4th}}, {{AUR|gforth}}<br />
* [[Wikipedia:Fortran|Fortran]] – [[GCC]]<br />
* [[Go]] – {{Pkg|go}}, [[GCC]]<br />
* [[Java]]<br />
** [[Wikipedia:Apache Groovy|Groovy]] – {{Pkg|groovy}}<br />
** [[Scala]]<br />
* [[Wikipedia:JavaScript|JavaScript]] – {{Pkg|rhino}}, {{AUR|spidermonkey}}, {{AUR|v8}}<br />
** [[Node.js]]<br />
* [[Julia]]<br />
* [[Wikipedia:Kotlin (programming language)|Kotlin]] – {{Pkg|kotlin}}<br />
* [[Wikipedia:Lua (programming language)|Lua]] – {{Pkg|lua}}<br />
* [[Wikipedia:Nim (programming language)|Nim]] – {{Pkg|nim}}<br />
* [[Octave]]<br />
* [[Wikipedia:Pascal (programming language)|Pascal]] – {{Pkg|fpc}}<br />
* [[Perl]]<br />
* [[PHP]]<br />
* [[Python]]<br />
* [[R]]<br />
* [[Ruby]]<br />
* [[Rust]]<br />
* [[Wikipedia:Swift (programming language)|Swift]] – {{AUR|swift}}, {{AUR|swift-bin}}<br />
* [[Wikipedia:Tcl|Tcl]] – {{Pkg|tcl}}<br />
<br />
== Functional languages ==<br />
<br />
Note that some languages listed above also support some functional programming.<br />
<br />
* [[Wikipedia:Erlang (programming language)|Erlang]] – {{Pkg|erlang}}<br />
** [[Elixir]]<br />
* [[Haskell]]<br />
* [[Wikipedia:Lisp (programming language)|Lisp]] dialects<br />
** [[Clojure]]<br />
** [[Common Lisp]]<br />
** [[Emacs Lisp]]<br />
** [[Wikipedia:Scheme (programming language)|Scheme]] – {{Pkg|mit-scheme}}<br />
* [[Wikipedia:ML (programming language)|ML]]<br />
** [[Wikipedia:Standard ML|Standard ML]] – {{Pkg|smlnj}}, {{Pkg|mlton}}, {{AUR|mosml}}, {{AUR|smlsharp}}<br />
** [[Wikipedia:OCaml|OCaml]] – {{Pkg|ocaml}}<br />
<br />
== Shell languages ==<br />
<br />
[[Bash]] is part of the [[base group]]. For others, see [[Command-line shell]].<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:Comparison of programming languages]]<br />
* [[Wikipedia:History of programming languages]]<br />
* [[Wikipedia:List of programming languages]]</div>Xuanruiqi