When defragmenting a vxfs filesystem, the program will make several passes across every inode in the filesystem. Large filesystems will take a lot of time to complete. It is not uncommon for the fsadm process to run for multiple days. Additionally, since the defragment process performs many reads and writes when reallocating blocks, the process can impact read and write performance of production applications.
The fsadm process can be safely stopped, if the correct procedure is followed:
You can safely kill a defrag operation, with the -15. It can take a few hours to complete the operation/file it is on, however, before it stops.
1. Use Ctrl-C or "kill -15" to kill fsadm
2. Don't use kill -9
3. You can run "truss -f -p <PID>" (on solaris or AIX) or "strace -f -p <PID>" (linux) to verify the process is still making progress, if you wish.
4. Fsadm will ignore a kill until it finishes reorganizing the file it is on file. So if there is a large file that is highly fragmented, especially in a large file system, it could take a long time, especially one with little free space.
- Preallocate files that you know will grow to prevent fragmentation.
- Get a metasave output (see below for instructions) if filesytem problems persist and you need analysis from support.
- Generally filesystems less than 75% full, or a large amount of free space, will defrag much quicker.
This affects vxfs filesystems on Solaris, Linux, AIX and HP-UX.