1827433 Members
4686 Online
109965 Solutions
New Discussion

LVM

 
SOLVED
Go to solution
Indrajit Bhagat
Regular Advisor

LVM

Like in Linux , We use fdisk command to know how many physical disk are installed and we get the /dev/hda for one physical disk and /dev/hdb for second physical disk,
than what is similar command in HP UNIx
13 REPLIES 13
Ivan Krastev
Honored Contributor
Solution

Re: LVM

Use ioscan:


ioscan -fnC disk


regards,
ivan
Coolmar
Esteemed Contributor

Re: LVM

ioscan -fnC disk

This will list all your disks and corresponding devices.
Indrajit Bhagat
Regular Advisor

Re: LVM

Then please Guide me how Pvcreate and Pvdisplay command can be executed.
Torsten.
Acclaimed Contributor

Re: LVM

Hi,

at least until now (HP-UX 11.23) the concept is different.

The disks are not "counted" (a,b,c,... or 1,2,3 ...).

If you run "ioscan -fnCdisk" or "ioscan -fnkCdisk" you will get a hw-path and device files.

The device file looks like this example:

/dev/dsk/c10t3d0

For a simple SCSI connected disk this means
the disk is connected to controller 10 (c10) (the HW path will tell you the slot where the HBA is installed),
the disks has SCSI ID 3 (t3) and the LUM number is 0 (d0).

Note, array LUNs will be translated to look like this, but the d-value will become important.

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!   
Coolmar
Esteemed Contributor

Re: LVM

pvcreate will create a Physical Volume.

# pvcreate /dev/dsk/c0t0d1

pvdisplay will display information about the physical volume.

So if you are wanting to create a volume group; then a logical volume; and then a filesystem like /oracle for example - here are the steps:

Search for attached disk

# ioscan -fnC disk

Initialize a disk for use with LVM

# pvcreate -f /dev/rdsk/c0t1d0

Create the device structure needed for a new volume group.

# cd /dev
# mkdir vgdata
# cd vgdata
# mknod group c 64 0x010000

Create volume group vgdata

# vgcreate vgdata /dev/dsk/c0t1d0
( if your expecting to use more than 16 physical disks use the -p option, range from 1 to 256 disks. }

Display volume group vgdata

# vgdisplay -v vg01

Add another disk to volume group

# pvcreate -f /dev/rdsk/c0t4d0

# vgextend vg01 /dev/dsk/c0t4d0

Create a 100 MB logical volume lvdata

#lvcreate -L 100 -n lvdata vgdata
# newfs -F vxfs /dev/vgdata/rlvdata
# mount /lvdata
Indrajit Bhagat
Regular Advisor

Re: LVM

this is output which i get
# ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
=========================================================================
disk 3 0/0/1/1.0.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c1t0d0 /dev/rdsk/c1t0d0
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 4 0/0/2/0.0.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE HP 36.4GMAS3367NC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 2 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
disk 6 0/10/0/0.1.0.42.0.0.0 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d0 /dev/rdsk/c5t0d0
disk 8 0/10/0/0.1.0.42.0.0.1 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d1 /dev/rdsk/c5t0d1
disk 10 0/10/0/0.1.0.42.0.0.2 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d2 /dev/rdsk/c5t0d2
disk 12 0/10/0/0.1.0.42.0.0.3 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d3 /dev/rdsk/c5t0d3
disk 5 0/12/0/0.1.0.39.0.0.0 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 7 0/12/0/0.1.0.39.0.0.1 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d1 /dev/rdsk/c4t0d1
disk 9 0/12/0/0.1.0.39.0.0.2 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d2 /dev/rdsk/c4t0d2
disk 11 0/12/0/0.1.0.39.0.0.3 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d3 /dev/rdsk/c4t0d3

Then how to execute Pvcreate and pvdisplay
Coolmar
Esteemed Contributor

Re: LVM

Sorry, should have mentioned above that you can also do everything from the menu interface SAM. Type SAM at the command line and then go into Disks and Filesystems...from there you can see all your disks and then create a volume group, create your logical volume, and then the filesystem. I found it easier to physically see everthing layed out when I was first familiarizing myself with LVM.
Coolmar
Esteemed Contributor

Re: LVM

# pvdisplay /dev/dsk/c1t0d0
# pvcreate -f /dev/rdsk/c1t0d0

** Notice that you require the raw device for the pvcreate command

Torsten.
Acclaimed Contributor

Re: LVM

You will find all important documentation on http://docs.hp.com - please have a look!

From your ioscan:

disk 6 0/10/0/0.1.0.42.0.0.0 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d0 /dev/rdsk/c5t0d0
disk 8 0/10/0/0.1.0.42.0.0.1 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d1 /dev/rdsk/c5t0d1
disk 10 0/10/0/0.1.0.42.0.0.2 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d2 /dev/rdsk/c5t0d2
disk 12 0/10/0/0.1.0.42.0.0.3 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c5t0d3 /dev/rdsk/c5t0d3
disk 5 0/12/0/0.1.0.39.0.0.0 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 7 0/12/0/0.1.0.39.0.0.1 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d1 /dev/rdsk/c4t0d1
disk 9 0/12/0/0.1.0.39.0.0.2 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d2 /dev/rdsk/c4t0d2
disk 11 0/12/0/0.1.0.39.0.0.3 sdisk CLAIMED DEVICE HP A6189B
/dev/dsk/c4t0d3 /dev/rdsk/c4t0d3


I see you are using a VA virtual array. I assume your

c5tydz

and

c4tydz

devices are the same (alternate pathes).

So be careful. For this time I would recommend to use SAM, but it is important for you to understand the concept.
Just start SAM, go to disk devices and create a new volume group and logical volumes and mount points.

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!   
Sp4admin
Trusted Contributor

Re: LVM

Hello,

THe command i use is "ioscan -fnC disk" to show the hardware path and disk /dev devices. You also need to make sure the hardware is claimed.

sp,
Indrajit Bhagat
Regular Advisor

Re: LVM

Suppose I wants to create a Logical Volume with any particular logical volume then what would be the command.
Ganesh Balraman
Regular Advisor

Re: LVM

Step 1 : Run ioscan and find out the deivce name.


Step2 : Vgcreate for one hard disk

Step3: Vgextend for another disk (Same device number).

This method is called alternate link configuaration.

Coolmar
Esteemed Contributor

Re: LVM

Create a 100 MB logical volume lvdata

Create a 100 MB logical volume lvdata

#lvcreate -L 100 -n lvdata vgdata
# newfs -F vxfs /dev/vgdata/rlvdata
# mount /lvdata

So in the above steps a 100MB logical volume was created in the vgdata volume group and mounted as /lvdata