Manual Pages

Table of Contents


na_du - The output of du command displays the blocks used in a file.


du [ -u ] [ -h | -k | -m] [ -r {start_offset:end_offset} ] { file_path }


The du command displays the number of blocks that are used in a file.

The file_path parameter is the pathname to a regular file in a volume or pathname of a NetApp LUN. By default the command displays "total blocks" held in a file as 1K blocks. The -h option scales the units of each sizerelated field to be KB, MB, or GB, whichever is most appropriate for the value being displayed. The -k, -m options scale each size-related field of the output to be expressed in kilobytes or megabytes respectively. Unit values are based on powers of two. For example, one megabyte is equal to 1,048,576 bytes.

The -u option of the command displays the number of "unique blocks" held in a file. "unique blocks" are the blocks that are referenced only once. Deduplication and FlexClone files and LUNs, share blocks and create multiple references to a single block. Smaller the "unique blocks" value compared to "total blocks", better is the "storage savings". Deleting a file will return back "unique blocks" worth of space. This does not include space trapped in Snapshot copies.

With the -r option, the command takes in a range and displays "total_blocks" in this range. Range is specified as begin offset':'end offset. The -u option displays "unique blocks" in that range (in addition to total blocks). start_offset is specified with 0 as the starting offset. end_offset is not inclusive. In other words, range is described by the interval [start_offset, end_offset).


The following example illustrates du command without any options.
  toaster> du /vol/vol1/file_2t
  2690385704      /vol/vol1/file_2t

This shows that the file `/vol/vol1/file_2t' has "total blocks" worth 2690385704KB.

The following example shows du command with -u option.

  toaster> du -u /vol/vol1/file_2t
  2690385704      10551824        /vol/vol1/file_2t

The first column specifies "total blocks" and second column "unique blocks". File `/vol/vol1/file_2t' has "total blocks" worth 2690385704KB and "unique blocks" worth 10551824KB. About 2679833880KB worth blocks have more than one reference. Deleting this file will return back only 10551824KB.

The following example shows du command with -u option with -m/-h options.

  toaster> du -mu /vol/vol1/file_2t
  2627329 10304   /vol/vol1/file_2t
  toaster> du -hu /vol/vol1/file_2t
  2565GB  10GB    /vol/vol1/fi

The following example shows du command with -u option with -r option. _FI_FI_

  toaster> du -ur 12121:12121212  /vol/vol1/file_2t
  11872   40      /vol/vol1/file_2t

  This says that there are 11872 1KB blocks between offsets 12121 and
  12121212. Out of that, 40 are unique.

  Even though "unique blocks" refer  to  minimum  amount  of
  space  that  can  be reclaimed by deleting a file, it does
  not include blocks that are part of a  Snapshot  copy  and
  hence the actual amount of space reclaimed could be lower.

                      12 June 2012                  na_df(1)