/tmp, /var/log, /var/tmp as /dev/md - why?

Andreas Schwarz freebsd.asc at strcmp.org
Tue Jul 1 19:27:30 UTC 2014


On 01.07.14, Anton Shterenlikht wrote:

> Why is it a good idea to mount /tmp and some var dirs on memory disks:
>
> root at raspberry-pi:/usr/ports # df -m
> Filesystem     1M-blocks Used Avail Capacity  Mounted on
> /dev/mmcsd0s2a     14694  777 12742     6%    /
> devfs                  0    0     0   100%    /dev
> /dev/mmcsd0s1         16    3    13    20%    /boot/msdos
> /dev/md0              28    4    22    16%    /tmp
> /dev/md1              14    0    12     0%    /var/log
> /dev/md2               4    0     4     0%    /var/tmp
> root at raspberry-pi:/usr/ports # 
>
> Is this about speed or power, or maybe space?

Speed and speed, but I can't understand why using md here, there is already tmpfs, 
which optimzed for such cases (dynamic allocation, etc.).

root at pizelot:~ # df
Filesystem     1K-blocks    Used   Avail Capacity  Mounted on
/dev/mmcsd0s2a    983680   57252  847736     6%    /
devfs                  1       1       0   100%    /dev
/dev/mmcsd0s2d   8106716 3068708 4389472    41%    /usr
/dev/mmcsd0s2e   8106716  155976 7302204     2%    /var
/dev/mmcsd0s2f   8106716     236 7457944     0%    /home
tmpfs            1097160       4 1097156     0%    /tmp
tmpfs            1097160       4 1097156     0%    /var/tmp



Regards,
Andreas



More information about the freebsd-arm mailing list