From owner-freebsd-arm@FreeBSD.ORG Sat May 31 17:31:54 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 B1CB36CA; Sat, 31 May 2014 17:31:54 +0000 (UTC) Received: from mail-qg0-x234.google.com (mail-qg0-x234.google.com [IPv6:2607:f8b0:400d:c04::234]) (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 60F702A93; Sat, 31 May 2014 17:31:54 +0000 (UTC) Received: by mail-qg0-f52.google.com with SMTP id a108so8342164qge.39 for ; Sat, 31 May 2014 10:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=exuqowdlGr465K1O/krT3AxU57s+u8xk3buEKC/Hyjo=; b=tgVnq/MitWTLCi4yK/E/JvooLwp+Mz1Py391SVgFsb48ZTNowrouU7eEfvil1qFnLM Zn3WAo2ufcZvqvHKscHdMh+oZSqfI4/lIxUpXgfRnu1WAz2oE07UxqED67ezWdDalR+/ Bi0xoJy7c8BjD5SwkS/b3W8DUAlvILpmDds3d3nM6CJJtjzUAnudLg2H+nOneyV/x/sQ nkQBilk6LjByI46ZQm9Xwmr6GGMPDDo7UN+PkZAoVGsyMG9TKn/qaPRdfNDu+zFKi75O UBX8yy1VFp40NnDH3+9JiVYPsD5Hq33SRTSnAht/L0vvlDIek2U6fz6FzYSHi23p3vpc g07A== MIME-Version: 1.0 X-Received: by 10.140.96.51 with SMTP id j48mr31425501qge.24.1401557513482; Sat, 31 May 2014 10:31:53 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Sat, 31 May 2014 10:31:53 -0700 (PDT) In-Reply-To: <05005B04-1BDA-4242-946B-28D0DA069A42@bsdimp.com> References: <20140531004306.GI26883@cicely7.cicely.de> <1401505209.20883.34.camel@revolution.hippie.lan> <20140531102305.GK26883@cicely7.cicely.de> <05005B04-1BDA-4242-946B-28D0DA069A42@bsdimp.com> Date: Sat, 31 May 2014 10:31:53 -0700 X-Google-Sender-Auth: 1pKb3avuM_yXL3BvDybGC2Ydrss Message-ID: Subject: Re: TRIM on SD cards From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-arm@freebsd.org" , Bernd Walter , ticso@cicely.de, Ian Lepore 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: Sat, 31 May 2014 17:31:54 -0000 On 31 May 2014 09:45, Warner Losh wrote: > One of the things that I did for images years ago was compressed tar file= s. There was so much variation between CF makers and at the time CF geometr= y was important to the BIOS, so we made our images as tar balls. We then ha= d a makefile target that would create a partition on the card that was actu= ally there, put boot blocks on it then extract the tarball=E2=80=A6 I neve= r have liked DD for creating images, even when LBAs ruled the day because y= ou=E2=80=99d always have to grow/shrink the FS afterwards. The only advanta= ge it had was it was easy=E2=80=A6 Perhaps it is time to go back to that mo= del? The alternative that wouldn=E2=80=99t suck too bad would be to create = variable sized images based on how much data was actually present and ensur= e there are no holes (or minimal holes) in the filesystem. > > Hmmm, if we know WHAT filesystem we=E2=80=99re dealing with, then we coul= d perhaps enhance fsck and/or growfs to BIO_DELETE all the blocks that it k= nows are free, which would be a useful, data-driven approach that could ens= ure we start out with a nicely trimmed FS. Given the vagaries of the differ= ent kinds of TRIMs and the various translation layers we have, that might b= e the most robust. Having makefs spit this out would be rather useful. -a