Quantcast
Channel: All System Administration posts
Viewing all articles
Browse latest Browse all 1179

Re: Need to move the data from Linear LV to stripped LV on RHEL 5.7

$
0
0

I created a Virtual Machine and tested this. Looks like it works.

 

When you're striping a LV, you obviously must have two or more PVs to stripe it to; otherwise you would gain nothing from striping. So, let's say that you have the original PV as /dev/sda and you want the striped version to go to /dev/sdb and /dev/sdc. In this example, the LV that you want to stripe is /dev/vgtest/lvol0.

 

Here is the command to create the striped mirror:

 

lvconvert -m 1 --mirrorlog core --stripes 2 /dev/vgtest/lvol0 /dev/sdb /dev/sdc

The number to the --stripes option must be equal to the number of PVs listed.

 

The default stripe size is 64 KB. You can adjust it with the --stripesize option if you wish.

 

The "--mirrorlog core" is dangerous: it might be OK for small and short-lived mirrors only, and only if your system is protected from power interruptions (= has an UPS). But it makes things simpler for testing and conversions, when the mirror is removed immediately after its creation is completed.

 

If you use disk-based mirror log instead (--mirrorlog disk or --mirrorlog mirrored), you will need one or two small extra PVs in the VG for the mirror logs, as LVM won't allocate space for the mirror log on PVs that will contain any of the actual LV mirror components.

 

 

And here is the command to remove the original non-striped mirror:

lvconvert -m 0 /dev/vgtest/lvol0 /dev/sda

 

If after the first step you want to roll back and remove the striped mirror instead:

lvconvert -m 0 /dev/vgtest/lvol0 /dev/sdb /dev/sdc

 


Viewing all articles
Browse latest Browse all 1179

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>