This document outlines the different procedures involved in reconfiguring storage devices while the
system is running. The document currently addresses iSCSI and Fibre Channel interconnects. Other
interconnects may be added in future versions of this document.
It is often desirable to add, remove or re-size storage devices while the operating system is running,
and without rebooting. This manual outlines the procedures that may be used to reconfigure storage
devices on Red Hat Enterprise Linux 5 host systems while the system is running. It covers iSCSI and
Fibre Channel storage interconnects; other interconnect types may be added it the future.
The Online Storage Reconfiguration guide focuses on adding, removing, modifying, and monitoring
storage devices. It does not discuss the Fibre Channel or iSCSI protocols in detail. For more
information about these protocols, refer to other documentation.
This manual assumes that you have advanced working knowledge of Red Hat Enterprise Linux
5, along with first-hand experience in managing storage devices in Linux. Before consulting this
book, verify if your host bus adapter vendor or hardware vendor have their own documentation. It is
recommended that you consult such documents in conjunction with this manual.
Note
This manual makes reference to various sysfs objects. Red Hat advises that the sysfs
object names and directory structure are subject to change in major Red Hat Enterprise
Linux 5 releases. This is because the upstream Linux kernel does not provide a stable
internal API. For guidelines on how to reference sysfs objects in a transportable way,
refer to the document Documentation/sysfs-rules.txt in the kernel source tree for
guidelines.
2
Document Conventions
Warning
Online storage reconfiguration must be done carefully. System failures or interruptions
during the process can lead to unexpected results. Red Hat advises that you reduce
system load to the maximum extent possible during the change operations. This will
reduce the chance of I/O errors, out-of-memory errors, or similar errors occurring in the
midst of a configuration change. The following sections provide more specific guidelines
regarding this.
In addition, Red Hat recommends that you back up all data before performing online
storage reconfiguration.
1.1. Document Conventions
This manual uses several conventions to highlight certain words and phrases and draw attention to
specific pieces of information.
In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts1 set. The
Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not,
alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes
the Liberation Fonts set by default.
1.1.1. Typographic Conventions
Four typographic conventions are used to call attention to specific words and phrases. These
conventions, and the circumstances they apply to, are as follows.
Mono-spaced Bold
Used to highlight system input, including shell commands, file names and paths. Also used to highlight
keycaps and key combinations. For example:
To see the contents of the file my_next_bestselling_novel in your current
working directory, enter the cat my_next_bestselling_novel command at the
shell prompt and press Enter to execute the command.
The above includes a file name, a shell command and a keycap, all presented in mono-spaced bold
and all distinguishable thanks to context.
Key combinations can be distinguished from keycaps by the hyphen connecting each part of a key
combination. For example:
Press Enter to execute the command.
Press Ctrl+Alt+F1 to switch to the first virtual terminal. Press Ctrl+Alt+F7 to
return to your X-Windows session.
The first paragraph highlights the particular keycap to press. The second highlights two key
combinations (each a set of three keycaps with each set pressed simultaneously).
If source code is discussed, class names, methods, functions, variable names and returned values
mentioned within a paragraph will be presented as above, in mono-spaced bold. For example:
1
https://fedorahosted.org/liberation-fonts/
3
Online Storage Guide
File-related classes include filesystem for file systems, file for files, and dir for
directories. Each class has its own associated set of permissions.
Proportional Bold
This denotes words or phrases encountered on a system, including application names; dialog box text;
labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:
Choose System → Preferences → Mouse from the main menu bar to launch Mouse
Preferences. In the Buttons tab, click the Left-handed mouse check box and click
Close to switch the primary mouse button from the left to the right (making the mouse
suitable for use in the left hand).
To insert a special character into a gedit file, choose Applications → Accessories→ Character Map from the main menu bar. Next, choose Search → Find… from
the Character Map menu bar, type the name of the character in the Search field
and click Next. The character you sought will be highlighted in the Character Table.
Double-click this highlighted character to place it in the Text to copy field and then
click the Copy button. Now switch back to your document and choose Edit → Paste
from the gedit menu bar.
The above text includes application names; system-wide menu names and items; application-specific
menu names; and buttons and text found within a GUI interface, all presented in proportional bold and
all distinguishable by context.
Mono-spaced Bold Italic or Proportional Bold Italic
Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or
variable text. Italics denotes text you do not input literally or displayed text that changes depending on
circumstance. For example:
To connect to a remote machine using ssh, type ssh username@domain.name at
a shell prompt. If the remote machine is example.com and your username on that
machine is john, type ssh john@example.com.
The mount -o remount file-system command remounts the named file
system. For example, to remount the /home file system, the command is mount -oremount /home.
To see the version of a currently installed package, use the rpm -q package
command. It will return a result as follows: package-version-release.
Note the words in bold italics above — username, domain.name, file-system, package, version and
release. Each word is a placeholder, either for text you enter when issuing a command or for text
displayed by the system.
Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and
important term. For example:
Publican is a DocBook publishing system.
1.1.2. Pull-quote Conventions
Terminal output and source code listings are set off visually from the surrounding text.
Output sent to a terminal is set in mono-spaced roman and presented thus:
Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.
Note
Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note
should have no negative consequences, but you might miss out on a trick that makes your
life easier.
Important
Important boxes detail things that are easily missed: configuration changes that only
apply to the current session, or services that need restarting before an update will apply.
Ignoring a box labeled 'Important' won't cause data loss but may cause irritation and
frustration.
Warning
Warnings should not be ignored. Ignoring warnings will most likely cause data loss.
1.2. We Need Feedback!
If you find a typographical error in this manual, or if you have thought of a way to make this manual
better, we would love to hear from you! Please submit a report in Bugzilla: http://bugzilla.redhat.com/
bugzilla/ against the product Red_Hat_Enterprise_Linux.
5
Online Storage Guide
When submitting a bug report, be sure to mention the manual's identifier:
Online_Storage_Reconfiguration_Guide
If you have a suggestion for improving the documentation, try to be as specific as possible when
describing it. If you have found an error, please include the section number and some of the
surrounding text so we can find it easily.
2. Fibre Channel
This section discusses the Fibre Channel API, native Red Hat Enterprise Linux 5 Fibre Channel
drivers, and the Fibre Channel capabilities of these drivers.
2.1. Fibre Channel API
Below is a list of /sys/class/ directories that contain files used to provide the userspace API. In
each item, host numbers are designated by H, bus numbers are B, targets are T, logical unit numbers
(LUNs) are L, and remote port numbers are R.
Important
If your system is using multipath software, Red Hat recommends that you consult your
hardware vendor before changing any of the values described in this section.
dev_loss_tmo — number of seconds to wait before marking a link as "bad". Once a link is
marked bad, IO running on its corresponding path (along with any new IO on that path) will be
failed.
The default dev_loss_tmo value varies, depending on which driver/device is used. If a Qlogic
adapter is used, the default is 35 seconds, while if an Emulex adapter is used, it is 30 seconds.
The dev_loss_tmo value can be changed via the scsi_transport_fc module parameter
dev_loss_tmo, although the driver can override this timeout value.
The maximum dev_loss_tmo value is 600 seconds. If dev_loss_tmo is set to zero or any
value greater than 600, the driver's internal timeouts will be used instead.
•
fast_io_fail_tmo — length of time to wait before failing IO executed when a link problem is
detected. IO that reaches the driver will fail. If IO is in a blocked queue, it will not be failed until
dev_loss_tmo expires and the queue is unblocked.
6
Native Fibre Channel Drivers and Capabilities
Host: /sys/class/fc_host/hostH/
• port_id
•
issue_lip — instructs the driver to rediscover remote ports.
2.2. Native Fibre Channel Drivers and Capabilities
Red Hat Enterprise Linux 5 ships with the following native fibre channel drivers:
• lpfc
• qla2xxx
• zfcp
• mptfc
Table 1, “Fibre-Channel API Capabilities” describes the different fibre-channel API capabilities of each
native Red Hat Enterprise Linux 5 driver. X denotes support for the capability.
lpfcqla2xxxzfcpmptfc
Transport
port_id
Transport
node_name
Transport
port_name
Remote Port
dev_loss_tmo
Remote Port
fast_io_fail_tmo
Host port_idXXXX
Host issue_lipXX
Supported as of Red Hat Enterprise Linux 5.4
Table 1. Fibre-Channel API Capabilities
XXXX
XXXX
XXXX
XXXX
XX
1
3. iSCSI
This section describes the iSCSI API and the iscsiadm utility. Before using the iscsiadm
utility, install the iscsi-initiator-utils package first; to do so, run yum install iscsi-initiator-utils.
In addition, the iSCSI service must be running in order to discover or log in to targets. To start the
iSCSI service, run service iscsi start
3.1. iSCSI API
To get information about running sessions, run:
iscsiadm -m session -P 3
7
Online Storage Guide
This command displays the session/device state, session ID (sid), some negotiated parameters, and
the SCSI devices accessible through the session.
For shorter output (for example, to display only the sid-to-node mapping), run:
iscsiadm -m session -P 0
or
iscsiadm -m session
These commands print the list of running sessions with the format:
For more information about the iSCSI API, refer to /usr/share/doc/iscsi-initiatorutils-version/README.
4. Persistent Naming
The operating system issues I/O to a storage device by referencing the path that is used to reach it.
For SCSI devices, the path consists of the following:
• PCI identifier of the host bus adapter (HBA)
• channel number on that HBA
• the remote SCSI target address
• the Logical Unit Number (LUN)
This path-based address is not persistent. It may change any time the system is reconfigured (either
by on-line reconfiguration, as described in this manual, or when the system is shutdown, reconfigured,
and rebooted). It is even possible for the path identifiers to change when no physical reconfiguration
has been done, as a result of timing variations during the discovery process when the system boots, or
when a bus is re-scanned.
The operating system provides several non-persistent names to represent these access paths
to storage devices. One is the /dev/sd name; another is the major:minor number. A third is
a symlink maintained in the /dev/disk/by-path/ directory. This symlink maps from the path
identifier to the current /dev/sd name. For example, for a Fibre Channel device, the PCI info and
Host:BusTarget:LUN info may appear as follows:
pci-0000:02:0e.0-scsi-0:0:0:0 -> ../../sda
8
WWID
For iSCSI devices, by-path/ names map from the target name and portal information to the sd
name.
It is generally not appropriate for applications to use these path-based names. This is because the
storage device these paths reference may change, potentially causing incorrect data to be written
to the device. Path-based names are also not appropriate for multipath devices, because the pathbased names may be mistaken for separate storage devices, leading to uncoordinated access and
unintended modifications of the data.
In addition, path-based names are system-specific. This can cause unintended data changes when
the device is accessed by multiple systems, such as in a cluster.
For these reasons, several persistent, system-independent, methods for identifying devices have been
developed. The following sections discuss these in detail.
4.1. WWID
The World Wide Identifier (WWID) can be used in reliably identifying devices. It is a persistent,
system-independent ID that the SCSI Standard requires from all SCSI devices. The WWID identifier is
guaranteed to be unique for every storage device, and independent of the path that is used to access
the device.
This identifier can be obtained by issuing a SCSI Inquiry to retrieve the Device Identification VitalProduct Data (page 0x83) or Unit Serial Number (page 0x80). The mappings from these WWIDs
to the current /dev/sd names can be seen in the symlinks maintained in the /dev/disk/by-id/
directory.
For example, a device with a page 0x83 identifier would have:
Or, a device with a page 0x80 identifier would have:
scsi-SSEAGATE_ST373453LW_3HW1RHM6 -> ../../sda
Red Hat Enterprise Linux 5 automatically maintains the proper mapping from the WWID-based device
name to a current /dev/sd name on that system. Applications can use the /dev/disk/by-id/
name to reference the data on the disk, even if the path to the device changes, and even when
accessing the device from different systems.
If there are multiple paths from a system to a device, device-mapper-multipath uses the WWID to
detect this. Device-mapper-multipath then presents a single "pseudo-device" in /dev/mapper/wwid, such as /dev/mapper/3600508b400105df70000e00000ac0000.
The command multipath -l shows the mapping to the non-persistent identifiers:
Host:Channel:Target:LUN, /dev/sd name, and the major:minor number.
Device-mapper-multipath automatically maintains the proper mapping of each WWID-based device
name to its corresponding /dev/sd name on the system. These names are persistent across path
changes, and they are consistent when accessing the device from different systems.
When the user_friendly_names feature (of device-mapper-multipath) is used, the WWID is
mapped to a name of the form /dev/mapper/mpathn. By default, this mapping is maintained in the
file /var/lib/multipath/bindings. These mpathn names are persistent as long as that file is
maintained.
Warning
The multipath bindings file (by default, /var/lib/multipath/bindings) must be
available at boot time. If /var is a separate filesystem from /, then you must change the
default location of the file. For more information, refer to http://kbase.redhat.com/faq/docs/
DOC-17650.
Important
If you use user_friendly_names, then additional steps are required to obtain
consistent names in a cluster. Refer to the Consistent Multipath Device Names2 section in
the Using Device-Mapper Multipath3 book.
In addition to these persistent names provided by the system, you can also use udev rules to
implement persistent names of your own, mapped to the WWID of the storage. For more information
about this, refer to http://kbase.redhat.com/faq/docs/DOC-7319.
4.2. UUID and Other Persistent Identifiers
If a storage device contains a filesystem, then that filesystem may provide one or both of the following:
• Universally Unique Identifier (UUID)
• Filesystem label
These identifiers are persistent, and based on metadata written on the device by certain applications.
They may also be used to access the device using the symlinks maintained by the operating system
in the /dev/disk/by-label/ (e.g. boot -> ../../sda1 ) and /dev/disk/by-uuid/ (e.g.
md and LVM write metadata on the storage device, and read that data when they scan devices. In
each case, the metadata contains a UUID, so that the device can be identified regardless of the
path (or system) used to access it. As a result, the device names presented by these facilities are
persistent, as long as the metadata remains unchanged.
5. Removing a Storage Device
Before removing access to the storage device itself, it is advisable to back up data from the device
first. Afterwards, flush I/O and remove all operating system references to the device (as described
10
Removing a Storage Device
below). If the device uses multipathing, then do this for the multipath "pseudo device" (Section 4.1,
“WWID”) and each of the identifiers that represent a path to the device. If you are only removing a
path to a multipath device, and other paths will remain, then the procedure is simpler, as described in
Section 7, “Adding a Storage Device or Path”.
Removal of a storage device is not recommended when the system is under memory pressure,
since the I/O flush will add to the load. To determine the level of memory pressure, run the command
vmstat 1 100; device removal is not recommended if:
• Free memory is less than 5% of the total memory in more than 10 samples per 100 (the command
free can also be used to display the total memory).
• Swapping is active (non-zero si and so columns in the vmstat output).
The general procedure for removing all access to a device is as follows:
Procedure 1. Ensuring a Clean Device Removal
1.Close all users of the device and backup device data as needed.
2.Use umount to unmount any file systems that mounted the device.
3.Remove the device from any md and LVM volume using it. If the device is a member of an LVM
Volume group, then it may be necessary to move data off the device using the pvmove command,
then use the vgreduce command to remove the physical volume, and (optionally) pvremove to
remove the LVM metadata from the disk.
4.If the device uses multipathing, run multipath -l and note all the paths to the device.
Afterwards, remove the multipathed device using multipath -f device.
5.Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device.
This is particularly important for raw devices, where there is no umount or vgreduce operation to
cause an I/O flush.
6.Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or
the major:minor number, in applications, scripts, or utilities on the system. This is important in
ensuring that different devices added in the future will not be mistaken for the current device.
7.Finally, remove each path to the device from the SCSI subsystem. To do so, use the command
echo 1 > /sys/block/device-name/device/delete where device-name may be sde,
for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target
ID, and l is the LUN.
Note
The older form of these commands, echo "scsi remove-single-device 0 0
0 0" > /proc/scsi/scsi, is deprecated.
You can determine the device-name, HBA number, HBA channel, SCSI target ID and LUN for a
device from various commands, such as lsscsi, scsi_id, multipath -l, and ls -l /dev/disk/by-*.
11
Loading...
+ 23 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.