1.13. Online Logical Units
1.13.1. Resizing an Online Logical Unit
188.8.131.52. 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.
184.108.40.206. 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 1.11, “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.
220.127.116.11. 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.
multipathddaemon to recognize (and adjust to) the changes you made to the resized logical unit:
Procedure 1.4. Resizing the Corresponding Multipath Device (Required for Red Hat Enterprise Linux 5.0 - 5.2)
- Dump the device mapper table for the multipathed device using:
dmsetup table multipath_device
- Save the dumped device mapper table as
table_name. This table will be re-loaded and edited later.
- Examine the device mapper table. Note that the first two numbers in each line correspond to the start and end sectors of the disk, respectively.
- Suspend the device mapper target:
dmsetup suspend multipath_device
- Open the device mapper table you saved earlier (i.e.
table_name). Change the second number (i.e. the disk end sector) to reflect the new number of 512 byte sectors in the disk. For example, if the new disk size is 2GB, change the second number to 4194304.
- Reload the modified device mapper table:
dmsetup reload multipath_device table_name
- Resume the device mapper target:
dmsetup resume multipath_device