[Mondo-devel] How to restore correct size of LV's

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Mondo-devel] How to restore correct size of LV's

Ian Little

Hi

I am having an issue with the size of Logical Volumes created when restoring a server in that the size of the resultant LVs are smaller than on the original server.

eg on the original server that  took the mondoarchive of I have:

NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0                    2:0    1    4K  0 disk
sda                    8:0    0   72G  0 disk
├─sda1                 8:1    0  953M  0 part /boot
└─sda2                 8:2    0 71.1G  0 part
 ├─vgos-rootvol     253:0    0   16G  0 lvm  /
 ├─vgos-swapvol     253:1    0  7.5G  0 lvm  [SWAP]
 ├─vgos-homevol     253:11   0  1.9G  0 lvm  /home
 ├─vgos-varvol      253:12   0  7.5G  0 lvm  /var
 ├─vgos-tmpvol      253:13   0  1.9G  0 lvm  /tmp
 └─vgos-oemagentvol 253:14   0   10G  0 lvm  /opt/oracle/oemagent
  
after the mondorestore it is now:
  
NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0                    2:0    1    4K  0 disk
sda                    8:0    0   72G  0 disk
├─sda1                 8:1    0  953M  0 part /boot
└─sda2                 8:2    0 71.1G  0 part
 ├─vgos-rootvol     253:0    0 15.6G  0 lvm  /
 ├─vgos-swapvol     253:1    0  7.1G  0 lvm  [SWAP]
 ├─vgos-homevol     253:2    0  1.4G  0 lvm  /home
 ├─vgos-oemagentvol 253:4    0   10G  0 lvm  /opt/oracle/oemagent
 ├─vgos-tmpvol      253:5    0  1.4G  0 lvm  /tmp
 └─vgos-varvol      253:6    0  7.1G  0 lvm  /var 
  
I believe I know what is causing this issue in that lvcreate now uses %VG to set the size as shown in the i-want-my-lvm-file:

# echo y | lvm lvcreate -l 2%VG -r auto -n homevol vgos
# echo y | lvm lvcreate -l 14%VG -r auto -n oemagentvol vgos
# echo y | lvm lvcreate -l 22%VG -r auto -n rootvol vgos
# echo y | lvm lvcreate -l 10%VG -r auto -n swapvol vgos
# echo y | lvm lvcreate -l 2%VG -r auto -n tmpvol vgos
# echo y | lvm lvcreate -l 10%VG -r auto -n varvol vgos 

The percentage is not accurate enough to create the correct size of the original eg if you take the tmpvol the percentage should be at least 2.6% to create the right size (1.9G), not the 2% in the lvcreate command which gives an LV of 1.4G.

If I look at /usr/lib64/mindi/analyze-my-lvm where the calculation seems to be made it truncates the percentage:

ratio=`perl -e '$per='$currentLE'*100/'$totalLE' ; print int($per)'`

for tmpvol this gives 2 rather than 2.621887539163415 (477*100/ 18193)

Is there anyway to force the use of the exact size of the LV ? (as was the case in previous versions of mondo using lvcreate -L <size>)  - other than manually changing the i-want-my-lvm on restore?

Apologies if I am missing something simple

Regards

Ian Little 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mondo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mondo-devel