Comparison of the logical size output of the fsadm -S shared, du, and df commands

The fsadm -S shared, du, and df commands report different values for the size of a FileSnap. The fsadm -S shared command displays this size as the "logical size," which is the logical space consumed, in kilobytes, and accounts for both exclusive blocks and shared blocks. This value represents the actual disk space needed if the file system did not have any shared blocks. The value from the fsadm -S shared command differs from the output of du -sk command since the du command does not track the blocks consumed by VxFS structural files. As a result, the output of the du -sk command is less than the logical size output reported by the fsadm -S shared command.

The following examples show output from the fsadm -S shared, du, and df commands:

  # mkfs -t vxfs -o version=9 /dev/vx/rdsk/dg/vol3
  version 9 layout
  104857600 sectors, 52428800 blocks of size 1024, log size 65536 blocks
  rcq size 4096 blocks
  largefiles supported

  # mount -t vxfs /dev/vx/dsk/dg/vol3 /mnt

  # df -k /mnt
  Filesystem           1K-blocks    Used   Available Use% Mounted on
  /dev/vx/dsk/dg1/vol3 52428800     83590  49073642  1%   /mnt

  # /opt/VRTS/bin/fsadm -S shared /mnt
  Mountpoint    Size(KB)   Available(KB)   Used(KB)   Logical_Size(KB) Shared
  /mnt          52428800   49073642        83590      83590            0%

  # du -sk /mnt
  0       /mnt

  # dd if=/dev/zero of=/mnt/foo bs=1024 count=10
  10+0 records in
  10+0 records out
  10240 bytes (10 kB) copied, 0.018901 seconds, 542 kB/s

  # vxfilesnap /mnt/foo /mnt/foo.snap

  # df -k /mnt
  Filesystem           1K-blocks      Used   Available Use% Mounted on
  /dev/vx/dsk/dg1/vol3 52428800       83600  49073632  1%   /mnt

  #  /opt/VRTS/bin/fsadm -S shared /mnt
  Mountpoint    Size(KB)   Available(KB)   Used(KB)   Logical_Size(KB) Shared
  /mnt          52428800   49073632        83600      83610            0%

  #  du -sk /mnt
  20      /mnt