Solved

Disk space

Posted on 2009-05-14
13
473 Views
Last Modified: 2013-12-27
Hi all,
I have a SUN Solaris machine with the below specification regarding disk space...
bash-3.00# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0      6.5G   6.2G   170M    98%    /
/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                   968M   1.4M   967M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
                       6.5G   6.2G   170M    98%    /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                       6.5G   6.2G   170M    98%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   967M   552K   967M     1%    /tmp
swap                   967M    40K   967M     1%    /var/run
/dev/dsk/c1t0d0s7       60G    10G    50G    18%    /export/home

As you can see i have a problem on the / partition and need to free some space from it...I would like to ask please about how I can list all files in that partition ordered by size in order to delete them

Regards
0
Comment
Question by:michofreiha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 24388937
check under /var dir for logs that are too big

cd /var
du -k . | sort -rn

this could be done from / as well
0
 
LVL 38

Expert Comment

by:yuzh
ID: 24391508
I would use:
du -sk * | sort -nr
under / and /var
to check it out, as omarfarid alread point out, it could be the logs are too big. also you need to check /var/mail to see if the mail boxes are growing too big as well.
0
 
LVL 9

Author Comment

by:michofreiha
ID: 24392898
Dear Sir,

I found out a file under /var/mail that is taking a lot of space as you can see below:

ls -lrt
total 21842
drwxrwxr-x   2 root     mail         512 Dec 19 10:00 :saved
-rw-rw----   1 root     mail     11166522 May 15 07:05 root

Please let me know if i can remove and create this file again and how I can do that?

Regards
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 38

Expert Comment

by:yuzh
ID: 24393411
if you don't want to keep the email for root, you can login as root (or su as root) and do:
cat /dev/null > /var/mail/root
to get rid of all the emails for root.
PS: the mail box is not that big
have a look at /var/crash/<yourhostname> to see if any crash file in there, you can delete them.
also have a look at my answer in http:Q_20378148.html to see if you can free up more space.
Have a nice weekend!
0
 
LVL 9

Author Comment

by:michofreiha
ID: 24393517
I did everything you asked me to do...I have only win some MB...I need to free more
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24393910
you should be able to see other big files. Did you look under /var/adm for messages* files?
0
 
LVL 9

Author Comment

by:michofreiha
ID: 24393961
Dear Sir,

please find below folders under /var/adm:

ls -lrt
total 264
-rw-rw-rw-   1 root     bin            0 Aug 25  2008 spellhist
-rw-------   1 uucp     bin            0 Aug 25  2008 aculog
drwxr-xr-x   2 adm      adm          512 Dec 19 10:00 exacct
drwxr-xr-x   2 adm      adm          512 Dec 19 10:00 log
drwxr-xr-x   2 root     sys          512 Dec 19 10:00 streams
drwxr-xr-x   2 root     sys          512 Dec 19 10:02 pool
drwxr-xr-x   2 root     sys          512 Dec 19 10:07 sm.bin
drwxrwxr-x   5 adm      adm          512 Dec 19 10:56 acct
drwxrwxr-x   2 adm      sys          512 Dec 19 10:56 sa
-rw-r--r--   1 root     root           0 Dec 19 11:15 vold.log
-rw-r--r--   1 root     root         423 Apr 14 09:16 messages.3
-rw-r--r--   1 root     root         792 Apr 23 13:00 messages.2
-rw-r--r--   1 root     root         282 May  3 10:04 messages.1
-rw-r--r--   1 root     root         996 May 10 16:00 messages.0
-rw-------   1 root     root        1393 May 14 14:29 sulog
-rw-r--r--   1 root     root           0 May 15 09:07 messages
-r--r--r--   1 root     root        2828 May 15 09:11 lastlog
-rw-r--r--   1 root     bin         4092 May 15 10:32 utmpx
-rw-r--r--   1 adm      adm       103044 May 15 10:32 wtmpx

Thanks
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24394006
can you show the output of

du -k / | sort -rn
0
 
LVL 9

Author Comment

by:michofreiha
ID: 24394458
Dear Sir,

Please find attached a file that contains the size for all my file system

Regards
FIle-Size.txt
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24394864
what do you have under /export/home/var ? it has 7.4 GB

7487651      /export/home/var

look for files that you can delete

Also look at xport/home/var/mya2billing , it has 2GB

2167449      /export/home/var/mya2billing
0
 
LVL 9

Author Comment

by:michofreiha
ID: 24395120
Dear omarfarid,
Files under /export/home/var are MySQL database files...I do not have a disk problem on this partition...The only issue that i have is on / as you can se below...I just still have 176MB free

Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c1t0d0s0      6.5G   6.2G   175M    98%    /
/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                   901M   1.4M   899M     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
/platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1
                       6.5G   6.2G   175M    98%    /platform/sun4u-us3/lib/libc_psr.so.1
/platform/sun4u-us3/lib/sparcv9/libc_psr/libc_psr_hwcap1.so.1
                       6.5G   6.2G   175M    98%    /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   900M    56K   899M     1%    /tmp
swap                   900M    40K   899M     1%    /var/run
/dev/dsk/c1t0d0s7       60G   9.7G    50G    17%    /export/home
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 250 total points
ID: 24395353
can you run the command below and post output

du -kd / | sort -rn
0
 
LVL 13

Assisted Solution

by:Rowley
Rowley earned 250 total points
ID: 24426958
Check /var/core for core dumps. You've really not left yourself much room to manouvre with that diddy root fs. I've always found "du -sh *" (the h for human readable) and piping to sort as mentioned above to be handy.

Clear any logs you might not need or want in /var/log and /var/adm and also any dead mail or crap in /var/spool. If you're really desperate, tune the root fs minfree value to use less than 10% (http://www.informit.com/articles/article.aspx?p=23960) or consider copying something like /opt or /usr/local across to another filesystem and mount or at dirtiest, symlink.

cd usr
find local -print | cpio -pdumv /export/home/
rm -rf /usr/local
ln -s /export/home/local local

and so on.
hth.
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…

717 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