LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-25-2018, 11:42 AM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
how to inspect and test SD-family "media cards" -- SD, mSD, uSD


I have a number of SD-family media cards that I use with my DSLR and Digital Audio Recorder. I believe there is a limit to the number of write-erase cycles these devices tolerate. Is there some way to inspect a device and learn how deep it is into its reasonable life?

Thanks in advance,
~~~ 0;-Dan
 
Old 06-25-2018, 02:28 PM   #2
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
i don't remember seeing a kernel option for that specifically, but there SD support has to be in the kernel to read/write them

i do remember seeing linux hack talks about "unlocking" the card. the cards have "extra memory" that gets consumed as the card "stops responding" (the chip inside the SD handles consuming it to appear as if everything is "normal"). apparently if one wants a "write once/few, read many" SD they can unlock the card for something like 2x the storage. i doubt it's supported on all brands: but it's been done by some on some brands.

if you unlocked the card, that would seem to be the way to know what ammount is accessible. you'd then have to run fschk(1) with read and or write (noting writes are what your trying to avoid due to limitations) to know what memory is not in "bad blocks" and what memory is still writeable.

if the SD is NOT UNLOCKED, then i you'd have to have some userland tool that knew the chipset well enough to hack in and read inner tables of the SD that do the "automatic masking", and i doubt you'll find that

Last edited by X-LFS-2010; 06-25-2018 at 02:30 PM.
 
1 members found this post helpful.
Old 06-25-2018, 05:54 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
SMART?
 
1 members found this post helpful.
Old 06-25-2018, 06:00 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Cards die, simple fact of life. Carry spares, and make regular backups.
KISS.

Back around 2000 I got a 340 MB (yes, megabyte) microdrive - real spinning disk in a CF form-factor. Gotta be more robust than crappy CF cards methinks. It died on my first overseas trip with it - I suspect it was the humidity as well as the bouncing around. Didn't have a backup, and could never recover all the photos.
Lesson well learnt - the microdrive remains in my office as a reminder.
 
1 members found this post helpful.
Old 06-26-2018, 11:54 AM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,771

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
SD media behave like "disk drives" in many, but not all, ways. lshw tells me about the SD controller, but not the media currently in place. stat /dev/mmcblk0 (or any of the partitions) is also silent about the in-place media.

I tried smartctl several different ways. It does not seem that SD-media support smart. It could also mean that my specific controller does not, but media might. (The media is a vfat/fat32/exfat as built so it is more likely a media issue.)

Code:
sudo smartctl --device=ata --all --tolerance=verypermissive /dev/mmcblk0smartctl 6.5 2016-01-24 r4214 [x86_64-
**********

linux-4.4.0-116-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Invalid argument

=== START OF INFORMATION SECTION ===
Device Model:     [No Information Found]
Serial Number:    [No Information Found]
Firmware Version: [No Information Found]
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   [No Information Found]
Local Time is:    Tue Jun 26 11:46:28 2018 CDT
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
                  Checking to be sure by trying SMART RETURN STATUS command.
SMART support is: Unknown - Try option -s with argument 'on' to enable it.
Read SMART Data failed: Invalid argument

=== START OF READ SMART DATA SECTION ===
Error SMART Status command failed: Invalid argument
SMART Status command failed: Invalid argument
SMART overall-health self-assessment test result: UNKNOWN!
SMART Status, Attributes and Thresholds cannot be read.

Read SMART Error Log failed: Invalid argument

Read SMART Self-test Log failed: Invalid argument

Selective Self-tests/Logging not supported

prompt $
I also tried:
Code:
prompt$ sudo smartctl --device=scsi --all --tolerance=verypermissive /dev/mmcblk0
**********

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-116-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Standard Inquiry (36 bytes) failed [Invalid argument]
Retrying with a 64 byte Standard Inquiry
Standard Inquiry (64 bytes) failed [Invalid argument]

=== START OF READ SMART DATA SECTION ===
Request Sense failed, [Invalid argument]
Error Counter logging not supported

Device does not support Self Test logging

prompt$
and I tried:
Code:
prompt$ sudo smartctl --device=sat --all --tolerance=verypermissive /dev/mmcblk0 
**********

smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-116-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: Invalid argument

=== START OF INFORMATION SECTION ===
Device Model:     [No Information Found]
Serial Number:    [No Information Found]
Firmware Version: [No Information Found]
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   [No Information Found]
Local Time is:    Tue Jun 26 11:51:26 2018 CDT
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.
SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 85-87 don't show if SMART is enabled.
                  Checking to be sure by trying SMART RETURN STATUS command.
SMART support is: Unknown - Try option -s with argument 'on' to enable it.
Read SMART Data failed: Invalid argument

=== START OF READ SMART DATA SECTION ===
SMART Status command failed: Invalid argument
SMART overall-health self-assessment test result: UNKNOWN!
SMART Status, Attributes and Thresholds cannot be read.

Read SMART Error Log failed: Invalid argument

Read SMART Self-test Log failed: Invalid argument

Selective Self-tests/Logging not supported

prompt$

Last edited by SaintDanBert; 06-26-2018 at 11:56 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Kodi 17 "Krypton" Media Center Gets One More Release Candidate, Go Out and Test LXer Syndicated Linux News 0 01-27-2017 05:18 PM
[SOLVED] "Media test failure, check cable". How serious is this? Fried disk or just fried bootloader? hazel Linux - Hardware 16 01-15-2017 11:49 AM
As the "Star Wars media Mouse-Hype" settles down to an assessment of "actual screenwriting" ... sundialsvcs General 27 12-30-2015 04:03 AM
LXer: Comparison Test: Linux Mint 12 "Lisa" KDE vs. Netrunner 4.1 "Dryland" LXer Syndicated Linux News 0 02-10-2012 08:10 AM
[SOLVED] Silencing the line "echo test > test/test.txt" in a shell script Arenlor Linux - General 2 06-18-2010 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration