RAID regions can be resized in order to expand or shrink the available data space in the region. Each RAID level has different characteristics, and thus each RAID level has different requirements for when and how they can expand or shrink.
See Chapter 16 for general information about resizing EVMS volumes and objects.
A Linear-RAID region can be expanded in two ways. First, if the last child object in the Linear-RAID region is expandable, then that object can be expanded, and the RAID region can expand into that new space. Second, one or more new objects can be added to the end of the region.
Likewise, a Linear-RAID region can be shrunk in two ways. If the last child object in the region is shrinkable, then that object can be shrunk, and the RAID region will shrink by the same amount. Also, one or more objects can be removed from the end of the RAID region (but the first object in the region cannot be removed).
Linear-RAID regions can be resized while they are active and in use.
You can expand a RAID-0 region by adding one new object to the region. You can shrink a RAID-0 region by removing up to N-1 of the current child objects in a region with N objects.
Because RAID-0 regions stripe across the child objects, when a RAID-0 region is resized, the data must be "re-striped" to account for the new number of objects. This means the MD plug-in will move each chunk of data from its location in the current region to the appropriate location in the expanded region. Be forewarned, the re-striping process can take a long time. At this time, there is no mechanism for speeding up or slowing down the re-striping process. The EVMS GUI and text-mode user interface will indicate the progress of the re-striping. Please do not attempt to interrupt the re-striping before it is complete, because the data in the RAID-0 region will likely become corrupted.
RAID-0 regions must be deactivated before they are resized in order to prevent data corruption while the data is being re-striped.
IMPORTANT: Please have a suitable backup available before attempting a RAID-0 resize. If the re-striping process is interrupted before it completes (for example, the EVMS process gets killed, the machine crashes, or a child object in the RAID region starts returning I/O errors), then the state of that region cannot be ensured in all situations.
EVMS will attempt to recover following a problem during a RAID-0 resize. The MD plug-in does keep track of the progress of the resize in the MD metadata. Each time a data chunk is moved, the MD metadata is updated to reflect which chunk is currently being processed. If EVMS or the machine crashes during a resize, the next time you run EVMS the MD plug-in will try to restore the state of that region based on the latest metadata information. If an expand was taking place, the region will be "rolled back" to its state before the expand. If a shrink was taking place, the shrink will continue from the point it stopped. However, this recovery is not always enough to ensure that the entire volume stack is in the correct state. If the RAID-0 region is made directly into a volume, then it will likely be restored to the correct state. On the other hand, if the RAID region is a consumed-object in an LVM container, or a child-object of another RAID region, then the metadata for those plug-ins might not always be in the correct state and might be at the wrong location on the RAID region. Thus, the containers, objects, and volumes built on top of the RAID-0 region might not reflect the correct size and might not even be discovered.
A RAID-1 region can be resized if all of the child objects can be simultaneously resized by the same amount.
RAID-1 regions cannot be resized by adding additional objects. This type of operation is referred to as "adding active objects," and is discussed in Section B.3.3.
RAID-1 regions must be deactivated before they are resized.
Resizing a RAID-4/5 region follows the same rules and restrictions for resizing a RAID-0 region. Expand a RAID-4/5 region by adding one new object to the region. Shrink a RAID-4/5 region by removing up to N-1 of the current child objects in a region with N objects.
See Section B.5.2 for information about how to perform this function.
Like RAID-0, RAID-4/5 regions must be deactivated before they are resized.