From owner-freebsd-questions@FreeBSD.ORG Wed May 28 00:49:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 487F437B404 for ; Wed, 28 May 2003 00:49:55 -0700 (PDT) Received: from cwe.compwest.com.au (compwest.com.au [202.72.147.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12AD943F3F for ; Wed, 28 May 2003 00:49:53 -0700 (PDT) (envelope-from paulh@bdug.org.au) Received: from ant.bdug.org.au (ant.parkview.compwest.com.au [202.72.147.43]) by cwe.compwest.com.au (8.12.6/8.11.6) with ESMTP id h4S7no9s003278 for ; Wed, 28 May 2003 15:49:50 +0800 (WST) (envelope-from paulh@bdug.org.au) Received: from wks (wks.bdug.org.au [192.168.0.2]) by ant.bdug.org.au (8.12.9/8.12.6) with SMTP id h4P81pTX015821 for ; Sun, 25 May 2003 16:01:52 +0800 (WST) (envelope-from paulh@bdug.org.au) From: "Paul Hamilton" To: "Freebsd-Questions" Date: Sun, 25 May 2003 16:02:31 +0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Subject: FW: simple way to mount a ramdisk? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2003 07:49:55 -0000 Well done Malcolm, and well written! Cheers, Paul Hamilton -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Malcolm Kay Sent: Sunday, 25 May 2003 12:00 PM To: Neo; freebsd-questions@freebsd.org Subject: Re: simple way to mount a ramdisk? On Sat, 24 May 2003 13:32, Neo wrote: > Hi, > > can anyone tell me please, how to "mount a mfs-filesystem for dummies"? > > My hdd is /dev/ad0 with two slices /dev/ad0s1a as / and /dev/ad0s1b as Does this mean you have the trees /usr, /var and /tmp all resident on /dev/ad0s1a ? > swap, the ramdisk (for example 8 megs in size) should become /ram. > Assuming you're running FBSD 4.x then: If /dev/md0c does not exist then # cd /dev # MAKEDEV md0 Next: # mkdir /ram Now follow the man page md(4): # disklabel -r -w md0 auto # newfs /dev/md0c # mount /dev/md0c /ram # chmod 1777 /ram Now: # df should show md0c mounted on /ram The capacity is set up when the kernel is compiled and is 20000 sectors of 512 bytes or about 10Mb. But empty sectors and sectors of uniform data don't consume real memory space. For automated installation on boot: The devices /dev/md0 and/dev/md0c should be permanent once created and so should /ram directory. You need to add somewhere in the start sequence: if [ -e /dev/md0 -a -e /dev/md0c ]; then disklabel -r -w md0 auto && \ newfs /dev/md0c && \ mount /dev/md0c /ram && \ chmod 1777 /ram fi This might be for example added to /etc/rc.local or created as such if it does not exist. Or better create a file /usr/local/etc/rc.d/ram.sh with the lines: #!/bin/sh if [ -e /dev/md0 -a -e /dev/md0c ]; then disklabel -r -w md0 auto && \ newfs /dev/md0c && \ mount /dev/md0c /ram && \ chmod 1777 /ram fi Make sure the file is set to executable: # chmod +x /usr/local/etc/rc.d/ram.sh (The file name must terminate in .sh) Malcolm _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"