Date: Sat, 17 Nov 2012 15:20:59 -0700 From: Gary Aitken <freebsd@dreamchaser.org> To: Warren Block <wblock@wonkity.com> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: 9.0 crash, ssd or filesystem problem? Message-ID: <50A80DCB.7030500@dreamchaser.org> In-Reply-To: <alpine.BSF.2.00.1211171352510.9337@wonkity.com> References: <50A53FF1.7050806@dreamchaser.org> <alpine.BSF.2.00.1211151550050.66706@wonkity.com> <50A602AB.2060307@dreamchaser.org> <alpine.BSF.2.00.1211160746190.74281@wonkity.com> <50A66659.5040406@dreamchaser.org> <alpine.BSF.2.00.1211161142300.76158@wonkity.com> <50A6FFC0.3050902@dreamchaser.org> <alpine.BSF.2.00.1211162119450.2013@wonkity.com> <50A7EE9B.4070003@dreamchaser.org> <alpine.BSF.2.00.1211171352510.9337@wonkity.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11/17/12 14:08, Warren Block wrote:
> On Sat, 17 Nov 2012, Gary Aitken wrote:
>
>> On 11/16/12 21:38, Warren Block wrote:
>>> On Fri, 16 Nov 2012, Gary Aitken wrote:
>>>
>>>> On 11/16/12 12:10, Warren Block wrote:
>>>>
>>>>> Additional SSD suggestions: when creating partitions, leave out the swap
>>>>> partition. If you have lots of memory, leave out the /tmp partition. Add
>>>>> that extra space to the /usr partition.
>>>>>
>>>>> Format the UFS filesystems with -Ut, for soft updates and TRIM support.
>>>>> (Make sure your SSD supports TRIM, almost all do.) (I don't use soft
>>>>> updates journaling.)
>>>>>
>>>>> Use dd(1) to make a zero-filled file on /usr somewhere, say /usr/swap.
>>>>> Make it the size you want swap to be, and do not make it a sparse file.
>>>>> Tell the system to use the swapfile in /etc/rc.conf:
>>>>>
>>>>> swapfile="/usr/swap"
>>>>>
>>>>> Use tmpfs for /tmp in /etc/fstab:
>>>>>
>>>>> tmpfs /tmp tmpfs rw,mode=01777 0 0
>>
>> When using the above in /etc/fstab to establish a tmp file,
>> how does the size of /tmp get established?
>> Is it limited only by the available swap,
>> or is it possible to put an upper bound on it that is smaller than swap?
>
> It's free VM, which should be available RAM plus available swap. Yes, you can easily limit the maximum size:
>
> tmpfs /tmp tmpfs rw,mode=01777,size=1073741824 0 0
>
> Untested, but I think that's correct.
Where is that documented?
I tried:
man mount
man fstab
refers to "See the options flag (-o) in the mount(8) page and the
file system specific page, such as mount_nfs(8)..."
man mount_tmpfs (doesn't exist)
and don't see a "size" option anywhere.
oh... there it is
man tmpfs
> There was a nice Sun white paper by Peter Snyder on tmpfs. It's linked on the Wikipedia tmpfs page, but Oracle has broken the link. Google has a rendered version of a PostScript copy (long URL):
> http://webcache.googleusercontent.com/search?q=cache:EXMeqvhFfrsJ:www.sun3arc.org/papers/OS/tmpfs_virtual_memory_filesystem.ps.gz+tmpfs+white+paper&cd=12&hl=en&ct=clnk&gl=us
Thanks.
Interesting, I would have thought swap space for something in a tmpfs was
not allocated until it needed to be swapped out. As I read it, used tmpfs
space reserves space in swap.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50A80DCB.7030500>
