Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5597097
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类:

2006-07-03 17:11:14

As an example, you can split a mirrored logical volume to back up one of the mirrored copies of a file system while leaving the other mirrored copy of the file system open for use. When you complete the backup activity, you can merge the split pair back to one mirrored logical volume.
 
For each mirrored logical volume that you split into two logical volumes, LVM dynamically creates a table that it uses to resynchronize the two when you merge them back again. The table reduces synchronization time. The table exists as long as neither of the split pair is extended, reduced , or split again, or until the system is rebooted.If no table exists,all data is resynchronized
 
When LVM merges the split pair, it resynchronizes the data, updating the physical extents in the split-off copy based on changes made to the copy that remained in use. No resynchronization takes place if no changes occured in either copy.
 
Example:
Online backup using lvsplit, lvmerge
 
Suppose you want to back up the file system /lptest in the doubly mirrored logical volume /dev/vg02/lvol1. Because you want to access the file system even while backing it up(that is, you do not want to unmount it), you plan to temporarily split the logical volume in two).
1,Split the logical volume.
# lvsplit -s backup /dev/vg02/lvol1
Logical volume "/dev/vg02/lvol1backup"has been successfully created with lv number 5 Logical volume "/dev/vg02/lvol1"has been successfully split
The new logical volume /dev/vg02/lvol1backup, split off from the original, now exists.
 
2,Perform backup( or other file system operation) on the file system in /dev/vg02/lvol1backup
 
3,Unmount the file system(if you had mounted it) in the split-off logical volume when you are ready to merge the split pairs.
 
4,Merge the split-off logical volume and the original logical volume back into one mirrored logical volume
# lvmerge /dev/vg02/lvol1backup /dev/vg02/lvol1
CAUTION:Notice the sequence.
        lvmerge split-off_logical_volume original_logical_volume. Do not reverse the order, or else the more recent data could be overwritten
The split-off logical volume merges back with the original logical volume, now modified.
After the merge, you can verify that the logical volume's mirrored state matches the pre-split state and that the split-off logical volume no longer exists.
 
阅读(1715) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~