From nobody Thu Jul 13 19:02:20 2023 X-Original-To: freebsd-embedded@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R23rg6PzLz4mb45 for ; Thu, 13 Jul 2023 19:02:27 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 4R23rg2Kwfz4MBd for ; Thu, 13 Jul 2023 19:02:27 +0000 (UTC) (envelope-from rb@gid.co.uk) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (moriarty.gid.co.uk [194.32.164.17]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id 36DJ2K27022521; Thu, 13 Jul 2023 20:02:20 +0100 (BST) (envelope-from rb@gid.co.uk) Content-Type: text/plain; charset=utf-8 List-Id: Dedicated and Embedded Systems List-Archive: https://lists.freebsd.org/archives/freebsd-embedded List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-embedded@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: SD card corruption From: Bob Bishop In-Reply-To: <709521ba-5719-5f80-10bf-1de05d99d5c1@sentex.net> Date: Thu, 13 Jul 2023 20:02:20 +0100 Cc: freebsd-embedded Content-Transfer-Encoding: quoted-printable Message-Id: References: <709521ba-5719-5f80-10bf-1de05d99d5c1@sentex.net> To: mike tancsa X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Rspamd-Queue-Id: 4R23rg2Kwfz4MBd X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:42831, ipnet:194.32.164.0/24, country:GB] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Hi, > On 13 Jul 2023, at 16:33, mike tancsa wrote: >=20 > TL;DR. We get batches of cards that suddenly fail with SD card wide = file corruption out of the blue. >=20 >=20 > A little background. We have APUs (PCEngines) in the field that work = REALLY well for reliability. However, the odd time that things go = south, its due to SD cards. I had a couple of devices last week fail = after about a year and when I got them back both had hundreds of fsck = errors. These are devices that stay mounted Read Only so there are no = writes to them. Even on the second partition of the nanobsd image which = was never mounted had many fsck errors. Normally we use SanDisk but had = to switch to some PNY due to supply chain issues. The PNY seem to be = more failure prone than the SanDisk, but we do get the odd SanDisk too = with the same pathology. >=20 > Once I get the bad SD card back, I can newfs it and all is fine. e.g. = I can fill the disk with 16GB of /dev/urandom files and the hashes all = match over time. >=20 > Is it just bad hardware / bad luck that is causing these seemingly = catastrophic failures or are there things that should be done in the = field to extend the life of SD cards ? What=E2=80=99s the environment like? SD cards really don=E2=80=99t like = being run hot for instance. Are there radios or other electrical noise = nearby? > Is there any way to predict these failures in advance ? >=20 > If I newfs -E (does the -E make a difference?) the unused partition = and then re-write it with the live image and then boot to the new = partition, does that buy my any longevity ? >=20 > ---Mike >=20 >=20 -- Bob Bishop rb@gid.co.uk