Provided by: defrag_0.73pjm1-7_i386 bug

NAME

       {e|e2|m|x}defrag - defragment file systems.

SYNOPSIS

       edefrag  |  e2defrag | mdefrag | xdefrag [ -Vdnrsv ] [ -b bad-inode ] [
       -i inode-priority-file ] [ -p pool-size ] /dev/name

DESCRIPTION

       Mdefrag will reorganise data on a minix file system partition in  order
       to  improve  the  file system’s performance.  Edefrag is the equivalent
       program for the old extended file system.   E2defrag  in  its  turn  is
       designed  for  the  second extended file system (versions 0.3 onwards).
       And the xdefrag program will operate on Xia FS filesystems.

       Note that unlike the fsck program, defrag MUST NOT be run on a  mounted
       file system device (unless invoked with the -r (readonly) option, which
       is always  safe).   Also  note  that  if  you  defragment  a  partition
       containing a bootable kernel image, you will have to reinstall the boot
       loader for that image (since the location on disk of the image may have
       changed).

       Remember,  if  defrag fails to complete for any reason (including power
       glitches, kernel bugs etc.), you will be left with a  terminally  sick,
       and  possibly completely unreadable, filesystem, so backup any valuable
       data before you start.

OPTIONS

       -V     Supply  full  version  information.   If  you  are  sending  bug
              reports, please include this information.

       -d     Run  in  debugging mode.  This will not be available if disabled
              at compile-time.

       -n     No-picture more.  Disables a  pseudo-graphic  picture  and  runs
              with  an  old-style  printf output. Note that the picture option
              requires  a  proper  terminfo  database   for   your   terminal,
              compatible  with  the ncurses package.  If the picture option is
              used, -v and -s options are set automatically. Nevertheless  you
              can  increase  amount  of  information output to the status line
              using several -v switches. This gives you a  chance  to  improve
              the speed of your reading.

       -r     Readonly  mode.   Defrag  will scan the file system and simulate
              the job of defragmentation, but  will  not  write  to  the  file
              system.  This can be used for debugging or testing.  It may also
              be used to find out how much work defrag will  have  to  do,  in
              order to choose a sensible pool-size

       -s     Summarise   file   system  information  and  defrag  performance
              statistics.

       -v     Verbose - gives a progress report as  defragmentation  proceeds.
              If  -v  is given twice, then a more detailed report is supplied.
              The fullest report, when -v is given three times,  also  reports
              the inode priority list as it is read.

       -b bad-inode
              Indicate  which inode stores the badblock list on the filesystem
              being defragmented.  This should be an inode whose  data  blocks
              are  all  bad  blocks.   The  defragmenter  will  not move these
              blocks, and will prevent any other data from being placed there.

              The  default  for  edefrag is -b 2, since mkefs always creates a
              bad block inode at inode 2.  The minix filesystem does not  have
              a  bad  block  inode  by  default,  but if you have created one,
              supply its inode number with this option.

       -i inode-priority-file
              As of version 0.4, defrag has a new facility which allows you to
              specify  how  to  reorganise  the data on your disk.  The inode-
              priority-file is a file giving a priority between -100  and  100
              to  each  inode  in  the  filesystem.  Higher priorities will be
              allocated nearer the beginning of  the  disk  than  lower  (more
              negative)  priorities.   Two  inodes  of  equal priority will be
              allocated in the  same  sequence  they  had  originally  on  the
              filesystem,  to  minimise  file  movement.   All  inodes  have a
              default priority of zero if they are ommitted from the  file  or
              if no -i option is given.

              The  file  inode-priority-file  should contain a series of lines
              containing either a single number (which will be interpreted  as
              an  inode number), or a number prefixed immediately by an equals
              sign (which will be interpreted as a priority to be  applied  to
              the subsequent inode numbers).

              If  multiple  priority files are specified, only the last one is
              effective.

       -p number
              Selects the number of buffers allocated  to  the  defragmenter’s
              buffer  pool.   These  buffers are used when relocating data, so
              the more buffers allocated, the more  efficient  the  relocation
              process.  The number you choose will depend on how much physical
              and virtual memory you have available.  The default pool size is
              512  buffers  (equivalent  to 2MB of memory used for filesystems
              with the default 4kB block size of current mke2fs versions).

SEE ALSO

       mkfs(8), fsck(8), mkefs(8), efsck(8), mke2fs(8), e2fsck(8)

BUGS

       Maybe, but then that’s why you backed up your data first, isn’t it?

       Although e2defrag  now  accepts  most  ext2  "extra  features"  (sparse
       superblocks,  compression,  etc.),  it  will always lag slightly behind
       e2fsprogs and the kernel.  If it tells  you  that  the  filesystem  has
       unsupported  features,  try using ‘tune2fs -O’ (immediately followed by
       e2fsck); see the tune2fs(8) man page.

       Requires that the filesystem already be  in  ‘host-endian’  form.   For
       ext2  filesystems, you can use ‘e2fsck -S’ to convert to and from host-
       endian form.  (Users  of  little-endian  machines  (like  ix86,  alpha,
       mipsel)  shouldn’t  need  to worry about this -- except possibly if you
       wish to defragment a filesystem created on a non-little-endian  machine
       using old software.)

AUTHORS

       Written  by  Stephen  Tweedie.  Adaptation for the xia, ext2 filesystem
       and the picture option are done by Alexey  Vovenko  and  Ulrich  Habel.
       Much  of  the  initial  version  was  developed from the fsck and efsck
       programs by Linus Torvalds and Remy Card.

       Send  bug  reports,  fixes,  improvements,  comments  and  fan-mail  to
       sct@dcs.ed.ac.uk.

                        Version 0.73pjm1   30 Apr 2001               DEFRAG(8)