6.15. Splitting off a RAID image as a separate logical volume
You can split off an image of a RAID logical volume to form a new logical volume. When you are removing a RAID image from an existing RAID1 logical volume or removing a RAID data subvolume and its associated metadata subvolume from the middle of the device, any higher numbered images will be shifted down to fill the slot. The index numbers on the logical volumes that make up a RAID array will thus be an unbroken sequence of integers.
You cannot split off a RAID image if the RAID1 array is not yet in sync.
Procédure
Display the LVM device my_vg/my_lv, which is a 2-way RAID1 array:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Split the RAID image into a separate logical volume. The following example splits a 2-way RAID1 logical volume, my_lv, into two linear logical volumes, my_lv and new:
lvconvert --splitmirror 1 -n new my_vg/my_lv
# lvconvert --splitmirror 1 -n new my_vg/my_lv Are you sure you want to split raid1 LV my_vg/my_lv losing all resilience? [y/n]: yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Split a 3-way RAID1 logical volume, my_lv, into a 2-way RAID1 logical volume, my_lv, and a linear logical volume, new:
lvconvert --splitmirror 1 -n new my_vg/my_lv
# lvconvert --splitmirror 1 -n new my_vg/my_lvCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Vérification
View the logical volume after you split off an image of a RAID logical volume:
lvs -a -o name,copy_percent,devices my_vg
# lvs -a -o name,copy_percent,devices my_vg LV Copy% Devices my_lv /dev/sde1(1) new /dev/sdf1(1)Copy to Clipboard Copied! Toggle word wrap Toggle overflow