Operating System - HP-UX
1848231 Members
8730 Online
104022 Solutions
New Discussion

Re: Resize filesystem block-size

 
Ajay Chakraborty
Occasional Contributor

Resize filesystem block-size

Is it possible to change block-size without shuting down or losing any data? We are using HP-UX 11 and file system type is vxfs. Right now, bsize=2048, we would like to change it to 8192.

Please advise. Thanks!
9 REPLIES 9
Geoff Wild
Honored Contributor

Re: Resize filesystem block-size

I don't think so - that's at the low level of a file system - IE - when you newfs it...or mkfs_vxfs

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Denver Osborn
Honored Contributor

Re: Resize filesystem block-size

The block size is set when the filesystem is created. You won't be able to modify it without recreating the filesystem and restoring from backup.

-denver
Geoff Wild
Honored Contributor

Re: Resize filesystem block-size

You are out of luck, from man fsadm_vxfs:

fsadm performs online administration functions on VxFS file systems.
fsadm supports file-system resizing, extent reorganization, directory
reorganization, and querying or changing the largefiles flag.

Best way would be - create a new file system - then shutdown the application - and move everything from the old file system to the new one.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ajay Chakraborty
Occasional Contributor

Re: Resize filesystem block-size

Thank you all for your quick responses!!!

-Ajay
Robert-Jan Goossens
Honored Contributor

Re: Resize filesystem block-size

Hi,

The default block size for JFS 3.5 is 1024 bytes (1 kilobyte). This is the
smallest available block size for JFS file systems. You can set a specific
block size at the time the file system is created, but it cannot be changed
once the file system has been created. Use the bsize option for newfs
(1M) or mkfs(1M) to specify the block size. You can get information
about using the bsize command option by going to the online manual
pages specific to JFS, mkfs_vxfs(1M) and newfs_vxfs(1M).

Regards,
Robert-Jan
Victor BERRIDGE
Honored Contributor

Re: Resize filesystem block-size

Hi Ajay,
Ive just been through the full process on a 10.20 K class just now (for the last 2 hours...)... so if you have enough room somewhere to create a file system greater than the biggest you want to change the BS you will be able to if you can stop whats running ( I drop from init 4 to 3)
1)go to your first file system do a find .|cpio -pduml

dims2:data/idx # find . -print|cpio -pduml /export/.
2) umount the copied files system then
newfs :
dims2:/ # newfs -F vxfs -b 8192 -o largefiles /dev/s4vg02/rlvol4
version 3 layout
8192000 sectors, 1024000 blocks of size 8192, log size 256 blocks
unlimited inodes, 1024000 data blocks, 1023680 free data blocks
32 allocation units of 32768 blocks, 32768 data blocks
last allocation unit has 8192 data blocks
first allocation unit starts at block 0
overhead per allocation unit is 0 blocks
dims2:/ # mount /data/idx
dims2:/ # cd /data/mnt1
dims2:data/mnt1 # find . -print|cpio -pduml /data/idx/.
8193006 blocks
dims2:data/mnt1 # cd /

then start again for the next one....
( I just did 80GB of fs like that...)

I suffered a bit because I removed by accident a archive directory for this damn unsupported oracle 7.2.3...
things work now, I can go home....


All the best
Victor
Victor BERRIDGE
Honored Contributor

Re: Resize filesystem block-size

Yep I can show the fstyp:
untouched:
dims2:home/ldm # fstyp -v /dev/s4vg02/rlvol3
vxfs
version: 3
f_bsize: 1024
f_frsize: 1024
f_blocks: 6144000
f_bfree: 4810076
f_bavail: 4810064
f_files: 288
f_ffree: 0
f_favail: 0
f_fsid: 1073872898
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 16
f_fsindex: 7
f_size: 6144000

Just modified one
dims2:home/ldm # fstyp -v /dev/s4vg02/rlvol4
vxfs
version: 3
f_bsize: 8192
f_frsize: 8192
f_blocks: 1024000
f_bfree: 511681
f_bavail: 511681
f_files: 32
f_ffree: 0
f_favail: 0
f_fsid: 1073872899
f_basetype: vxfs
f_namemax: 254
f_magic: a501fcf5
f_featurebits: 0
f_flag: 16
f_fsindex: 7
f_size: 1024000


All the best
Victor
Bill Hassell
Honored Contributor

Re: Resize filesystem block-size

Changing the blocksize won't affect disk performance in a meaningful way. Archaic vendor recommendations have required filesystem block sizes to match up with database block sizes. The reality is that the HP-UX driver does a lot of reblocking of read/write requests behind the scenes and therefore the block size is simply part of the space management for filesystem. The VxFS filesystem manages blocksizes dynamically so changing the blocksize to 8K may defeat the design of VxFS and possibly waste space for very small files.

Many years ago, some filesystems had blocksizes that were not even multiples of the application's raed/write buffers and performance issues could be improved by adjusting the blocksize. That was back in the days when 120 meg disk drives were too heavy to lift by yourself. Modern Unix drivers and disk space management systems hide all of this and improve performance.

And to answer your basic question, changing the blocksize requires shutting down all processes that are using the filesystem, then backup all the data, umount the filesystem then erase all the data by issuing a newfs command and specify the desired blocksize. Mount the new filesystem and restore all your data.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: Resize filesystem block-size

I'm betting that your question concerns matching the filesystem blocksize to the database blocksize. Under vxfs, it really doesn't matter because vxfs filesystems are extent-based. While blocksizes do impact hfs, ufs, or s5 filesystem performance, you will not see any difference in performance in vxfs filesystems. Your 1k blocks are just fine.
If it ain't broke, I can fix that.