Operating System - HP-UX
1830940 Members
1724 Online
110017 Solutions
New Discussion

Defragmenting file system on HP-UX

 
Anil_29
Advisor

Defragmenting file system on HP-UX

Hi,
I want to defrag /var filesystem online on a HP machine running B.10.20.

Are there any chances of data loss.

Thanks & Regards,
Anil
9 REPLIES 9
KapilRaj
Honored Contributor

Re: Defragmenting file system on HP-UX

defrag ??? Is this available in UNIX ??. I remember this term in DOS.

kiddin ....

I do not in HPUX but in AIX there is a command called defragfs .. Check for something similier in HPUX. Also logically it would not work if u do not have Online JFS

Regds,

Kaps
Nothing is impossible
Mark Grant
Honored Contributor

Re: Defragmenting file system on HP-UX

Yes but no.

There is a chance of data loss but, to be honest I have never seen it happen. If you are at all nervous about this, take a backup first.
Never preceed any demonstration with anything more predictive than "watch this"
SureshKumar_2
Valued Contributor

Re: Defragmenting file system on HP-UX

Hi anil

If u have HFS it is an optimised defragmentation.

Hope this url will help you

HFS :
http://aa11.cjb.net/hpux_admin/1997/0008.html

Online jFS :
http://unix.derkeiler.com/Mailing-Lists/HP-UX-Admin/2003-10/0029.html

regards
suresh
Things are very easy, when u know about it...
T G Manikandan
Honored Contributor

Re: Defragmenting file system on HP-UX

you should have Online JFS installed for this.

the extent fragmentation and directory fragmentation are specified by the -e and -d options of the fsadm command.

I would really recommend to take a ignite image backup before you do something on this system file system,.

First run -E & -E options to just view the report of fragmentation.

SANTOSH S. MHASKAR
Trusted Contributor

Re: Defragmenting file system on HP-UX

Hi Anil,

Defragmenting of file system on HP_UX is definitely avaliable if the file system type is
vxfs or JFS. U can use following command

# fsadm -F vxfs -e -v /var


Also look for fsadm_vxfs man pages.

- Santosh
Anil_29
Advisor

Re: Defragmenting file system on HP-UX

Hi Manikanthan,

Thanks for all who replied.
Can u pls tell me if my /var file system requires defragmentation, I am pasting the output of "fsadm -F vxfs -D -E /var" command. cna can any one briefly explain the output.

# fsadm -F vxfs -D -E /var

Directory Fragmentation Report
Dirs Total Immed Immeds Dirs to Blocks to
Searched Blocks Dirs to Add Reduce Reduce
total 2830 1110 1956 51 55 104

Extent Fragmentation Report
Total Average Average Total
Files File Blks # Extents Free Blks
16150 31 1 42085
blocks used for indirects: 326
% Free blocks in extents smaller than 64 blks: 47.79
% Free blocks in extents smaller than 8 blks: 34.40
% blks allocated to extents 64 blks or larger: 75.81
Free Extents By Size
1: 635 2: 477 4: 404 8: 78
16: 17 32: 11 64: 8 128: 6
256: 6 512: 2 1024: 1 2048: 0
4096: 0 8192: 0 16384: 0 32768: 1

Thanks & Regards,
Anil
Jim Mallett
Honored Contributor

Re: Defragmenting file system on HP-UX

Anil,

man 1m fsadm_vxfs has a section that explains most of fields and values.

In most cases, a smaller number is better.
Important fields to look at are:
Immeds to Add
Dirs to Reduce
Blocks to Reduce
Avg # Extents
%Free in smaller than 64 blocks
%Free in smaller than 8 blocks

I schedule a defrag for all vxfs file systems monthly. To give you an example of what my /var looks like:

Directory Fragmentation Report
Dirs Total Immed Immeds Dirs to Blocks to
Searched Blocks Dirs to Add Reduce Reduce
10052 725 9469 1 8
27
Extent Fragmentation Report
Total Average Average Total
Files File Blks # Extents Free Blks
19342 31 1 1474780
blocks used for indirects: 24
% Free blocks in extents smaller than 64 blks: 2.29
% Free blocks in extents smaller than 8 blks: 0.16
% blks allocated to extents 64 blks or larger: 82.06

HP suggests "%Free blocks in extents smaller than 64 blocks" be less than 50%, your # is approaching that. In most cases you're not going to run a defrag and say "Wow, what an improvement." But even small improvements over time can help out the big picture. Although a defrag can be run at any time, there will be a performance hit while it is happening so keep that in mind if users are accessing the system. I just schedule mine off hours.

Jim
Hindsight is 20/20
Bill Hassell
Honored Contributor

Re: Defragmenting file system on HP-UX

As mentioned, you will not see a significant improvement in speed at all. The VxFS filesystem does a good job in keeping file fragmentation to a minimum. Your first step in managing /var should be to implement an automated removal of unnecessary and temporary files in /var/tmp and trimming or archiving logfiles in /var/adm. Similarly, the cleanup command is needed to manage patches and of course, junk (forgooten data) in /var/mail and /var/spool are always a problem. And if your system has crashed, there may be crash dumps in /var/adm/crash. Do this to locate the trouble areas:

du -kx /var | sort -rn | more


Bill Hassell, sysadmin
dirk dierickx
Honored Contributor

Re: Defragmenting file system on HP-UX

some unix fs have this option, however its impact will be minimal, the unix fs is already optimized.