title: mount.fuse3(8)

text:
# mount.fuse3(8)

## NAME
fuse - configuration and mount options for FUSE file systems

## DESCRIPTION
FUSE (Filesystem in Userspace) is a simple interface for userspace programs to export a virtual filesystem to the Linux kernel. FUSE also aims to provide a secure method for non privileged users to create and mount their own filesystem implementations.

## DEFINITIONS
FUSE

The in-kernel filesystem that forwards requests to a user-space process.

filesystem

The user-space process that responds to requests received from the kernel.

libfuse

The shared library that most (user-space) filesystems use to communicate with FUSE (the kernel filesystem). libfuse also provides the fusermount3 (or fusermount if you have older version of libfuse) helper to allow non-privileged users to mount filesystems.

filesystem owner

The user that starts the filesystem and instructs the kernel to associate it with a particular mountpoint. The latter is typically done by the filesystem itself on start-up. When using libfuse, this is done by calling the fusermount3 utility.

client

Any process that interacts with the mountpoint.

## CONFIGURATION
Some options regarding mount policy can be set in the file /etc/fuse.conf. Currently these options are:

mount_max = NNN

Set the maximum number of FUSE mounts allowed to non-root users. The default is 1000.

user_allow_other

Allow non-root users to specify the allow_other or allow_root mount options (see below).

These limits are enforced by the fusermount3 helper, so they can be avoided by filesystems that run as root.

## OPTIONS
Most of the generic mount options described in mount are supported (ro, rw, suid, nosuid, dev, nodev, exec, noexec, atime, noatime, sync, async, dirsync). Filesystems are mounted with nodev,nosuid by default, which can only be overridden by a privileged user.

### General mount options:
These are FUSE specific mount options that can be specified for all filesystems:

default_permissions

This option instructs the kernel to perform its own permission check instead of deferring all permission checking to the filesystem. The check by the kernel is done in addition to any permission checks by the filesystem, and both have to succeed for an operation to be allowed. The kernel performs a standard UNIX permission check (based on mode bits and ownership of the directory entry, and uid/gid of the client). This mount option is activated implicitly if the filesystem enables ACL support during the initial feature negotiation when opening the device fd. In this case, the kernel performs both ACL and standard unix permission checking.

Filesystems that do not implement any permission checking should generally add this option internally.

allow_other

This option overrides the security measure restricting file access to the filesystem owner, so that all users (including root) can access the files.

rootmode=M

Specifies the file mode of the filesystem's root (in octal representation).

blkdev

Mount a filesystem backed by a block device. This is a privileged option. The device must be specified with the fsname=NAME option.

blksize=N

Set the block size for the filesystem. This option is only valid for 'fuseblk' type mounts. The default is 512. In most cases, this option should not be specified by the filesystem owner but set internally by the filesystem.

max_read=N

With this option the maximum size of read operations can be set. The default is infinite, but typically the kernel enforces its own limit in addition to this one. A value of zero corresponds to no limit. This option should not be specified by the filesystem owner. The correct (or optimum) value depends on the filesystem implementation and should thus be set by the filesystem internally.

This mount option is deprecated in favor of direct negotiation over the device fd (as done for e.g. the maximum size of write operations). For the time being, libfuse-using filesystems that want to limit the read size must therefore use this mount option and set the same value again in the init() handler.

fd=N

The file descriptor to use for communication between the userspace filesystem and the kernel. The file descriptor must have been obtained by opening the FUSE device (/dev/fuse). This option should not be specified by the filesystem owner. It is set by libfuse (or, if libfuse is not used, must be set by the filesystem itself).

user_id=N

group_id=N Specifies the numeric uid/gid of the mount owner. This option should not be specified by the filesystem owner. It is set by libfuse (or, if libfuse is not used, must be set by the filesystem itself).

fsname=NAME

Sets the filesystem source (first field in /etc/mtab). The default is the name of the filesystem process.

subtype=TYPE

Sets the filesystem type (third field in /etc/mtab). The default is the name of the filesystem process. If the kernel supports it, /etc/mtab and /proc/mounts will show the filesystem type as fuse.TYPE If the kernel doesn't support subtypes, the source field will be TYPE#NAME, or if fsname option is not specified, just TYPE.

### libfuse-specific mount options:
These following options are not actually passed to the kernel but interpreted by libfuse. They can be specified for all filesystems that use libfuse:

allow_root

This option is similar to allow_other but file access is limited to the filesystem owner and root. This option and allow_other are mutually exclusive.

auto_unmount

This option enables automatic release of the mountpoint if filesystem terminates for any reason. Normally the filesystem is responsible for releasing the mountpoint, which means that the mountpoint becomes inaccessible if the filesystem terminates without first unmounting. This option is dangerous and should only be used after careful consideration of the risks.

Automatically unmounting the filesystem means that if the filesystem crashes the mountpoint may suddenly appear empty, which may have unintended consequences. For example, a running backup and mirroring program may conclude that all the data in the filesystem has been deleted and proceed to propagate this deletion to the backup / remote system. If the mountpoint instead becomes inaccessible (the default), most programs will behave correctly (report an error).

This feature may also accidentally unmount the wrong filesystem due to race conditions. For example, if another filesystem was mounted underneath the same mountpoint, or if a new filesystem is mounted after the FUSE process has crashed, it may accidentally get unmounted.

At the moment, this option implies that the filesystem will also be mounted with nodev and nosuid (even when mounted by root). This restriction may be lifted in the future.

### High-level mount options:
These following options are not actually passed to the kernel but interpreted by libfuse. They can only be specified for filesystems that use the high-level libfuse API:

kernel_cache

This option disables flushing the cache of the file contents on every open(2). This should only be enabled on filesystems, where the file data is never changed externally (not through the mounted FUSE filesystem). Thus it is not suitable for network filesystems and other "intermediate" filesystems. NOTE: if this option is not specified (and neither direct_io) data is still cached after the open(2), so a read(2) system call will not always initiate a read operation.

auto_cache

This option is an alternative to kernel_cache. Instead of unconditionally keeping cached data, the cached data is invalidated on open(2) if the modification time or the size of the file has changed since it was last opened.

umask=M

Override the permission bits in st_mode set by the filesystem. The resulting permission bits are the ones missing from the given umask value. The value is given in octal representation.

uid=N

Override the st_uid field set by the filesystem (N is numeric).

gid=N

Override the st_gid field set by the filesystem (N is numeric).

entry_timeout=T

The timeout in seconds for which name lookups will be cached. The default is 1.0 second. For all the timeout options, it is possible to give fractions of a second as well (e.g. entry_timeout=2.8)

negative_timeout=T

The timeout in seconds for which a negative lookup will be cached. This means, that if file did not exist (lookup returned ENOENT), the lookup will only be redone after the timeout, and the file/directory will be assumed to not exist until then. The default is 0.0 second, meaning that caching negative lookups are disabled.

attr_timeout=T

The timeout in seconds for which file/directory attributes are cached. The default is 1.0 second.

ac_attr_timeout=T

The timeout in seconds for which file attributes are cached for the purpose of checking if auto_cache should flush the file data on open. The default is the value of attr_timeout

noforget

remember=T

Normally, libfuse assigns inodes to paths only for as long as the kernel is aware of them. With this option inodes are instead assigned for at least T seconds (or, in the case of noforget, the life-time of the filesystem). This will require more memory, but may be necessary when using applications that make use of inode numbers.

modules=M1[:M2...]

Add modules to the filesystem stack. Modules are pushed in the order they are specified, with the original filesystem being on the bottom of the stack.

### mount.fuse3 options:
These options are interpreted by mount.fuse3 and are thus only available when mounting a file system via mount.fuse3 (such as when mounting via the generic mount(1) command or /etc/fstab). Supported options are:

setuid=USER

Switch to USER and its primary group before launching the FUSE file system process. mount.fuse3 must be run as root or with CAP_SETUID and CAP_SETGID for this to work.

drop_privileges

Perform setup of the FUSE file descriptor and mounting the file system before launching the FUSE file system process. mount.fuse3 requires privilege to do so, i.e. must be run as root or at least with CAP_SYS_ADMIN and CAP_SETPCAP. It will launch the file system process fully unprivileged, i.e. without capabilities(7) and prctl(2) flags set up such that privileges can't be reacquired (e.g. via setuid or fscaps binaries). This reduces risk in the event of the FUSE file system process getting compromised by malicious file system data.

## FUSE MODULES (STACKING)
Modules are filesystem stacking support to high level API. Filesystem modules can be built into libfuse or loaded from shared object

### iconv
Perform file name character set conversion. Options are:

from_code=CHARSET

Character set to convert from (see iconv -l for a list of possible values). Default is UTF-8.

to_code=CHARSET

Character set to convert to. Default is determined by the current locale.

### subdir
Prepend a given directory to each path. Options are:

subdir=DIR

Directory to prepend to all paths. This option is mandatory.

rellinks

Transform absolute symlinks into relative

norellinks

Do not transform absolute symlinks into relative. This is the default.

## SECURITY
The fusermount3 program is installed set-user-gid to fuse. This is done to allow users from fuse group to mount their own filesystem implementations. There must however be some limitations, in order to prevent Bad User from doing nasty things. Currently those limitations are:

1.

The user can only mount on a mountpoint, for which it has write permission

2.

The mountpoint is not a sticky directory which isn't owned by the user (like /tmp usually is)

3.

No other user (including root) can access the contents of the mounted filesystem.

## NOTE
FUSE filesystems are unmounted using the fusermount3(1) command (fusermount3 -u mountpoint).

## AUTHORS
FUSE is currently maintained by Nikolaus Rath <Nikolaus@rath.org>

The original author of FUSE is Miklos Szeredi <mszeredi@inf.bme.hu>.

This man page was originally written by Bastien Roucaries <roucaries.bastien+debian@gmail.com> for the Debian GNU/Linux distribution.

## SEE ALSO
fusermount3(1) fusermount(1) mount(8) fuse(4)


fwupd-refresh.service

package: fwupd

title: fwupd-refresh.service(8)

text:
# fwupd-refresh.service(8)

## NAME
fwupd-refresh.service — message of the day integration.

## DESCRIPTION
Message on the day integration is used to display the availability of updates when connecting to a remote console.

It has two elements:

•

Automatic firmware metadata refresh

•

Message of the day display

This uses a systemd timer to run on a regular cadence. To enable this, run:

```

```

```
  systemctl enable fwupd-refresh.timer
```

## NOTES
Motd display is dependent upon the availability of the update-motd snippet consumption service such as pam_motd.

To enable a proxy, set the systemd global environment in /etc/systemd/system.conf so all the systemd child processes have the proxy settings applied:

```

```

```
[Manager]
```

```
DefaultEnvironment=http_proxy=“http://internal.corp:3128/ ”https_proxy=“http://internal.corp:3128/”
```

## SEE ALSO
<fwupdmgr(1)> <fwupd.conf(5)>


fxload

package: fxload

title: fxload(8)

summary: Firmware download to EZ-USB devices

text:
# fxload(8)

## NAME
fxload - Firmware download to EZ-USB devices

## SYNOPSIS
fxload [ -v ] [ -D devpath ] [ -I hexfile ] [ -t type ] [ -c config ] [ -s loader ]

fxload [ -D devpath ] [ -L link ] [ -m mode ]

fxload [ -V ]

## DESCRIPTION
fxload is a program which downloads firmware to USB devices based on AnchorChips EZ-USB, Cypress EZ-USB FX, or Cypress EZ-USB FX2 microcontrollers. These have 8-bit 8051 cores with special extensions for USB I/O. The FX2 supports high speed USB 2.0 transfers (480 Mbit/sec) as well as full speed USB 1.1 transfers (12 Mbit/sec), while the earlier parts supports only full speed transfers. These controllers have several package options, and can be set up with external memory (on-chip memory is usually about 8K), EEPROMs, and ROMs when device costs allow.

This uses "usbfs" (older name: "usbdevfs") to access devices, and issues vendor specific control requests to download and reset the EZ-USB devices. Normally, firmware will then "renumerate" by disconnecting from USB and then reconnecting as a new device. It then appears with new device descriptors and functionality, as provided by the firmware which has been downloaded.

To support some non-firmware applications, this can also set up symbolic links for those usbfs names. It can also change their access modes. Both of these can help simplify software applications that need to talk to USB devices using user mode drivers, don't want to run with privileges or to examine all of the existing USB devices, and which don't need more kernel drivers.

See the Linux-Hotplug web site for information about how to use fxload to download device firmware when hotplugging USB devices, using driver-specific scripts stored in the /etc/hotplug/usb directory.

## FUNCTION LETTERS
At least one of the following options must be specified. Note that as usual with UNIX and Linux commands, the order of command option flags does not matter. You may use these in any order.

-I hexfile

Downloads the specified firmware file. This firmware is provided in standard Intel hexfile format. (Common naming conventions include *.hex and *.ihx.) Depending on the device and firmware in use, the -s option may also be necessary to specify a second stage loader. Firmware is normally downloaded to RAM and executed, but there is also an option for downloading into bootable I2C EEPROMs.

-L link

Creates the specified symbolic link to the usbfs device path. This would typically be used to create a name in a directory that would be searched by an application. The symlink would be removed by some other component on device unplug.

-m mode

Changes permissions on the "usbfs" device node. By default, those nodes are only accessible by privileged users, which doesn't help when the user mode device driver needs to run without root privileges. Note that usbfs mount options like devmode=0666 are also available.

-V

Identifies the version of fxload being invoked, and exits without performing other actions.

Note that when downloading firmware that renumerates, there's no point in changing the device permissions or creating a symbolic link.

## OPTIONS
By default, fxload assumes the device uses an EZ-USB or EZ-USB FX. It also assumes that the device in question has been specified by USB kernel hotplugging conventions, using the DEVICE environment variable to name a "usbfs" file that can be used to talk to the device.

-c config

Indicates the specified firmware should be downloaded to an I2C boot EEPROM rather than to RAM. The parameter is the EZ-USB FX or FX2 configuration byte, and for AnchorChips devices the value should be zero. This requires a second stage loader that knows how to write to I2C EEPROMs specified using the -s option, as well as a device that's provided with an EEPROM large enough to store the boot firmware. After downloading to a device's EEPROM, you should retest it starting from power off.

-s loader

This identifies the hex file holding a second stage loader (in the same hex file format as the firmware itself), which is loaded into internal memory. This loader understands additional vendor control requests, beyond the one built into all EZ-USB hardware, which are needed to write external RAM or EEPROM. As a last step when loading firmware, fxload normally overwrites this second stage loader with parts of the firmware residing on-chip.

-t type

Indicates which type of microcontroller is used in the device; type may be one of an21 (the original AnchorChips devices), fx (Cypress' updated version, the EZ-USB FX), or fx2 (the Cypress EZ-USB FX2, supporting high speed transfers). Except when writing to EEPROM, all that normally matters when downloading firmware is whether or not the device uses an FX2.

-v

Prints some diagnostics, such as download addresses and sizes, to standard error. Repeat the flag (-vv, -vvv) to get more diagnostics.

-D devpath

Specifies the "usbfs" path name for the device in question, such as /proc/bus/usb/004/080. This takes precedence over any DEVICE environment variable that may be set.

## NOTES
This program implements one extension to the standard "hex file" format. Lines beginning with a "#" character are ignored, and may be used to hold copyright statements and other information. Other tools may not handle hexfiles using this extension.

At this writing, "usbfs" is a kernel configuration option. That means that device drivers relying on user mode firmware downloading may need to depend on that kernel configuration option. A less preferable alternative involves compiling the firmware into the kernel and managing downloads and renumeration there. This is less preferable in part because much device firmware is provided with GPL-incompatible licensing, and in part because storing such firmware firmware wastes kernel memory.

For EZ-USB family devices, the hardware's first stage loader (supporting the 0xA0 vendor request) can't write into external memory. Configurations that put firmware into external memory thus need a second stage loader. For typical "flat" memory architectures, a loader supporting the 0xA3 vendor request is used to write into that memory. Similarly, a second stage loader that supports the 0xA2 vendor request is needed when writing boot firmware into an I2C EEPROM. These 0xA2 and 0xA3 vendor commands are conventions defined by Cypress. Devices that use bank switching or similar mechanisms to stretch the 64KByte address space may need different approach to loading firmware.

Not all devices support EEPROM updates. Some EZ-USB based devices don't have an I2C EEPROM; many such EEPROMs are too small to store firmware; and some firmware can't be placed in bootable I2C EEPROMs.

## ENVIRONMENT VARIABLES
DEVICE

normally names a "usbfs" file that will be used to talk to the device. This is provided by the Linux kernel as part of USB hotplugging.

## FILES
/usr/share/usb/a3load.hex

Second stage loader that works with AnchorChips EZ-USB, Cypress EZ-USB FX, and Cypress EZ-USB FX2. Note that this only supports the 0xA3 vendor command, to write external memory. A loader that also supports the 0xA2 command, to write boot EEPROMs, is included with Cypress developer kits.

## SEE ALSO
hotplug(8)

## AUTHORS
Linux Hotplugging Project http://linux-hotplug.sourceforge.net/


garbd

package: galera-garbd

title: garbd(8)

summary: arbitrator daemon for Galera cluster

text:
# garbd(8)

## NAME
garbd - arbitrator daemon for Galera cluster

## SYNOPSIS
garbd [options] [group address]

## DESCRIPTION
garbd joins Galera cluster as an additional node for the purpose of establishing quorum in case of network partitioning. It can do so by serving:

a) as an odd node to prevent split-brains;

b) as a reference connection point outside a datacenter.

Arbitrator node must see all messages that the other nodes of the cluster see, however it does not process them any further and just discards them. As such it does not store any cluster state and can't be used to bootstrap the cluster, so it only can join existing cluster.

## OPTIONS

### Configuration:
-d [ --daemon ]

Become daemon

-a [ --address ] arg

Group address in Galera format

-g [ --group ] arg

Group name

--sst arg

SST request string that contains SST request to trigger state snapshot dump (state backup) on one of the other nodes. For details refer to Galera documentation at https://www.galeracluster.com

--donor arg

SST donor name (for state dump)

-o [ --options ] arg

GCS/GCOMM option list. It is likely to be the same as on other nodes of the cluster.

-l [ --log ] arg

Path to log file

-c [ --cfg ] arg

Path to configuration file. Configuration file contains garbd options in the form <option>=<value>, one option per line. Hash symbol starts comments. Example:

\# garbd config file

daemon=1

address="gcomm://192.168.90.3:4567"

group="my_cluster"

options="gmcast.segment=4;"

log="/tmp/garb.log"

### Other options:
-v [ --version ]

Print version

-h [ --help ]

Show help message

## FILES
/etc/default/garb

The system wide configuration file for system service script on Debian-derived systems.

/etc/sysconfig/garb The system wide configuration file for system service script on Red Hat -derived systems.

## BUGS
See Galera bug tracker at https://github.com/codership/galera

## AUTHOR
Codership Oy <info at codership dot com>


gamemoded

package: gamemode-daemon

title: gamemoded(8)

text:
# gamemoded(8)

## NAME
gamemoded - daemon that optimises system performance on demand

## SYNOPSIS
gamemoded [OPTIONS...]

## DESCRIPTION
GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS.

The design has a clear cut abstraction between the host daemon and library (gamemoded and libgamemode), and the client loaders (libgamemodeauto and gamemode_client.h) that allows for safe usage without worrying about whether the daemon is installed or running. This design also means that while the host library currently relies on systemd for exchanging messages with the daemon, it's entirely possible to implement other internals that still work with the same clients.

GameMode was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is intended to be expanded beyond just CPU governor states, as there are a wealth of automation tasks one might want to apply.

## OPTIONS
-r[PID], --request=[PID]

Toggle gamemode for process. When no PID given, requests gamemode and pauses

-s[PID], --status=[PID]

Query the status of gamemode for process When no PID given, queries the status globally

-d, --daemonize

Run the daemon as a separate process (daemonize it)

-l, --log-to-syslog

Log to syslog

-h, --help

Print help text

-t, --test

Run diagnostic tests on the current installation

-v, --version

Print the version

## USAGE
libgamemodeauto.so.0 can be pre-loaded into any program to request gamemoded begin or end the mode. See gamemoderun(1) for details.

The gamemode_client.h header can be used by developers to build the requests into a program:

```
#include "gamemode_client.h"

    if( gamemode_request_start() < 0 ) {

        fprintf( stderr, "gamemode request failed: %s\n", gamemode_error_string() )

    }

    /* run the process */

    /* Not required, gamemoded can clean up after game exits */

    gamemode_request_end();
```

Atlernatively developers can define GAMEMODE_AUTO to mimic the behaviour of libgamemodeauto.so.0:

```
#define GAMEMODE_AUTO
#include "gamemode_client.h"
```

Or, distribute libgamemodeauto.so.0 and either link with -lgamemodeauto or inject it as above with LD_PRELOAD.

## CONFIG
gamemoded will load and merge gamemode.ini config files from these directories in the following order:

/usr/share/gamemode/

/etc/

$XDG_CONFIG_HOME or $HOME/.config/

$PWD

Behaviour of the config file can be explained by presenting a commented example:

```
[general]
; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance
reaper_freq=5
; The desired governor is used when entering GameMode instead of "performance"
desiredgov=performance
; The default governor is used when leaving GameMode instead of restoring the original value
;defaultgov=powersave
; The iGPU desired governor is used when the integrated GPU is under heavy load
igpu_desiredgov=powersave
; Threshold to use to decide when the integrated GPU is under heavy load.
; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the
; integraged GPU is under heavy enough load to justify switching to
; igpu_desiredgov.  Set this to -1 to disable all iGPU checking and always
; use desiredgov for games.
igpu_power_threshold=0.3
; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently
; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable
; with 4 or more CPU cores. "on" will always enable. Defaults to "off".
softrealtime=off
; GameMode can renice game processes. You can put any value between 0 and 20 here, the value
; will be negated and applied as a nice value (0 means no change). Defaults to 0.
; To use this feature, the user must be added to the gamemode group (and then rebooted):
; sudo usermod -aG gamemode $(whoami)
renice=0
; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value
; between 0 and 7 here (with 0 being highest priority), or one of the special values
; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority),
; currently, only the best-effort class is supported thus you cannot set it here
ioprio=0
; Sets whether gamemode will inhibit the screensaver when active
; Defaults to 1
inhibit_screensaver=1
; Sets whether gamemode will disable split lock mitigation when active
; Defaults to 1
disable_splitlock=1
[filter]
; If "whitelist" entry has a value(s)
; gamemode will reject anything not in the whitelist
;whitelist=RiseOfTheTombRaider
; Gamemode will always reject anything in the blacklist
;blacklist=HalfLife3
;    glxgears
[gpu]
; Here Be Dragons!
; Warning: Use these settings at your own risk
; Any damage to hardware incurred due to this feature is your responsibility and yours alone
; It is also highly recommended you try these settings out first manually to find the sweet spots
; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks
;apply_gpu_optimisations=0
; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
;gpu_device=0
; Nvidia specific settings
; Requires the coolbits extension activated in nvidia-xconfig
; This corresponds to the desired GPUPowerMizerMode
; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2
; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h
;nv_powermizer_mode=1
; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer
; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values
;nv_core_clock_mhz_offset=0
;nv_mem_clock_mhz_offset=0
; AMD specific settings
; Requires a relatively up to date AMDGPU kernel module
; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring
; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures
; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now
;amd_performance_level=high
[cpu]
; Parking or Pinning can be enabled with either "yes", "true" or "1" and disabled with "no", "false" or "0".
; Either can also be set to a specific list of cores to park or pin, comma separated list where "-" denotes
; a range. E.g "park_cores=1,8-15" would park cores 1 and 8 to 15.
; The default is uncommented is to disable parking but enable pinning. If either is enabled the code will
; currently only properly autodetect Ryzen 7900x3d, 7950x3d and Intel CPU:s with E- and P-cores.
; For Core Parking, user must be added to the gamemode group (not required for Core Pinning):
; sudo usermod -aG gamemode $(whoami)
;park_cores=no
;pin_cores=yes
[supervisor]
; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for
; The whilelist and blacklist control which supervisor programs are allowed to make the above requests
;supervisor_whitelist=
;supervisor_blacklist=
; In case you want to allow a supervisor to take full control of gamemode, this option can be set
; This will only allow gamemode clients to be registered by using the above functions by a supervisor client
;require_supervisor=0
[custom]
; Custom scripts (executed using the shell) when gamemode starts and ends
;start=notify-send "GameMode started"
;    /home/me/bin/stop_foldingathome.sh
;end=notify-send "GameMode ended"
;    /home/me/bin/start_foldingathome.sh
; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time.
;script_timeout=10
```

## SEE ALSO
gamemoderun(1), systemd(1)

## ABOUT
GameMode source can be found at https://github.com/FeralInteractive/gamemode.git

## AUTHOR
Feral Interactive (linux-contact@feralinteractive.com)


gdisk

package: gdisk

title: gdisk(8)

text:
# gdisk(8)

## NAME
gdisk - Interactive GUID partition table (GPT) manipulator

## SYNOPSIS
gdisk [ -l ] device

## DESCRIPTION
GPT fdisk (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables. It will automatically convert an old-style Master Boot Record (MBR) partition table or BSD disklabel stored without an MBR carrier partition to the newer Globally Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID partition table. When used with the -l command-line option, the program displays the current partition table and then exits.

GPT fdisk operates mainly on the GPT headers and partition tables; however, it can and will generate a fresh protective MBR, when required. (Any boot loader code in the protective MBR will not be disturbed.) If you've created an unusual protective MBR, such as a hybrid MBR created by gptsync or gdisk's own hybrid MBR creation feature, this should not be disturbed by most ordinary actions. Some advanced data recovery options require you to understand the distinctions between the main and backup data, as well as between the GPT headers and the partition tables. For information on MBR vs. GPT, as well as GPT terminology and structure, see the extended gdisk documentation at https://www.rodsbooks.com/gdisk/ or consult Wikipedia.

The gdisk program employs a user interface similar to that of Linux's fdisk, but gdisk modifies GPT partitions. It also has the capability of transforming MBR partitions or BSD disklabels into GPT partitions. Like the original fdisk program, gdisk does not modify disk structures until you explicitly write them to disk, so if you make a mistake, you can exit from the program with the 'q' option to leave your partitions unmodified.

Ordinarily, gdisk operates on disk device files, such as /dev/sda or /dev/hda under Linux, /dev/disk0 under Mac OS X, or /dev/ad0 or /dev/da0 under FreeBSD. The program can also operate on disk image files, which can be either copies of whole disks (made with dd, for instance) or raw disk images used by emulators such as QEMU or VMWare. Note that only raw disk images are supported; gdisk cannot work on compressed or other advanced disk image formats.

The MBR partitioning system uses a combination of cylinder/head/sector (CHS) addressing and logical block addressing (LBA). The former is klunky and limiting. GPT drops CHS addressing and uses 64-bit LBA mode exclusively. Thus, GPT data structures, and therefore gdisk, do not need to deal with CHS geometries and all the problems they create. Users of fdisk will note that gdisk lacks the options and limitations associated with CHS geometries.

For best results, you should use an OS-specific partition table program whenever possible. For example, you should make Mac OS X partitions with the Mac OS X Disk Utility program and Linux partitions with the Linux gdisk or GNU Parted program.

Upon start, gdisk attempts to identify the partition type in use on the disk. If it finds valid GPT data, gdisk will use it. If gdisk finds a valid MBR or BSD disklabel but no GPT data, it will attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are likely to have unusable first and/or final partitions because they overlap with the GPT data structures, though.) GPT fdisk can identify, but not use data in, Apple Partition Map (APM) disks, which are used on 680x0- and PowerPC-based Macintoshes. Upon exiting with the 'w' option, gdisk replaces the MBR or disklabel with a GPT. This action is potentially dangerous! Your system may become unbootable, and partition type codes may become corrupted if the disk uses unrecognized type codes. Boot problems are particularly likely if you're multi-booting with any GPT-unaware OS. If you mistakenly launch gdisk on an MBR disk, you can safely exit the program without making any changes by using the 'q' option.

The MBR-to-GPT conversion will leave at least one gap in the partition numbering if the original MBR used logical partitions. These gaps are harmless, but you can eliminate them by using the 's' option, if you like. (Doing this may require you to update your /etc/fstab file.)

When creating a fresh partition table, certain considerations may be in order:

*

For data (non-boot) disks, and for boot disks used on BIOS-based computers with GRUB as the boot loader, partitions may be created in whatever order and in whatever sizes are desired.

*

Boot disks for EFI-based systems require an EFI System Partition (gdisk internal code 0xEF00) formatted as FAT-32. I recommended making this partition 550 MiB. (Smaller ESPs are common, but some EFIs have flaky FAT drivers that necessitate a larger partition for reliable operation.) Boot-related files are stored here. (Note that GNU Parted identifies such partitions as having the "boot flag" set.)

*

Some boot loaders for BIOS-based systems make use of a BIOS Boot Partition (gdisk internal code 0xEF02), in which the secondary boot loader is stored, possibly without the benefit of a filesystem. (GRUB2 may optionally use such a partition.) This partition can typically be quite small (roughly 32 to 200 KiB, although 1 MiB is more common in practice), but you should consult your boot loader documentation for details.

*

If Windows is to boot from a GPT disk, a partition of type Microsoft Reserved (gdisk internal code 0x0C01) is recommended. This partition should be about 128 MiB in size. It ordinarily follows the EFI System Partition and immediately precedes the Windows data partitions. (Note that old versions of GNU Parted create all FAT partitions as this type, which actually makes the partition unusable for normal file storage in both Windows and Mac OS X.)

*

Some OSes' GPT utilities create some blank space (typically 128 MiB) after each partition. The intent is to enable future disk utilities to use this space. Such free space is not required of GPT disks, but creating it may help in future disk maintenance. You can use GPT fdisk's relative partition positioning option (specifying the starting sector as '+128M', for instance) to simplify creating such gaps.

## OPTIONS
-l

List the partition table for the specified device and then exits.

Most interactions with gdisk occur with its interactive text-mode menus. Three menus exist: the main menu, the recovery & transformation menu, and the experts' menu. The main menu provides the functions that are most likely to be useful for typical partitioning tasks, such as creating and deleting partitions, changing partition type codes, and so on. Specific functions are:

b

Save partition data to a backup file. You can back up your current in-memory partition table to a disk file using this option. The resulting file is a binary file consisting of the protective MBR, the main GPT header, the backup GPT header, and one copy of the partition table, in that order. Note that the backup is of the current in-memory data structures, so if you launch the program, make changes, and then use this option, the backup will reflect your changes. Note also that the restore option is on the recovery & transformation menu; the backup option is on the main menu to encourage its use.

c

Change the GPT name of a partition. This name is encoded as a UTF-16 string, but proper entry and display of anything beyond basic ASCII values requires suitable locale and font support. For the most part, Linux ignores the partition name, but it may be important in some OSes. GPT fdisk sets a default name based on the partition type code. Note that the GPT partition name is different from the filesystem name, which is encoded in the filesystem's data structures.

d

Delete a partition. This action deletes the entry from the partition table but does not disturb the data within the sectors originally allocated to the partition on the disk. If a corresponding hybrid MBR partition exists, gdisk deletes it, as well, and expands any adjacent 0xEE (EFI GPT) MBR protective partition to fill the new free space.

i

Show detailed partition information. The summary information produced by the 'p' command necessarily omits many details, such as the partition's unique GUID and the translation of gdisk's internal partition type code to a plain type name. The 'i' option displays this information for a single partition.

l

Display a summary of partition types. GPT uses a GUID to identify partition types for particular OSes and purposes. For ease of data entry, gdisk compresses these into two-byte (four-digit hexadecimal) values that are related to their equivalent MBR codes. Specifically, the MBR code is multiplied by hexadecimal 0x0100. For instance, the code for Linux swap space in MBR is 0x82, and it's 0x8200 in gdisk. A one-to-one correspondence is impossible, though. Most notably, the codes for all varieties of FAT and NTFS partition correspond to a single GPT code (entered as 0x0700 in gdisk). Some OSes use a single MBR code but employ many more codes in GPT. For these, gdisk adds code numbers sequentially, such as 0xa500 for a FreeBSD disklabel, 0xa501 for FreeBSD boot, 0xa502 for FreeBSD swap, and so on. Note that these two-byte codes are unique to gdisk. The type code list may optionally be filtered by a search string; for instance, entering linux shows only partition type codes with descriptions that include the string Linux. This search is performed case-insensitively.

n

Create a new partition. This command is modeled after the equivalent fdisk option, although some differences exist. You enter a partition number, starting sector, and an ending sector. Both start and end sectors can be specified in absolute terms as sector numbers or as positions measured in kibibytes (K), mebibytes (M), gibibytes (G), tebibytes (T), or pebibytes (P); for instance, 40M specifies a position 40MiB from the start of the disk. You can specify locations relative to the start or end of the specified default range by preceding the number by a '+' or '-' symbol, as in +2G to specify a point 2GiB after the default start sector, or -200M to specify a point 200MiB before the last available sector. Pressing the Enter key with no input specifies the default value, which is the start of the largest available block for the start sector and the end of the same block for the end sector. Default start and end points may be adjusted to optimize partition alignment.

o

Clear out all partition data. This includes GPT header data, all partition definitions, and the protective MBR. The sector alignment is reset to the default (1 MiB, or 2048 sectors on a disk with 512-byte sectors).

p

Display basic partition summary data. This includes partition numbers, starting and ending sector numbers, partition sizes, gdisk's partition types codes, and partition names. For additional information, use the 'i' command.

q

Quit from the program without saving your changes. Use this option if you just wanted to view information or if you make a mistake and want to back out of all your changes.

r

Enter the recovery & transformation menu. This menu includes emergency recovery options (to fix damaged GPT data structures) and options to transform to or from other partitioning systems, including creating hybrid MBRs.

s

Sort partition entries. GPT partition numbers need not match the order of partitions on the disk. If you want them to match, you can use this option. Note that some partitioning utilities sort partitions whenever they make changes. Such changes will be reflected in your device filenames, so you may need to edit /etc/fstab if you use this option.

t

Change a single partition's type code. You enter the type code using a two-byte hexadecimal number, as described earlier. You may also enter a GUID directly, if you have one and gdisk doesn't know it.

v

Verify disk. This option checks for a variety of problems, such as incorrect CRCs and mismatched main and backup data. This option does not automatically correct most problems, though; for that, you must use options on the recovery & transformation menu. If no problems are found, this command displays a summary of unallocated disk space.

w

Write data. Use this command to save your changes.

x

Enter the experts' menu. Using this option provides access to features you can use to get into even more trouble than the main menu allows.

?

Print the menu. Type this command (or any other unrecognized command) to see a summary of available options.

The second gdisk menu is the recovery & transformation menu, which provides access to data recovery options and features related to the transformation of partitions between partitioning schemes (converting BSD disklabels into GPT partitions or creating hybrid MBRs, for instance). A few options on this menu duplicate functionality on the main menu, for the sake of convenience. The options on this menu are:

b

Rebuild GPT header from backup. You can use the backup GPT header to rebuild the main GPT header with this option. It's likely to be useful if your main GPT header was damaged or destroyed (say, by sloppy use of dd).

c

Load backup partition table. Ordinarily, gdisk uses only the main partition table (although the backup's integrity is checked when you launch the program). If the main partition table has been damaged, you can use this option to load the backup from disk and use it instead. Note that this will almost certainly produce no or strange partition entries if you've just converted an MBR disk to GPT format, since there will be no backup partition table on disk.

d

Use main GPT header and rebuild the backup. This option is likely to be useful if the backup GPT header has been damaged or destroyed.

e

Load main partition table. This option reloads the main partition table from disk. It's only likely to be useful if you've tried to use the backup partition table (via 'c') but it's in worse shape then the main partition table.

f

Load MBR and build fresh GPT from it. Use this option if your GPT is corrupt or conflicts with the MBR and you want to use the MBR as the basis for a new set of GPT partitions.

g

Convert GPT into MBR and exit. This option converts as many partitions as possible into MBR form, destroys the GPT data structures, saves the new MBR, and exits. Use this option if you've tried GPT and find that MBR works better for you. Note that this function generates up to four primary MBR partitions or three primary partitions and as many logical partitions as can be generated. Each logical partition requires at least one unallocated block immediately before its first block. Therefore, it may be possible to convert a maximum of four partitions on disks with tightly-packed partitions; however, if free space was inserted between partitions when they were created, and if the disk is under 2 TiB in size, it should be possible to convert all the partitions to MBR form. See also the 'h' option.

h

Create a hybrid MBR. This is an ugly workaround that enables GPT-unaware OSes, or those that can't boot from a GPT disk, to access up to three of the partitions on the disk by creating MBR entries for them. Note that these hybrid MBR entries can easily go out of sync with the GPT entries, particularly when hybrid-unaware GPT utilities are used to edit the disk. Thus, you may need to re-create the hybrid MBR if you use such tools. Unlike the 'g' option, this option does not support converting any partitions into MBR logical partitions.

i

Show detailed partition information. This option is identical to the 'i' option on the main menu.

l

Load partition data from a backup file. This option is the reverse of the 'b' option on the main menu. Note that restoring partition data from anything but the original disk is not recommended.

m

Return to the main menu. This option enables you to enter main-menu commands.

o

Print protective MBR data. You can see a summary of the protective MBR's partitions with this option. This may enable you to spot glaring problems or help identify the partitions in a hybrid MBR.

p

Print the partition table. This option is identical to the 'p' option in the main menu.

q

Quit without saving changes. This option is identical to the 'q' option in the main menu.

t

Transform BSD partitions into GPT partitions. This option works on BSD disklabels held within GPT (or converted MBR) partitions. Converted partitions' type codes are likely to need manual adjustment. gdisk will attempt to convert BSD disklabels stored on the main disk when launched, but this conversion is likely to produce first and/or last partitions that are unusable. The many BSD variants means that the probability of gdisk being unable to convert a BSD disklabel is high compared to the likelihood of problems with an MBR conversion.

v

Verify disk. This option is identical to the 'v' option in the main menu.

w

Write table to disk and exit. This option is identical to the 'w' option in the main menu.

x

Enter the experts' menu. This option is identical to the 'x' option in the main menu.

?

Print the menu. This option (or any unrecognized entry) displays a summary of the menu options.

The third gdisk menu is the experts' menu. This menu provides advanced options that aren't closely related to recovery or transformation between partitioning systems. Its options are:

a

Set attributes. GPT provides a 64-bit attributes field that can be used to set features for each partition. gdisk supports four attributes: system partition, read-only, hidden, and do not automount. You can set other attributes, but their numbers aren't translated into anything useful. In practice, most OSes seem to ignore these attributes.

b

Swap the byte order for the name of the specified partition. Some partitioning tools, including GPT fdisk 1.0.7 and earlier, can write the partition name in the wrong byte order on big-endian computers, such as the IBM s390 mainframes and PowerPC-based Macs. This feature corrects this problem.

c

Change partition GUID. You can enter a custom unique GUID for a partition using this option. (Note this refers to the GUID that uniquely identifies a partition, not to its type code, which you can change with the 't' main-menu option.) Ordinarily, gdisk assigns this number randomly; however, you might want to adjust the number manually if you've wound up with the same GUID on two partitions because of buggy GUID assignments (hopefully not in gdisk) or sheer incredible coincidence.

d

Display the sector alignment value. See the description of the 'l' option for more details.

e

Move backup GPT data structures to the end of the disk. Use this command if you've added disks to a RAID array, thus creating a virtual disk with space that follows the backup GPT data structures. This command moves the backup GPT data structures to the end of the disk, where they belong.

f

Randomize the disk's GUID and all partitions' unique GUIDs (but not their partition type code GUIDs). This function may be used after cloning a disk with another utility in order to render all GUIDs once again unique.

g

Change disk GUID. Each disk has a unique GUID code, which gdisk assigns randomly upon creation of the GPT data structures. You can generate a fresh random GUID or enter one manually with this option.

h

Recompute CHS values in protective or hybrid MBR. This option can sometimes help if a disk utility, OS, or BIOS doesn't like the CHS values used by the partitions in the protective or hybrid MBR. In particular, the GPT specification requires a CHS value of 0xFFFFFF for over-8GiB partitions, but this value is technically illegal by the usual standards. Some BIOSes hang if they encounter this value. This option will recompute a more normal CHS value -- 0xFEFFFF for over-8GiB partitions, enabling these BIOSes to boot.

i

Show detailed partition information. This option is identical to the 'i' option on the main menu.

j

Adjust the location of the main partition table. This value is normally 2, but it may need to be increased in some cases, such as when a system-on-chip (SoC) is hard-coded to read boot code from sector 2. I recommend against adjusting this value unless doing so is absolutely necessary.

l

Change the sector alignment value. Disks with more logical sectors per physical sectors (such as modern Advanced Format drives), some RAID configurations, and many SSD devices, can suffer performance problems if partitions are not aligned properly for their internal data structures. On new disks, GPT fdisk attempts to align partitions on 1 MiB boundaries (2048 sectors on disks with 512-byte sectors) by default, which optimizes performance for all of these disk types. On pre-partitioned disks, GPT fdisk attempts to identify the alignment value used on that disk, but will set 8-sector alignment on disks larger than 300 GB even if lesser alignment values are detected. In either case, it can be changed by using this option. The alignment value also affects the default end sector value when creating a new partition; it will be aligned to one less than a multiple of the alignment value, if possible. This should keep partitions a multiple of the alignment value in size. Some disk encryption tools require partitions to be sized to some value, typically 4096 bytes, so the default alignment of 1 MiB works well for them.

m

Return to the main menu. This option enables you to enter main-menu commands.

n

Create a new protective MBR. Use this option if the current protective MBR is damaged in a way that gdisk doesn't automatically detect and correct, or if you want to convert a hybrid MBR into a "pure" GPT with a conventional protective MBR.

o

Print protective MBR data. You can see a summary of the protective MBR's partitions with this option. This may enable you to spot glaring problems or help identify the partitions in a hybrid MBR.

p

Print the partition table. This option is identical to the 'p' option in the main menu.

q

Quit without saving changes. This option is identical to the 'q' option in the main menu.

r

Enter the recovery & transformations menu. This option is identical to the 'r' option on the main menu.

s

Resize partition table. The default partition table size is 128 entries. Officially, sizes of less than 16KB (128 entries, given the normal entry size) are unsupported by the GPT specification; however, in practice they seem to work, and can sometimes be useful in converting MBR disks. Larger sizes also work fine. OSes may impose their own limits on the number of partitions, though.

t

Swap two partitions' entries in the partition table. One partition may be empty. For instance, if partitions 1-4 are defined, transposing 1 and 5 results in a table with partitions numbered from 2-5. Transposing partitions in this way has no effect on their disk space allocation; it only alters their order in the partition table.

u

Replicate the current device's partition table on another device. You will be prompted to type the new device's filename. After the write operation completes, you can continue editing the original device's partition table. Note that the replicated partition table is an exact copy, including all GUIDs; if the device should have its own unique GUIDs, you should use the f option on the new disk.

v

Verify disk. This option is identical to the 'v' option in the main menu.

z

Zap (destroy) the GPT data structures and exit. Use this option if you want to repartition a GPT disk using fdisk or some other GPT-unaware program. You'll be given the choice of preserving the existing MBR, in case it's a hybrid MBR with salvageable partitions or if you've already created new MBR partitions and want to erase the remnants of your GPT partitions. If you've already created new MBR partitions, it's conceivable that this option will damage the first and/or last MBR partitions! Such an event is unlikely, but could occur if your new MBR partitions overlap the old GPT data structures.

?

Print the menu. This option (or any unrecognized entry) displays a summary of the menu options.

In many cases, you can press the Enter key to select a default option when entering data. When only one option is possible, gdisk usually bypasses the prompt entirely.

## BUGS
Known bugs and limitations include:

*

The program compiles correctly only on Linux, FreeBSD, Mac OS X, and Windows. Linux versions for x86-64 (64-bit), x86 (32-bit), and PowerPC (32-bit) have been tested, with the x86-64 version having seen the most testing. Under FreeBSD, 32-bit (x86) and 64-bit (x86-64) versions have been tested. Only 32-bit versions for Mac OS X and Windows have been tested by the author, although I've heard of 64-bit versions being successfully compiled.

*

The FreeBSD version of the program can't write changes to the partition table to a disk when existing partitions on that disk are mounted. (The same problem exists with many other FreeBSD utilities, such as gpt, fdisk, and dd.) This limitation can be overcome by typing sysctl kern.geom.debugflags=16 at a shell prompt.

*

The fields used to display the start and end sector numbers for partitions in the 'p' command are 14 characters wide. This translates to a limitation of about 45 PiB. On larger disks, the displayed columns will go out of alignment.

*

In the Windows version, only ASCII characters are supported in the partition name field. If an existing partition uses non-ASCII UTF-16 characters, they're likely to be corrupted in the 'i' and 'p' menu options' displays; however, they should be preserved when loading and saving partitions. Binaries for Linux, FreeBSD, and OS X support full UTF-16 partition names.

*

The program can load only up to 128 partitions (4 primary partitions and 124 logical partitions) when converting from MBR format. This limit can be raised by changing the #define MAX_MBR_PARTS line in the basicmbr.h source code file and recompiling; however, such a change will require using a larger-than-normal partition table. (The limit of 128 partitions was chosen because that number equals the 128 partitions supported by the most common partition table size.)

*

Converting from MBR format sometimes fails because of insufficient space at the start or (more commonly) the end of the disk. Resizing the partition table (using the 's' option in the experts' menu) can sometimes overcome this problem; however, in extreme cases it may be necessary to resize a partition using GNU Parted or a similar tool prior to conversion with gdisk.

*

MBR conversions work only if the disk has correct LBA partition descriptors. These descriptors should be present on any disk over 8 GiB in size or on smaller disks partitioned with any but very ancient software.

*

BSD disklabel support can create first and/or last partitions that overlap with the GPT data structures. This can sometimes be compensated by adjusting the partition table size, but in extreme cases the affected partition(s) may need to be deleted.

*

Because of the highly variable nature of BSD disklabel structures, conversions from this form may be unreliable -- partitions may be dropped, converted in a way that creates overlaps with other partitions, or converted with incorrect start or end values. Use this feature with caution!

*

Booting after converting an MBR or BSD disklabel disk is likely to be disrupted. Sometimes re-installing a boot loader will fix the problem, but other times you may need to switch boot loaders. Except on EFI-based platforms, Windows through at least Windows 7 doesn't support booting from GPT disks. Creating a hybrid MBR (using the 'h' option on the recovery & transformation menu) or abandoning GPT in favor of MBR may be your only options in this case.

## AUTHORS
Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)

Contributors:

* Yves Blusseau (1otnwmz02@sneakemail.com)

* David Hubbard (david.c.hubbard@gmail.com)

* Justin Maggard (justin.maggard@netgear.com)

* Dwight Schauer (das@teegra.net)

* Florian Zumbiehl (florz@florz.de)

## SEE ALSO
cfdisk(8), cgdisk(8), fdisk(8), mkfs(8), parted(8), sfdisk(8), sgdisk(8), fixparts(8).

https://en.wikipedia.org/wiki/GUID_Partition_Table

https://developer.apple.com/technotes/tn2006/tn2166.html

https://www.rodsbooks.com/gdisk/

## AVAILABILITY
The gdisk command is part of the GPT fdisk package and is available from Rod Smith.


sgdisk

title: sgdisk(8)

summary: Command\-line GUID partition table (GPT) manipulator for Linux and Unix

text:
# sgdisk(8)

## NAME
sgdisk - Command-line GUID partition table (GPT) manipulator for Linux and Unix

## SYNOPSIS
sgdisk [ options ] device

## DESCRIPTION
GPT fdisk is a text-mode menu-driven package for creation and manipulation of partition tables. It consists of two programs: the text-mode interactive gdisk and the command-line sgdisk. Either program will automatically convert an old-style Master Boot Record (MBR) partition table or BSD disklabel stored without an MBR carrier partition to the newer Globally Unique Identifier (GUID) Partition Table (GPT) format, or will load a GUID partition table. This man page documents the command-line sgdisk program.

Some advanced data manipulation and recovery options require you to understand the distinctions between the main and backup data, as well as between the GPT headers and the partition tables. For information on MBR vs. GPT, as well as GPT terminology and structure, see the extended gdisk documentation at https://www.rodsbooks.com/gdisk/ or consult Wikipedia.

The sgdisk program employs a user interface that's based entirely on the command line, making it suitable for use in scripts or by experts who want to make one or two quick changes to a disk. (The program may query the user when certain errors are encountered, though.) The program's name is based on sfdisk, but the user options of the two programs are entirely different from one another.

Ordinarily, sgdisk operates on disk device files, such as /dev/sda or /dev/hda under Linux, /dev/disk0 under Mac OS X, or /dev/ad0 or /dev/da0 under FreeBSD. The program can also operate on disk image files, which can be either copies of whole disks (made with dd, for instance) or raw disk images used by emulators such as QEMU or VMWare. Note that only raw disk images are supported; sgdisk cannot work on compressed or other advanced disk image formats.

The MBR partitioning system uses a combination of cylinder/head/sector (CHS) addressing and logical block addressing (LBA). The former is klunky and limiting. GPT drops CHS addressing and uses 64-bit LBA mode exclusively. Thus, GPT data structures, and therefore sgdisk, do not need to deal with CHS geometries and all the problems they create.

For best results, you should use an OS-specific partition table program whenever possible. For example, you should make Mac OS X partitions with the Mac OS X Disk Utility program and Linux partitions with the Linux gdisk, sgdisk, or GNU Parted programs.

Upon start, sgdisk attempts to identify the partition type in use on the disk. If it finds valid GPT data, sgdisk will use it. If sgdisk finds a valid MBR or BSD disklabel but no GPT data, it will attempt to convert the MBR or disklabel into GPT form. (BSD disklabels are likely to have unusable first and/or final partitions because they overlap with the GPT data structures, though.) GPT fdisk can identify, but not use data in, Apple Partition Map (APM) disks, which are used on 680x0- and PowerPC-based Macintoshes. If you specify any option that results in changes to an MBR or BSD disklabel, sgdisk ignores those changes unless the -g (--mbrtogpt), -z (--zap), or -Z (--zap-all) option is used. If you use the -g option, sgdisk replaces the MBR or disklabel with a GPT. This action is potentially dangerous! Your system may become unbootable, and partition type codes may become corrupted if the disk uses unrecognized type codes. Boot problems are particularly likely if you're multi-booting with any GPT-unaware OS.

The MBR-to-GPT conversion will leave at least one gap in the partition numbering if the original MBR used logical partitions. These gaps are harmless, but you can eliminate them by using the -s (--sort) option, if you like. (Doing this may require you to update your /etc/fstab file.)

When creating a fresh partition table, certain considerations may be in order:

*

For data (non-boot) disks, and for boot disks used on BIOS-based computers with GRUB as the boot loader, partitions may be created in whatever order and in whatever sizes are desired.

*

Boot disks for EFI-based systems require an EFI System Partition (gdisk internal code 0xEF00) formatted as FAT-32. I recommended making this partition 550 MiB. (Smaller ESPs are common, but some EFIs have flaky FAT drivers that necessitate a larger partition for reliable operation.) Boot-related files are stored here. (Note that GNU Parted identifies such partitions as having the "boot flag" set.)

*

Some boot loaders for BIOS-based systems make use of a BIOS Boot Partition (gdisk internal code 0xEF02), in which the secondary boot loader is stored, possibly without the benefit of a filesystem. (GRUB2 may optionally use such a partition.) This partition can typically be quite small (roughly 32 to 200 KiB, although 1 MiB is more common in practice), but you should consult your boot loader documentation for details.

*

If Windows is to boot from a GPT disk, a partition of type Microsoft Reserved (sgdisk internal code 0x0C01) is recommended. This partition should be about 128 MiB in size. It ordinarily follows the EFI System Partition and immediately precedes the Windows data partitions. (Note that GNU Parted creates all FAT partitions as this type, which actually makes the partition unusable for normal file storage in both Windows and Mac OS X.)

*

Some OSes' GPT utilities create some blank space (typically 128 MiB) after each partition. The intent is to enable future disk utilities to use this space. Such free space is not required of GPT disks, but creating it may help in future disk maintenance.

## OPTIONS
Some options take no arguments, others take one argument (typically a partition number), and others take compound arguments with colon delimitation. For instance, -n (--new) takes a partition number, a starting sector number, and an ending sector number, as in sgdisk -n 2:2000:50000 /dev/sdc, which creates a new partition, numbered 2, starting at sector 2000 an ending at sector 50,000, on /dev/sdc.

Unrelated options may be combined; however, some such combinations will be nonsense (such as deleting a partition and then changing its GUID type code). sgdisk interprets options in the order in which they're entered, so effects can vary depending on order. For instance, sgdisk -s -d 2 sorts the partition table entries and then deletes partition 2 from the newly-sorted list; but sgdisk -d 2 -s deletes the original partition 2 and then sorts the modified partition table.

Error checking and opportunities to correct mistakes in sgdisk are minimal. Although the program endeavors to keep the GPT data structures legal, it does not prompt for verification before performing its actions. Unless you require a command-line-driven program, you should use the interactive gdisk instead of sgdisk, since gdisk allows you to quit without saving your changes, should you make a mistake.

Although sgdisk is based on the same partition-manipulation code as gdisk, sgdisk implements fewer features than its interactive sibling. Options available in sgdisk are:

-a, --set-alignment=value

Set the sector alignment multiple. GPT fdisk aligns the start of partitions to sectors that are multiples of this value, which defaults to 1 MiB (2048 on disks with 512-byte sectors) on freshly formatted disks. This alignment value is necessary to obtain optimum performance with Western Digital Advanced Format and similar drives with larger physical than logical sector sizes, with some types of RAID arrays, and with SSD devices. When the -I option is used, this same alignment value is used to determine partition end points; but partitions end at one less than a multiple of this value, to keep the partition length a multiple of this value.

-A, --attributes=list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]

View or set partition attributes. Use list to see defined (known) attribute values. Omit the partition number (and even the device filename) when using this option. The others require a partition number. The show and get options show the current attribute settings (all attributes or for a particular bit, respectively). The or, nand, xor, =, set, clear, and toggle options enable you to change the attribute bit value. The set, clear, toggle, and get options work on a bit number; the others work on a hexadecimal bit mask. For example, type sgdisk -A 4:set:2 /dev/sdc to set the bit 2 attribute (legacy BIOS bootable) on partition 4 on /dev/sdc.

-b, --backup=file

Save partition data to a backup file. You can back up your current in-memory partition table to a disk file using this option. The resulting file is a binary file consisting of the protective MBR, the main GPT header, the backup GPT header, and one copy of the partition table, in that order. Note that the backup is of the current in-memory data structures, so if you launch the program, make changes, and then use this option, the backup will reflect your changes. If the GPT data structures are damaged, the backup may not accurately reflect the damaged state; instead, they will reflect GPT fdisk's first-pass interpretation of the GPT.

-B, --byte-swap-name=partnum

Swap the byte order for the name of the specified partition. Some partitioning tools, including GPT fdisk 1.0.7 and earlier, can write the partition name in the wrong byte order on big-endian computers, such as the IBM s390 mainframes and PowerPC-based Macs. This feature corrects this problem.

-c, --change-name=partnum:name

Change the GPT name of a partition. This name is encoded as a UTF-16 string, but proper entry and display of anything beyond basic ASCII values requires suitable locale and font support. For the most part, Linux ignores the partition name, but it may be important in some OSes. If you want to set a name that includes a space, enclose it in quotation marks, as in sgdisk -c 1:"Sample Name" /dev/sdb. Note that the GPT name of a partition is distinct from the filesystem name, which is encoded in the filesystem's data structures.

-C, --recompute-chs

Recompute CHS values in protective or hybrid MBR. This option can sometimes help if a disk utility, OS, or BIOS doesn't like the CHS values used by the partitions in the protective or hybrid MBR. In particular, the GPT specification requires a CHS value of 0xFFFFFF for over-8GiB partitions, but this value is technically illegal by the usual standards. Some BIOSes hang if they encounter this value. This option will recompute a more normal CHS value -- 0xFEFFFF for over-8GiB partitions, enabling these BIOSes to boot.

-d, --delete=partnum

Delete a partition. This action deletes the entry from the partition table but does not disturb the data within the sectors originally allocated to the partition on the disk. If a corresponding hybrid MBR partition exists, gdisk deletes it, as well, and expands any adjacent 0xEE (EFI GPT) MBR protective partition to fill the new free space.

-D, --display-alignment

Display current sector alignment value. Partitions will be created on multiples of the sector value reported by this option. You can change the alignment value with the -a option.

-e, --move-second-header

Move backup GPT data structures to the end of the disk. Use this option if you've added disks to a RAID array, thus creating a virtual disk with space that follows the backup GPT data structures. This command moves the backup GPT data structures to the end of the disk, where they belong.

-E, --end-of-largest

Displays the sector number of the end of the largest available block of sectors on the disk. A script may store this value and pass it back as part of -n's option to create a partition. If no unallocated sectors are available, this function returns the value 0.

-f, --first-in-largest

Displays the sector number of the start of the largest available block of sectors on the disk. A script may store this value and pass it back as part of -n's option to create a partition. If no unallocated sectors are available, this function returns the value 0. Note that this parameter is blind to partition alignment; when you actually create a partition, its start point might be changed from this value.

-F, --first-aligned-in-largest

Similar to -f (--first-in-largest), except returns the sector number with the current alignment correction applied. Use this function if you need to compute the actual partition start point rather than a theoretical start point or the actual start point if you set the alignment value to 1.

-g, --mbrtogpt

Convert an MBR or BSD disklabel disk to a GPT disk. As a safety measure, use of this option is required on MBR or BSD disklabel disks if you intend to save your changes, in order to prevent accidentally damaging such disks.

-G, --randomize-guids

Randomize the disk's GUID and all partitions' unique GUIDs (but not their partition type code GUIDs). This function may be used after cloning a disk in order to render all GUIDs once again unique.

-h, --hybrid

Create a hybrid MBR. This option takes from one to three partition numbers, separated by colons, as arguments. You may optionally specify a final partition "EE" to indicate that the EFI GPT (type 0xEE) should be placed last in the table, otherwise it will be placed first, followed by the partition(s) you specify. Their type codes are based on the GPT fdisk type codes divided by 0x0100, which is usually correct for Windows partitions. If the active/bootable flag should be set, you must do so in another program, such as fdisk. The gdisk program offers additional hybrid MBR creation options.

-i, --info=partnum

Show detailed partition information. The summary information produced by the -p command necessarily omits many details, such as the partition's unique GUID and the translation of sgdisk's internal partition type code to a plain type name. The -i option displays this information for a single partition.

-I, --align-end

When possible, align the end points of partitions to one less than a multiple of the alignment value. When both start and end points are aligned, partitions should be multiples of the alignment value in size, which is necessary for some partition encryption tools to function correctly. This option applies to all partitions created after this option on the command line. Note that this alignment is not always possible; for instance, if the free space at the end of a disk is less than the alignment value, with the current final partition being aligned, and if sgdisk is asked to create a partition in that space, then it will not be end-aligned.

-j, --adjust-main-table=sector

Adjust the location of the main partition table. This value is normally 2, but it may need to be increased in some cases, such as when a system-on-chip (SoC) is hard-coded to read boot code from sector 2. I recommend against adjusting this value unless doing so is absolutely necessary.

-l, --load-backup=file

Load partition data from a backup file. This option is the reverse of the -b option. Note that restoring partition data from anything but the original disk is not recommended. This option will work even if the disk's original partition table is bad; however, most other options on the same command line will be ignored.

-L, --list-types

Display a summary of partition types. GPT uses a GUID to identify partition types for particular OSes and purposes. For ease of data entry, sgdisk compresses these into two-byte (four-digit hexadecimal) values that are related to their equivalent MBR codes. Specifically, the MBR code is multiplied by hexadecimal 0x0100. For instance, the code for Linux swap space in MBR is 0x82, and it's 0x8200 in gdisk. A one-to-one correspondence is impossible, though. Most notably, the codes for all varieties of FAT and NTFS partition correspond to a single GPT code (entered as 0x0700 in sgdisk). Some OSes use a single MBR code but employ many more codes in GPT. For these, sgdisk adds code numbers sequentially, such as 0xa500 for a FreeBSD disklabel, 0xa501 for FreeBSD boot, 0xa502 for FreeBSD swap, and so on. Note that these two-byte codes are unique to gdisk and sgdisk. This option does not require you to specify a valid disk device filename.

-m, --gpttombr

Convert disk from GPT to MBR form. This option takes from one to four partition numbers, separated by colons, as arguments. Their type codes are based on the GPT fdisk type codes divided by 0x0100. If the active/bootable flag should be set, you must do so in another program, such as fdisk. The gdisk program offers additional MBR conversion options. It is not possible to convert more than four partitions from GPT to MBR form or to convert partitions that start above the 2TiB mark or that are larger than 2TiB.

-n, --new=partnum:start:end

Create a new partition. You enter a partition number, starting sector, and an ending sector. Both start and end sectors can be specified in absolute terms as sector numbers or as positions measured in kibibytes (K), mebibytes (M), gibibytes (G), tebibytes (T), or pebibytes (P); for instance, 40M specifies a position 40MiB from the start of the disk. You can specify locations relative to the start or end of the specified default range by preceding the number by a '+' or '-' symbol, as in +2G to specify a point 2GiB after the default start sector, or -200M to specify a point 200MiB before the last available sector. A start or end value of 0 specifies the default value, which is the start of the largest available block for the start sector and the end of the same block for the end sector. A partnum value of 0 causes the program to use the first available partition number. Subsequent uses of the -A (--attributes), -c (--change-name), -t (--typecode), and -u (--partition-guid) options may also use 0 to refer to the same partition.

-N, --largest-new=num

Create a new partition that fills the largest available block of space on the disk. You can use the -a (--set-alignment) option to adjust the alignment, if desired. A num value of 0 causes the program to use the first available partition number.

-o, --clear

Clear out all partition data. This includes GPT header data, all partition definitions, and the protective MBR. Note that this operation will, like most other operations, fail on a damaged disk. If you want to prepare a disk you know to be damaged for GPT use, you should first wipe it with -Z and then partition it normally. This option will work even if the disk's original partition table is bad; however, most other options on the same command line will be ignored.

-O, --print-mbr

Display basic MBR partition summary data. This includes partition numbers, starting and ending sector numbers, partition sizes, MBR partition types codes, and partition names. This option is useful mainly for diagnosing partition table problems, particularly on disks with hybrid MBRs.

-p, --print

Display basic GPT partition summary data. This includes partition numbers, starting and ending sector numbers, partition sizes, sgdisk's partition types codes, and partition names. For additional information, use the -i (--info) option.

-P, --pretend

Pretend to make specified changes. In-memory GPT data structures are altered according to other parameters, but changes are not written to disk.

-r, --transpose

Swap two partitions' entries in the partition table. One or both partitions may be empty, although swapping two empty partitions is pointless. For instance, if partitions 1-4 are defined, transposing 1 and 5 results in a table with partitions numbered from 2-5. Transposing partitions in this way has no effect on their disk space allocation; it only alters their order in the partition table.

-R, --replicate=second_device_filename

Replicate the main device's partition table on the specified second device. Note that the replicated partition table is an exact copy, including all GUIDs; if the device should have its own unique GUIDs, you should use the -G option on the new disk.

-s, --sort

Sort partition entries. GPT partition numbers need not match the order of partitions on the disk. If you want them to match, you can use this option. Note that some partitioning utilities sort partitions whenever they make changes. Such changes will be reflected in your device filenames, so you may need to edit /etc/fstab if you use this option.

-t, --typecode=partnum:{hexcode|GUID}

Change a single partition's type code. You enter the type code using either a two-byte hexadecimal number, as described earlier, or a fully-specified GUID value, such as EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.

-T, --transform-bsd=partnum

Transform BSD partitions into GPT partitions. This option works on BSD disklabels held within GPT (or converted MBR) partitions. Converted partitions' type codes are likely to need manual adjustment. sgdisk will attempt to convert BSD disklabels stored on the main disk when launched, but this conversion is likely to produce first and/or last partitions that are unusable. The many BSD variants means that the probability of sgdisk being unable to convert a BSD disklabel is high compared to the likelihood of problems with an MBR conversion.

-u, --partition-guid=partnum:guid

Set the partition unique GUID for an individual partition. The GUID may be a complete GUID or 'R' to set a random GUID.

-U, --disk-guid=guid

Set the GUID for the disk. The GUID may be a complete GUID or 'R' to set a random GUID.

--usage

Print a brief summary of available options.

-v, --verify

Verify disk. This option checks for a variety of problems, such as incorrect CRCs and mismatched main and backup data. This option does not automatically correct most problems, though; for that, you must use options on the recovery & transformation menu. If no problems are found, this command displays a summary of unallocated disk space. This option will work even if the disk's original partition table is bad; however, most other options on the same command line will be ignored.

-V, --version

Display program version information. This option may be used without specifying a device filename.

-z, --zap

Zap (destroy) the GPT data structures and then exit. Use this option if you want to repartition a GPT disk using fdisk or some other GPT-unaware program. This option destroys only the GPT data structures; it leaves the MBR intact. This makes it useful for wiping out GPT data structures after a disk has been repartitioned for MBR using a GPT-unaware utility; however, there's a risk that it will damage boot loaders or even the start of the first or end of the last MBR partition. If you use it on a valid GPT disk, the MBR will be left with an inappropriate EFI GPT (0xEE) partition definition, which you can delete using another utility.

-Z, --zap-all

Zap (destroy) the GPT and MBR data structures and then exit. This option works much like -z, but as it wipes the MBR as well as the GPT, it's more suitable if you want to repartition a disk after using this option, and completely unsuitable if you've already repartitioned the disk.

-?, --help

Print a summary of options.

## RETURN VALUES
sgdisk returns various values depending on its success or failure:

0

Normal program execution

1

Too few arguments

2

An error occurred while reading the partition table

3

Non-GPT disk detected and no -g option, but operation requires a write action

4

An error prevented saving changes

5

An error occurred while reading standard input (should never occur with sgdisk, but may with gdisk)

8

Disk replication operation (-R) failed

## BUGS
Known bugs and limitations include:

*

The program compiles correctly only on Linux, FreeBSD, and Mac OS X. Linux versions for x86-64 (64-bit), x86 (32-bit), and PowerPC (32-bit) have been tested, with the x86-64 version having seen the most testing.

*

The FreeBSD version of the program can't write changes to the partition table to a disk when existing partitions on that disk are mounted. (The same problem exists with many other FreeBSD utilities, such as gpt, fdisk, and dd.) This limitation can be overcome by typing sysctl kern.geom.debugflags=16 at a shell prompt.

*

The fields used to display the start and end sector numbers for partitions in the -p option are 14 characters wide. This translates to a limitation of about 45 PiB. On larger disks, the displayed columns will go out of alignment.

*

The program can load only up to 128 partitions (4 primary partitions and 124 logical partitions) when converting from MBR format. This limit can be raised by changing the #define MAX_MBR_PARTS line in the basicmbr.h source code file and recompiling; however, such a change will require using a larger-than-normal partition table. (The limit of 128 partitions was chosen because that number equals the 128 partitions supported by the most common partition table size.)

*

Converting from MBR format sometimes fails because of insufficient space at the start or (more commonly) the end of the disk. Resizing the partition table (using the 's' option in the experts' menu) can sometimes overcome this problem; however, in extreme cases it may be necessary to resize a partition using GNU Parted or a similar tool prior to conversion with gdisk.

*

MBR conversions work only if the disk has correct LBA partition descriptors. These descriptors should be present on any disk over 8 GiB in size or on smaller disks partitioned with any but very ancient software.

*

BSD disklabel support can create first and/or last partitions that overlap with the GPT data structures. This can sometimes be compensated by adjusting the partition table size, but in extreme cases the affected partition(s) may need to be deleted.

*

Because of the highly variable nature of BSD disklabel structures, conversions from this form may be unreliable -- partitions may be dropped, converted in a way that creates overlaps with other partitions, or converted with incorrect start or end values. Use this feature with caution!

*

Booting after converting an MBR or BSD disklabel disk is likely to be disrupted. Sometimes re-installing a boot loader will fix the problem, but other times you may need to switch boot loaders. Except on EFI-based platforms, Windows through at least Windows 7 RC doesn't support booting from GPT disks. Creating a hybrid MBR (using the 'h' option on the recovery & transformation menu) or abandoning GPT in favor of MBR may be your only options in this case.

## AUTHORS
Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)

Contributors:

* Yves Blusseau (1otnwmz02@sneakemail.com)

* David Hubbard (david.c.hubbard@gmail.com)

* Justin Maggard (justin.maggard@netgear.com)

* Dwight Schauer (das@teegra.net)

* Florian Zumbiehl (florz@florz.de)

## SEE ALSO
cfdisk(8), cgdisk(8), fdisk(8), gdisk(8), mkfs(8), parted(8), sfdisk(8), fixparts(8).

https://en.wikipedia.org/wiki/GUID_Partition_Table

https://developer.apple.com/technotes/tn2006/tn2166.html

https://www.rodsbooks.com/gdisk/

## AVAILABILITY
The sgdisk command is part of the GPT fdisk package and is available from Rod Smith.


gearmand

package: gearmand

title: gearmand(8)

text:
# gearmand(8)

## NAME
gearmand - Gearmand Documentation, http://gearman.info/

## SYNOPSIS
General options

-b [ --backlog ] arg (=32)

Number of backlog connections for listen.

--check-args

Check command line and configuration file argments and then exit.

-d [ --daemon ]

Daemon, detach and run in the background.

-f [ --file-descriptors ] arg

Number of file descriptors to allow for the process (total connections will be slightly less). Default is max allowed for user.

-h [ --help ]

Print this help menu.

-j [ --job-retries ] arg (=0)

Number of attempts to run the job before the job server removes it. This is helpful to ensure a bad job does not crash all available workers. Default is no limit.

-l [ --log-file ] arg

Log file to write errors and information to. Turning this option on also forces the first verbose level to be enabled.

-L [ --listen ] arg

Address the server should listen on. Default is INADDR_ANY.

-p [ --port ] arg (=4730)

Port the server should listen on.

-P [ --pid-file ] arg

File to write process ID out to.

-r [ --protocol ] arg

Load protocol module.

-R [ --round-robin ]

Assign work in round-robin order per worker connection. The default is to assign work in the order of functions added by the worker.

-q [ --queue-type ] arg

Persistent queue type to use.

-t [ --threads ] arg (=4)

Number of I/O threads to use. Default=4.

-u [ --user ] arg

Switch to given user after startup.

-v [ --verbose ] arg (=v)

Increase verbosity level by one.

-V [ --version ]

Display the version of gearmand and exit.

-w [ --worker-wakeup ] arg (=0)

Number of workers to wakeup for each job received. The default is to wakeup all available workers.

--keepalive

Enable keepalive on sockets.

--keepalive-idle arg (=-1)

If keepalive is enabled, set the value for TCP_KEEPIDLE for systems that support it. A value of -1 means that either the system does not support it or an error occurred when trying to retrieve the default value.

--keepalive-interval arg (=-1)

If keepalive is enabled, set the value for TCP_KEEPINTVL for systems that support it. A value of -1 means that either the system does not support it or an error occurred when trying to retrieve the default value.

--keepalive-count arg (=-1)

If keepalive is enabled, set the value for TCP_KEEPCNT for systems that support it. A value of -1 means that either the system does not support it or an error occurred when trying to retrieve the default value.

HTTP:

--http-port arg (=8080)

Port to listen on.

sqlite

--libsqlite3-db arg

Database file to use.

--libsqlite3-table arg (=gearman_queue)

Table to use.

Memcached(libmemcached)

--libmemcached-servers arg

List of Memcached servers to use.

Drizzle/MySQL(libdrizzle)

--libdrizzle-host arg

Host of server.

--libdrizzle-port arg

Port of server. (by default Drizzle)

--libdrizzle-uds arg

Unix domain socket for server.

--libdrizzle-user arg

User name for authentication.

--libdrizzle-password arg

Password for authentication.

--libdrizzle-db arg

Schema/Database to use.

--libdrizzle-table arg

Table to use.

--libdrizzle-mysql arg

Use MySQL protocol.

Postgres

--libpq-conninfo arg

PostgreSQL connection information string.

--libpq-table arg (=queue)

Table to use.

tokyocabinet

--libtokyocabinet-file arg

File name of the database. [see: man tcadb, tcadbopen() for name guidelines]

--libtokyocabinet-optimize

Optimize database on open. [default=true]

## DESCRIPTION
Gearman provides a generic application framework to farm out work to other machines or processes that are better suited to do the work. It allows you to do work in parallel, to load balance processing, and to call functions between languages. It can be used in a variety of applications, from high-availability web sites to the transport of database replication events. In other words, it is the nervous system for how distributed processing communicates. A few strong points about Gearman:

- Open Source - It’s free! (in both meanings of the word) Gearman has an active open source community that is easy to get involved with if you need help or want to contribute.

- Multi-language - There are interfaces for a number of languages, and this list is growing. You also have the option to write heterogeneous applications with clients submitting work in one language and workers performing that work in another.

- Flexible - You are not tied to any specific design pattern. You can quickly put together distributed applications using any model you choose, one of those options being Map/Reduce.

- Fast - Gearman has a simple protocol and interface with a new optimized server in C to minimize your application overhead.

- Embeddable - Since Gearman is fast and lightweight, it is great for applications of all sizes. It is also easy to introduce into existing applications with minimal overhead.

- No single point of failure - Gearman can not only help scale systems, but can do it in a fault tolerant way.

### Thread Model
The -t option to gearmand allows you to specify multiple I/O threads, this is enabled by default. There are currently three types of threads in the job server:

Listening and management thread - only one I/O thread - can have many Processing thread - only one

When no -t option is given or -t 0 is given, all of three thread types happen within a single thread. When -t 1 is given, there is a thread for listening/management and a thread for I/O and processing. When -t 2 is given, there is a thread for each type of thread above. For all -t option values above 2, more I/O threads are created.

The listening and management thread is mainly responsible for accepting new connections and assigning those connections to an I/O thread (if there are many). It also coordinates startup and shutdown within the server. This thread will have an instance of libevent for managing socket events and signals on an internal pipe. This pipe is used to wakeup the thread or to coordinate shutdown.

The I/O thread is responsible for doing the read and write system calls on the sockets and initial packet parsing. Once the packet has been parsed it it put into an asynchronous queue for the processing thread (each thread has it’s own queue so there is very little contention). Each I/O thread has it’s own instance of libevent for managing socket events and signals on an internal pipe like the listening thread.

The processing thread should have no system calls within it (except for the occasional brk() for more memory), and manages the various lists and hash tables used for tracking unique keys, job handles, functions, and job queues. All packets that need to be sent back to connections are put into an asynchronous queue for the I/O thread. The I/O thread will pick these up and send them back over the connected socket. All packets flow through the processing thread since it contains the information needed to process the packets. This is due to the complex nature of the various lists and hash tables. If multiple threads were modifying them the locking overhead would most likely cause worse performance than having it in a single thread (and would also complicate the code). In the future more work may be pushed to the I/O threads, and the processing thread can retain minimal functionality to manage those tables and lists. So far this has not been a significant bottleneck, a 16 core Intel machine is able to process upwards of 50k jobs per second.

For thread safety to work when UUID are generated, you must be running the uuidd daemon.

### Persistent Queues
Inside the Gearman job server, all job queues are stored in memory. This means if a server restarts or crashes with pending jobs, they will be lost and are never run by a worker. Persistent queues were added to allow background jobs to be stored in an external durable queue so they may live between server restarts and crashes. The persistent queue is only enabled for background jobs because foreground jobs have an attached client. If a job server goes away, the client can detect this and restart the foreground job somewhere else (or report an error back to the original caller). Background jobs on the other hand have no attached client and are simply expected to be run when submitted.

The persistent queue works by calling a module callback function right before putting a new job in the internal queue for pending jobs to be run. This allows the module to store the job about to be run in some persistent way so that it can later be replayed during a restart. Once it is stored through the module, the job is put onto the active runnable queue, waking up available workers if needed. Once the job has been successfully completed by a worker, another module callback function is called to notify the module the job is done and can be removed. If a job server crashes or is restarted between these two calls for a job, the jobs are reloaded during the next job server start. When the job server starts up, it will call a replay callback function in the module to provide a list of all jobs that were not complete. This is used to populate the internal memory queue of jobs to be run. Once this replay is complete, the job server finishes its initialization and the jobs are now runnable once workers connect (the queue should be in the same state as when it crashed). These jobs are removed from the persistent queue when completed as normal. NOTE: Deleting jobs from the persistent queue storage will not remove them from the in-memory queue while the server is running.

The queues are implemented using a modular interface so it is easy to add new data stores for the persistent queue.

A persistent queue module is enabled by passing the -q or –queue-type option to gearmand. Run gearmand –help to see which queue modules are supported on your system. If you are missing options for one you would like to use, you will need to install any dependencies and then recompile the gearmand package.

### Extended Protocols
The protocol plugin interface allows you to take over the packet send and receive functions, allowing you to pack the buffers as required by the protocol. The core read and write functions can (and should) be used by the protocol plugin.

### HTTP
This protocol plugin allows you to map HTTP requests to Gearman jobs. It only provides client job submission currently, but it may be extended to support other request types in the future. The plugin can handle both GET and POST data, the latter being used to send a workload to the job server. The URL being requested is translated into the function being called.

For example, the request:

```
POST /reverse HTTP/1.1
Content-Length: 12
Hello world!
```

Is translated into a job submission request for the function “reverse” and workload “Hello world!”. This will respond with:

```
HTTP/1.0 200 OK
X-Gearman-Job-Handle: H:lap:4
Content-Length: 12
Server: Gearman/0.8
!dlrow olleH
```

The following headers can be passed to change the behavior of the job:

```
* X-Gearman-Unique: <unique key>
* X-Gearman-Background: true
* X-Gearman-Priority: <high|low>
```

For example, to run a low priority background job, the following request can be sent:

```
POST /reverse HTTP/1.1
Content-Length: 12
X-Gearman-Background: true
X-Gearman-Priority: low
Hello world!
```

The response for this request will not have any data associated with it since it was a background job:

```
HTTP/1.0 200 OK
X-Gearman-Job-Handle: H:lap:6
Content-Length: 0
Server: Gearman/0.8
```

The HTTP protocol should be considered experimental.

## HOME
To find out more information please check: http://gearman.info/

## SEE ALSO
gearman(1) gearadmin(1) libgearmand(3)

## AUTHOR
Data Differential http://www.datadifferential.com/

## COPYRIGHT
2011-2019, Data Differential, http://www.datadifferential.com/