Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.raspberry-pi > #10455

Re: When does a program write to the SD card

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.sys.raspberry-pi
Subject Re: When does a program write to the SD card
Date 2016-01-28 13:10 +0000
Organization A noiseless patient Spider
Message-ID <n8d407$be2$2@dont-email.me> (permalink)
References <v38iabtlq7oapgb1f4i523kbv3pojn826b@4ax.com>

Show all headers | View raw


On Wed, 27 Jan 2016 15:01:33 -0500, Jon wrote:

> I've read much about the SD card being a weak link reliability wise.
>
Whether this is a problem depends entirely on you and how you use the 
device.

If you always use reputable SD cards[*] and make a habit of doing any of 
the following:

- switching an RPi, satnav, PDA, etc. off without shutting it down
  correctly 

- taking the SD card out of a PC's reader without using the PC's 
  eject/unmount function and waiting for it to finish writing to the card
   

- pulling the SD card out of an RPi, satnav, PDA, etc. while its still
  running 

then you'll sooner or later you'll corrupt the card and it will be your 
fault. The degree of corruption can vary from a single damaged file, 
through needing to reformat the card all the way up to a totally borked 
card. It all depends on what the was being done to the card at the time:

- if the card was only being read, i.e. there are no incomplete or
  pending writes to it, then damage is unlikely.

- if a file was being written to or has unwritten data in OS buffers 
  then you may find that just that file is damaged 

- if a file was being extended, deleted, or its directory entry was being
  changed then you may need to repair or reformat the card

- all SD cards use wear levelling. This involves re-mapping its memory
  blocks to swap the content of seldom used blocks with heavily used ones
  and you don't know when an SD card is being remapped. However, if the
  card was being remapped when the device was powered off or the card was
  pulled out, then you may find the card is totally corrupted and can't
  even be reformatted. 

Bottom line: *ALWAYS* make sure the device was correctly shut down or the 
card has been ejected/unmounted before taking the SD card out of it.

I've been using SD cards for over 10 years in a variety of PDAs, satnavs, 
RPis and flight loggers. I have never had a corrupted SD card in that 
time but I'm careful to check that the card is unmounted or the device is 
properly shut down before I insert or remove a card.

[*] reputable cards are branded cards from suppliers who make the cards 
they sell, i.e. SanDisk, Samsung and Toshiba. Everybody else rebrands 
cards made by somebody else. Lexar (formerly Crucial) and Kingston may be 
OK but I won't touch noname cards or cards from other brands. 


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.sys.raspberry-pi | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

When does a program write to the SD card Jon - 2016-01-27 15:01 -0500
  Re: When does a program write to the SD card druck <news@druck.org.uk> - 2016-01-27 20:24 +0000
    Re: When does a program write to the SD card Jon - 2016-01-28 10:37 -0500
  Re: When does a program write to the SD card Anssi Saari <as@sci.fi> - 2016-01-28 10:23 +0200
  Re: When does a program write to the SD card Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-28 13:10 +0000
    When does a program write to the SD card removemefirst.Richard.Menedetter@f31.n310.z2.fidonet.org (Richard Menedetter) - 2016-01-28 14:32 +1200
      Re: When does a program write to the SD card Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-28 21:01 +0000
        When does a program write to the SD card removemefirst.Richard.Menedetter@f31.n310.z2.fidonet.org (Richard Menedetter) - 2016-01-29 01:40 +1200
          Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-01-29 09:45 +0000
            When does a program write to the SD card removemefirst.Richard.Menedetter@f31.n310.z2.fidonet.org (Richard Menedetter) - 2016-01-29 12:17 +1200
              Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-01-29 12:22 +0000
                Re: When does a program write to the SD card Dave Higton <dave@davehigton.me.uk> - 2016-01-29 14:52 +0000
                Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-01-29 15:34 +0000
                Re: When does a program write to the SD card druck <news@druck.org.uk> - 2016-02-04 23:52 +0000
                Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-02-05 00:37 +0000
                When does a program write to the SD card NOSPAM.Richard.Menedetter@f31.n310.z2.binkp.net (Richard Menedetter) - 2016-02-02 18:34 +1200
                Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-02-02 18:00 +0000
          Re: When does a program write to the SD card Martin Gregorie <martin@address-in-sig.invalid> - 2016-01-29 11:41 +0000
            When does a program write to the SD card NOSPAM.Richard.Menedetter@f31.n310.z2.binkp.net (Richard Menedetter) - 2016-02-02 18:29 +1200
        Re: When does a program write to the SD card "Dave Liquorice" <allsortsnotthisbit@howhill.com> - 2016-01-31 10:42 +0000
          Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-01-31 11:04 +0000
          Re: When does a program write to the SD card Ronald Pfeiffer <ronald.pfeiffer@gmx.de> - 2016-02-05 02:22 +0100
            Re: When does a program write to the SD card druck <news@druck.org.uk> - 2016-02-07 12:29 +0000
              Re: When does a program write to the SD card Rob Morley <nospam@ntlworld.com> - 2016-02-07 13:59 +0000
                Re: When does a program write to the SD card The Natural Philosopher <tnp@invalid.invalid> - 2016-02-07 14:10 +0000
                Re: When does a program write to the SD card druck <news@druck.org.uk> - 2016-02-07 16:00 +0000

csiph-web