1826417 Members
3725 Online
109692 Solutions
New Discussion

Re: Creating PVs

 
SOLVED
Go to solution
dasn
Advisor

Creating PVs

Hi Guys,
I have two LUNs mapped to my HP-UX host from Hitachi array connected in a fabric. Following is the ioscan output...

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
=======================================================================
disk 1 0/0/1/1.15.0 sdisk CLAIMED DEVICE SEAGATE ST318404LC
/dev/dsk/c1t15d0 /dev/rdsk/c1t15d0
disk 5 0/2/0/0.2.0.255.0.0.0 sdisk CLAIMED DEVICE HITACHI DF500
/dev/dsk/c6t0d0 /dev/rdsk/c6t0d0
disk 12 0/2/0/0.2.0.255.0.0.1 sdisk CLAIMED DEVICE HITACHI DF500
/dev/dsk/c6t0d1 /dev/rdsk/c6t0d1
disk 17 0/4/0/0.1.0.255.0.0.0 sdisk CLAIMED DEVICE HITACHI DF500
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 18 0/4/0/0.1.0.255.0.0.1 sdisk CLAIMED DEVICE HITACHI DF500
/dev/dsk/c4t0d1 /dev/rdsk/c4t0d1
#

Both the LUNs are of 3 Gig size. I want to create one logical volumes of 3Gig size in each lun and also add pvlink into it. Would some one give me the steps ?

Also, previously i had created some volumes in one of these luns,

VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 1016
VGDA 2
PE Size (Mbytes) 4
Total PE 767
Alloc PE 750
Free PE 17
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
How do i delete it and start a fresh ?

Thanks in advance for the reply.
12 REPLIES 12
freddy_21
Respected Contributor

Re: Creating PVs

Hello,

could you give me vgdisplay -v vg01? because i dont know your disk already configure.

if you send the output. i will write step by step.

thank
freddy
dasn
Advisor

Re: Creating PVs

Here is the output...

# vgdisplay -v vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 3
Open LV 3
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 1016
VGDA 2
PE Size (Mbytes) 4
Total PE 767
Alloc PE 750
Free PE 17
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/pvlink_test_vol_01
LV Status available/syncd
LV Size (Mbytes) 1000
Current LE 250
Allocated PE 250
Used PV 1

LV Name /dev/vg01/pvlink_test_vol_02
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 500
Used PV 1

LV Name /dev/vg01/pvlink_test_vol_03
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0


--- Physical volumes ---
PV Name /dev/dsk/c6t0d0
PV Name /dev/dsk/c4t0d0 Alternate Link
PV Status available
Total PE 767
Free PE 17
Autoswitch On


#

Thanks for the response
freddy_21
Respected Contributor

Re: Creating PVs

c4t0d1 and c6t0d1 is one new disk ( alternate )

check with pvdisplay -v /dev/dsk/c6t0d1
have any lvol configuration? if no it means this is new disk.


the command are:
1. format new disk
#pvcreate -f /dev/rdsk/c6t0d1
2. extend new disk at vg01 configuration
vgextend /dev/vg01 /dev/dsk/c6t0d1 /dev/dsk/c4t0d1
3. please used sam for configure lvol. more easier because no need write fstab file or other.


thanks
freddy




dasn
Advisor

Re: Creating PVs

Yes that is right. c4t0d1 and c6t0d1 is a new disk. I am sorry, actually i want to re-create LV using lun d0 only, which already have some LVs created which i want to delete and freshly create a sinlge volume using entire 3gig. I dont want to create any LVs in d1 lun. Thanks,
NKD
freddy_21
Respected Contributor

Re: Creating PVs

Hello Dasn,

I still dont understand what do you need.

My understanding>

vg01 have 1 disk the size 3 GB with 3 logical volume. Now you have 1 new disk the size 3 GB. You want to cretae new volume group so the result:
vg01 only have 1 logical volume ( lvol size 3 GB ) <-- existing disk
vg02 only have 1 logical volume ( lvol size 3 GB ) <-- new disk

thanks
freddy
dasn
Advisor

Re: Creating PVs

vg01 only have 1 logical volume ( lvol size 3 GB ) <-- existing disk


I want to the above opeartion only. I dont want to create any lvol in the new disk. I dont want to touch it. Hope its more clear now ?
freddy_21
Respected Contributor

Re: Creating PVs

hello dasn

you must care about your data.
vg01 have 3 lvol but only 2 lvols have size.

LV Name /dev/vg01/pvlink_test_vol_01
LV Status available/syncd
LV Size (Mbytes) 1000
Current LE 250
Allocated PE 250
Used PV 1

LV Name /dev/vg01/pvlink_test_vol_02
LV Status available/syncd
LV Size (Mbytes) 2000
Current LE 500
Allocated PE 500
Used PV 1

LV Name /dev/vg01/pvlink_test_vol_03
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0

how about data at
/dev/vg01/pvlink_test_vol_01 <- 1 GB
/dev/vg01/pvlink_test_vol_02 <- 2 GB
/dev/vg01/pvlink_test_vol_03 <- 0 GB


are you ok with your data at both lvol?

Thanks
freddy

Denver Osborn
Honored Contributor
Solution

Re: Creating PVs

Ok, you have VG01 with one lun (c4t0d0) and 3 test lvols. you want to remove the 3 test lvols and create one lvol using all of c4t0d0. You don't want to touch the other lun c4t0d1. Is this right? If so, here's what you can do.

1) unmount the 3 test lvols if they are, then remove the lvols.

umount /dev/vg01/pvlink_test_vol_01
umount /dev/vg01/pvlink_test_vol_02
umount /dev/vg01/pvlink_test_vol_03

lvremove /dev/vg01/pvlink_test_vol_01
lvremove /dev/vg01/pvlink_test_vol_02
lvremove /dev/vg01/pvlink_test_vol_03

2) now that the test lvols are removed, create your new lvol.

lvcreate -n lvol_name -l 767 /dev/vg01

That's it. You can create the filesystem or do whatever you had planned for it.

If you intended on adding the new lun c4t0d1 to the volume group, you will need to pvcreate then vgextend to add c4t0d1 to vg01.

-denver
dasn
Advisor

Re: Creating PVs

Yes very much. These are tests luns and does not contain any valuable data. I am doing some test with it.

Thanks for reply.
freddy_21
Respected Contributor

Re: Creating PVs

i think denver way is right. Sorry i cant understand what you want. need more explanation. before make wrong with your data and configuration.

dont forget newfs for new lvol.


thanks
freddy
dasn
Advisor

Re: Creating PVs

Denever,
Your understanding is right. Could you please explain the command,

lvcreate -n lvol_name -l 767 /dev/vg01 ? what it will do ?? Will it automatically calculate the size for the vol from /dev/vg01 or it would spread itself in the entire size ??

Thanks for the response.
- Niranjan
Denver Osborn
Honored Contributor

Re: Creating PVs

lvcreate -n lvol_name -l 767 /dev/vg01

"-n" so you can provide a non-default name for the volume.

"-l" is the number of extents to allocate to the lvol. Using 767 for this value tells LVM you'll use the entire disk for your lvol. As per the vgdisplay -v output, the disk has 767 extents (Total PE).

You could also use "-L" to specify the size of the lvol in MB. With 767 PE at 4MB, using "-L 3068" should also use all of the available space for the lvol.

-denver