gnbd_import

Langue: en

Version: 306049 (debian - 07/07/09)

Section: 8 (Commandes administrateur)

NAME

gnbd_import - manipulate GNBD block devices on a client

SYNOPSIS

gnbd_import [OPTION]...

DESCRIPTION

gnbd_import imports, lists, and removes GNBDs from the system. GNBD is similar to the Network Block Device (nbd) in the Linux kernel, except that it allows multiple clients to connect at once and has a built-in fence command.

OPTIONS

-a
Validate.

Restart failed gnbd_recvd processes. Usually, if a gnbd becomes disconnected, the gnbd_recvd process for that device will automatically try to reconnect. If that process is killed, gnbd_import -a will restart it.

-c server
Check fenced.

List all the IP addresses currently IO fenced from the specified server. If the specified server does not have any IP addresses fenced, nothing will be returned. If the server machine is not running gnbd_serv, an error will be returned.

-e server
List exported.

List GNBDs exported by the specified server, along with the port at which they can be accessed. If the specified server is not exporting any GNBDs, nothing will be returned. If the server machine is not running gnbd_serv, an error will be returned.

-h
Help.

Print the usage information.

-i server
Import.

Import all GNBDs which the specified server has exported. This will not allow a GNBD to be imported if another one with the same name has already been imported.

-l
List.

List all imported GNBDs. If no options are specified, this is the default action. There are eight fields for each device: Device name, Minor #, Proc name, Server, Port, State, Readonly and Sectors. The Device name is the name that was chosen for the device when the server exported it. The Minor # is the minor number for the GNBD on the local machine. The Proc name is the name for the device that will appear in /proc/partitions, since Linux does not allow devices in /proc/partitions to have arbitrary names. NOTE: A GNBD's Device name will be consistent across a cluster. Its Minor # and Proc name may not be. Server and Port are the ones used to communicate with the GNBD's server. State describes the state of the device. It has three variables. The first will either say Open or Closed, depending on whether the imported GNBD is open or closed. The second will either say Connected or Disconnected, depending on whether or not there is a working TCP connection from the device to its server. When the connection is broken, this variable might not be immediately updated. The third variable will either say Pending or Clear, depending on whether or not there are any IO requests that the GNBD has sent to the server, but which haven't been completed yet. Readonly tells whether the gnbd server exported this device as readonly. Sectors is the device size in 512 bytes sectors.

-n
No Cluster

This keeps gnbd_import from trying to contact the cluster manager. This option is used with -i. NOTE: With this option, it is not possible to import uncached devices. Warning: This option should only be used in situations that do not need any clustering. Attempting to use fence_gnbd to block access to device imported with this option may silently fail, leading to possible data corruption in a cluster environment.

-O
Override

This makes gnbd_import run in non-interactive mode. It will no longer prompt the user before attempting unsafe actions. It is recommended that you do not use this option.

-p
Port.

Change the port to connect to on the server. This option is used with -c, -e and -i. If the port option is not set, gnbd_import will try to connect to port 14567 on the server machine to find the gnbd_serv daemon. You should only need to use this if you have changed the gnbd_serv port from its default.

-q
Quiet mode.

Only print out errors or questions.

-R
Remove All.

Remove all of the imported GNBDs from the system. Only GNBDs that are in the Closed Disconnected Clear state can be removed (See the -l option), unless -O is used. Remove All stops after the first failed remove.

-r [GNBD | LIST]
Remove.

Remove named GNBD(s) from system. Only GNBDs that are in the Closed Disconnected Clear state can be removed (See the -l option), unless the -O option is used. Remove stops after the first failed remove.

-s host
Fence.

IO fence the specified host. This command is generally invoked by fenced. WARNING It is not always possible to seamlessly reconnect a client that has had its connection cut. You should not execute this command manually unless you know what you are doing. See the -t option for more information. Once a host is fenced from a server, it will not be able to access any GNBDs on that server until it is unfenced (see the -u option).

-t server
Fence from Server.

Specify a server for the IO fence (only used with the -s option).

-u host
Unfence.

Unfence the specified host. WARNING: Unfencing a client at the incorrect time can result in data corruption. In normal operation, it should never be necessary to run this command. See the -t option.

-U GNBD
Get UID.

Gets the Universal Identifier for the specified GNBD. This command is used by dm-multipathing to create multipath maps.

-V
Version information.

Print out version information.

-v
Verbose output.

Print additional messages during the operation of gnbd_import.

SEE ALSO

gnbd_export(8)

BUGS

A computer should not import a GNBD device that it exports. Any significant amount of IO on that device will cause a kernel deadlock. This is a problem common to most NBDs. Instead, the underlying device should be used directly. See gnbd_export for more on this.