Can i use tmpfs to mount /tmp ?

Matthew Seaman m.seaman at
Sun Sep 5 08:14:08 UTC 2010

On 05/09/2010 07:09:50, zaxis wrote:
> The /dev/ad4s3e is used for /tmp. Now i want to use tmpfs instead of ufs as
> below
> none /tmp tmpfs size=64M,nodev,nosuid,noexec 0 0
> If i can, then how to reuse the space of /dev/ad4s3e ?

There are two choices.

Either mount your ad4s3e partition somewhere else as a regular
filesystem -- you can move the mount point simply by unmounting it,
editing fstab and then mounting the new partition.  Do that before
mounting your new tmpfs based /tmp, or you'll block access to the whole
filesystem on ad4s3e.  Oh, and 'chmod 755 /new/mountpoint' after you
move it -- you don't want the /tmp defaults of mode 1777 on a normal

Or amalgamate the ad4s3e partition with one of the partitions
neighbouring it on the drive.  Use bsdlabel(8) to examine and modify the
disk-level layout.  If you join ad4s3e on to the end of the preceeding
partition, you can use growfs(8) to expand that partition into the extra
space.  Otherwise you'll have to newfs(8) the expanded partition and
recover the contents from backup.  Either way, this sort of partition
wrangling operation involves low-level fiddling in the guts of the OS
and an enhanced potential for things to go horribly wrong, so make sure
you've got good backups and spend some time planning exactly what you
are going to do, even down to the extent of writing out all the commands
you'll need beforehand.



PS.  64MB is pretty small for a /tmp -- you might want to increase the
size of your tmpfs.

Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID: matthew at               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url :

More information about the freebsd-questions mailing list