From owner-freebsd-questions Thu Mar 22 6: 5:43 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 814FB37B718 for ; Thu, 22 Mar 2001 06:05:36 -0800 (PST) (envelope-from mwm@mired.org) Received: (qmail 28612 invoked by uid 100); 22 Mar 2001 14:05:35 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15034.1711.854344.618218@guru.mired.org> Date: Thu, 22 Mar 2001 08:05:35 -0600 To: "Steven D. Smith" Cc: questions@freebsd.org Subject: Re: ramdisks and mfs... In-Reply-To: <200103221401.JAA20150@gate1.health.state.ny.us> References: <200103221401.JAA20150@gate1.health.state.ny.us> X-Mailer: VM 6.89 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Steven D. Smith types: > Mike, exactly how do you create this 'ramdisk device'? I just add the line: /dev/da1s1b /tmp mfs rw,nosuid,-s=262144 0 0 to /etc/fstab, and the system does the rest. > Mike Meyer on 03/22/2001 08:57:14 AM > > To: Eric M Logan > cc: questions@freebsd.org (bcc: Steven D. Smith/HSB/ISHSG/DIVADMIN/DOH) > Subject: Re: ramdisks and mfs... > > > > Eric M Logan types: > > First, thanks for your quick reply. Just one last thing, actually two. Am I > > correct in assuming that a "pure" ramdisk from /dev/md* is faster than a > pseudo > > ramdisk backed by a swap partition? And, what's the point of the former since > it > > relies on a slow hd? Shouldn't the latter be the preferred way to do > ramdisks? > > A better way to see what's going on is that md allocates memory from > real, where mfs allocates it from virtual. A ramdisk on real memory > will be faster than one on virtual memory if the virtual memory is > actually paged out. When that happens, *something* has be page be > paged out. Allowing that something to be your ramdisk means you've > raised the threshhold before the system starts paging or thrashing, > which is a good thing. > > There are situations where having a small ramdisk that doesn't have > disk preallocated to it is an advantage (systems without swap, or > during installation, for instance). Even for typical workstation > usage, if you restrict the usage of /tmp to small things, it might be > useful. But I use /tmp for pretty much anything I don't plan on > keeping around (extracting tarballs or things sent in the mail, for > instance) and don't really want to limit it to the 10Meg the kernel > allows an md disk to be by default. > > > > Mike Meyer wrote: > > > > > Eric M Logan types: > > > > Is there a difference between /dev/md* and mounting a partition from > > > > swap. Let me elaborate. I have a swap partition mounted and I have > > > > /tmp mounted using the same address as that swap partition. Anything I > > > > put in /tmp will therefore be gone upon reboot. Is this what's > > > > considered a ramdisk in Freebsd? Or, is using /dev/md* mounted > > > > somewhere what's known as a ramdisk in FreeBSD? In Linux, it's the > > > > latter. Any help would be appreciated, thanks. > > > > > > I assume you're using mfs for /tmp. Yes, that qualifies as a ramdisk, > > > even though it's backed by swap. If you don't need the memory back, > > > it'll act just like a ramdisk. If you do need the memory for something > > > else, your data will be paged out to swap, and have to be read back > > > from disk. md isn't backed by swap, so the data is always in ram, > > > meaning the memory isn't usable by anything else. > > > > > > > > -- > > > Mike Meyer > http://www.mired.org/home/mwm/ > > > Independent WWW/Perforce/FreeBSD/Unix consultant, email for more > information. > > > > > > > > > -- > Mike Meyer http://www.mired.org/home/mwm/ > Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > > > > -- Mike Meyer http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message