8

Is it safe to interrupt (Ctrl-C) a long running xfs_fsr job?

I'm attempting to defragment a very large XFS volume.

bahamat
  • 39,666
  • 4
  • 75
  • 104
twblamer
  • 929

1 Answers1

9

Like all filesystem manipulation tools, xfs_fsr takes care of leaving the filesystem in a consistent state, in case the machine crashes (due to a power failure, for example). Unless you're unlucky and encounter a bug, that is — filesystem drivers are more complex than they look, especially as they are written for speed.

If you interrupt xfs_fsr cleanly (with any of the usual signals SIGINT, SIGHUP, SIGTERM or SIGQUIT), it takes care to write where it left off in /var/tmp/.fsrlast (or the file indicated with the -f option). So you can safely interrupt it with Ctrl+C, and restart it again with the same options later to complete the job.