Operating System - HP-UX
1753466 Members
4623 Online
108794 Solutions
New Discussion юеВ

LVM or Raid changes OS block size???

 
Keane_2
New Member

LVM or Raid changes OS block size???

I was reading in an Oracle press book (Oracel 24x7,page 284) that when using LVM or raid storage that the standard block size of 512 bytes can default to 8K. This has the effect on databases with oracle block sizes of 2K or 4K of returning more than the requested single oracle block. The proposed solution was to reset the OS block size to equal that of the planned Oracle block sizes. My questions are... Is this true of HP-UX 11? How do you tell what the logical block size is on a volume or raid system? How do you change it? and If you are using online JFS to bypass the Unix I/O buffers then does this fall back on the 512 bytes block size?
3 REPLIES 3
Patrick Wessel
Honored Contributor

Re: LVM or Raid changes OS block size???

You can verify the blocksize of your file system by "fstype -v /dev/vg_whatever/lv_name

example:
# fstyp -v /dev/vg00/lvol3
vxfs
version: 3
f_bsize: 1024 <<< see below
f_frsize: 1024 <<<< see below
f_blocks: 86016
f_bfree: 66550
f_bavail: 66464
f_files: 5408
f_ffree: 1073771904
f_favail: 1073771904
f_fsid: 1073741827
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 0
f_fsindex: 4
f_size: 86016

According to the statvfs(2) man page, f_bsize is the "preferred" block size and b_frsize is the "fundamental" block size. Here's how HFS and VxFS actually interpret these fields:
Field HFS Value for VxFS
----- --- --------------
f_bsize block size (8K) largest possible block size (8K)
f_frsize fragment size (1K) actual block size (usually 1K)


If you decide to modify the block size, you must recreate the file system. To alter the block size, when you use "newfs -F vxfs", use this option:
"-o bsize=" is the block size, in bytes, for files on the file system and represents the smallest amount of disk.

example
#newfs -F vxfs -b 8192 /dev/vg03/rlvol1
There is no good troubleshooting with bad data
Wim Blom
New Member

Re: LVM or Raid changes OS block size???

Hi Keane,

The question is not what is the block size of LVM, but what block size is your oracle database using.

If your oracle block size is 8k or larger(this is adviced by oracle) you will never run into this perfomance problem on oracle level. If your oracle blocksize is smaller then 8k and you have performance problems, maybe looking into increasing the oracle block size will provide a better solution then altering the LVM blocksize.

And just for the record this is only a performance problem, there is no risk of dataloss.

And as far as I know once a logical volume is created, the blocksize is set and can't be altered not even by HP-UX.

I Hope this helps you along.

Regards,

Wim
Quality is our driving force
Dave Wherry
Esteemed Contributor

Re: LVM or Raid changes OS block size???

Your block size can not be changed on an existing file system. You would need to backup you data and recreate the file system with newfs:
newfs -F vxfs -b 8192 /dev/vg99/lvol99

We create all of our database file systems with the 8k block per Oracles' recomendation.

Another issue is with wasted space. If your file system is created with an 8k block size and Oracle is set to use say 4k, you are only using half of each block. Essentially wasting half of your disk space.