Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Devices and File Systems Oracle Solaris 10 1/13 Information Library |
1. Managing Removable Media (Overview/Tasks)
2. Writing CDs and DVDs (Tasks)
4. Dynamically Configuring Devices (Tasks)
5. Managing USB Devices (Tasks)
6. Using InfiniBand Devices (Overview/Tasks)
How to Display the Size of Files
How to Find Files That Exceed a Specified Size Limit
Checking the Size of Directories
How to Display the Size of Directories, Subdirectories, and Files
How to Display the User Ownership of Local UFS File Systems
Finding and Removing Old or Inactive Files
How to Find and Remove Old or Inactive Files
How to Clear Out Temporary Directories
How to Find and Delete core Files
How to Delete Crash Dump Files
9. Administering Disks (Tasks)
10. SPARC: Setting Up Disks (Tasks)
11. x86: Setting Up Disks (Tasks)
12. Configuring Oracle Solaris iSCSI Targets (Tasks)
13. The format Utility (Reference)
14. Managing File Systems (Overview)
15. Creating and Mounting File Systems (Tasks)
16. Configuring Additional Swap Space (Tasks)
17. Checking UFS File System Consistency (Tasks)
18. UFS File System (Reference)
19. Backing Up and Restoring UFS File Systems (Overview/Tasks)
20. Using UFS Snapshots (Tasks)
21. Copying Files and File Systems (Tasks)
22. Managing Tape Drives (Tasks)
This table summarizes the commands available for displaying information about file size and disk space.
|
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.
UFS
ZFS
$ df / (/dev/dsk/c0t0d0s0 ): 101294 blocks 105480 files /devices (/devices ): 0 blocks 0 files /system/contract (ctfs ): 0 blocks 2147483578 files /proc (proc ): 0 blocks 1871 files /etc/mnttab (mnttab ): 0 blocks 0 files /etc/svc/volatile (swap ): 992704 blocks 16964 files /system/object (objfs ): 0 blocks 2147483530 files /usr (/dev/dsk/c0t0d0s6 ): 503774 blocks 299189 files /dev/fd (fd ): 0 blocks 0 files /var/run (swap ): 992704 blocks 16964 files /tmp (swap ): 992704 blocks 16964 files /opt (/dev/dsk/c0t0d0s5 ): 23914 blocks 6947 files /export/home (/dev/dsk/c0t0d0s7 ): 16810 blocks 7160 files
For example, the following root pool (rpool) has 10.0 GB allocated and 58.0 GB free.
# zpool list rpool NAME SIZE ALLOC FREE CAP HEALTH ALTROOT rpool 68G 10.0G 58.0G 14% ONLINE -
If you compare the pool space accounting with the file system space accounting by reviewing the USED columns of your individual file systems minus some space for pool metadata, you can see that the pool space is accounted for. For example:
# zfs list -r rpool NAME USED AVAIL REFER MOUNTPOINT rpool 10.2G 56.8G 106K /rpool rpool/ROOT 5.04G 56.8G 31K legacy rpool/ROOT/solaris 5.04G 56.8G 5.04G / rpool/dump 1.00G 56.8G 1.00G - rpool/export 63K 56.8G 32K /export rpool/export/home 31K 56.8G 31K /export/home rpool/swap 4.13G 56.9G 4.00G -
Example 8-1 Displaying File Size Information in 1024 Bytes on a System With a UFS Root File System
In the following example, file system information for a system with a UFS root file system is displayed in 1024 bytes.
$ df -h Filesystem size used avail capacity Mounted on /dev/dsk/c0t0d0s0 249M 200M 25M 90% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 485M 376K 485M 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object /dev/dsk/c0t0d0s6 3.2G 2.9G 214M 94% /usr fd 0K 0K 0K 0% /dev/fd swap 485M 40K 485M 1% /var/run swap 485M 40K 485M 1% /tmp /dev/dsk/c0t0d0s5 13M 1.7M 10M 15% /opt /dev/dsk/c0t0d0s7 9.2M 1.0M 7.3M 13% /export/home
Although /proc and /tmp are local file systems, they are not UFS file systems. /proc is a PROCFS file system, /var/run and /tmp are TMPFS file systems, and /etc/mnttab is an MNTFS file system.
Example 8-2 Displaying Total Number of Blocks and Files Allocated for a UFS File System
The following example shows a list of all mounted file systems, device names, total 512-byte blocks used, and the number of files. The second line of each two-line entry displays the total number of blocks and files that are allocated for the file system.
$ df -t / (/dev/dsk/c0t0d0s0 ): 101294 blocks 105480 files total: 509932 blocks 129024 files /devices (/devices ): 0 blocks 0 files total: 0 blocks 113 files /system/contract (ctfs ): 0 blocks 2147483578 files total: 0 blocks 69 files /proc (proc ): 0 blocks 1871 files total: 0 blocks 1916 files /etc/mnttab (mnttab ): 0 blocks 0 files total: 0 blocks 1 files /etc/svc/volatile (swap ): 992608 blocks 16964 files total: 993360 blocks 17025 files /system/object (objfs ): 0 blocks 2147483530 files total: 0 blocks 117 files /usr (/dev/dsk/c0t0d0s6 ): 503774 blocks 299189 files total: 6650604 blocks 420480 files /dev/fd (fd ): 0 blocks 0 files total: 0 blocks 31 files /var/run (swap ): 992608 blocks 16964 files total: 992688 blocks 17025 files /tmp (swap ): 992608 blocks 16964 files total: 992688 blocks 17025 files /opt (/dev/dsk/c0t0d0s5 ): 23914 blocks 6947 files total: 27404 blocks 7168 files /export/home (/dev/dsk/c0t0d0s7 ): 16810 blocks 7160 files total: 18900 blocks 7168 files