1829124 Members
1919 Online
109986 Solutions
New Discussion

LVM

 
Fenny_1
Super Advisor

LVM

Kindly tell me what commands at a minimum are required to create a logical volume on HP-UX 11i?
7 REPLIES 7
Victor BERRIDGE
Honored Contributor

Re: LVM

Hi,
sam....
This is GUI approach...

By command line, it depends where you start:
If you stll have space in your volume group -
then its just lvcreate...

look at the man pages og vgextend pvcreate lvcreate lvextend and newfs

All the best
Victor
Hilary Nicholson
Frequent Advisor

Re: LVM

Hi,

If you already have the volume group created then you need to use lvcreate to create the logical volume

eg to create a 200MB logical volume on vg02
lvcreate -L 200 /dev/vg02


Then if this is to be a filesystem you will need to use the newfs command

Look at the man page for lvcreate for all the options you need.

Regards,

Hilary
bhavin asokan
Honored Contributor

Re: LVM

hi,

the attached document will help you

regds,
MarkSyder
Honored Contributor

Re: LVM

The easiest way is with SAM.

Select discs and filesystems, logical volumes, actions, create.

SAM will guide you through the information you need to provide.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Slawomir Gora
Honored Contributor

Re: LVM

Hi,

if you have created Volume Group
lvcreate -L size_in_MB -n lv_name vg_name
ex:
lvcreate -L 1000 -n ora1 vg00

if you want mirror lv and you have only 2 disks in vg
lvextend -m 1 /dev/vg00/ora1



look at manual for details.
Fred Ruffet
Honored Contributor

Re: LVM

The easiest is case, will be to use "vgdisplay " to see how many space left on a vg, and then "lvcreate -L -n ". After that, you will still have to format with mkfs.

From the start, the whole thing would be :
. "ioscan -fkn -C disk" to list disk devices.
. "pvcreate", "vgcreate" and "lvcreate" will create respectively Physical volumes, Volume groups and Logical volumes.

Use man pages to list all options.

But all of this are for command-line-fanatics like me. An other way, *very* more simple and safe, will be to use sam :)

Regards,

Fred

PS : Today is still a "Error while posting the reply" day...
--

"Reality is just a point of view." (P. K. D.)
G. Vrijhoeven
Honored Contributor

Re: LVM

To create a logical volume:

Select one or more disks. ioscan (1M) shows the disks attached to the system and their device file names.

Initialize each disk as an LVM disk by using the pvcreate command. For example, enter
pvcreate /dev/rdsk/c0t0d0
Note that using pvcreate will result in the loss of any existing data currently on the physical volume.

You use the character device file for the disk.

Once a disk is initialized, it is called a physical volume.

Pool the physical volumes into a volume group. To complete this step:


Create a directory for the volume group. For example:
mkdir /dev/vgnn

Create a device file named group in the above directory with the mknod command.
mknod /dev/vgnn/group c 64 0xNN0000
The c following the device file name specifies that group is a character device file.

The 64 is the major number for the group device file; it will always be 64.

The 0xNN0000 is the minor number for the group file in hexadecimal. Note that each particular NN must be a unique number across all volume groups.

For more information on mknod, see mknod (1M); for more information on major numbers and minor numbers, see Configuring HP-UX for Peripherals .

Create the volume group specifying each physical volume to be included using vgcreate. For example:
vgcreate /dev/vgnn /dev/dsk/c0t0d0
Use the block device file to include each disk in your volume group. You can assign all the physical volumes to the volume group with one command. No physical volume can already be part of an existing volume group.

Once you have created a volume group, you can now create a logical volume using lvcreate. For example:
lvcreate /dev/vgnn
Using the above command creates the logical volume /dev/vgnn/lvoln with LVM automatically assigning the n in lvoln.

When LVM creates the logical volume, it creates the block and character device files and places them in the directory /dev/vgnn

Check:

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90672/B2355-90672_top.html&con=/hpux/onlinedocs/B2355-90672/00/00/32-con.html&toc=/hpux/onlinedocs/B2355-90672/00/00/32-toc.html&searchterms=lvcreate&queryid=20041029-012834
for more info.

Regards,

Gideon