5.4.16.7. Splitting and Merging a RAID Image


You can temporarily split off an image of a RAID1 array for read-only use while keeping track of any changes by using the --trackchanges argument in conjunction with the --splitmirrors argument of the lvconvert command. This allows you to merge the image back into the array at a later time while resyncing only those portions of the array that have changed since the image was split.
The format for the lvconvert command to split off a RAID image is as follows.
lvconvert --splitmirrors count --trackchanges vg/lv [removable_PVs]
Copy to Clipboard Toggle word wrap
When you split off a RAID image with the --trackchanges argument, you can specify which image to split but you cannot change the name of the volume being split. In addition, the resulting volumes have the following constraints.
  • The new volume you create is read-only.
  • You cannot resize the new volume.
  • You cannot rename the remaining array.
  • You cannot resize the remaining array.
  • You can activate the new volume and the remaining array independently.
You can merge an image that was split off with the --trackchanges argument specified by executing a subsequent lvconvert command with the --merge argument. When you merge the image, only the portions of the array that have changed since the image was split are resynced.
The format for the lvconvert command to merge a RAID image is as follows.
lvconvert --merge raid_image
Copy to Clipboard Toggle word wrap
The following example creates a RAID1 logical volume and then splits off an image from that volume while tracking changes to the remaining array.
# lvcreate --type raid1 -m2 -L1G -n my_lv .vg
  Logical volume "my_lv" created
# lvs -a -o name,copy_percent,devices my_vg
  LV               Copy%  Devices                                     
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0]        /dev/sdb1(1)                                
  [my_lv_rimage_1]        /dev/sdc1(1)                                
  [my_lv_rimage_2]        /dev/sdd1(1)                                
  [my_lv_rmeta_0]         /dev/sdb1(0)                                
  [my_lv_rmeta_1]         /dev/sdc1(0)                                
  [my_lv_rmeta_2]         /dev/sdd1(0)                                
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_lv_rimage_2 split from my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_2' to merge back into my_lv
# lvs -a -o name,copy_percent,devices my_vg
  LV               Copy%  Devices                                     
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0),my_lv_rimage_2(0)
  [my_lv_rimage_0]        /dev/sdb1(1)                                
  [my_lv_rimage_1]        /dev/sdc1(1)                                
  my_lv_rimage_2         /dev/sdd1(1)                                
  [my_lv_rmeta_0]         /dev/sdb1(0)                                
  [my_lv_rmeta_1]         /dev/sdc1(0)                                
  [my_lv_rmeta_2]         /dev/sdd1(0)
Copy to Clipboard Toggle word wrap
The following example splits off an image from a RAID1 volume while tracking changes to the remaining array, then merges the volume back into the array.
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  lv_rimage_1 split from my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_1' to merge back into my_lv
# lvs -a -o name,copy_percent,devices my_vg
  LV               Copy%  Devices                      
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0)
  [my_lv_rimage_0]        /dev/sdc1(1)                 
  my_lv_rimage_1          /dev/sdd1(1)                 
  [my_lv_rmeta_0]         /dev/sdc1(0)                 
  [my_lv_rmeta_1]         /dev/sdd1(0)                 
# lvconvert --merge my_vg/my_lv_rimage_1
  my_vg/my_lv_rimage_1 successfully merged back into my_vg/my_lv
# lvs -a -o name,copy_percent,devices my_vg
  LV               Copy%  Devices                      
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0)
  [my_lv_rimage_0]        /dev/sdc1(1)                 
  [my_lv_rimage_1]        /dev/sdd1(1)                 
  [my_lv_rmeta_0]         /dev/sdc1(0)                 
  [my_lv_rmeta_1]         /dev/sdd1(0)
Copy to Clipboard Toggle word wrap
Once you have split off an image from a RAID1 volume, you can make the split permanent by issuing a second lvconvert --splitmirrors command, repeating the initial lvconvert command that split the image without specifying the --trackchanges argument. This breaks the link that the --trackchanges argument created.
After you have split an image with the --trackchanges argument, you cannot issue a subsequent lvconvert --splitmirrors command on that array unless your intent is to permanently split the image being tracked.
The following sequence of commands splits an image and tracks the image and then permanently splits off the image being tracked.
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_lv_rimage_1 split from my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_1' to merge back into my_lv
# lvconvert --splitmirrors 1 -n new my_vg/my_lv
# lvs -a -o name,copy_percent,devices my_vg
  LV   Copy%  Devices     
  my_lv          /dev/sdc1(1)
  new            /dev/sdd1(1)
Copy to Clipboard Toggle word wrap
Note, however, that the following sequence of commands will fail.
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_lv_rimage_1 split from my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_1' to merge back into my_lv
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  Cannot track more than one split image at a time
Copy to Clipboard Toggle word wrap
Similarly, the following sequence of commands will fail as well, since the split image is not the image being tracked.
# lvconvert --splitmirrors 1 --trackchanges my_vg/my_lv
  my_lv_rimage_1 split from my_lv for read-only purposes.
  Use 'lvconvert --merge my_vg/my_lv_rimage_1' to merge back into my_lv
# lvs -a -o name,copy_percent,devices my_vg
  LV               Copy%  Devices                      
  my_lv            100.00 my_lv_rimage_0(0),my_lv_rimage_1(0)
  [my_lv_rimage_0]        /dev/sdc1(1)                 
  my_lv_rimage_1          /dev/sdd1(1)                 
  [my_lv_rmeta_0]         /dev/sdc1(0)                 
  [my_lv_rmeta_1]         /dev/sdd1(0)                 
# lvconvert --splitmirrors 1 -n new my_vg/my_lv /dev/sdc1
  Unable to split additional image from my_lv while tracking changes for my_lv_rimage_1
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat