Superb Way To perform storage migration using lvconvert Without Data-loss and Downtime

Your Storage system has reached almost to the end of support and you want to migrate to newer technologies. Area of concern here is downtime and data-loss.Of course you can do this using backup and restore methodology or using pvmove. However, smart way for performing storage migration using lvconvert. This method does not involve downtime also it guarantees 100% against data-loss.

Demo scenario:

You have mount point “/uxtechno” which is being created using LVM. Now this mount point is created using “/dev/sdf1” which comes from old fashioned storage system and support of the same storage system is coming to an end. Now new disk /dev/sdg is allocated to system. And you want to migrate all the data from old disk to new disk without any data-loss and downtime. In this case, you can perform storage migration using lvconvert.

Details of the system.

1. Mount point

1

2

3

4

5

[root@rhel1~]# df -h /uxtechno

Filesystem Size Used Avail Use%Mounted on

/dev/mapper/vg_uxtechno-lv_uxtechno

194M5.6M179M4%/uxtechno

[root@rhel1~]#

2. Check current underlying disk , volume group and lv details:

Volume group:

1

2

3

4

5

[root@rhel1~]# vgs

VG#PV #LV #SN Attr VSize VFree

myvg220wz--n-2.99g508.00m

vg_rhel1120wz--n-19.51g0

vg_uxtechno110wz--n-1.19g1020.00m

LV Details:

1

2

3

4

5

6

7

[root@rhel1~]# lvs

LV VG Attr LSize Origin Snap%Move Log Copy%Convert

etc_dup myvg-wi-a-512.00m

lvol0 myvg-wi-a-1.99g

lv_root vg_rhel1-wi-ao15.57g

lv_swap vg_rhel1-wi-ao3.94g

lv_uxtechno vg_uxtechno-wi-ao200.00m

Currently resided file on the mount point

1

2

3

4

5

6

7

[root@rhel1~]# cd /uxtechno/

[root@rhel1 uxtechno]# ll

total13

drwx------2root root12288Jan909:14lost+found

-rw-r--r--1root root22Jan909:17myfile.txt

[root@rhel1 uxtechno]# cat myfile.txt

ILove UXTechno!!!!!!

Step 1:Check for new disk , create new PV and add it current volume group.

In the above output /dev/sdg is the new disk coming from new storage system.

a. Create new partition using fdisk command.

b. Create new PV.

1

2

3

[root@rhel1~]# pvcreate /dev/sdg1

Writing physical volume data todisk"/dev/sdg1"

Physical volume"/dev/sdg1"successfully created

c. Add this new disk to current VG.

1

2

3

4

5

6

7

8

[root@rhel1~]# vgextend vg_uxtechno /dev/sdg1 -v

Checking forvolume group"vg_uxtechno"

Archiving volume group"vg_uxtechno"metadata(seqno6).

Wiping cache of LVM-capable devices

Adding physical volume'/dev/sdg1'tovolume group'vg_uxtechno'

Volume group"vg_uxtechno"will be extended by1newphysical volumes

Creating volume group backup"/etc/lvm/backup/vg_uxtechno"(seqno7).

Volume group"vg_uxtechno"successfully extended

Now VG will have two PV’s as below, confirm it using vgdisplay -v vg_uxtechno command:

Step 2: Create Mirror

Now create mirror using lvconvert command which is main stage of performing storage migration using lvconvert.

If this post helped you by any means, then Please
Support Us! by making Payment Payment Link.
Subscribe For RSS Feed::Here.
Like my facebook page FaceBook PageFollow Us on Twitter::TwitterFollow Us on YouTube::YouTube