HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
l
lvm(7) lvm(7)
EXAMPLES
The basic steps to take to begin using LVM are as follows:
• Identify the disks to be used for LVM.
• Create an LVM data structure on each identified disk (see pvcreate (1M)).
• Collect all the physical volumes to form a new volume group (see vgcreate (1M)).
• Create logical volumes from the space in the volume group (see lvcreate (1M)).
• Use each logical volume as if it were a disk section (create a file system, or use for raw access).
To configure disk
/dev/dsk/c0t0d0
as part of a new volume group named
vg01.
First, initialize the disk for LVM with the
pvcreate command.
pvcreate /dev/rdsk/c0t0d0
Then, create the pseudo device file that is used by the LVM subsystem.
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x030000
The minor number for the group file should be unique among all the volume groups on the system.
It has the format 0xNN0000, where NN ranges from 00 to 09. The maximum value of NN is con-
trolled by the kernel tunable parameter,
maxvgs.
Create the volume group,
vg01, containing the physical volume, /dev/dsk/c0t0d0
, with the
vgcreate command.
vgcreate /dev/vg01 /dev/dsk/c0t0d0
You can view information about the newly created volume group with the vgdisplay command.
vgdisplay -v /dev/vg01
Create a logical volume of size 100 MB, named usrvol, on this volume group with the
lvcreate
command.
lvcreate -L 100 -n usrvol /dev/vg01
This creates two device files for the logical volume, /dev/vg01/usrvol
, which is the block device
file, and
/dev/vg01/rusrvol
, which is the character (raw) device file.
You can view information about the newly created logical volume with the
lvdisplay command.
lvdisplay /dev/vg01/lvol1
Any operation allowed on a disk partition is allowed on the logical volume. Thus, you can use
usrvol to hold a file system.
newfs /dev/vg01/rusrvol hp7937
mount /dev/vg01/usrvol /usr
SEE ALSO
lvchange(1M), lvcreate(1M), lvdisplay(1M), lvextend(1M), lvlnboot(1M), lvreduce(1M), lvremove(1M),
lvrmboot(1M), pvchange(1M), pvcreate(1M), pvdisplay(1M), pvmove(1M), vgcfgbackup(1M),
vgcfgrestore(1M), vgchange(1M), vgcreate(1M), vgdisplay(1M), vgexport(1M), vgextend(1M),
vgimport(1M), vgreduce(1M), vgremove(1M), vgscan(1M).
Managing Systems and Workgroups.
If HP MirrorDisk/UX is installed: lvmerge(1M), lvsplit(1M), lvsync(1M), vgsync(1M).
If HP ServiceGuard is installed: cmcheckconf(1M), cmquerycl(1M), Managing MC/ServiceGuard.
HP-UX 11i Version 2: September 2004 − 2 − Hewlett-Packard Company Section 7−−71