25.16. Resizing an Online Logical Unit
25.16.1. Resizing Fibre Channel Logical Units
$ echo 1 > /sys/block/sdX/device/rescan
sd2, and so on) that represents a path for the multipathed logical unit. To determine which devices are paths for a multipath logical unit, use
multipath -ll; then, find the entry that matches the logical unit being resized. It is advisable that you refer to the WWID of each entry to make it easier to find which one matches the logical unit being resized.
25.16.2. Resizing an iSCSI Logical Unit
# iscsiadm -m node --targetname target_name -R 
target_namewith the name of the target where the device is located.
# iscsiadm -m node -R -I interface
interfacewith the corresponding interface name of the resized logical unit (for example,
iface0). This command performs two operations:
- It scans for new devices in the same way that the command
echo "- - -" > /sys/class/scsi_host/host/scandoes (refer to Section 25.14, “Scanning iSCSI Interconnects”).
- It re-scans for new/modified logical units the same way that the command
echo 1 > /sys/block/sdX/device/rescandoes. Note that this command is the same one used for re-scanning Fibre Channel logical units.
25.16.3. Updating the Size of Your Multipath Device
multipathd. To do so, first ensure that
multipathdis running using
service multipathd status. Once you've verified that
multipathdis operational, run the following command:
# multipathd -k"resize map multipath_device"
multipath_devicevariable is the corresponding multipath entry of your device in
/dev/mapper. Depending on how multipathing is set up on your system,
multipath_devicecan be either of two formats:
Xis the corresponding entry of your device (for example,
- a WWID; for example,
multipath -ll. This displays a list of all existing multipath entries in the system, along with the major and minor numbers of their corresponding devices.
multipathd -k"resize map multipath_device"if there are any commands queued to
multipath_device. That is, do not use this command when the
/etc/multipath.conf) is set to
"queue", and there are no active paths to the device.
25.16.4. Changing the Read/Write State of an Online Logical Unit
# blockdev --getro /dev/sdXYZ
# cat /sys/block/sdXYZ/ro 1 = read-only 0 = read-write
multipath -llcommand. For example:
36001438005deb4710000500000640000 dm-8 GZ,GZ500 [size=20G][features=0][hwhandler=0][ro] \_ round-robin 0 [prio=200][active] \_ 6:0:4:1 sdax 67:16 [active][ready] \_ 6:0:5:1 sday 67:32 [active][ready] \_ round-robin 0 [prio=40][enabled] \_ 6:0:6:1 sdaz 67:48 [active][ready] \_ 6:0:7:1 sdba 67:64 [active][ready]
Procedure 25.12. Change the R/W State
- To move the device from RO to R/W, see step 2.To move the device from R/W to RO, ensure no further writes will be issued. Do this by stopping the application, or through the use of an appropriate, application-specific action.Ensure that all outstanding write I/Os are complete with the following command:
# blockdev --flushbufs /dev/deviceReplace device with the desired designator; for a device mapper multipath, this is the entry for your device in
dev/mapper. For example,
- Use the management interface of the storage device to change the state of the logical unit from R/W to RO, or from RO to R/W. The procedure for this differs with each array. Consult applicable storage array vendor documentation for more information.
- Perform a re-scan of the device to update the operating system's view of the R/W state of the device. If using a device mapper multipath, perform this re-scan for each path to the device before issuing the command telling multipath to reload its device maps.This process is explained in further detail in Section 184.108.40.206, “Rescanning Logical Units”.
220.127.116.11. Rescanning Logical Units
# echo 1 > /sys/block/sdX/device/rescan
multipath -11, then find the entry that matches the logical unit to be changed.
Example 25.15. Use of the
multipath -11 Command
multipath -11above shows the path for the LUN with WWID 36001438005deb4710000500000640000. In this case, enter:
# echo 1 > /sys/block/sdax/device/rescan
# echo 1 > /sys/block/sday/device/rescan
# echo 1 > /sys/block/sdaz/device/rescan
# echo 1 > /sys/block/sdba/device/rescan
18.104.22.168. Updating the R/W State of a Multipath Device
# multipath -r
multipath -11command can then be used to confirm the change.