setarch

package: setarch

title: setarch(8)

text:
# setarch(8)

## NAME
setarch - change reported architecture in new program environment and/or set personality flags

## SYNOPSIS
setarch [arch] [options] [program [argument...]]

setarch --list|-h|-V

arch [options] [program [argument...]]

## DESCRIPTION
setarch modifies execution domains and process personality flags.

The execution domains currently only affects the output of uname -m. For example, on an AMD64 system, running setarch i386 program will cause program to see i686 instead of x86_64 as the machine type. It can also be used to set various personality options. The default program is /bin/sh.

Since version 2.33 the arch command line argument is optional and setarch may be used to change personality flags (ADDR_LIMIT_*, SHORT_INODE, etc) without modification of the execution domain.

## OPTIONS
--list

List the architectures that setarch knows about. Whether setarch can actually set each of these architectures depends on the running kernel.

--show[=personality]

Show the currently active personality and flags. If the personality argument is provided, it is shown instead of the current one. personality is a hexadecimal number with values was described in sys/personality.h.

--uname-2.6

Causes the program to see a kernel version number beginning with 2.6. Turns on UNAME26.

-v, --verbose

Be verbose.

-3, --3gb

Specifies program should use a maximum of 3GB of address space. Supported on x86. Turns on ADDR_LIMIT_3GB.

--4gb

This option has no effect. It is retained for backward compatibility only, and may be removed in future releases.

-B, --32bit

Limit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns on ADDR_LIMIT_32BIT.

-F, --fdpic-funcptrs

Treat user-space function pointers to signal handlers as pointers to address descriptors. This option has no effect on architectures that do not support FDPIC ELF binaries. In kernel v4.14 support is limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU architectures.

-I, --short-inode

Obsolete bug emulation flag. Turns on SHORT_INODE.

-L, --addr-compat-layout

Provide legacy virtual address space layout. Use when the program binary does not have PT_GNU_STACK ELF header. Turns on ADDR_COMPAT_LAYOUT.

-R, --addr-no-randomize

Disables randomization of the virtual address space. Turns on ADDR_NO_RANDOMIZE.

-S, --whole-seconds

Obsolete bug emulation flag. Turns on WHOLE_SECONDS.

-T, --sticky-timeouts

This makes select(2), pselect(2), and ppoll(2) system calls preserve the timeout value instead of modifying it to reflect the amount of time not slept when interrupted by a signal handler. Use when program depends on this behavior. For more details see the timeout description in select(2) manual page. Turns on STICKY_TIMEOUTS.

-X, --read-implies-exec

If this is set then mmap(2) PROT_READ will also add the PROT_EXEC bit - as expected by legacy x86 binaries. Notice that the ELF loader will automatically set this bit when it encounters a legacy binary. Turns on READ_IMPLIES_EXEC.

-Z, --mmap-page-zero

SVr4 bug emulation that will set mmap(2) page zero as read-only. Use when program depends on this behavior, and the source code is not available to be fixed. Turns on MMAP_PAGE_ZERO.

-h, --help

Display help text and exit.

-V, --version

Print version and exit.

## EXAMPLE

```
setarch --addr-no-randomize mytestprog
setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
```

## AUTHORS
Elliot Lee <sopwith@redhat.com>, Jindrich Novy <jnovy@redhat.com>, Karel Zak <kzak@redhat.com>

## SEE ALSO
personality(2), select(2)

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The setarch command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


setserial

package: setserial

title: setserial(8)

summary: get/set Linux serial port information

text:
# setserial(8)

## NAME
setserial - get/set Linux serial port information

## SYNOPSIS
setserial [ -abqvVWz ] device [ parameter1 [ arg ] ] ...

setserial -g [ -abGv ] device1 ...

## DESCRIPTION
setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on.

During the normal bootup process, only COM ports 1-4 are initialized, using the default I/O ports and IRQ values, as listed below. In order to initialize any additional serial ports, or to change the COM 1-4 ports to a nonstadard configuration, the setserial program should be used. Typically it is called from an rc.serial script, which is usually run out of /etc/rc.local.

The device argument or arguments specifies the serial device which should be configured or interrogated. It will usually have the following form: /dev/cua[0-3].

If no parameters are specified, setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags.

If the -g option is given, the arguments to setserial are interpreted as a list of devices for which the characteristics of those devices should be printed.

Without the -g option, the first argument to setserial is interpreted as the device to be modified or characteristics to be printed, and any additional arguments are interpreted as parameters which should be assigned to that serial device.

For the most part, superuser privilege is required to set the configuration parameters of a serial port. A few serial port parameters can be set by normal users, however, and these will be noted as exceptions in this manual page.

## OPTIONS
Setserial accepts the following options:

-a

When reporting the configuration of a serial device, print all available information.

-b

When reporting the configuration of a serial device, print a summary of the device's configuration, which might be suitable for printing during the bootup process, during the /etc/rc script.

-G

Print out the configuration information of the serial port in a form which can be fed back to setserial as command-line arguments.

-q

Be quiet. Setserial will print fewer lines of output.

-v

Be verbose. Setserial will print additional status output.

-V

Display version and exit.

-W

Do wild interrupt initialization and exit. This option is no longer relevant in Linux kernels after version 2.1.

-z

Zero out the serial flags before starting to set flags. This is related to the automatic saving of serial flags using the -G flag.

## PARAMETERS
The following parameters can be assigned to a serial port.

All argument values are assumed to be in decimal unless preceeded by "0x".

port port_number

The port option sets the I/O port, as described above.

irq irq_number

The irq option sets the hardware IRQ, as described above.

uart uart_type

This option is used to set the UART type. The permitted types are none, 8250, 16450, 16550, 16550A, 16650, 16650V2, 16654, 16750, 16850, 16950, and 16954. Using UART type none will disable the port. Some internal modems are billed as having a "16550A UART with a 1k buffer". This is a lie. They do not have really have a 16550A compatible UART; instead what they have is a 16450 compatible UART with a 1k receive buffer to prevent receiver overruns. This is important, because they do not have a transmit FIFO. Hence, they are not compatible with a 16550A UART, and the autoconfiguration process will correctly identify them as 16450's. If you attempt to override this using the uart parameter, you will see dropped characters during file transmissions. These UART's usually have other problems: the skip_test parameter also often must be specified.

autoconfig

When this parameter is given, setserial will ask the kernel to attempt to automatically configure the serial port. The I/O port must be correctly set; the kernel will attempt to determine the UART type, and if the auto_irq parameter is set, Linux will attempt to automatically determine the IRQ. The autoconfig parameter should be given after the port,auto_irq, and skip_test parameters have been specified.

auto_irq

During autoconfiguration, try to determine the IRQ. This feature is not guaranteed to always produce the correct result; some hardware configurations will fool the Linux kernel. It is generally safer not to use the auto_irq feature, but rather to specify the IRQ to be used explicitly, using the irq parameter.

^auto_irq

During autoconfiguration, do not try to determine the IRQ.

skip_test

During autoconfiguration, skip the UART test. Some internal modems do not have National Semiconductor compatible UART's, but have cheap imitations instead. Some of these cheasy imitations UART's do not fully support the loopback detection mode, which is used by the kernel to make sure there really is a UART at a particular address before attempting to configure it. So for certain internal modems you will need to specify this parameter so Linux can initialize the UART correctly.

^skip_test

During autoconfiguration, do not skip the UART test.

baud_base baud_base

This option sets the base baud rate, which is the clock frequency divided by 16. Normally this value is 115200, which is also the fastest baud rate which the UART can support.

spd_hi

Use 57.6kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.

spd_vhi

Use 115kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.

spd_shi

Use 230kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.

spd_warp

Use 460kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.

spd_cust

Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.

spd_normal

Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.

divisor divisor

This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.

sak

Set the break key at the Secure Attention Key.

^sak

disable the Secure Attention Key.

fourport

Configure the port as an AST Fourport card.

^fourport

Disable AST Fourport configuration.

close_delay delay

Specify the amount of time, in hundredths of a second, that DTR should remain low on a serial line after the callout device is closed, before the blocked dialin device raises DTR again. The default value of this option is 50, or a half-second delay.

closing_wait delay

Specify the amount of time, in hundredths of a second, that the kernel should wait for data to be transmitted from the serial port while closing the port. If "none" is specified, no delay will occur. If "infinite" is specified the kernel will wait indefinitely for the buffered data to be transmitted. The default setting is 3000 or 30 seconds of delay. This default is generally appropriate for most devices. If too long a delay is selected, then the serial port may hang for a long time if when a serial port which is not connected, and has data pending, is closed. If too short a delay is selected, then there is a risk that some of the transmitted data is output at all. If the device is extremely slow, like a plotter, the closing_wait may need to be larger.

session_lockout

Lock out callout port (/dev/cuaXX) accesses across different sessions. That is, once a process has opened a port, do not allow a process with a different session ID to open that port until the first process has closed it.

^session_lockout

Do not lock out callout port accesses across different sessions.

pgrp_lockout

Lock out callout port (/dev/cuaXX) accesses across different process groups. That is, once a process has opened a port, do not allow a process in a different process group to open that port until the first process has closed it.

^pgrp_lockout

Do not lock out callout port accesses across different process groups.

hup_notify

Notify a process blocked on opening a dial in line when a process has finished using a callout line (either by closing it or by the serial line being hung up) by returning EAGAIN to the open. The application of this parameter is for getty's which are blocked on a serial port's dial in line. This allows the getty to reset the modem (which may have had its configuration modified by the application using the callout device) before blocking on the open again.

^hup_notify

Do not notify a process blocked on opening a dial in line when the callout device is hung up.

split_termios

Treat the termios settings used by the callout device and the termios settings used by the dialin devices as separate.

^split_termios

Use the same termios structure to store both the dialin and callout ports. This is the default option.

callout_nohup

If this particular serial port is opened as a callout device, do not hangup the tty when carrier detect is dropped.

^callout_nohup

Do not skip hanging up the tty when a serial port is opened as a callout device. Of course, the HUPCL termios flag must be enabled if the hangup is to occur.

low_latency

Minimize the receive latency of the serial device at the cost of greater CPU utilization. (Normally there is an average of 5-10ms latency before characters are handed off to the line discpline to minimize overhead.) This is off by default, but certain real-time applications may find this useful.

^low_latency

Optimize for efficient CPU processing of serial characters at the cost of paying an average of 5-10ms of latency before the characters are processed. This is the default.

## CONSIDERATIONS OF CONFIGURING SERIAL PORTS
It is important to note that setserial merely tells the Linux kernel where it should expect to find the I/O port and IRQ lines of a particular serial port. It does *not* configure the hardware, the actual serial board, to use a particular I/O port. In order to do that, you will need to physically program the serial board, usually by setting some jumpers or by switching some DIP switches.

This section will provide some pointers in helping you decide how you would like to configure your serial ports.

The "standard MS-DOS" port associations are given below:

```
/dev/ttys0 (COM1), port 0x3f8, irq 4
/dev/ttys1 (COM2), port 0x2f8, irq 3
/dev/ttys2 (COM3), port 0x3e8, irq 4
/dev/ttys3 (COM4), port 0x2e8, irq 3
```

```

```

Due to the limitations in the design of the AT/ISA bus architecture, normally an IRQ line may not be shared between two or more serial ports. If you attempt to do this, one or both serial ports will become unreliable if you try to use both simultaneously. This limitation can be overcome by special multi-port serial port boards, which are designed to share multiple serial ports over a single IRQ line. Multi-port serial cards supported by Linux include the AST FourPort, the Accent Async board, the Usenet Serial II board, the Bocaboard BB-1004, BB-1008, and BB-2016 boards, and the HUB-6 serial board.

The selection of an alternative IRQ line is difficult, since most of them are already used. The following table lists the "standard MS-DOS" assignments of available IRQ lines:

```
IRQ 3: COM2
IRQ 4: COM1
IRQ 5: LPT2
IRQ 7: LPT1
```

```

```

Most people find that IRQ 5 is a good choice, assuming that there is only one parallel port active in the computer. Another good choice is IRQ 2 (aka IRQ 9); although this IRQ is sometimes used by network cards, and very rarely VGA cards will be configured to use IRQ 2 as a vertical retrace interrupt. If your VGA card is configured this way; try to disable it so you can reclaim that IRQ line for some other card. It's not necessary for Linux and most other Operating systems.

The only other available IRQ lines are 3, 4, and 7, and these are probably used by the other serial and parallel ports. (If your serial card has a 16bit card edge connector, and supports higher interrupt numbers, then IRQ 10, 11, 12, and 15 are also available.)

On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it in this manner.

IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should not be used, since they are assigned to other hardware and cannot, in general, be changed. Here are the "standard" assignments:

```
IRQ  0      Timer channel 0
IRQ  1      Keyboard
IRQ  2      Cascade for controller 2
IRQ  3      Serial port 2
IRQ  4      Serial port 1
IRQ  5      Parallel port 2 (Reserved in PS/2)
IRQ  6      Floppy diskette
IRQ  7      Parallel port 1
IRQ  8      Real-time clock
IRQ  9      Redirected to IRQ2
IRQ 10      Reserved
IRQ 11      Reserved
IRQ 12      Reserved (Auxillary device in PS/2)
IRQ 13      Math coprocessor
IRQ 14      Hard disk controller
IRQ 15      Reserved
```

```

```

## MULTIPORT CONFIGURATION
Certain multiport serial boards which share multiple ports on a single IRQ use one or more ports to indicate whether or not there are any pending ports which need to be serviced. If your multiport board supports these ports, you should make use of them to avoid potential lockups if the interrupt gets lost.

In order to set these ports specify set_multiport as a parameter, and follow it with the multiport parameters. The multiport parameters take the form of specifying the port that should be checked, a mask which indicate which bits in the register are significant, and finally, a match parameter which specifies what the significant bits in that register must match when there is no more pending work to be done.

Up to four such port/mask/match combinations may be specified. The first such combinations should be specified by setting the parameters port1, mask1, and match1. The second such combination should be specified with port2, mask2, and match2, and so on. In order to disable this multiport checking, set port1 to be zero.

In order to view the current multiport settings, specify the parameter get_multiport on the command line.

Here are some multiport settings for some common serial boards:

```
AST FourPort    port1 0x1BF mask1 0xf match1 0xf
Boca BB-1004/8  port1 0x107 mask1 0xff match1 0
Boca BB-2016    port1 0x107 mask1 0xff match1 0

                port2 0x147 mask2 0xff match2 0
```

```

```

## Hayes ESP Configuration
Setserial may also be used to configure ports on a Hayes ESP serial board.

The following parameters when configuring ESP ports:

rx_trigger

This is the trigger level (in bytes) of the receive FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in data loss. Valid values are 1 through 1023.

tx_trigger

This is the trigger level (in bytes) of the transmit FIFO. Larger values may result in fewer interrupts and hence better performance; however, a value too high could result in degraded transmit performance. Valid values are 1 through 1023.

flow_off

This is the level (in bytes) at which the ESP port will "flow off" the remote transmitter (i.e. tell him to stop stop sending more bytes). Valid values are 1 through 1023. This value should be greater than the receive trigger level and the flow on level.

flow_on

This is the level (in bytes) at which the ESP port will "flow on" the remote transmitter (i.e. tell him to resume sending bytes) after having flowed it off. Valid values are 1 through 1023. This value should be less than the flow off level, but greater than the receive trigger level.

rx_timeout

This is the amount of time that the ESP port will wait after receiving the final character before signaling an interrupt. Valid values are 0 through 255. A value too high will increase latency, and a value too low will cause unnecessary interrupts.

## CAUTION
CAUTION: Configuring a serial port to use an incorrect I/O port can lock up your machine.

## FILES
/etc/rc.local /etc/rc.serial

## SEE ALSO
tty(4), ttys(4), kernel/chr_drv/serial.c

## AUTHOR
The original version of setserial was written by Rick Sladkey (jrs@world.std.com), and was modified by Michael K. Johnson (johnsonm@stolaf.edu).

This version has since been rewritten from scratch by Theodore Ts'o (tytso@mit.edu) on 1/1/93. Any bugs or problems are solely his responsibility.


sfdisk

package: sfdisk

title: sfdisk(8)

text:
# sfdisk(8)

## NAME
sfdisk - display or manipulate a disk partition table

## SYNOPSIS
sfdisk [options] device [-N partition-number]

sfdisk [options] command

## DESCRIPTION
sfdisk is a script-oriented tool for partitioning any block device. It runs in interactive mode if executed on a terminal (stdin refers to a terminal).

Since version 2.26 sfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.

sfdisk protects the first disk sector when create a new disk label. The option --wipe always disables this protection. Note that fdisk(8) and cfdisk(8) completely erase this area by default.

sfdisk (since version 2.26) aligns the start and end of partitions to block-device I/O limits when relative sizes are specified, when the default values are used or when multiplicative suffixes (e.g., MiB) are used for sizes. It is possible that partition size will be optimized (reduced or enlarged) due to alignment if the start offset is specified exactly in sectors and partition size relative or by multiplicative suffixes.

The recommended way is not to specify start offsets at all and specify partition size in MiB, GiB (or so). In this case sfdisk aligns all partitions to block-device I/O limits (or when I/O limits are too small then to megabyte boundary to keep disk layout portable). If this default behaviour is unwanted (usually for very small partitions) then specify offsets and sizes in sectors. In this case sfdisk entirely follows specified numbers without any optimization.

sfdisk does not create the standard system partitions for SGI and SUN disk labels like fdisk(8) does. It is necessary to explicitly create all partitions including whole-disk system partitions.

sfdisk uses BLKRRPART (reread partition table) ioctl to make sure that the device is not used by system or other tools (see also --no-reread). It’s possible that this feature or another sfdisk activity races with systemd-udevd(8). The recommended way how to avoid possible collisions is to use --lock option. The exclusive lock will cause systemd-udevd to skip the event handling on the device.

The sfdisk prompt is only a hint for users and a displayed partition number does not mean that the same partition table entry will be created (if -N not specified), especially for tables with gaps.

## COMMANDS
The commands are mutually exclusive.

[-N partition-number] device

The default sfdisk command is to read the specification for the desired partitioning of device from standard input, and then create a partition table according to the specification. See below for the description of the input format. If standard input is a terminal, then sfdisk starts an interactive session. If the option -N is specified, then the changes are applied to the partition addressed by partition-number. The unspecified fields of the partition are not modified.

Note that it’s possible to address an unused partition with -N. For example, an MBR always contains 4 partitions, but the number of used partitions may be smaller. In this case sfdisk follows the default values from the partition table and does not use built-in defaults for the unused partition given with -N. See also --append.

-A, --activate device [partition-number...]

Switch on the bootable flag for the specified partitions and switch off the bootable flag on all unspecified partitions. The special placeholder '-' may be used instead of the partition numbers to switch off the bootable flag on all partitions. The activation command is supported for MBR and PMBR only. If a GPT label is detected, then sfdisk prints warning and automatically enters PMBR.

If no partition-number is specified, then list the partitions with an enabled flag.

--backup-pt-sectors device

Back up the current partition table sectors in binary format and exit. See the BACKING UP THE PARTITION TABLE section.

--delete device [partition-number...]

Delete all or the specified partitions.

-d, --dump device

Dump the partitions of a device in a format that is usable as input to sfdisk. See the BACKING UP THE PARTITION TABLE section.

-g, --show-geometry [device...]

List the geometry of all or the specified devices. For backward compatibility the deprecated option --show-pt-geometry have the same meaning as this one.

-J, --json device

Dump the partitions of a device in JSON format. Note that sfdisk is not able to use JSON as input format.

-l, --list [device...]

List the partitions of all or the specified devices. This command can be used together with --verify.

-F, --list-free [device...]

List the free unpartitioned areas on all or the specified devices.

--part-attrs device partition-number [attributes]

Change the GPT partition attribute bits. If attributes is not specified, then print the current partition settings. The attributes argument is a comma- or space-delimited list of bits numbers or bit names. For example, the string "RequiredPartition,50,51" sets three bits. The currently supported attribute bits are: Bit 0 (RequiredPartition)

If this bit is set, the partition is required for the platform to function. The creator of the partition indicates that deletion or modification of the contents can result in loss of platform features or failure for the platform to boot or operate. The system cannot function normally if this partition is removed, and it should be considered part of the hardware of the system.

Bit 1 (NoBlockIOProtocol)

EFI firmware should ignore the content of the partition and not try to read from it.

Bit 2 (LegacyBIOSBootable)

The partition may be bootable by legacy BIOS firmware.

Bits 3-47

Undefined and must be zero. Reserved for expansion by future versions of the UEFI specification.

Bits 48-63

Reserved for GUID specific use. The use of these bits will vary depending on the partition type. For example Microsoft uses bit 60 to indicate read-only, 61 for shadow copy of another partition, 62 for hidden partitions and 63 to disable automount.

--part-label device partition-number [label]

Change the GPT partition name (label). If label is not specified, then print the current partition label.

--part-type device partition-number [type]

Change the partition type. If type is not specified, then print the current partition type. The type argument is hexadecimal for MBR, GUID for GPT, type alias (e.g. "linux") or type shortcut (e.g. 'L'). For backward compatibility the options -c and --id have the same meaning as this one.

--part-uuid device partition-number [uuid]

Change the GPT partition UUID. If uuid is not specified, then print the current partition UUID.

--disk-id device [id]

Change the disk identifier. If id is not specified, then print the current identifier. The identifier is UUID for GPT or unsigned integer for MBR.

-r, --reorder device

Renumber the partitions, ordering them by their start offset.

-s, --show-size [device...]

List the sizes of all or the specified devices in units of 1024 byte size. This command is DEPRECATED in favour of blockdev(8).

-T, --list-types

Print all supported types for the current disk label or the label specified by --label.

-V, --verify [device...]

Test whether the partition table and partitions seem correct.

--relocate oper device

Relocate partition table header. This command is currently supported for GPT header only. The argument oper can be: gpt-bak-std

Move GPT backup header to the standard location at the end of the device.

gpt-bak-mini

Move GPT backup header behind the last partition. Note that UEFI standard requires the backup header at the end of the device and partitioning tools can automatically relocate the header to follow the standard.

## OPTIONS
-a, --append

Don’t create a new partition table, but only append the specified partitions. Note that unused partition maybe be re-used in this case although it is not the last partition in the partition table. See also -N to specify entry in the partition table.

-b, --backup

Back up the current partition table sectors before starting the partitioning. The default backup file name is ~/sfdisk-<device>-<offset>.bak; to use another name see option -O, --backup-file. See section BACKING UP THE PARTITION TABLE for more details.

--color[=when]

Colorize the output. The optional argument when can be auto, never or always. If the when argument is omitted, it defaults to auto. The colors can be disabled; for the current built-in default see the --help output. See also the COLORS section.

-f, --force

Disable all consistency checking.

--Linux

Deprecated and ignored option. Partitioning that is compatible with Linux (and other modern operating systems) is the default.

--lock[=mode]

Use exclusive BSD lock for device or file it operates. The optional argument mode can be yes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to yes. This option overwrites environment variable $LOCK_BLOCK_DEVICE. The default is not to use any lock at all, but it’s recommended to avoid collisions with systemd-udevd(8) or other tools.

-n, --no-act

Do everything except writing to the device.

--no-reread

Do not check through the re-read-partition-table ioctl whether the device is in use.

--no-tell-kernel

Don’t tell the kernel about partition changes. This option is recommended together with --no-reread to modify a partition on used disk. The modified partition should not be used (e.g., mounted).

-O, --backup-file path

Override the default backup file name. Note that the device name and offset are always appended to the file name.

--move-data[=path]

Move data after partition relocation, for example when moving the beginning of a partition to another place on the disk. The size of the partition has to remain the same, the new and old location may overlap. This option requires option -N in order to be processed on one specific partition only. The optional path specifies log file name. The log file contains information about all read/write operations on the partition data. The word "@default" as a path forces sfdisk to use ~/sfdisk-<devname>.move for the log. The log is optional since v2.35.

Note that this operation is risky and not atomic. Don’t forget to backup your data!

See also --move-use-fsync.

In the example below, the first command creates a 100MiB free area before the first partition and moves the data it contains (e.g., a filesystem), the next command creates a new partition from the free space (at offset 2048), and the last command reorders partitions to match disk order (the original sdc1 will become sdc2).

echo '+100M,' | sfdisk --move-data /dev/sdc -N 1

echo '2048,' | sfdisk /dev/sdc --append

sfdisk /dev/sdc --reorder

--move-use-fsync

Use the fsync(2) system call after each write when moving data to a new location by --move-data.

-o, --output list

Specify which output columns to print. Use --help to get a list of all supported columns. The default list of columns may be extended if list is specified in the format +list (e.g., -o +UUID).

-q, --quiet

Suppress extra info messages.

-u, --unit S

Deprecated option. Only the sector unit is supported. This option is not supported when using the --show-size command.

-X, --label type

Specify the disk label type (e.g., dos, gpt, ...). If this option is not given, then sfdisk defaults to the existing label, but if there is no label on the device yet, then the type defaults to dos. The default or the current label may be overwritten by the "label: <name>" script header line. The option --label does not force sfdisk to create empty disk label (see the EMPTY DISK LABEL section below).

-Y, --label-nested type

Force editing of a nested disk label. The primary disk label has to exist already. This option allows editing for example a hybrid/protective MBR on devices with GPT.

-w, --wipe when

Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode; except the old partition-table signatures which are always wiped before create a new partition-table if the argument when is not never. The auto mode also does not wipe the first sector (boot sector), it is necessary to use the always mode to wipe this area. In all cases detected signatures are reported by warning messages before a new partition table is created. See also the wipefs(8) command.

-W, --wipe-partitions when

Wipe filesystem, RAID and partition-table signatures from a newly created partition, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages after a new partition is created. See also wipefs(8) command.

-v, --version

Display version information and exit.

-h, --help

Display help text and exit.

## INPUT FORMATS
sfdisk supports two input formats and generic header lines.

### Header lines
The optional header lines specify generic information that apply to the partition table. The header-line format is:

<name>: <value>

The currently recognized headers are:

unit

Specify the partitioning unit. The only supported unit is sectors.

label

Specify the partition table type. For example dos or gpt.

label-id

Specify the partition table identifier. It should be a hexadecimal number (with a 0x prefix) for MBR and a UUID for GPT.

first-lba

Specify the first usable sector for GPT partitions. This header is ignored if the script and device sector size differ. In this case sfdisk uses label specific default.

last-lba

Specify the last usable sector for GPT partitions. This header is ignored if the script and device sector size differ. In this case sfdisk uses label specific default.

table-length

Specify the maximal number of GPT partitions.

grain

Specify minimal size in bytes used to calculate partitions alignment. The default is 1MiB and it’s strongly recommended to use the default. Do not modify this variable if you’re not sure.

sector-size

Specify sector size. sfdisk always uses device sector size. Since version 2.39 sfdisk recalculates sizes from dump if the script and device sector size differ.

Note that it is only possible to use header lines before the first partition is specified in the input.

### Unnamed-fields format
start size type bootable

where each line fills one partition descriptor.

Fields are separated by whitespace, comma (recommended) or semicolon possibly followed by whitespace; initial and trailing whitespace is ignored. Numbers can be octal, decimal or hexadecimal; decimal is the default. When a field is absent, empty or specified as '-' a default value is used. But when the -N option (change a single partition) is given, the default for each field is its previous value.

The default value of start is the first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes. Since v2.38 when the -N option (change a single partition) is given, a '+' can be used to enlarge partition by move start of the partition if there is a free space before the partition.

The default value of size indicates "as much as possible"; i.e., until the next partition or end-of-device. A numerical argument is by default interpreted as a number of sectors, however if the size is followed by one of the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB) then the number is interpreted as the size of the partition in bytes and it is then aligned according to the device I/O limits. A '+' can be used instead of a number to enlarge the partition as much as possible. Note '+' is equivalent to the default behaviour for a new partition; existing partitions will be resized as required.

The partition type is given in hex for MBR (DOS) where 0x prefix is optional; a GUID string for GPT; a shortcut or an alias. It’s recommended to use two letters for MBR hex codes to avoid collision between deprecated shortcut 'E' and '0E' MBR hex code. For backward compatibility sfdisk tries to interpret type as a shortcut as a first possibility in partitioning scripts although on other places (e.g. --part-type command) it tries shortcuts as the last possibility.

Since v2.36 libfdisk supports partition type aliases as extension to shortcuts. The alias is a simple human readable word (e.g. "linux").

Since v2.37 libfdisk supports partition type names on input, ignoring the case of the characters and all non-alphanumeric and non-digit characters in the name (e.g. "Linux /usr x86" is the same as "linux usr-x86").

Supported shortcuts and aliases:

L - alias 'linux'

Linux; means 83 for MBR and 0FC63DAF-8483-4772-8E79-3D69D8477DE4 for GPT.

S - alias 'swap'

swap area; means 82 for MBR and 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F for GPT

Ex - alias 'extended'

MBR extended partition; means 05 for MBR. The original shortcut 'E' is deprecated due to collision with 0x0E MBR partition type.

H - alias 'home'

home partition; means 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 for GPT

U - alias 'uefi'

EFI System partition, means EF for MBR and C12A7328-F81F-11D2-BA4B-00A0C93EC93B for GPT

R - alias 'raid'

Linux RAID; means FD for MBR and A19D880F-05FC-4D3B-A006-743F0F84911E for GPT

V - alias 'lvm'

LVM; means 8E for MBR and E6D6D379-F507-44C2-A23C-238F2A3DF928 for GPT

The default type value is linux.

The shortcut 'X' for Linux extended partition (85) is deprecated in favour of 'Ex'.

bootable is specified as [*|-], with as default not-bootable. The value of this field is irrelevant for Linux - when Linux runs it has been booted already - but it might play a role for certain boot loaders and for other operating systems.

### Named-fields format
This format is more readable, robust, extensible and allows specifying additional information (e.g., a UUID). It is recommended to use this format to keep your scripts more readable.

[device :] name[=value], ...

The device field is optional. sfdisk extracts the partition number from the device name. It allows specifying the partitions in random order. This functionality is mostly used by --dump. Don’t use it if you are not sure.

The value can be between quotation marks (e.g., name="This is partition name"). The fields start= and size= support '+' and '-' in the same way as Unnamed-fields format.

The currently supported fields are:

start=number

The first non-assigned sector aligned according to device I/O limits. The default start offset for the first partition is 1 MiB. If the offset is followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then the number is interpreted as offset in bytes.

size=number

Specify the partition size in sectors. The number may be followed by the multiplicative suffixes (KiB, MiB, GiB, TiB, PiB, EiB, ZiB and YiB), then it’s interpreted as size in bytes and the size is aligned according to device I/O limits.

bootable

Mark the partition as bootable.

attrs=string

Partition attributes, usually GPT partition attribute bits. See --part-attrs for more details about the GPT-bits string format.

uuid=string

GPT partition UUID.

name=string

GPT partition name.

type=code

A hexadecimal number (without 0x) for an MBR partition, a GUID for a GPT partition, a shortcut as for unnamed-fields format or a type name (e.g. type="Linux /usr (x86)"). See above the section about the unnamed-fields format for more details. For backward compatibility the Id= field has the same meaning.

## EMPTY DISK LABEL
sfdisk does not create partition table without partitions by default. The lines with partitions are expected in the script by default. The empty partition table has to be explicitly requested by "label: <name>" script header line without any partitions lines. For example:

echo 'label: gpt' | sfdisk /dev/sdb

creates empty GPT partition table. Note that the --append disables this feature.

## BACKING UP THE PARTITION TABLE
It is recommended to save the layout of your devices. sfdisk supports two ways.

### Dump in sfdisk compatible format
Use the --dump command to save a description of the device layout to a text file. The dump format is suitable for later sfdisk input. For example:

sfdisk --dump /dev/sda > sda.dump

This can later be restored by:

sfdisk /dev/sda < sda.dump

Note that sfdisk completely restores partition types and partition UUIDs. This could potentially become problematic if you duplicate the same layout to different disks, as it may result in duplicate UUIDs within your system.

### Full binary backup
If you want to do a full binary backup of all sectors where the partition table is stored, then use the --backup-pt-sectors command. It writes the sectors to ~/sfdisk-<device>-<offset>.bak files. The default name of the backup file can be changed with the --backup-file option. The backup files contain only raw data from the device. For example:

sfdisk --backup-pt-sectors /dev/sda

The GPT header can later be restored by:

dd if=~/sfdisk-sda-0x00000200.bak of=/dev/sda seek=$((0x00000200)) bs=1 conv=notrunc

It’s also possible to use the --backup option to create the same backup immediately after startup for other sfdisk commands. For example, backup partition table before deleting all partitions from partition table:

sfdisk --backup --delete /dev/sda

The same concept of backup files is used by wipefs(8).

Note that sfdisk since version 2.26 no longer provides the -I option to restore sectors. dd(1) provides all necessary functionality.

## COLORS
The output colorization is implemented by terminal-colors.d(5) functionality. Implicit coloring can be disabled by an empty file

/etc/terminal-colors.d/sfdisk.disable

for the sfdisk command or for all tools by

/etc/terminal-colors.d/disable

The user-specific $XDG_CONFIG_HOME/terminal-colors.d or $HOME/.config/terminal-colors.d overrides the global setting.

Note that the output colorization may be enabled by default, and in this case terminal-colors.d directories do not have to exist yet.

The logical color names supported by sfdisk are:

header

The header of the output tables.

warn

The warning messages.

welcome

The welcome message.

## ENVIRONMENT
SFDISK_DEBUG=all

enables sfdisk debug output.

LIBFDISK_DEBUG=all

enables libfdisk debug output.

LIBBLKID_DEBUG=all

enables libblkid debug output.

LIBSMARTCOLS_DEBUG=all

enables libsmartcols debug output.

LOCK_BLOCK_DEVICE=<mode>

use exclusive BSD lock. The mode is "1" or "0". See --lock for more details.

## NOTES
Since version 2.26 sfdisk no longer provides the -R or --re-read option to force the kernel to reread the partition table. Use blockdev --rereadpt instead.

Since version 2.26 sfdisk does not provide the --DOS, --IBM, --DOS-extended, --unhide, --show-extended, --cylinders, --heads, --sectors, --inside-outer, --not-inside-outer options.

## EXAMPLES
sfdisk --list --label-nested=mbr /dev/sda

Print protective MBR on device with GPT disk label.

echo -e ',10M,L\n,10M,L\n,+,\n' | sfdisk /dev/sdc

Create three Linux partitions, with the default start, the size of the first two partitions is 10MiB, and the last partition fills all available space on the device.

echo -e 'size=10M, type=L\n size=10M, type=L\n size=+\n' | sfdisk /dev/sdc

The same as the previous example, but in named-fields format.

echo -e 'type=swap' | sfdisk -N 3 /dev/sdc

Set type of the 3rd partition to 'swap'.

sfdisk --part-type /dev/sdc 3 swap

The same as the previous example, but without script use.

sfdisk --delete /dev/sdc 2

Delete 2nd partition.

echo "+,+" | sfdisk -N 3 --move-data /dev/sdc

Enlarge 3rd partition in both directions, move start to use free space before the partition and enlarge the size to use all free space after to the partition, and move partition data too.

## AUTHORS
Karel Zak <kzak@redhat.com>

The current sfdisk implementation is based on the original sfdisk from Andries E. Brouwer.

## SEE ALSO
fdisk(8), cfdisk(8), parted(8), partprobe(8), partx(8)

## REPORTING BUGS
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.

## AVAILABILITY
The sfdisk command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.


rescan-scsi-bus.sh

title: rescan-scsi-bus.sh(8)

text:
# rescan-scsi-bus.sh(8)

## NAME
rescan-scsi-bus.sh - script to add and remove SCSI devices without rebooting

## SYNOPSIS
rescan-scsi-bus.sh [--alltargets] [--attachpq3] [-c] [---channels=CLIST] [--color] [-d] [--flush] [-f] [--forceremove] [--forcerescan] [--help] [--hosts=HLIST] [--ids=TLIST] [--ignore-rev] [--issue-lip] [-i] [--issue-lip-wait=SECS] [-I SECS] [-l] [-L NUM] [--largelun] [--luns=LLIST] [-m] [--multipath] [--no-lip-scan] [--nooptscan] [--nosync] [--remove] [--removelun2] [--resize] [--sparselun] [--sync] [--timeout=SECS] [--update] [--version] [--wide] [HOST1 [HOST2 ...]]

## OPTIONS
Option are ordered by their long name. Those without a long name are ordered as if their single letter was a long name.

-a, --alltargets

scan all targets, not just currently existing [default: disabled]

--attachpq3

tell kernel to attach sg to LUN 0 that reports PQ=3

-c

enables scanning of channels 0 1 [default: 0 / all detected ones]

--channels=CLIST

scan only channel(s) in CLIST

--color

use coloured prefixes OLD/NEW/DEL

-d

enable debug [default: 0]

-f, --flush

flush failed multipath devices [default: disabled]

--forceremove

remove stale devices (DANGEROUS)

--forcerescan

remove and re-add existing devices (DANGEROUS)

-h, --help

print usage message then exit

--hosts=HLIST

scan only host(s) in HLIST

--ids=TLIST

scan only target ID(s) in TLIST

--ignore-rev

ignore (firmware) revision change. This is the third text field (4 bytes long) in a standard INQUIRY response.

-i, --issue-lip

issue a FibreChannel LIP reset [default: disabled]

-I SECS, --issue-lip-wait=SECS

issue a FibreChannel LIP reset and then wait SECS seconds.

-L NUM

activates scanning for LUNs 0--NUM [default: 0]

-l

activates scanning for LUNs 0--7 [default: 0]

--largelun

tell kernel to support LUNs > 7 even on SCSI2 devs

--luns=NLIST

scan only lun(s) in NLIST

-m, --multipath

update multipath devices [default: disabled]

--no-lip-scan

don't scan FC Host when the --issue-lip option is also given.

--nooptscan

don't stop looking for LUNs is 0 is not found

--nosync

do not issue a sync [default: sync if remove]

-r, --remove

enables removing of devices [default: disabled]

--reportlun2

tell kernel to try REPORT_LUN even on SCSI2 devices

-s, --resize

look for resized disks and reload associated multipath devices, if applicable

--sparselun

tell kernel to support sparse LUN numbering

--sync

issue a sync [default: sync if remove]

-t, --timeout=SECS

timeout for testing if device is online. Test is skipped if 0 [default: 30 (seconds)]

-u, --update

look for existing disks that have been remapped

-V, --version

shows version string then exits. The version string is a numeric datestamp of the form YYYYMMDD.

-w, --wide

scan for target device IDs 0--15 [default: 0--7]

Host numbers may thus be specified either directly on cmd line (deprecated) or with the --hosts=LIST parameter (recommended).

Arguments to options that end in LIST (e.g. TLIST) can have this form:

A[-B][,C[-D]]...

which is a comma separated list of single values and/or ranges (no spaces allowed).

## SEE ALSO
There is a brief descripion here: https://fibrevillage.com/storage/585-rescan-scsi-bus-sh-script-for-adding-and-removing-scsi-devices-without-rebooting

sg3_utils Homepage: https://sg.danny.cz/sg


title: scsi_logging_level(8)

text:
# scsi_logging_level(8)

## NAME
scsi_logging_level - access Linux SCSI logging level information

## SYNOPSIS
scsi_logging_level [--all=LEV] [--create] [--error=LEV] [--get] [--help] [--highlevel=LEV] [--hlcomplete=LEV] [--hlqueue=LEV] [--ioctl=LEV] [--llcomplete=LEV] [--llqueue=LEV] [--lowlevel=LEV] [--midlevel=LEV] [--mlcomplete=LEV] [--mlqueue=LEV] [--scan=LEV] [--set] [--timeout=LEV] [--version]

## DESCRIPTION
This bash shell script accesses the Linux SCSI subsystem logging level. The current values can be shown (e.g. with --get) or changed (e.g. with --set). Superuser permissions will typically be required to set the logging level.

One of these options: --create, --get or --set is required. Only one of them can be given.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-a, --all=LEV

LEV is used for all SCSI_LOG fields.

-c, --create

Options are parsed and placed in internal fields that are displayed but no logging levels are changed within the Linux kernel.

-E, --error=LEV

LEV is placed in the SCSI_LOG_ERROR field.

-g, --get

Fetches the current SCSI logging levels from the Linux kernel and displays them.

-h, --help

print out the usage message then exit.

-H, --highlevel=LEV

LEV is placed in the SCSI_LOG_HLQUEUE and SCSI_LOG_HLCOMPLETE fields.

--hlcomplete=LEV

LEV is placed in the SCSI_LOG_HLCOMPLETE field.

--hlqueue=LEV

LEV is placed in the SCSI_LOG_HLQUEUE field.

-I, --ioctl=LEV

LEV is placed in the SCSI_LOG_IOCTL field.

--llcomplete=LEV

LEV is placed in the SCSI_LOG_LLCOMPLETE field.

--llqueue=LEV

LEV is placed in the SCSI_LOG_LLQUEUE field.

-L, --lowlevel=LEV

LEV is placed in the SCSI_LOG_LLQUEUE and SCSI_LOG_LLCOMPLETE fields.

-M, --midlevel=LEV

LEV is placed in the SCSI_LOG_MLQUEUE and SCSI_LOG_MLCOMPLETE fields.

--mlcomplete=LEV

LEV is placed in the SCSI_LOG_MLCOMPLETE field.

--mlqueue=LEV

LEV is placed in the SCSI_LOG_MLQUEUE field.

-S, --scan=LEV

LEV is placed in the SCSI_LOG_SCAN field.

-s, --set

Uses the fields specified in this command's options and attempts to apply them to the Linux SCSI subsystem logging levels. Typically superuser permissions will be required to do this.

-T, --timeout=LEV

LEV is placed in the SCSI_LOG_TIMEOUT field.

-v, --version

Outputs the version information and then exits.

## NOTES
The --get and --set options access the /proc/sys/dev/scsi/logging_level pseudo file.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Any other exit status indicates that an error has occurred.

## EXAMPLES
The following will set SCSI_LOG_ERROR to level 5 in the Linux kernel. It requires root permissions:

scsi_logging_level -s -E 5

So as to not interfere with other SCSI subsystem upper level drivers (ULDs) which most likely will be active at the same time, the Linux sg driver uses SCSI_LOG_TIMEOUT for logging purposes. To see full debugging and trace from the sg driver use:

scsi_logging_level -s -T 7

The output from the sg driver caused by this will go to the system logs (e.g. /var/log/syslog). To reduce the amount of output use a number lower than 7. Using 0 will turn off the tracing and debug.

To turn on maximum SCSI subsystem logging use:

scsi_logging_level -s -a 7

That is probably best done on a system that does not use a SCSI command device to hold the root file system, or the file system that holds the system log. Note that SATA disks and USB attached storage nearly always use the SCSI subsystem.

## AUTHORS
Written by IBM. Small alterations by Douglas Gilbert.

## REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>.

## COPYRIGHT
Copyright © IBM Corp. 2006

This software is distributed under the GPL version 2. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The software was obtained from an IBM package called s390-tools-1.6.2 found on that company's "developerworks" site. The most recent version of that package at this time is 1.8.3 .


title: scsi_mandat(8)

text:
# scsi_mandat(8)

## NAME
scsi_mandat - check SCSI device support for mandatory commands

## SYNOPSIS
scsi_mandat [--help] [--log] [--quiet] [--verbose] DEVICE

## DESCRIPTION
This bash shell script calls several SCSI commands on the given DEVICE. These SCSI commands are considered mandatory (although that varies a little depending on which standard/draft the DEVICE complies with). The results of each test and a pass/fail count are output.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-h, --help

print out the usage message then exit.

-L, --log

the output to stderr (from each SCSI command executed) is appended to a file called 'scsi_mandat.err' in the current working directory.

-q, --quiet

the amount of output is reduced and typically only the pass/fail count is output.

-v, --verbose

increase level or verbosity.

## EXIT STATUS
The exit status of this script is the number of "bad" errors found. So an exit status of 0 means all mandatory SCSI commands worked as expected.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2011-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_inq,sg_luns,sg_turs,sg_requests,sg_vpd,sg_senddiag (sg3_utils)


title: scsi_readcap(8)

summary: do SCSI READ CAPACITY command on disks

text:
# scsi_readcap(8)

## NAME
scsi_readcap - do SCSI READ CAPACITY command on disks

## SYNOPSIS
scsi_readcap [--brief] [--help] [--long] [--verbose] DEVICE [DEVICE]*

## DESCRIPTION
This bash shell script calls the sg_readcap utility on each given DEVICE. This will send a SCSI READ CAPACITY command to each DEVICE.

The default action of this script is to send the 10 byte cdb READ CAPACITY(10) command to each DEVICE. If a response indicates the number of blocks is greater than or equal to '2**32 - 1' then the READ CAPACITY(16) is sent and its response is output.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-b, --brief

shortens the output to two hexadecimal numbers, both prefixed by '0x'. The first number is the number of blocks available and the second is the size of each blocks in bytes (e.g. '0x12a19eb0 0x200'). If an error is detected '0x0 0x0' is output and the script continues if there are more DEVICEs.

-h, --help

print out the usage message then exit.

-l, --long

the default is to send the READ CAPACITY(10) command (i.e. the 10 byte cdb variant). When this option is given the READ CAPACITY(16) command is sent. The latter command yields more information in its response.

-v, --verbose

increase level or verbosity.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Otherwise the exit status is that of the last sg_readcap utility called. See the sg3_utils(8) man page.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2009-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_readcap (sg3_utils)


title: scsi_ready(8)

summary: do SCSI TEST UNIT READY on devices

text:
# scsi_ready(8)

## NAME
scsi_ready - do SCSI TEST UNIT READY on devices

## SYNOPSIS
scsi_ready [--brief] [--help] [--verbose] DEVICE [DEVICE]*

## DESCRIPTION
This bash shell script calls the sg_turs utility on each given DEVICE. This will send a SCSI TEST UNIT READY command to each DEVICE. Disks, tape drives and DVD/BD players amongst others may respond to this SCSI command.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-b, --brief

for each DEVICE given output a line containing either ' ready' or ' device not ready'. If DEVICE is not found or there is another serious error then an error message will appear instead.

-h, --help

print out the usage message then exit.

-v, --verbose

increase level or verbosity.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Otherwise the exit status is that of the last sg_turs utility called. See the sg3_utils(8) man page.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2009-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_turs (sg3_utils)


title: scsi_satl(8)

text:
# scsi_satl(8)

## NAME
scsi_satl - check SCSI to ATA Translation (SAT) device support

## SYNOPSIS
scsi_satl [--help] [--log] [--quiet] [--verbose] DEVICE

## DESCRIPTION
This bash shell script calls several SCSI commands on the given DEVICE that is assumed to be an ATA device behind a SCSI to ATA Translation (SAT) layer (SATL). The results of each test and a pass/fail count are output.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-h, --help

print out the usage message then exit.

-L, --log

the output to stderr (from each SCSI command executed) is appended to a file called 'scsi_satl.err' in the current working directory.

-q, --quiet

the amount of output is reduced and typically only the pass/fail count is output.

-v, --verbose

increase level or verbosity.

## EXIT STATUS
The exit status of this script is the number of "bad" errors found. So an exit status of 0 means all mandatory SCSI commands worked as expected.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2011-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_inq, sg_luns, sg_turs, sg_requests, sg_vpd, sg_senddiag, sg_modes, sg_sat_identify (sg3_utils)


title: scsi_start(8)

summary: start one or more SCSI disks

text:
# scsi_start(8)

## NAME
scsi_start - start one or more SCSI disks

## SYNOPSIS
scsi_start [--help] [--verbose] [--wait] DEVICE [DEVICE]*

## DESCRIPTION
This bash shell script calls the sg_start utility on each given DEVICE. The purpose is to spin up (start) each given DEVICE.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-h, --help

print out the usage message then exit.

-v, --verbose

increase level or verbosity.

-w, --wait

wait for the spin up (start) on each given DEVICE to complete. The default action is to do each start in immediate mode.

## NOTES
If a large number of disks are spun up at the same time (i.e. without the --wait option) then the power supply may be overloaded.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Otherwise the exit status is that of the last sg_start utility called. See the sg3_utils(8) man page.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2009-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_start (sg3_utils)


title: scsi_stop(8)

summary: stop (spin down) one or more SCSI disks

text:
# scsi_stop(8)

## NAME
scsi_stop - stop (spin down) one or more SCSI disks

## SYNOPSIS
scsi_stop [--help] [--verbose] [--wait] DEVICE [DEVICE]*

## DESCRIPTION
This bash shell script calls the sg_start utility on each given DEVICE. The purpose is to spin down (stop) each given DEVICE.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-h, --help

print out the usage message then exit.

-v, --verbose

increase level or verbosity.

-w, --wait

wait for the spin down (stop) on each given DEVICE to complete. The default action is to do each stop in immediate mode.

## NOTES
The sg_start utility calls the SCSI START STOP UNIT command and can either start (spin up) or stop (spin down) a SCSI disk depending on the given command line options.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Otherwise the exit status is that of the last sg_start utility called. See the sg3_utils(8) man page.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2009-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_start (sg3_utils)


title: scsi_temperature(8)

summary: fetch the temperature of a SCSI device

text:
# scsi_temperature(8)

## NAME
scsi_temperature - fetch the temperature of a SCSI device

## SYNOPSIS
scsi_temperature [--help] [--verbose] DEVICE [DEVICE]*

## DESCRIPTION
This bash shell script calls the sg_logs utility on each given DEVICE in order to find the device's temperature. The Temperature log page is checked first and if it is not available then the Informational Exceptions log page is checked.

## OPTIONS
Arguments to long options are mandatory for short options as well.

-h, --help

print out the usage message then exit.

-v, --verbose

increase level or verbosity.

## EXIT STATUS
The exit status of this script is 0 when it is successful. Otherwise the exit status is that of the last sg_logs utility called. See the sg3_utils(8) man page.

## AUTHORS
Written by D. Gilbert

## COPYRIGHT
Copyright © 2011-2013 Douglas Gilbert

This software is distributed under a BSD-2-Clause license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO
sg_logs (sg3_utils)