Managing Devices in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Managing Disk Use

Use the following task map for a list of management tasks you can perform on disks.

Table 5-1  Managing Disk Use Task Map
Task
Description
For Instructions
Display information about the use of disk space on the system.
Show how disk space is currently being used.
Display information about sizes of files that use up disk space.
Show sizes and other information about files that are stored on the system disks.
Display information about the size of directories and subdirectories.
Display the size of one or more directories, subdirectories, and files by using the du command.
Perform disk maintenance.
Ensure disk availability by regularly removing unnecessary files and directories. Identify old files by listing them based on time stamps.
Find and remove old or inactive files.
Use the find to identify inactive files that can be marked for deletion.
Clear out temporary directories.
Locate temp directories, then use the rm –r * command to remove the entire directory.
Find and delete core files.
Find and delete core files by using the find . -name core -exec rm {} \; command.

The following list summarizes the commands available for displaying information about file size and disk space.

  • zpool list – displays pool space size, how much space is allocated to datasets and internal metadata and how much space is unallocated. See the zpool(1M) man page.

  • zfs list – displays amount of space consumed by datasets and any descendents, the amount of space available to the dataset and its descendents, and the amount of data that is referenced by this dataset, which may or may not be shared with other datasets in the pool. See the zfs(1M) man page.

  • df – reports the number of free disk blocks and files. See the df(1M) man page.

  • du – summarizes disk space allocated to each subdirectory. See the du(1) man page.

  • find –size – searches recursively through a directory based on the size specified with the –size option. See the find(1) man page.

  • ls – lists the size of a file in the power of 1024 scaling. See the ls(1) man page.

The zpool list and zfs list commands are better than the legacy df and du commands for determining your available ZFS storage pool and file system space. With the legacy commands, you cannot easily discern between pool and file system space, nor do the legacy commands account for space that is consumed by descendent file systems or snapshots.