Can a vxfs defrag operation, once initiated by running fsadm -e -d be safely canceled?
|Article:TECH143058|||||Created: 2010-10-29|||||Updated: 2010-12-27|||||Article URL http://www.symantec.com/docs/TECH143058|
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.
This affects vxfs filesystems on Solaris, Linux, AIX and HP-UX.
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.
See related technotes:
Data that needs to be collected following filesystem or volume corruption for Root Cause Analysis prior to fixing the problem
Shrink VxFS file system - blocks are currently in use: TECH28482
Checking for Defragmentation: See Document ID: 305567
Article URL http://www.symantec.com/docs/TECH143058