# The /usr partition



## ccc (Mar 26, 2012)

*H*i,

According to:

http://www.freebsdwiki.net/index.php/Hard_Disk_Partition_Sizes



> The /usr partition contains a few major sections. There are a few approaches to this section. One is to give it it's own largish partition. *Second - and absolutely not recommended - is to lump it into the main / partition* (and either move the ports tree or watch its size carefully).



Why is it not recommended to lump it into the main / partition? One of my *F*reeBSD systems is running without a separate /usr partition, should I change this?


----------



## frijsdijk (Mar 26, 2012)

The bsdinstaller in 9.0 by default will create just one big / .. so it's not a very hard no-go, but in BSD-land, sysadmins like to create partitions to minimize the risk of filling it > 100% (remember that by default, /tmp will come from /usr/tmp). Also, packages you install will go to /usr(/local). You don't want that taking space from your /.


----------



## ccc (Mar 26, 2012)

Thanks, I have the following:
	
	



```
# cat /etc/fstab

# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s2b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s3d             /tmp            ufs     rw              2       2
/dev/ad0s4d             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
linproc                 /compat/linux/proc/  linprocfs  rw      0       0
```


```
# df -m
Filesystem  1M-blocks Used Avail Capacity  Mounted on
/dev/ad0s1a     24207 5355 16915    24%    /
devfs               0    0     0   100%    /dev
/dev/ad0s3d       964    0   887     0%    /tmp
/dev/ad0s4d      9823  251  8786     3%    /var
linprocfs           0    0     0   100%    /usr/compat/linux/proc
```
Should I change something to prevent problems in the future, or just leave like this?


----------



## frijsdijk (Mar 26, 2012)

Looks like you have plenty of space left in /. I'd probably not change it. But if it's a critical server, I would prefer to partition, something like:


```
/    1GB
/usr 15GB
```

.. that's more or less always the same. You could then decide to even slice-up /tmp and /var/tmp (I do), each 5GB or so. How much you need in /var depends on how much logging your machine produces, and how much you decide to keep. Or is it a big database server (mysql stores in /var/db/mysql by default)? Is it a mailserver with a huge mailspool? All go into /var.

Keeping / small minimizes the risk of that partition becoming damaged, so the system can at least always boot. But never make it smaller than 1GB. If you run freebsd-update and get a new kernel, the old and new together can consume up to 400-500 MB.


----------



## wblock@ (Mar 26, 2012)

Just added a correction to http://forums.freebsd.org/showthread.php?t=30549, please see that first.

The fstab shown in post #3 above is very wrong, don't use it.  All those slice numbers should be the same, because all of the partitions (a-f) are on the same slice, slice 1.


----------

