From owner-freebsd-arm@FreeBSD.ORG Tue Jul 1 15:35:23 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D25B9A for ; Tue, 1 Jul 2014 15:35:23 +0000 (UTC) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D87CA2DFA for ; Tue, 1 Jul 2014 15:35:22 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id tp5so8247140ieb.36 for ; Tue, 01 Jul 2014 08:35:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=SWxdHsj8+YP6zmx4Z3eINWK18Lb1vd/0N9K4cB+gaTw=; b=LYFG2pIVaUtoGXZeYrmQ3Ckw/Pmzgwn8n/JmapZCxUMxrFQAd6/osGpRyabKu/2kl+ 4yvmOkE/zydtztyTPywj/hvbo78AmiaZErtnOE8mc8tORyoAiq6krvEHCULFhgoOq9PS 8G5WbUqqsiAEyRgI+RAj5I1H4pAhTueg8v/Xx3uI2x6boLF5vYyUx+JdGr2oG5jI+mpx gbeUqVGLPeuZyzYX3FYGQDl4eFXOQIMohmTOwahNpxzaWdFvA7TiN0TIOn5Ghnsdsgi6 4jYM3fip3xLlCFf5xNw/S/eSqsmhh66d5Z1tsZK4AnZwpSnS+4AHsqeWxKWEI9HOh0FX HwPw== X-Gm-Message-State: ALoCoQmtojVZwyu+G1yiDZyIsHJ5+RCGiEPWM9QOjtxiRZOxSJhGUYkIn7MnxJWGx4NUe38Soa8J X-Received: by 10.42.118.9 with SMTP id v9mr44705228icq.26.1404228916080; Tue, 01 Jul 2014 08:35:16 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id d4sm14797255igc.5.2014.07.01.08.35.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 08:35:15 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_6751D0A8-49EB-4125-B282-7935AE8F50C0"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? From: Warner Losh In-Reply-To: <201407010925.s619PHeT006679@mech-cluster241.men.bris.ac.uk> Date: Tue, 1 Jul 2014 09:35:29 -0600 Message-Id: References: <201407010925.s619PHeT006679@mech-cluster241.men.bris.ac.uk> To: mexas@bris.ac.uk X-Mailer: Apple Mail (2.1878.2) Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 15:35:23 -0000 --Apple-Mail=_6751D0A8-49EB-4125-B282-7935AE8F50C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jul 1, 2014, at 3:25 AM, Anton Shterenlikht wrote: > Why is it a good idea to mount /tmp and some var dirs on memory disks: >=20 > root@raspberry-pi:/usr/ports # df -m > Filesystem 1M-blocks Used Avail Capacity Mounted on > /dev/mmcsd0s2a 14694 777 12742 6% / > devfs 0 0 0 100% /dev > /dev/mmcsd0s1 16 3 13 20% /boot/msdos > /dev/md0 28 4 22 16% /tmp > /dev/md1 14 0 12 0% /var/log > /dev/md2 4 0 4 0% /var/tmp > root@raspberry-pi:/usr/ports #=20 >=20 > Is this about speed or power, or maybe space? >=20 > Can I not put all these dirs on sd card? >=20 > I'm new to arm, so maybe things are different > to other arches. It isn=92t so much about ARM as it is about SD cards. Each write to a = file causes wear and tear on the card. Each update of metadata likewise. = There are things that can be done (like enabling trim) that reduce the = wear and tear on the card, NAND flash only has so much life. Do you = really want to use it for data that=92s at best disposable? No. SD cards = these days are made from NAND that=92s lucky to get 3k separate writes = to it (or even worse: 500 in the case of TLC NAND). Given such a limited = resource, nanobsd, and others, use MD devices to eliminate that wear and = tear. It is the same rason there=92s no swap partition... Having said that, I=92ve run many development systems without doing = this. They work fine, but doing it in production has shown to result in = some SD cards (not all) breaking prematurely. Warner --Apple-Mail=_6751D0A8-49EB-4125-B282-7935AE8F50C0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTstVCAAoJEGwc0Sh9sBEA1fAP/05hPbwe8Nh03ZKbUoJTSIJV P23q8KXX0ocRKwT8AJedhpNqTWHFTkAzF0cIGLEiatxQnsRSAosVDisAxZNlqYxH uA417z6EWt68R9BnTBCFu5/UmagszH1i6KSWTXWmxR2e8ltGSqf4RgXRj9qzJKKo UhNOsHsoI29820kErS7oykCMBSL+EinVOs/HI6OGm4Lnnu3crUHTMdces+TMXTk9 oG4R7KLPWNDJTXBdPrNyJysVnrM94/GvG+/6C1qG8T2b30oLdOS8jj7OU3mtkYJv QHBsiz011LxZAsLXpCQcTZj0xb/SzJ1jdI3p8XlBAVNNsWtxcpARV+3HuO1fBfOJ Psxyv0urhIAOsRqSZ63bg/MWP0U+3p3nGCV/0z5xmZV6iiXpexertFj+1/WOyvU2 nxxmbvpNtplQLI5jJCSCdBhKVqO2risEOxetSgMFCHLUTPMZ2eMsIVWATPSO0fiI M1XqR7eKaLcpnJZZtk9Gc6zet1CfiwxeLQzR8Thd56pgQpt7k0+Lul99Lxq9qe4K GumOGLF3SOV+282K/XJMCu5eNl+90HA51X6HZ+Gkj9PSI+rFGNcqOyOmmbn8RHWV yOpaX43fqX75GtjYIBWhRE/wJpUa7V3wgHDjGBQYv1RwzwlLO+eaeRI0efvT3lfW hM/LVl5NvOVtZ5J3behQ =yh03 -----END PGP SIGNATURE----- --Apple-Mail=_6751D0A8-49EB-4125-B282-7935AE8F50C0--