Description

This article provides information on how to display the size of a specific directory or sub-directory.

Symptoms

If the size of a particular directory is required, whether for a upgrade or to keep track of the directory size , the default show system storage command will not determine the capacity or the used space of a particular directory.


Solution


For example, show system storage will not display the specific size of a /var/tmp directory:

lab> show system storage
Filesystem Size Used Avail Capacity Mounted on
/dev/da1s1a 885M 180M 697M 20% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/md0 49M 49M 0B 100% /packages/mnt/jbase
/dev/md1 315M 315M 0B 100% /packages/mnt/jkernel-ppc-11.4R1.14
/dev/md2 19M 19M 0B 100% /packages/mnt/jpfe-MX80-11.4R1.14
/dev/md3 5.3M 5.3M 0B 100% /packages/mnt/jdocs-11.4R1.14
/dev/md4 95M 95M 0B 100% /packages/mnt/jroute-ppc-11.4R1.14
/dev/md5 24M 24M 0B 100% /packages/mnt/jcrypto-ppc-11.4R1.14
/dev/md6 2.8G 10.0K 2.6G 0% /tmp
/dev/md7 2.8G 1.2M 2.6G 0% /mfs
/dev/da1s1e 99M 258K 97M 0% /config
procfs 4.0K 4.0K 0B 100% /proc
/dev/da1s1f 2.8G 2.5G 108M 96% /var


To find the specific size of any directory, as in the above example of /var/tmp ,  perform the following procedure:

-----------------------------
lab> start shell
% du -hs /var/tmp
424M /var/tmp
-------------------------------

424M is the used space. This can also be verified with the /var directory via show system storage :
root@% du -hs /var
2.5G /var
To clean the device space, you can try remove the unused file via the CLI:
> file delete xxx

or use the following CLI command to clean up the temporary files:
{MASTER}
lab@T1600-re0> request system storage cleanup

List of files to delete:
<snip>

Delete these files ? [yes,no] (no) yes


Example output:


JTAC_LAB> request system storage cleanup dry-run

List of files to delete:

Size Date Name
6874B Jul 18 22:54 /var/log/interactive-commands.0.gz
4983B Jul 18 22:54 /var/log/messages.0.gz
338B Jul 18 22:54 /var/log/smartd.trace.0.gz
59B Jul 18 22:15 /var/log/wtmp.0.gz
57B Jul 18 22:14 /var/log/wtmp.1.gz
355B Mar 21 2011 /var/lost+found/#2732807
278.3M Sep 29 2010 /var/sw/pkg/jbundle-10.0R2.10.tgz
278.8M Dec 15 2010 /var/sw/pkg/jbundle-10.0R3.10.tgz
278.7M Dec 16 2010 /var/sw/pkg/jbundle-10.0S3.1.tgz
334.6M Dec 14 2011 /var/sw/pkg/jbundle-10.4R7.5.tgz
152.1M Nov 29 2008 /var/sw/pkg/jbundle-9.0R4.5.tgz
283.5M Sep 29 2010 /var/sw/pkg/jinstall-10.0R2.10-domestic-signed.tgz
284.0M Dec 15 2010 /var/sw/pkg/jinstall-10.0R3.10-domestic-signed.tgz
283.9M Dec 16 2010 /var/sw/pkg/jinstall-10.0S3.1-domestic-signed.tgz
340.7M Dec 14 2011 /var/sw/pkg/jinstall-10.4R7.5-domestic-signed.tgz
83.7K Sep 29 2010 /var/sw/pkg/jservices-aacl-pic-10.0R2.10.tgz
187.6K Sep 29 2010 /var/sw/pkg/jservices-appid-pic-10.0R2.10.tgz
2622.8K Sep 29 2010 /var/sw/pkg/jservices-bgf-pic-10.0R2.10.tgz
1208.5K Sep 29 2010 /var/sw/pkg/jservices-idp-pic-10.0R2.10.tgz
143.5K Sep 29 2010 /var/sw/pkg/jservices-llpdf-pic-10.0R2.10.tgz
100.7K Sep 29 2010 /var/sw/pkg/jservices-sfw-pic-10.0R2.10.tgz
3784.4K Sep 29 2010 /var/sw/pkg/jservices-voice-bsg-10.0R2.10.tgz
1565B Feb 19 2010 /var/tmp/default.conf
124.0K Jul 18 22:13 /var/tmp/gres-tp/env.dat
0B Jul 18 22:13 /var/tmp/gres-tp/lock
155B Jul 18 22:14 /var/tmp/krt_gencfg_filter.txt



NOTE:
dry-run — (Optional) List files proposed for deletion (without deleting them):


JTAC_LAB> request system storage cleanup

List of files to delete:

Size Date Name
6874B Jul 18 22:54 /var/log/interactive-commands.0.gz
4983B Jul 18 22:54 /var/log/messages.0.gz
338B Jul 18 22:54 /var/log/smartd.trace.0.gz
59B Jul 18 22:15 /var/log/wtmp.0.gz
57B Jul 18 22:14 /var/log/wtmp.1.gz
355B Mar 21 2011 /var/lost+found/#2732807
278.3M Sep 29 2010 /var/sw/pkg/jbundle-10.0R2.10.tgz
278.8M Dec 15 2010 /var/sw/pkg/jbundle-10.0R3.10.tgz
278.7M Dec 16 2010 /var/sw/pkg/jbundle-10.0S3.1.tgz
334.6M Dec 14 2011 /var/sw/pkg/jbundle-10.4R7.5.tgz
152.1M Nov 29 2008 /var/sw/pkg/jbundle-9.0R4.5.tgz
283.5M Sep 29 2010 /var/sw/pkg/jinstall-10.0R2.10-domestic-signed.tgz
284.0M Dec 15 2010 /var/sw/pkg/jinstall-10.0R3.10-domestic-signed.tgz
283.9M Dec 16 2010 /var/sw/pkg/jinstall-10.0S3.1-domestic-signed.tgz
340.7M Dec 14 2011 /var/sw/pkg/jinstall-10.4R7.5-domestic-signed.tgz
83.7K Sep 29 2010 /var/sw/pkg/jservices-aacl-pic-10.0R2.10.tgz
187.6K Sep 29 2010 /var/sw/pkg/jservices-appid-pic-10.0R2.10.tgz
2622.8K Sep 29 2010 /var/sw/pkg/jservices-bgf-pic-10.0R2.10.tgz
1208.5K Sep 29 2010 /var/sw/pkg/jservices-idp-pic-10.0R2.10.tgz
143.5K Sep 29 2010 /var/sw/pkg/jservices-llpdf-pic-10.0R2.10.tgz
100.7K Sep 29 2010 /var/sw/pkg/jservices-sfw-pic-10.0R2.10.tgz
3784.4K Sep 29 2010 /var/sw/pkg/jservices-voice-bsg-10.0R2.10.tgz
1565B Feb 19 2010 /var/tmp/default.conf
124.0K Jul 18 22:13 /var/tmp/gres-tp/env.dat
0B Jul 18 22:13 /var/tmp/gres-tp/lock
155B Jul 18 22:14 /var/tmp/krt_gencfg_filter.txt

Delete these files ? [yes,no] (no) yes


JTAC_LAB> request system storage cleanup dry-run

List of files to delete:

Size Date Name
314B Jul 18 22:56 /var/log/interactive-commands.0.gz
119B Jul 18 22:56 /var/log/messages.0.gz
277B Jul 18 22:56 /var/log/smartd.trace.0.gz
27B Jul 18 22:55 /var/log/wtmp.0.gz