# /usr full



## janroc (Apr 15, 2009)

Hi all,

FreeBSD 7.1-RELEASE-p4

I have problem that /usr is full.
It seem to be the /usr/lib that is the problem.

Any sugestion for a cleanup?

Jan


----------



## mfaridi (Apr 15, 2009)

put in here output of 

df -h


----------



## janroc (Apr 15, 2009)

I have cleanup some files.


```
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/da0s1a    496M    391M     65M    86%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/da0s1e    496M     12K    456M     0%    /tmp
/dev/da0s1f    9.0G    7.6G    648M    92%    /usr
/dev/da0s1d    1.2G    295M    830M    26%    /var
```


----------



## mfaridi (Apr 15, 2009)

janroc said:
			
		

> I have cleanup some files.
> 
> Filesystem     Size    Used   Avail Capacity  Mounted on
> /dev/da0s1a    496M    391M     65M    86%    /
> ...



check your home directory


----------



## ale (Apr 15, 2009)

If you have ports-mgmt/portupgrade installed, you can run portsclean -CDiLP to delete obsolete distfiles, libraries and eventually built packages.
You can also try sysutils/libchk to spot unreferenced libraries.
And ports-mgmt/pkg_cutleaves will list leaves packages, so you may check if there is something you are not using and that you can delete.


----------



## janroc (Apr 15, 2009)

mfaridi said:
			
		

> check your home directory



I dont use home.


----------



## tangram (Apr 15, 2009)

You first need to know where those gigas are being spent. Run the following:


```
# cd /usr
# du -h -d 1
```

This will print with one depth the size of directories in /usr.


----------



## janroc (Apr 15, 2009)

tangram said:
			
		

> You first need to know where those gigas are being spent. Run the following:
> 
> 
> ```
> ...




Nice command thank you.
1Gb free now.


----------



## graudeejs (Apr 15, 2009)

to delete distfiles

```
cd /usr/ports/distfiles
rm -R *
```
you can delete obj files if you have recompiled system from sources

```
cd /usr/obj
chflags -R 0 *
rm -R *
```

also you can clean ports (in case you for got to do that)

```
cd /usr/ports
make clean
```

if that is not enough you can remove /usr/src, if you don't need it

```
rm -R /usr/src
```



If you want to increase partition size make backups change size and restore from backups

How to backup and restore:
http://forums.freebsd.org/showthread.php?t=185

Simple way to make gpt partitions (i like pgt, i really do)
http://forums.freebsd.org/showthread.php?t=1305

and if you want i can explain how to use bsdlabel to change partition size in old fashion, but I don't know how to use fdisk.
I really hate FreeBSD fdisk utility


----------



## hydra (Apr 15, 2009)

sysutils/ncdu is a handy tool, install it and:
ncdu /usr

it will show you the dirs that occupy the most space


----------



## janroc (Apr 16, 2009)

*[solved]*

[SOLVED]

Thank you

Jan


----------



## ranggadablues (Jul 8, 2010)

to janroc

please tell me how you to solved it?


----------

