Hello Friends,
In my previous post, you can find the simple way to extend or increase the file system size in HP-UX operating system. So now we need to understand also how these file system is created with LVM. So in my new post, i would try to explain you how we will create LVM and file system in HP-UX operating system.
In this post, I will give you an example for HP-UX 11i v2/v3 version operating system. As my current machine keeping same version OS. You can find the LVM creation for Linux in my other post on my blog.
As you know LVM stands for logical volume management system which are used for file creation. Please find the step by step method to create the LVM in HP-UX operating system as describe below.
1. First we will create the physical volume using free disk space. After that we will create the volume group. to create the physical volume we will use "pvcreate" command.
-------------------------------------------------------------------------------------------------------------
hpx:/>pvcreate -f /dev/rdisk/disk1
Physical volume "/dev/rdisk/disk1" has been successfully created.
-------------------------------------------------------------------------------------------------------------
Using "pvcreate" command new physical volume group'/dev/rdisk/disk1 has been created.
2. In second step, we will create the new volume group with the help of physical volume. but before running the creation command we need to create a VG directory in /dev location.Once we will create the directory we will change the ownership and permission of the folder respectively.
-------------------------------------------------------------------------------------------------------------
hpx:/>mkdir -p /dev/vg00 Note: (you can replace volume group name accordingly)
hpx:/>chown -R root:root /dev/vg00
hpx:/>chmod -R 755 /dev/vg00
-------------------------------------------------------------------------------------------------------------
3. Now we will create a special group device file.In HP-UX each volume group must have a group device special file under its sub directory in /dev. This group DSF is created with the "mknod " command, like any other DSFs the group file must have a major and a minor number.
One of the most important thing while creating the LVM on the HP-UX is major & minor number. For LVM 1.0 volume groups the major number must be 64 and for the LVM 2.0 one must be 128.
For minor number, the first two digits will uniquely identify the volume group and the remaining digits must be 0000.
In our case we’re creating a 1.0 volume group on HP-UX operating system.
hpx:/>cd /dev/vg00
hpx:/dev/vg00>mknod group c 64 0x010000
Now change the ownership to root:sys and the permissions to 640.
hpx:/>chown root:sys group
hpx:/>chmod 640 group
4. Now create the volume group using below command.
hpx:/>vgcreate -s 16 vg00 /dev/disk/disk1
Volume group "/dev/vg00" has been successfully created.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
In above command , we will create new volume group "vg00" with 4 MB size.
5. Now your new volume group in HP-UX operating system has been created successfully. You can check the volume group and physical group by using below command.
-------------------------------------------------------------------------------------------------------------
hpx:/> vgdisplay -v vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 6000
VGDA 2
PE Size (Mbytes) 16
Total PE 26
Alloc PE 0
Free PE 26
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
--- Physical volumes ---
PV Name /dev/disk/disk1
PV Status available
Total PE 13
Free PE 13
Autoswitch On
-------------------------------------------------------------------------------------------------------------
In above output you can see the VG Name & PV Name which we created during LVM creation. Now using these Volume group "vg00" we can able to create file system on HP-UX file system.
6. Now in final step we will create the logical volume group in HP-UX using VG.
hpx:/> lvcreate -n vg00_test -L 256 vg00
Logical volume "/dev/vg00/vg00_test_S2" has been successfully created with
character device "/dev/vg00/rvg00_test_S2".
Logical volume "/dev/vg00/vg00_test_S2" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
If our example the logical volume group name is "vg00_test". If you see the syntax of above command "-n" option is used for new logical volume name and "-L" option is used for specifying the file system size in MB.
hpx:/> lvdisplay /dev/vg00/vg00_test
Using this command you can check newly created logical volume group on HP-UX operating system.
7. For file system creation in HP-UX, we will use below method step by step.
hpx:/>newfs -F vxfs -o largefiles /dev/vg00/vg00_test
version 7 layout 393216 sectors, 393216 blocks of size 1024, log size 1024 blocks large files supported
In above syntax, we will create a new file system, now we will create the mount point where we mount this file system
-------------------------------------------------------------------------------------------------------------
hpx:/>mkdir /test
hpx:/>mount /dev/vg00/vg00_test /test.
-------------------------------------------------------------------------------------------------------------
Using above method /test file system has been created successfully and if you want to check the current size of file system you can use "bdf /dev/vg00/vg00_test" command.
Hope, this post is useful for you. If you have any questions related this post please comment on it. I will try to provide the simple and step by step solution to you.