In this post, You can get an idea about HP-UX logical volume manager commands with an example. As you know LVM is basically used for disk management in operating system that allow to manager the physical disks and logical volume.
Please find the below HP-UX LVM commands with an example.
➤ Create a new volume group, logical volume and file system:
You can used the below command in HP-UX operating system to create a new volume group, logical volume and file system.
hpx:/>pvcreate /dev/rdsk/c2t1d0
For creating a new volume group first we need to create physical volume as describe in above command.
hpx:/>mkdir /dev/vg01
hpx:/>mknod /dev/vg01/group c 64 0x010000
In above step we will create a directory where we need to create a volume group.
hpx:/>vgcreate /dev/vg01 /dev/dsk/c2t1d0
After successfully creation of volume group we will create a new logical voulme as describe in below command.
hpx:/>lvcreate -L 2048 /dev/vg01
hpx:/>newfs -F vxfs -o largefiles /dev/vg01/vgvol1
Using above command we create a new file system now in next step we will create a directory where we need to mount the newly created file system.
hpx:/>mkdir /backup
hpx:/>mount /dev/vg01/vgvol1 /backup
Once you mount the logical voulme with file system you can run the file system checking command to verify that mounting is succesfully or not.
➤ Create a stripped filesystem:
In this, we will create a stripped file system with the help of volume group and logical voulme.
hpx:/>lvcreate -i 2 -I 32 -L 48 -n vgvol1 /dev/vg01
-i number of stripes
-I stripe size of 32KB
-L size of the volume
➤ HP-UX display boot information:
You can use the below command to display boot information.
hpx:/>lvlnboot -v /dev/vg00
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c2t0d0 (0/1/1/0.0.0) -- Boot Disk
/dev/dsk/c2t1d0 (0/1/1/0.1.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Root: lvol3 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Swap: lvol2 on: /dev/dsk/c2t0d0
/dev/dsk/c2t1d0
Dump: lvol2 on: /dev/dsk/c2t0d0, 0
When you run the above command you can find the above output , if you see the boot information you can find you have two disk which is available for boot.
➤ HP-UX display all disks system information:
hpx:/> ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
==============================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GMAX3147NC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 146 GMAX3147NC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0
In the above output you can found the all the disk which is available in the system.
➤ HP-UX display dump devices:
hpx:/> lvlnboot -v
Normally it is showing the boot information in which you can check the dump devices name.