From owner-freebsd-questions@FreeBSD.ORG Sat May 24 20:59:50 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 4DD2637B401 for ; Sat, 24 May 2003 20:59:50 -0700 (PDT) Received: from smtp0.adl1.internode.on.net (smtp0.adl1.internode.on.net [203.16.214.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 405E343F85 for ; Sat, 24 May 2003 20:59:47 -0700 (PDT) (envelope-from malcolm.kay@internode.on.net) Received: from beta.home (ppp1969.sa.padsl.internode.on.net [150.101.26.176]) h4P3xdMO073537; Sun, 25 May 2003 13:29:45 +0930 (CST) Content-Type: text/plain; charset="iso-8859-1" From: Malcolm Kay Organization: At home To: "Neo" , Date: Sun, 25 May 2003 13:29:39 +0930 User-Agent: KMail/1.4.3 References: <002701c321a9$52f16fd0$0400a8c0@NEUROMANCER> In-Reply-To: <002701c321a9$52f16fd0$0400a8c0@NEUROMANCER> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305251329.39197.malcolm.kay@internode.on.net> Subject: Re: 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: Sun, 25 May 2003 03:59:50 -0000 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=20 /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 =09# 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=20 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