# filesystem full



## balanga (Nov 16, 2017)

Every 11 minutes I get a msg on the system console saying:-

```
kernel: pid xxx (dd), uid 2 inumber 1525*** on /: filesystem full
```

df shows that rootfs is 103%!!! used

Looks like I need to do some housekeeping!! 

Where should I start?


----------



## aragats (Nov 16, 2017)

Use `du` to determine the largest directories, you can start from */*, using a simple filter helps much, for example:
	
	



```
du -sh /usr/local/* | sed -n /[0-9]G/p
1.4G   /usr/local/lib
1.0G   /usr/local/share
```
Then you can use *M* instead of *G* to get only _Megabytes_ prefix.[/code]


----------



## ShelLuser (Nov 16, 2017)

Next time you should probably also consider to split up your system in different filesystems, that way the system might survive such a fill up. For example, on my UFS systems I _always_ separate /home, /var, /usr, /usr/local and some others (depending on whether I use those or not) such as /usr/src (mainly so that I can mount it readonly) and /usr/doc.

This will ensure that whenever I overplay my hand by dumping too much data on my server (in /home) it won't affect the other parts of my system (because /var won't be affected the other services can still write their temp datafiles and/or logfiles).

I think this is an approach you should definitely consider using, even on a simple home server. Because it can help protect you against situations such as these.


----------



## PacketMan (Nov 16, 2017)

My primary home server has two disks - one for the OS and programs, and one for my media.  From time to time I do a `du -d1 -h`. The d1 drills down 1 level of folders. If you change that to d2 it will drill down two levels.  The more you drill down the longer it can take for the results to so.  The -d1 is a great way to get a high level view of the various folders.

OS disk is smaller, media disk is much much larger.


----------



## _martin (Nov 16, 2017)

There's more ways to skin a cat. You have problem at / so start there. You can do:

`cd / && du -smx * | sort -n`

And see where the most utilization is. You can repeat this with subdirectories and then their subdirectories. With bigger FS you can use 'g' instead of 'm'. 

As ShelLuser suggested it's good to split your directory structure in some way. There's no right way to do it, it depends on many factors and your needs.


----------

