Solved

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

Posted on 2004-04-15
11
423 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 4

Accepted Solution

by:
john-at-7fff earned 250 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now