# Why do I have two /tmp ?



## NightTripper (Oct 9, 2012)

```
# df -h
Filesystem                    Size    Used   Avail Capacity  Mounted on
/dev/da0p2                      4G    368M    3.3G    10%    /
devfs                         1.0k    1.0k      0B   100%    /dev
[color="Blue"]/dev/da0p5                      2G     16M    1.8G     1%    /tmp[/color]
/dev/da0p6                    7.9G    5.3G    1.9G    74%    /usr
/dev/da0p7                     88G    348M     81G     0%    /var
zpool1/noaaport-data          399G     55G    343G    14%    /var/noaaport/data
zpool0/noaaport-nbsp-spool     15G    3.3G     12G    21%    /var/noaaport/nbsp/spool
zpool0                         12G     31k     12G     0%    /zpool0
zpool1                        343G     31k    343G     0%    /zpool1
[color="blue"]/dev/md0                       19M     19M   -1.5M   108%    /tmp[/color]
```


----------



## NightTripper (Oct 9, 2012)

And there is no CD in the drive

Mark


----------



## OH (Oct 9, 2012)

Show us your /etc/fstab.

I've noticed that I'm able to accidentally mount a HD partition on a mountpoint where a malloc drive (what your md0 probably is) is already mounted. Yours seems to be the reverse case.


----------



## NightTripper (Oct 9, 2012)

```
file "/etc/fstab", 7 lines
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/da0p2      /               ufs     rw      1       1
/dev/da0p3      none            swap    sw      0       0
# /dev/da0p4    none            swap    sw      0       0
/dev/da0p5      /tmp            ufs     rw      2       2
/dev/da0p6      /usr            ufs     rw      2       2
/dev/da0p7      /var            ufs     rw      2       2
```


----------



## night (Oct 9, 2012)

I'm trying to install webmin.  But it bombs out after a few seconds.  Telling me that there is no room on /tmp??

Mark


----------



## OH (Oct 9, 2012)

I can't comment on webmin (never touched the stuff), but something is creating /dev/md0 (presumably allocating 20MB of RAM) and mounting it on /tmp.

If not from /etc/fstab this would be done using mdconfig(), either by hand or from a script. You'll have to search for uses of this program to find the culprit.


----------



## night (Oct 9, 2012)

It seems that webmin is creating the extra /tmp.  But why would it make it so small as to fail because of no space??

Mark


----------



## fender0107401 (Oct 10, 2012)

See md(4)


----------



## night (Oct 10, 2012)

```
noaaport# mdconfig -d -u 0
mdconfig: ioctl(/dev/mdctl): Device busy
noaaport#
```

How do I kill the memory drive?  Other resources on my system are confusing the memory /tmp with the system /tmp

Mark


----------



## OH (Oct 10, 2012)

First
`# umount /dev/md0`
only then
`# mdconfig -d -u 0`


----------



## night (Oct 10, 2012)

```
noaaport# umount /dev/md0
umount: unmount of /tmp failed: Device busy
noaaport#
```

Mark


----------



## OH (Oct 10, 2012)

Well, other than searching what's hogging your /tmp, the easiest would probably be to reboot and keep webmin on a tighter leash on your next attempt (did you ask the webmin people or the port maintainer why webmin is messing with /tmp?)


----------



## night (Oct 10, 2012)

> did you ask the webmin people or the port maintainer why webmin is messing with /tmp?


Yep, but the light is off over there?

I dislike rebooting if I don't have to.  But like you said.  Thius might be one of those times.

Mark


----------



## night (Oct 10, 2012)

Reboot complete.  But that drive is back??  I'll try to disable webmin and try again.

Mark


----------



## night (Oct 10, 2012)

Webmin is disabled but the memory drive is still there.  And it will not let me umount /dev/md0 it.

Any suggestions?

Mark


----------



## kpa (Oct 10, 2012)

Is the root filesystem or the filesystem for /tmp read-only by a chance?


----------



## night (Oct 10, 2012)

This memory disk is not read only.

Mark


----------



## t1066 (Oct 11, 2012)

Maybe you should check /etc/rc.conf. Mine has something like


```
tmpmfs="YES"
tmpsize="512M"
tmpmfs_flags="-m 0 -o async,noatime -S -p 1777"
```


----------



## night (Oct 11, 2012)

Only  tmpmfs="YES"

Mark


----------



## t1066 (Oct 11, 2012)

Set tmpmfs="NO" if you do not want to use mdmfs(8) on /tmp.


----------



## rjw (Oct 11, 2012)

You've (or a script) has mounted a memory device over /tmp.

To identify what memory device is configured:


```
mdconfig -l -v
```

Unmount the device:


```
umount /tmp
```

Destroy the memory device:


```
mdconfig -d -u 0
```


----------



## night (Oct 11, 2012)

It seems I put that CMD in the rc.conf file.  I did it as I was configuring a NOAAport server.  I was blindly parroting the instructions.  I hope I learned from this.

I emailed the creator of that software about this.  He told me to increase the size of the memory based tmp file to 512 meg  Everything works now.

Mark


----------



## wblock@ (Oct 11, 2012)

tmpfs(5) does not need a fixed size and does not tie up RAM unnecessarily.


----------



## night (Oct 13, 2012)

But the fact it is dynamic causes a little, and I mean little, loss in speed.  And speed is what the author is after.

Mark


----------



## wblock@ (Oct 13, 2012)

Sorry, I did not see a speed requirement.  tmpfs(5) can also be set to a fixed size.  Benchmarks between the two would be interesting.


----------

