Operating System - HP-UX
1837936 Members
2385 Online
110124 Solutions
New Discussion

Re: New VG with old settings

 
SOLVED
Go to solution
Madhu_17
Regular Advisor

New VG with old settings

Hi Friends,

I would like to create a new VG with old settings.

Pls find below the old settings.

#vgdisplay -v /dev/vgxx

--- Volume groups ---
VG Name /dev/vgxx
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 1
Open LV 1
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 1023
VGDA 2
PE Size (Mbytes) 4
Total PE 1023
Alloc PE 1000
Free PE 23
Total PVG 0

--- Logical volumes ---
LV Name /dev/vgxx/uxx
LV Status available/syncd
LV Size (Mbytes) 4000
Current LE 1000
Allocated PE 1000
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/cxtydz
PV Status available
Total PE 1023
Free PE 23

Can anybody pls give me the step by step procedure to exactly create a VG on a new disk with the above settings.


Thanks,
Madhu
27 REPLIES 27
Victor BERRIDGE
Honored Contributor

Re: New VG with old settings

Hi Madhu,
Why would you wish to have "exactly" the same settings?
For what I see this seems to be the default when you vgcreate without options... and so I see some limitations that may lead you to issues later: max PE/PV 1023 will unable you to use disks greater than 4GB...

In the LVM philosophy you dont create a vg on a disk but:
1) make a disk LVM compatible with pvcreate making it a physical volume
2) Add a physical volume to a volume group

So the first step is the characteristics of your volume group:

How many disks at maximum?
What maximum size?
What maximum logical volumes (How many at max...)

What size of PE?

etc...

You seem to have a logical volume using all the group space, from a user aspect that means are you trying to create another logical volume /file system of 4GB?

All the best
Victor
Madhu_17
Regular Advisor

Re: New VG with old settings

Yes Victor..

Disk is of 4GB.

first i would like to create a VG with only one disk and only one LV.
later i want to mirror this VG with another disk.

Ple let me know, if you need anymore info.


Victor BERRIDGE
Honored Contributor

Re: New VG with old settings

Hi Madhu,
And Happy New Year...
Its not because you wish to create a group with a disk of 4GB to be limited at that size of disks (are they still easy to find?...)
And to mirror - Its adding a disk in a VG in order to mirror LVM (NOT VG...) I wonder if what you are trying to achieve is not adding a PV of 4GB to your existing VG in order to do mirroring - Is that so? (So no vg creation then!)

All the best
Victor
Madhu_17
Regular Advisor

Re: New VG with old settings

Victor,

Thanks for your wishes. I wish you the same.

Don't go by my terms. i know atleast the funda of the LVM.

I would like to do the below things.

1) creating a new VG with one disk with old settings
2) creating one LV in that VG
3) later i'll mirror this LV with another 4GB disk.

Pls give me the exact steps to do this.


Thanks,
Madhu
Victor BERRIDGE
Honored Contributor
Solution

Re: New VG with old settings

OK...
You first have to find a unused minor number:
So go and check all your VG and look at group

Create a directory in /dev with the name you want to give (r5vg01 for raid5 disks...):
(I change my umask here to 022)
umask 022
mkdir /dev/r5vg01;ll -ld r5vg01
drwxr-xr-x 2 root sys 96 Jan 04 11:09 r5vg01

The group now with the minor here its 0x010000:
umask 026; mknod /dev/r5vg01/group c 64 0x010000
# ll r5vg01
total 0
crw-r----- 1 root sys 64 0x010000 Jan 04 11:11 group

the number has to be univoque... beeing sequential you just take the next after your last VG/group value

Create the disk as PV:
# pvcreate /dev/rdsk/c4t0d0
Physical volume "/dev/rdsk/c4t0d0" has been successfully created.

now vgcreate:
Im quite sure if you do not give any values you finish up with the same you have shown, also as I said I woulnd limit myself to 4GB disks so do as you wish (with/without -e..)
vgcreate -e 9000 /dev/r5vg01 /dev/dsk/c4t0d0

Now create your first logical volume:
you can add after -l opion -n since you didnt say how the others were named I believe its default...
lvcreate -l 1000 /dev/r5vg01

Doing here a vgdisplay would show now a lvol1 with 1000 extents of 4MB => 4GB

Last step is creating a filsystem on it:
(pay attention to use the raw => r...

newfs /dev/r5vg01/rlvol1

I hope I havent forgotten anything (disturbed by phone calls dont help...)

Ah yes mount and try

All the best
Victor
Madhu_17
Regular Advisor

Re: New VG with old settings

Victor,

Thanks for your great response. Your procedure matches exactly my requirement.

But i'm facing small problem with minor number allocation.

When i checkedup my system is using all the numbers from 0x000000 to 0x090000. So, i selected 0x100000. but when i use vgcreate command i'm getting the below error.

vgcreate: Cannot open the control file "/dev/vg08/group": No such device

Any feed back?
Pete Randall
Outstanding Contributor

Re: New VG with old settings

Madhu,

Minor numbers are in hex, so you need to specify "0a0000" rather than "100000".


Pete

Pete
Fred Ruffet
Honored Contributor

Re: New VG with old settings

Regarding Victor's answer, mirroring steps are missing.

. adding new disk, you will use "insf -e" to create devices, then "ioscan -fnC disk" to determine new disk's device.
. Assuming new device is cXtYdZ, create the new pv with "pvcreate /dev/rdsk/cXtYdZ", and extend vg on it with "vgextend r5vg01 /dev/dsk/cXtYdZ".
. Then mirror any lvol on r5vg01 vg must be mirrored to new disk : "lvextend -m 1 /dev/r5vg01/lvolname"

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: New VG with old settings

Pete,

Even with hex numbers i'm facing the same problem.


Fred: I am not mirroring at this point of time.


Any suggetions Please???
Victor BERRIDGE
Honored Contributor

Re: New VG with old settings

Madhu,
Im a bit stuck on an AIX issue... but I just connected myself on a HPUX11.11 and tried with the next value which is as Pete says 0x0a0000
For that I went in /dev to check Im not going to mess up this (well yes a production box...) friend
octant # mkdir vg99
octant # cd vg99
octant # mknod /dev/vg99/group c 64 0x0a0000
octant # ll
total 0
crw-rw-rw- 1 root sys 64 0x0a0000 Jan 4 12:38 group
octant #

Check the syntax should look like above:
.../group c 64

All the best
Victor
Fred Ruffet
Honored Contributor

Re: New VG with old settings

can you post output of "ls -l" on the /dev/vgXX/group file you create ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: New VG with old settings

Yes Victor. Without any doubt i'm using the exact syntax. i tried with oc also now.

#ls -l /dev/vgxx/group
crw-r----- 1 root sys 64 0x0c0000 Jan 4 03:24 /dev/vgxx/group

Victor BERRIDGE
Honored Contributor

Re: New VG with old settings

Now you have one!
well its not 0x0a.. but why not
So try again...
I hope it works
Victor BERRIDGE
Honored Contributor

Re: New VG with old settings

Oh,
To check what you have:
ll /dev/*vg*/group


All the best
Madhu_17
Regular Advisor

Re: New VG with old settings

I tried with 0a. still getting the same error. I could able to create the file. but while using vgcreate i'm getting the above error.
Pete Randall
Outstanding Contributor

Re: New VG with old settings

Madhu,

I'm confused, your "ls" output shows /dev/vgxx, yet your vgcreate failure complains about vg08. Can you post the exact syntax you are using for both the mknod and the vgcreate steps?


Pete

Pete
Madhu_17
Regular Advisor

Re: New VG with old settings

mknod /dev/vgxx/group c 64 0x0c0000

vgcreate -e 9000 /dev/vgxx /dev/dsk/cxtydz
Fred Ruffet
Honored Contributor

Re: New VG with old settings

What user are you currently using to issue those commands ? It should be root. No other.

Is pvcreate done ?

have you looked at /var/adm/syslog/syslog.log for more details ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: New VG with old settings

I think some LVM problem is in my system. few days back also i faced lot of problem in adding one disk to LV. even after taking lot of feedback in this forum.

Thanks all for your valuable suggetions. i'm giving up this problem. i have some other idea now to solve my current problem.

Can anybody tell the better idea of copying files from one filesystem to other without disturbing modification times and owner.

i would like to use the below command. correct me if this is not suggestable.

#find . -depth -print | cpio -pdlmv newdir

Regards,
Madhu

Pete Randall
Outstanding Contributor

Re: New VG with old settings

Madhu,

That's correct. I usually use -pdumxl on the cpio, but yours should work.


Pete

Pete
Fred Ruffet
Honored Contributor

Re: New VG with old settings

If you wanted to mirror disk in order to create a clone machine, then you could do it with dd. With a good block size, it should be
better than cpio.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: New VG with old settings

Fred,

Can you pls tell me the exact syntax of the dd command. i've to perform some improtant task of copying the production data from one filesystem to another and i've to make the new filesystem operatrional.

Pete Randall
Outstanding Contributor

Re: New VG with old settings

Try "dd if=/dev/rdsk/cXtXdX of=/dev/rdsk/cYtYdY bs=1024k".

Make sure you use the raw device and at least the 1024k blocksize.


Pete

Pete
Fred Ruffet
Honored Contributor

Re: New VG with old settings

Plug the disk you want to copy on in the machine.
Consider the following :
. Source disk is seen as cXtYdZ
. Destination disk is seen as cUtVdW

Then use the following command :
dd if=/dev/rdsk/cXtYdZ of=/dev/rdsk/cUtVdW bs=10240k
(We don't specify block count, so whole disk is copied.)

You can then unplug the disk and put it in the other machine. Note that destination machine should not be on network when powering with this disk : things such as hostname, IP... should be changed first.

Also, I assume in this procedure that machines have very near hardwares and that you want to copy disk from vg00. For other vg or a vg00 containing more than 1 non-mirrored disk, procedure should be modified.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)