Showing posts with label vgcreate. Show all posts
Showing posts with label vgcreate. Show all posts

Monday 22 May 2017

Basic HP-UX Commands for Logical Volume Manager (LVM)

This post is useful for those users which are beginners on HP-UX platform. They can easily find all the basic command which are required for creation a file system using logical volume manager (LVM).

Concept of LVM are same in all Unix operating system. LVM is basically used for disk management in operating system that allow to manager the physical disks and logical volume. Here, I will provide to you all basic HP-UX commands.

Basic Commands of HP-UX LVM: 

⏩ How to create a new volume group, logical volume and file system on HP-UX operating system
 
For creating a new physical volume group on HP-UX system, please use the below method.

hpx:/>pvcreate /dev/rdsk/c2t1d1

"Pvcreate" command is used for creating a physical volume on operating system.
⏩ How to create a volume group on HP-UX operating system.

For creating a volume group, first we need to create a directory which we used as a volume group. In my case I will use my volume group name "vstorage" so I need to create a directory with name of vstorage.

hpx:/>mkdir /dev/vstorage
hpx:/>mknod /dev/vstorage/group c 64 0x010000

Once you create a directory, then please create a new volume group with the available disk c2t1d1.

hpx:/>vgcreate /dev/vstorage /dev/dsk/c2t1d1

⏩ How to create a logical group on HP-UX operating system.

When you successfully create a new volume group "vstorage" as describe in above step, we will create a logical group as describe below.

hpx:/>lvcreate -L 2048 /dev/vstorage

If you see the above command we have created a 2 GB size of logical volume.

⏩ How to create a filesystem on HP-UX operating system.

When you successfully created a new logical volume group, then we will create a new file system with the help of VG and LV.

Please find the below command to create a filesystem on HP-UX operating system using LVM.

hpx:/>newfs -F vxfs -o largefiles /dev/vstorage/vg_vstorage

Note: Here, we used "vstorage" as a VG and vg_vstorage as a LV. Now we will create a directory where we mount the new LV.

hpx:/>mkdir /hpux
hpx:/>mount /dev/vstorage/vg_vstorage /hpux

Now, your new file system "/hpux" has been created with the help of LVM. You can mount the file system permanently in filesystem configuration file, so once you take a reboot of server, your file system will not disappear.

Please comment on the post, if you are facing any issue regarding this topic.