Re: Defragfs gotchas?



I just checked one of our AIX 5.1 ML8 systems using instfix -ia and
searched the output for defragfs.



Before running defragfs on AIX 5.1, I would run the following commands
to make sure the following APARs are installed:



instfix -ik IY38698

instfix -ik IY28806

instfix -ik IY50790

instfix -ik IY52025

instfix -ik IY62599

instfix -ik IY66450

instfix -ik IY76827



Are you using jfs or jfs2 for the /var file system? (command: lsfs /var)



I didn't check fix central, are there any other APARs that pertain to
AIX 5.1 and defragfs that are not listed above?







Here is the list of APAR abstracts and symptom texts from instfix -ia



========================================================================
======

IY38698 Abstract: defragfs upates timestamps of files on JFS2



IY38698 Symptom Text:

Timestamp on files gets updated when defragfs command is run

on a J2 filesystem.

This does not happen on JFS filesystem.



========================================================================
======

IY28806 Abstract: System assert following defragfs call using 64-bit
kernel



IY28806 Symptom Text:

System assert following defragfs call under 64-bit kernel.



========================================================================
======

IY50790 Abstract: data corruption after defragfs run



IY50790 Symptom Text:

Some files may be corrupted after running defragfs.

This only happens on JFS2



========================================================================
======

IY52025 Abstract: malloc failed error due to signed int overflow



IY52025 Symptom Text:

Running defragfs will result in the following message:

error: defragfs 0506-403 malloc failed



========================================================================
======

IY62599 Abstract: defragfs failed on very fragmented file system



IY62599 Symptom Text:

defragfs failed



========================================================================
======

IY66450 Abstract: defragfs could corrupt JFS2 and may lead to crash



IY66450 Symptom Text:

Running defragfs command on a JFS2 filesystem could lead

to system crash and filesystem corruption.



========================================================================
======

IY76827 Abstract: Data corruption on JFS after running defragfs



IY76827 Symptom Text:

Data loss can result from the use of the JFS defragfs

utility on a large-file enabled filesystem. Corruption may

appear in filesystem metadata or file data and may occur

significantly after defragfs has run. The use of defragfs

should be avoided until after this APAR is applied.

This problem may also result in a crash in v_findiblk,

dlistadd, or other JFS metadata corruption related

crashes. In these cases, user data may be written over

filesystem metadata.

If defragfs has been run recently on a large-file enabled JFS

filesystem, fsck should be run to repair any filesystem

metadata issues. In addition, any data verification services

available should be run for the data on those filesystems

(e.g. database verification services).



========================================================================
======







Edward.Davignon@xxxxxxxxxxxxxx

Lead Analyst - Distributed Systems

Utility Shared Services - IT

Energy East Corporation

Office Phone: (585) 771-4952



"Measure twice. Cut once."



-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@xxxxxxxxxxxxx] On Behalf Of
Karl Jones
Sent: Tuesday, May 08, 2007 10:29 AM
To: aix-l@xxxxxxxxxxxxx
Subject: Defragfs gotchas?



Last night I got an error indicating that we should run defragfs on /var


on our 5.1 system.



Any concerns about doing this? Do I need to wait until after hours to

do this?



Here's the output of a dry run:



F50:# defragfs -r /var

statistics before running defragfs:

number of free fragments 90159

number of allocated fragments 171985

number of free spaces shorter than a block 208

number of free fragments in short free spaces 876



statistics after running defragfs:

number of free spaces shorter than a block 30

number of free fragments in short free spaces 146



other statistics:

number of fragments moved 5896

number of logical blocks moved 806

number of allocation attempts 541

number of exact matches 245



Relevant Pages

  • dont run defragfs!
    ... an understatement - "Data loss WILL result" is more like it. ... defragfs scrambled my own email inbox. ... utility on a large-file enabled filesystem. ... appear in filesystem metadata or file data and may occur ...
    (AIX-L)
  • Re: Problem Reducing Size of JFS2 File System
    ... # lslv -l fslv01 ... I tried a defragfs, but that doesn't come up with any results. ... When I try the chfs command directly from the command line (as opposed ... request due to filesystem fragmentation. ...
    (comp.unix.aix)
  • Re: defragfs command
    ... reorgvg will re-locate physical partitions but the content of those ... defragfs moves filesystem blocks so that free space is logically contiguous. ... > mean at the end of the command, ...
    (AIX-L)