Operating System - HP-UX
1833462 Members
2778 Online
110052 Solutions
New Discussion

how to create a file system for disks assigned from SAN.

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

how to create a file system for disks assigned from SAN.

Hi

I am new to HP-UX. I have to create a filesystem using LVM for the disks assigned from SAM.

in my environment, we are using Emulex and qlogic HBA cards. so i need information for both the cards.

I want information for followings.

1) what command is used to view the device files for both Emulex and qlogic HBA cards?

2) what command is used to view the wwnn and wwpn for both Emulex and qlogic HBA cards?

3) what command is used to view the newly created SAN device.

4) How to create a logical volume using this newly created SAN device.

pls explain me step by step.
17 REPLIES 17
yulianto piyut
Valued Contributor
Solution

Re: how to create a file system for disks assigned from SAN.

can you check first your hba on your system:
# ioscan -nfCfc
if your card installed properly, you can view the wwpn number of your hba and give to storage admin to make zone to your storage.
to detect storage:
# ioscan -nfCdisk
to create VG using LVM:
# pvcreate /dev/rdsk/cxtxdx
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgcreate /dev/vg01 /dev/dsk/cxtxdx
# lvcreate -L size_of_lv -n lv_name /dev/vg01
# newfs -F vxfs -o largefiles /dev/vg01/rlv_name
# mount /dev/vg01/lv_name /name
Mark McDonald_2
Trusted Contributor

Re: how to create a file system for disks assigned from SAN.

Sam is a useful tool for newbies. It will do what you need, and the commands are available to view in the logs.
Richard Hepworth
Esteemed Contributor

Re: how to create a file system for disks assigned from SAN.

also you can use fcmsutil (/opt/fcms/bin/fcmsutil) to view wwpn and wwnn

fcmsutil
senthil_kumar_1
Super Advisor

Re: how to create a file system for disks assigned from SAN.

why we are using follwoing commands.

1) after this command "#pvcreate /dev/rdsk/cxtxdx" why we are using this below two commands. for creating volume group.

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000

I think the volume group (vg01) is created automatically in linux. am i correct?

in this command "# mknod /dev/vg01/group c 64 0x010000". c - character device,the major number is - 64 and minor number is - 0x010000. am i correct.

what is the major and minor number for volume groups if we are going to create volume groups in future. like major number will be - 65,66 ... and minor number will be what.

in my whole under standing, is the above information correct?

what is the command we have to use if we are going to create another volume group in future?


Richard Hepworth
Esteemed Contributor

Re: how to create a file system for disks assigned from SAN.

Senthil,

You are correct in your assumption of mknod. The major number for LVM device files is 64 and so you will always specifiy 64 for future vg's. The minor number however should be unique and so your next VG will be 0x020000

regards,

Richard
yulianto piyut
Valued Contributor

Re: how to create a file system for disks assigned from SAN.

in future volume group, the minor number must different and in hexa number, 0x020000, 0x030000, 0x040000 etc.
senthil_kumar_1
Super Advisor

Re: how to create a file system for disks assigned from SAN.

I have two questions.

1)is the following details will be assigned automatically to the logical volumes such as
1) block / character
2) major number
3) minor number

2)why "rlvol1" file is created apart from "lvol1" what is the purpose of "rvol1".
but in Linux the "rvol1" is not created. we are doing all the things in "lvol1".
am i correct?
Richard Hepworth
Esteemed Contributor

Re: how to create a file system for disks assigned from SAN.

You don't have to worry about device files for lvols, these are created automatically.

/dev/vg00/lvol1 is the block device
/dev/vg00/rlvol1 is the character device

Johnson Punniyalingam
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

>>I have two questions.

1)is the following details will be assigned automatically to the logical volumes such as
1) block / character
2) major number
3) minor number

Yes,

2)why "rlvol1" file is created apart from "lvol1" what is the purpose of "rvol1".

raw device file, lvol - Logical volume

but in Linux the "rvol1" is not created. we are doing all the things in "lvol1".
am i correct?<<

reason for why you use rlvol, if you d'not have ONLINE JFS to Extend you file system, you need specify "rlvol"

Thanks,
Johnson

Problems are common to all, but attitude makes the difference
Avinash20
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

rlvol and lvol ??

lvol will access the buffer-cache while rlvol doesn't.

Raw logical volumes(rlvol) can be used by application to directly write to the disk instead of going via buffer-cache which improves performance.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
senthil_kumar_1
Super Advisor

Re: how to create a file system for disks assigned from SAN.

in yulianto piyut 1st reply.

He has written as follwos.

# pvcreate /dev/rdsk/cxtxdx

## vgcreate /dev/vg01 /dev/dsk/cxtxdx

in this, in pvcreate, he used rdsk - /dev/rdsk/cxtxdx

in vgcreate, he used dsk - /dev/dsk/cxtxdx

what is the difference between these.
Richard Hepworth
Esteemed Contributor

Re: how to create a file system for disks assigned from SAN.

/dev/rdsk/c?t?d? is the character or raw device file, this sends io directly to the disk device. pvcreate create's the LVM structure

/dev/dsk/c?t?d? is the block device, referenced for most common LVM tasks
Ganesan R
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

Hi Senthil,

There are plenty of docs available to understand the difference between block and raw devices.

The very basic difference is that block devices will use buffer cache for I/O. With this the data will read/write to the buffer first and later on it will be written to the disk. IO through the block device files takes place in blocks.

Whereas the raw devices will directly read/write to the disk which provides best performance. IO through the raw device files takes place in characters.

Best wishes,

Ganesh.
Avinash20
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

The pvcreate command initializes a direct access storage device (a raw
disk device) for use as a physical volume in a volume group.


pvcreate requires character device

# pvcreate /dev/dsk/c1t3d0
pvcreate: "/dev/dsk/c1t3d0": not a character device.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Ganesan R
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

Hi Again,

To be more specific,

For vgcreate, vgextend, vgimport, vgexport, lvextend, lvsplit, lvmerge, lvlnboot, lvrmboot, mount, umount operations block device file will be used.

And for operations like pvcreate, mkboot, vgcfgrestore, diskinfo, newfs,extendfs raw device will be used.


Best wishes,

Ganesh.
Johnson Punniyalingam
Honored Contributor

Re: how to create a file system for disks assigned from SAN.

HI Senthil Kumar,

raw device file, can also be used for Oracle Database.

What are the benefits of raw devices?

There can be a performance benefit from using raw devices, since a write
to a raw device bypasses the UNIX buffer cache; the data is transferred
direct from the Oracle buffer cache to the disk. This is not guaranteed,
though; if there is no I/O bottleneck, raw devices will not help. The
performance benefit if there is a bottleneck can vary between a few
percent to something like 40%. Note that the overall amount of I/O is
not reduced; it is just done more efficiently.

Another, lesser, benefit of raw devices is that no filesystem overhead
is incurred, in terms of inode allocation and maintenance, or free block
allocation and maintenance.

But no longer:

You could also mount file systems that you don't want buffer cache by:
-o mincache=direct
That will bypass the buffer cache all together - good option for Oracle on LVM.

Using raw device partitions introduces a level of complexity in configuration planning, administration, and the movement of databases.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
masood bt
Regular Advisor

Re: how to create a file system for disks assigned from SAN.


Once the LUNS are allocated for the server
try installing the special files for those LUNS by running:
#insf -e
Then search for the disks by running
# ioscan -fnC disk
Identify the disks you wanna use:
# pvcreate /dev/rdsk/cxtxdx
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgcreate /dev/vg01 /dev/dsk/cxtxdx
# lvcreate -L size_of_lv -n lv_name /dev/vg01
# newfs -F vxfs -o
create a mount point 'test'
#mkdir test
edit the /etc/fstab:add the new logical volume(/dev/vg01/lv_name and its mount point /test
# mount /dev/vg01/lv_name /test

#bdf

If you are not able to see the newly created fs..then run #mountall

Behind every Great fortune, there is a crime