From owner-freebsd-arm@FreeBSD.ORG Wed Jul 2 08:33:04 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99D1EF1 for ; Wed, 2 Jul 2014 08:33:04 +0000 (UTC) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA8F72821 for ; Wed, 2 Jul 2014 08:33:03 +0000 (UTC) Received: from mail-we0-f174.google.com ([74.125.82.174]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKU7PDt9JnYFJWrXxMX9nJdPdVBM+NA4dy@postini.com; Wed, 02 Jul 2014 08:33:04 UTC Received: by mail-we0-f174.google.com with SMTP id u57so10954673wes.19 for ; Wed, 02 Jul 2014 01:32:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:message-id:to:subject:cc:reply-to :in-reply-to; bh=4Dj3AuuQ5C6JftnZ8D8fGZoTPJzx1qXTKIeQzKYrwzA=; b=BVS0ZlFxbE9zuO5E/mzaM25KCRU4zK3QMq9MJFPvKjXUSeECm4dVgYJPHONs9zRoRK suSQjYx3mqZnI7kLMikA+TfHqV2Moff2b+vbPw4upvb4JyeaFaLzscVquNhgAA7/kFmZ oBdOiL0z4MPKlRXU8o1koJQB7DmGhbmiziE9me9ymuDXOqhmLp986DIZH7R9kkaG25FV 1+SgxUAdFUAp7PeyjlCkotd49oNA+wh1fG1mMhrs+cL6Zk0SDcc9Swr36nWFBJ96NnVj aqNZRvBujYejeO2198QC9naf28SIKf7b5+KHSnnD/X5kXVWDsykwpIh3iitFxrW6ZtEr LZig== X-Gm-Message-State: ALoCoQmR2P2uxEhlKqMl/SvDa3nBmh5Hi3V9tbBPo7x2lazYlu+wNQsIZwOkYT38g/GDmN9pGJJ8U5nCDraseYeJ6DLA/WNU9jTEjZyUHpa9MCyvyxBsnejXHolJsgngyZ/44rnu7fWZ X-Received: by 10.194.190.78 with SMTP id go14mr1242052wjc.128.1404289975837; Wed, 02 Jul 2014 01:32:55 -0700 (PDT) X-Received: by 10.194.190.78 with SMTP id go14mr1242001wjc.128.1404289975287; Wed, 02 Jul 2014 01:32:55 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (mech-cluster241.men.bris.ac.uk. [137.222.187.241]) by mx.google.com with ESMTPSA id cz4sm52625102wib.23.2014.07.02.01.32.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jul 2014 01:32:54 -0700 (PDT) Received: from mech-cluster241.men.bris.ac.uk (localhost [127.0.0.1]) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8) with ESMTP id s628Wrta014904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Jul 2014 09:32:53 +0100 (BST) (envelope-from mexas@mech-cluster241.men.bris.ac.uk) Received: (from mexas@localhost) by mech-cluster241.men.bris.ac.uk (8.14.8/8.14.8/Submit) id s628WqWE014903; Wed, 2 Jul 2014 09:32:52 +0100 (BST) (envelope-from mexas) Date: Wed, 2 Jul 2014 09:32:52 +0100 (BST) From: Anton Shterenlikht Message-Id: <201407020832.s628WqWE014903@mech-cluster241.men.bris.ac.uk> To: imp@bsdimp.com, mexas@bris.ac.uk Subject: Re: /tmp, /var/log, /var/tmp as /dev/md - why? Reply-To: mexas@bris.ac.uk In-Reply-To: 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: Wed, 02 Jul 2014 08:33:04 -0000 >From imp@bsdimp.com Tue Jul 1 18:09:59 2014 > >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 Wow, thank you! I knew nothing about sd cards, so this is very helpful. So, if I need to build kernel, world and ports often, sd card is a poor choice? I better use an external disk? What I really want to find out is whether I can have a dumb graphical terminal from Rpi-B. Thanks Anton