Link to home
Start Free TrialLog in
Avatar of roduno
roduno

asked on

What command tells you how much space is in a directory?

I am trying to configure a gcc compiler and one of the things that I am trying is the pkgadd -d command.  When I do that I get an error that says "errno 28 No space left on Device".  What is the correct command that finds out how much space is in a directory.  The only command I know right now is df and that only gives me the overall view.  Also: Is there any way to increase the size of a directory without having to reformat the whole disk over again?

Avatar of john-at-7fff
john-at-7fff

df -k will give you the space left on each volume.

du will tell you how much space is used by each file.
You can also do

du -s

to get a summary, which is really useful. Like:

du -s /etc/*

Finally: Changing the size of a directory --

Well, the problem is likely that you want to change the space on a VOLUME, i.e., a partition on the disk. On the very newest versions of Solaris, there is what is known as Dynamic File Systems -- among other places, you might read: http://www.netapp.com/tech_library/3294.html

But in general, on Solaris, you would have to destroy the partition and create it anew to make it bigger.

Re: Running out of space during pkgadd: Sometimes you can set up some symbolic links to make pkgadd use other volumes. See this thread for instance:

http://www.computing.net/solaris/wwwboard/forum/3751.html
Avatar of roduno

ASKER

Good information but can you give me an example of how I would symbolically link the different directories?
Do:

du /var/tmp/*

What do you get?

(Just wondering how much junk is in your tmp directory.)

Also paste in a df -k

And you're definitely running as root (would have to be for pkgadd)?
Avatar of roduno

ASKER

# du /var/tmp/*
2       /var/tmp/caafxaacb
0       /var/tmp/stats10505.dtd
0       /var/tmp/stats10506.xml
Avatar of roduno

ASKER

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0      90079   49343   31729    61%    /
/dev/dsk/c0t0d0s6     798495  716033   26568    97%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
/dev/dsk/c0t0d0s3      32847    8622   20941    30%    /var
swap                  701000      16  700984     1%    /var/run
swap                  701008      24  700984     1%    /tmp
/dev/dsk/c0t0d0s5      26615    2133   21821     9%    /opt
/dev/dsk/c0t2d0s7    38476820       9 38092043     1%    /export/home0
/dev/dsk/c0t0d0s7    36827276  120234 36338770     1%    /export/home
/dev/dsk/c0t0d0s1     337815  218529   85505    72%    /usr/openwin
ASKER CERTIFIED SOLUTION
Avatar of john-at-7fff
john-at-7fff

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops -- on that last bit, you want rmdir /var/tmp then mkdir /var/tmp, etc.
Double oops: What I wrote orignally was right. Forgot it was a symbolic link!!
Avatar of roduno

ASKER

Thanks for the detailed info.  I am through for today so I will try this tomorrow or definitely over the weekend and I will get back and let you know how it goes.
Avatar of roduno

ASKER

Worked great!  Thanks a bunch!
#df -kh

increace the swap space