Displaying Disk Information

The df tool located in /bin is designed to display free disk space. In addition, df is a useful way to find out what your current disk partitions are, how much space each one takes up, which block each partition starts on, which device file is associated with each partition, and where each partition is mounted.

To display disk information:

$ df

The computer will respond with output similar to the following:

Filesystem

512-blocks

Used

Avail Capacity

Mounted on

/dev/disk0s3

156039264

26138984

129388280

17%

/

devfs

193

193

0

100%

/dev

fdesc

2

2

0

100%

/dev

<volfs>

1024

1024

0

100%

/.vol

automount -nsl [170]

0

0

0

100%

/Network

automount -fstab [174]

0

0

0

100%

/automount/

Servers

 

 

 

 

 

automount -static [174]

0

0

0

100%

/automount/

static

 

 

 

 

 

The -loption restricts reporting to local drives only. The -koption displays sizes in kilobyte format.

Each line in the output refers to a different partition. The first column tells you the device file associated with that partition. The second column displays the capacity of the partition followed by used and available space on the volume. The last column tells you where the partition is mounted.

Monitoring Disk Space

You can monitor the amount of free space on disks and take predefined actions when thresholds are exceeded. When you need more vigilant monitoring of disk space than the log rolling scripts provide, you can use the diskspacemonitor tool. It lets you monitor disk space and take action more frequently than once a day when disk space is critically low, and gives you the opportunity to provide your own action scripts. diskspacemonitor is disabled by default.

To enable diskspacemonitor:

$ sudo diskspacemonitor on.

You may be prompted for your password. See the diskspacemonitor man page for more information.

Chapter 7 Working with Disks and Volumes

85

Page 85
Image 85
Apple Mac OS X Server manual Displaying Disk Information, Monitoring Disk Space, To display disk information