?
Solved

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

Posted on 2004-04-15
11
Medium Priority
?
436 Views
Last Modified: 2013-12-27
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?

0
Comment
Question by:roduno
  • 5
  • 5
11 Comments
 
LVL 4

Expert Comment

by:john-at-7fff
ID: 10838790
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
0
 

Author Comment

by:roduno
ID: 10838828
Good information but can you give me an example of how I would symbolically link the different directories?
0
 
LVL 4

Expert Comment

by:john-at-7fff
ID: 10838844
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)?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:roduno
ID: 10838862
# du /var/tmp/*
2       /var/tmp/caafxaacb
0       /var/tmp/stats10505.dtd
0       /var/tmp/stats10506.xml
0
 

Author Comment

by:roduno
ID: 10838865
# 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
0
 
LVL 4

Accepted Solution

by:
john-at-7fff earned 1000 total points
ID: 10838973
OK. I would recommend that you read the documentation for ln -s before doing this.

Your big filesystem is /dev/dsk/c0t0d0s7 (mounted on /export/home0)
Unfortunately, you have a small filesystem (/dev/dsk/c0t0d0s3) mounted on /var

Make a new tmp directory on /export/home0:

    mkdir /export/home0/mytmp

Then remove /var/tmp and everything underneath it:

    rm -R /var/tmp

Then create a symbolic link so that /var/tmp is actually over at your new /export/home0/mytmp:

    ln -s /export/home0/mytmp /var/tmp

Now check your work:

do

     ls -l /var

You should see a line like this:

lrwxrwxrwx   1 root     other         18 Apr 16 23:11 tmp -> /export/home0/mytmp

Now try your pkgadd.

To get rid of the symbolic link and get things back to the original:

rm /var/tmp
mkdir /var/tmp
ls -l /var

GOOD LUCK.
0
 
LVL 4

Expert Comment

by:john-at-7fff
ID: 10838981
Oops -- on that last bit, you want rmdir /var/tmp then mkdir /var/tmp, etc.
0
 
LVL 4

Expert Comment

by:john-at-7fff
ID: 10838983
Double oops: What I wrote orignally was right. Forgot it was a symbolic link!!
0
 

Author Comment

by:roduno
ID: 10839005
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.
0
 

Author Comment

by:roduno
ID: 10851266
Worked great!  Thanks a bunch!
0
 
LVL 1

Expert Comment

by:laxmicanth
ID: 10884248
#df -kh

increace the swap space
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question