When the system is online for a long time, maybe one day it will suffer some problem as some disks crash or phase out so that need to replace the old disk with the new one. If the replaced disk is configured by LVM and exists a lot of data, how to do it?
If there is no enough free physical extents (PV) in the volume group, we have to add a new disk (as /dev/sdd) and its size need to be large than the replaced disk. In the moment, we also need to know which disk (as /dev/sdb1) need to be replaced or view /var/log/messages to find out the bad disk.
After done it, we have to make this new disk to be available with LVM by using pvcreate /dev/sdd commandTo verify the status of the new physical volume by using pvdisplay /dev/sdd commandTo realize which volume group the bad or old disk ( /dev/sdb1) belongs to by using pvdisplay /dev/sdb1 commandTo add the new disk ( /dev/sdd) to the volume group drbdVG00 by using vgextend drbdVG00 /dev/sdd command
To realize which logical volume the volume group drbdVG00 belong to by using lvdisplay commandTo move physical extents in active volume group drbdVG00 from /dev/sdb1 to /dev/sdd by using pvmove –n drbdVG00 /dev/sdb1 /dev/sdd commandTo remove bad or old disk from the volume group by using vgreduce drbdVG00 /dev/sdb1 commandFinally, please shutdown the system next to remove the bad or old disk (# 1) and boot it. The data still exist in LVM disk as before.
Reference :
(# 1) When remove the bad or old SCSI disk but never change disk order (that the new disk ID also is the same as before) all disk order will be changed but LVM function is normal.
When remove the bad or old SCSI disk and change disk order (that new disk ID is the same as the old one) the bad or old disk just is replaced with the new disk and LVM function is normal as well.
沒有留言:
張貼留言