We have moved to a new Sailfish OS Forum. Please start new discussions there.
6

signs of a dying sd-card in jolla phone [not a question]

asked 2016-05-07 14:57:29 +0300

misc11 gravatar image

so yesterday my sd-card died, which isnt so bad because no important data was there. but here are the sign of the last 2 weeks that should have given me a hint:

  • note: im used to experiencing a lot of weird behavior from my phone... so im only mentioning things here that are unusual and that i connect to the card. i may update in the future.

  • 2 weeks ago: while listening to podcasts (file on sd-card) the playback would stop. the cover of media-app whould show a watermark of the app icon. open app would show the playback paused. when hitting play again it would start from the beginning.

  • 1 week ago: playback issues happen way more often. lets say once an hour. file browser would not find files / sd-card anymore (i just restarted - i guess i could have remounted or reinserted the sd-card too). also weird behavior when deleting files: they would still be listed but tapping them in file browser would show "files doesnt exist".

  • 2 days ago: audio becomes unusable. issues every 2-3 minutes.

  • death: of course sd-card cant be found, more interestingly though all my ringtones were saved on sd-card - so now instead of switching to other sounds, the phone would just be quiet (no alarms, no ringtones)

i hope this helps somebody... save your data!

ps: also if feel free to add your experience

additional info: 32gb fat32

edit retag flag offensive reopen delete

The question has been closed for the following reason "not a real question" by misc11
close date 2016-09-07 23:10:01.364947

Comments

1

Nice, thnx. I experienced something like this myself. It looks like the sd-card was a bad one, because I used it for less than a year. Or could it be that Sailfish writes a lot more caching to the sd?

Xmasjos ( 2016-05-08 01:45:36 +0300 )edit

hi @Xmasjos ,well i used this sd-card for over 3 years and i used it quite heavily. 10gb permantly used and on the 20gb rest i wrote in these 3 years ~300gb. this should not be enough to wear out the flash but its more than most people write to it i guess. it was in my jolla for the last 1.5 years. i have seen the tracker create some files on the card, but im not aware of many write accesses... (im not somebody who would know anyway)

misc11 ( 2016-05-08 09:37:40 +0300 )edit

1 Answer

Sort by » oldest newest most voted
6

answered 2016-05-08 18:09:58 +0300

DrYak gravatar image

Tips to extend life of a SD card:

Hardware

  • Prefer cards that feature Static Wear Leveling in addition to your garden variety Dynamic Wear Leveling.
    With this the wear leveling will also cycle through the static blocks that don't get written to.
    (i.e.: your old files will get periodically refreshed, and the wear-leveling is spread over the whole device and not only over the few blocks that get written and the extra free pool. The later dramatically help flash wear endurance)
  • Prefer cards that feature ECC (error correction)
  • Prefer cards with as many "Allocation Units"/"segments"/"Erase Block groups" kept in RAM cache.

NOTE: few constructors directly advertise this kind of low-level spec. If you can't catch an engineer on the customer service, at least try to get the "Pro" version of product line (usually the one with ECC). Or even the "Industrial" version (designed to be nearly indestructible in very harsh environments and usage patterns) but be prepared to pay a very high price tag.

In my experience Transcend's Ultimate serie is good. It features ECC (even advertised on the website !) and according to the engineers I've spoken to, it also uses static wear-leveling.

Don't bother with "Best microSD card"-style reviews. These review are mostly useless: the only thing they test is out-of-box read/write speed on fresh data (i.e.: they won't even detect things as simple as read speed decay like Samsung 840 EVO with older firmware were plagued). They don't give the slightest useful information about long term reliability.

Software

When formatting your microSD card :

  • Try to align it to allocation units of the flash.
    • Basically, look at the partition table (fdisk -l /dev/mmcblk0). If the originsl partition is aligned to 8MiB, that means you need to also align your newly created partition to 8Mib.
    • In case of FAT32 / exFAT (ew....) try also aligning the FAT tables so it ends at an allocation unit boundary, and the data clusters begin at the next au. (e.g.: Partition starts at 8MiB, FAT(s) is between 8MiB and 16MiB, content of first file (usually root directory) begins at 16MiB). The link about has the gory details about how to do it.
  • FAT32 and exFAT (ew....) aren't very good for flash as they constantly write at the same place (on the FAT table. Hence the advantage of keeping it packed inside 1 au which can be kept by the card within one of its RAM cache)
  • Prefer file systems that are either copy-on-write or log-structured, they are much gentler on flash
    • BTRFS is CoW
      • it means it never overwrites anything, but writes a new copy, and eventually garbage collects the old copy (unless that copy is kept as part of a snapshot subvolume)
      • it's also checksumed, so it's trivial to check data integrity by using btrfs scrub start.
      • snapshot subvolume are a very handy tool to keep some simple sort of backups (it won't save you in case of lost/burnt SD card, but you can revert to an earlier version, in case of data corruption / hardware starting to fail and refusing further writes)
      • it is also Sailfish OS default native format, meaning it is supported. See this answer or that answer about how to do it in a compatible manner.
    • F2FS is log-structured file system
      • it means that the whole system is a kind of journal. Each write is a new journal entry. (and the oldest entries will get garbage collected when free space needs to be claimed - as long as data of those entry has been deleted)
  • DO BACKUPS !!! And to insist again: DO BACKUPS !!!
    • It's a phone. Even if you use the best microSD card and the stablest filesystem ever, your phone can still get lost, stolen or heavily damaged.
    • Have a look at BTRFS's snapshots, it comes handy to help organise you backups (though currently BTRFS's send / receive seem not to be working, so you'll have to resort to rsync in the meantime for uploading part)
    • Again, DO BACKUPS !!!
  • Avoid putting swap on flash media, unless you know exactly what you're doing. It puts a lot of stress on the flash media, so use media able to sustain it.
    In my personnal experience:
    • I've killed a Lexar 633x in a couple of days. (Luckily it was under Warranty).
    • I've killed a Samsung EVO in a couple of months. (Luckily, warranty again).
    • My current Transcend Ultimate (ECC + Static wear levelling) is still happily chugging along after nearly one year, with no sign ever of wear or physical corruption.

NOTE: the draw back of switching your partition to BTRFS is that it's not widely supported outside Linux (though the situation is starting to change ).

I should definitely hurry up getting UDF working on Sailfish OS. It's log-structured, but it's supported on Windows / Mac OS X too.

edit flag offensive delete publish link more

Comments

@DrYak since you seem to have some knowledge about these things... do you know if there are many write accesses to sd cards by sailfish? i mean, if you dont use it as swap or anything like that there shouldnt be any problem for most people even they dont to any tricks like allignment...

misc11 ( 2016-05-08 19:18:31 +0300 )edit

A very quick look (i.e.: by looking for recenlty modified files using ls -ltrA) : well, not much, apparently. e.g.: The media tracker doesn't store its cache on the card it self.

(unlike Windows which creates it's "thumbnail" cache in the same directory. Mac OS X did also exhibit some similar behaviours - was it the ._DS_Store file ?)

the sd-mount.sh script also mounts filesystems with the noatime flag, so that's also one source less of writes (for filesystems that do actually have access time).

So if you're basically just putting in your FAT32 / exFAT SD card from your photocamera to post a few pictures on instagram, the card shouldn't get any write. (maybe except the dirty bit. I haven't checked if Linux sets it on mounting - like Windows does - or on write - which should be the correct way to do it).

Most commercial SD cards are sold pre-aligned: Their partition is formated in a way that the data is aligned correctly. (That's where the urban legend "SD card are optimised for FAT" comes from. It's not that the card's microcontroller has any special circuitry to handle FAT, is that the FAT partition is formated in a special way to better take advantage of how the microcontroller works - see my links: the one about allocation units and the one about alignement).

DrYak ( 2016-05-08 20:06:40 +0300 )edit
1

You forgot to remind this: DO BACKUPS!

objectifnul ( 2016-05-08 22:33:04 +0300 )edit

@DrYak the file i found on the card was sth like: ".< name_of_a_audiofile >.tracker", so my guess was it was the tracker... so i guess write wear wasnt the reason my card died.

misc11 ( 2016-05-09 00:02:24 +0300 )edit

Question tools

Follow
3 followers

Stats

Asked: 2016-05-07 14:57:29 +0300

Seen: 457 times

Last updated: May 08 '16