Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2016 00:36:38 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Erich Dollansky <erich@alogt.com>
Cc:        bob prohaska <fbsd@www.zefox.net>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>,  Ian Lepore <ian@freebsd.org>
Subject:   Re: Effect of partitioning on wear-leveling
Message-ID:  <CANCZdfphByqtV8DvfMu5BWrW63rvKX4AT=7WxDkh_ERvMOwuCw@mail.gmail.com>
In-Reply-To: <20160322141432.3f0a3a61@X220.alogt.com>
References:  <20160321175952.GA83908@www.zefox.net> <1458586884.68920.96.camel@freebsd.org> <20160321221153.GB83908@www.zefox.net> <20160322141432.3f0a3a61@X220.alogt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 22, 2016 at 12:14 AM, Erich Dollansky <erich@alogt.com> wrote:

> Hi,
>
> On Mon, 21 Mar 2016 15:11:53 -0700
> bob prohaska <fbsd@www.zefox.net> wrote:
>
> > On Mon, Mar 21, 2016 at 01:01:24PM -0600, Ian Lepore wrote:
> > >
> > > Freebsd does no wear-leveling, it's up to the microcontrollers
> > > within the storage devices to do that.
> > >
> > > Those controllers have no notion of partitioning or filesystem
> > > layout and do whatever they want to do internally about wear
> > > leveling.  That leads to the mildly disturbing situation of having
> > > blocks from a readonly filesystem and blocks from a writable
> > > filesystem sharing the same flash erase-block inside the device.
> > > One likes to think of the data in a readonly filesystem as safely
> > > protected from the read-modify -write activity that happens at the
> > > flash erase-block level, but no such g'tee is made on any mmc, sd,
> > > or usb flash-based devices I know of.
> > >
> > > - Ian
> > >
> > Ok, thanks. It sounds like /var and /tmp could be confined to
> > limited-size partitions while still permitting wear leveling to use
> > other, less-used parts of the device. So, if a block nominally
> > in /var reaches end of life can the wear leveling controller start
> > stashing data anywhere on the device?
> >
> > As a practical matter, should I even be worrying about this? Folks
> > once made a big deal of partitioning storage so a runaway process
> > couldn't choke the whole machine. Is the precaution still worth
> > taking on ARM?
> >
> we use memory disk for /var and /tmp. If you really need the content of
> these directories, you could write them back to flash by a script every
> hour or so and save all the writes between.
>
> Do not forget the flash devices used in Raspberries & Co. cannot be
> compared with the flash devices used in flash disk.


Raspberries don't have flash. :)

SD cards generally use similar NAND to consumer grade SSDs, but have
firmware optimized for the digital camera market. There are some
differences,
but the chips are basically the same under the hood. Many of the
optimizations
trade off speed for longevity differently between SSDs and SD cards. NVME
adds a new layer of fun to all this, but even there tweaks to the different
program
and erase algorithms are extensive.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfphByqtV8DvfMu5BWrW63rvKX4AT=7WxDkh_ERvMOwuCw>