Operating System - HP-UX
1752777 Members
6001 Online
108789 Solutions
New Discussion юеВ

icrease size of a file to virtual guest

 
SOLVED
Go to solution
ting stong
Occasional Advisor

icrease size of a file to virtual guest

Hello, I have got a question, we use a VMguest which has a disk defined as file, created by
hpvmdevmgmt -S 20G /virt/files/db01x
but the database on system is growing very fast, is there any possibility how to increase file size or there is a need to create another file and connect it to the system?
br Thomas
4 REPLIES 4
Torsten.
Acclaimed Contributor
Solution

Re: icrease size of a file to virtual guest

No idea if you can "grow" this file, but I would create another file (or LVOL), assign it to the guest and use the guests LVM to extend the VG and the LVOLs.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Eric SAUBIGNAC
Honored Contributor

Re: icrease size of a file to virtual guest

Bonjour,

As far as I know there is no option included in hpvmdevmgmt to increase the size of a file.


IMHO, I think you can do it in a classical way with dd. For example, if working with block size = 1 Mo and you want to add 5 GB, something like :

dd if=/dev/zero of=/virt/files/db01x bs=1024k seek=20480 count=5120

will add 5 Go (count=5120 blocks of 1024 Ko each) after the first 20 Go (seek=20480 blocks of 1024 Ko)

You can also have something more clever and faster :

dd if=/dev/zero of=/virt/files/db01x bs=1024k seek=25599 count=1

It will add just one block of 1 Mo at position 25 Go - 1 Mo (seek=25599 blocks). To have a file of 25 Go, there is no need to populate all blocks in the file. The latest one is sufficient.


And I think you will have to stop and restart the VM so that it take care of the new size.


Of course be careful !!! Bad computation of numbers of blocks and you will loose all the datas :-( Have some tests before ...


Now, how are you going to handle this new space ? In the VM, how do you use the virtual disk ?

- Through LVM ? So you will have to issue some "vgmodify" commands (size of the disk, maximum physical extends).
- As a raw device ? You will have to notice Oracle to resize.


So, if you use LVM at VM Guest side, you should consider Torsten's answer and work with LVM : add a new virtual disk file to the VM, add it to the VG and extend the size of the LV


Eric
ting stong
Occasional Advisor

Re: icrease size of a file to virtual guest

nice, really nice thx
melvyn burnard
Honored Contributor

Re: icrease size of a file to virtual guest

Out of interest, what is the guest OS you are using?
I ask this because I am wondering whether DRD might not be useful here ( I have not had the chance to try this)
Use hpvmdevmgmt to create a NEW larger "disc" file, add this to the VM, then on the VM guest OS ( assuming ti is HP-UX and you have DRD installed on it, use DRD to clone the vg00 "disc" to the new larger "disc", then activate the clone, i.e. boot from it.

As I say, I have not tried this but I believe it will work, as DRD can be used to clone VM guest images to be used by other guests.
see http://docs.hp.com/en/5992-4803/5992-4803.pdf
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!