Solved

Disk space

Posted on 2009-05-14
13
457 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
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 40

Expert Comment

by:omarfarid
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
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
Comment Utility
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
Comment Utility
you should be able to see other big files. Did you look under /var/adm for messages* files?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 9

Author Comment

by:michofreiha
Comment Utility
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
Comment Utility
can you show the output of

du -k / | sort -rn
0
 
LVL 9

Author Comment

by:michofreiha
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

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

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

771 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

10 Experts available now in Live!

Get 1:1 Help Now