1833831 Members
2247 Online
110063 Solutions
New Discussion

pvmove

 
SOLVED
Go to solution
Woo Kim Chye
Occasional Advisor

pvmove

Hi,
My server has a VG with a single lvol consists of 4 disks. 2 of them are used for mirror.

Attached is the output of my vgdisplay and below is a portion of the lvdisplay output:

--- Logical volumes ---
LV Name /dev/vg01/lvol1_sc1
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 30000
Current LE 7500
Allocated PE 15000
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c6t12d0 4340 4340
/dev/dsk/c6t13d0 3160 3160
/dev/dsk/c8t0d0 4340 4340
/dev/dsk/c8t1d0 3160 3160

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c6t12d0 00000 current /dev/dsk/c8t0d0 00000 current
00001 /dev/dsk/c6t12d0 00001 current /dev/dsk/c8t0d0 00001 current
00002 /dev/dsk/c6t12d0 00002 current /dev/dsk/c8t0d0 00002 current
00003 /dev/dsk/c6t12d0 00003 current /dev/dsk/c8t0d0 00003 current
00004 /dev/dsk/c6t12d0 00004 current /dev/dsk/c8t0d0 00004 current
00005 /dev/dsk/c6t12d0 00005 current /dev/dsk/c8t0d0 00005 current
00006 /dev/dsk/c6t12d0 00006 current /dev/dsk/c8t0d0 00006 current
00007 /dev/dsk/c6t12d0 00007 current /dev/dsk/c8t0d0 00007 current
00008 /dev/dsk/c6t12d0 00008 current /dev/dsk/c8t0d0 00008 current

As the disk utilization for the lvol is very low(about few hundreds MB)I want to reduce the lvol from 2 disk to 1 disk. How am I going to do that?? Is there a way to check that the 2nd disk contains some data??

Can I just use pvmove to move the physical extent from 1 disk to the other disk??

Thanks.
5 REPLIES 5
Armin Feller
Honored Contributor

Re: pvmove

Hi,

if the second disk is also in use of LVM you can check with 'pvdisplay' what the disk is containing:

# pvdisplay -v /dev/dsk/c8t0d0 | more

Then you have to calculate if there is enough free space available on second disk and you can use 'pvmove' to move the datas:

# pvmove /dev/dsk/c8t0d0 /dev/dsk/cXtYdZ
or
# pvmove /dev/vg01/lvol1_sc1 /dev/dsk/cXtYdZ

Regards ...
Armin
Stefan Farrelly
Honored Contributor
Solution

Re: pvmove

The problem you have is that your lvol extends over both disks (and both the mirror disks) so you need to lvreduce your lvol BEFORE you can try to remove the disk you dont need using lvreduce.

So,do you have OnlineJFS installed ? If so this will attempt to reduce your lvol on the fly if you use fsadm, and if its successful then you can do an lvreduce to make your lvol small ebough to fit on a single disk, then you can reduce out the disk you want to free up (and if you need to use pvmove to move all used extents to a single disk).

If youre fsadm online reduce fails, or you dont have OnlineJFS, you will need to offload your data to tape, remove your lvol, then you can recreate it so its only one 1 disk (and 1 mirror disk), then reload your data. This is a long job.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Frederic Sevestre
Honored Contributor

Re: pvmove

Hi,

The lvol1_sc1 used about 30 Go and 4 disks (2 mirrored).
Is there a file system on your LV ?

If yes, you 'll first have to reduce the FS, then the LV.

The best way is to backup your data, delete the lv and re-create it on only 1 disk ( + 1 mirror) 17 Go max, then restore your data.

If you have OnLine JFS, you can try :

fsadm -e /mountpoint
fsadm -b /mountpoint
lvreduce -L

Then check using lvdisplay -v.

Fr??d??ric

Crime doesn't pay...does that mean that my job is a crime ?
Woo Kim Chye
Occasional Advisor

Re: pvmove

Hi,
Yes.. I do have OnlineJFS installed. Is that means fsadm will do the trick as mentioned by Frederic???
Frederic Sevestre
Honored Contributor

Re: pvmove

It should work.
But it is not sure that the fsadm will free enough space
Crime doesn't pay...does that mean that my job is a crime ?