Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Rep:
Really weird issue with new SD cards
This is not exactly a Linux issue, as Windows can't even detect these cards at all... but hoping someone has any ideas, this is a really strange one.
So someone asked me to copy a bunch of data to a SD card, don't know why they want that, but that's what they want. Not a USB stick, not a portable hard drive, but SD card.
So I ordered 2 256GB cards. They're Kingston Canvas! Go Plus. Start copying data then start to get massive IO errors and it eventually fails. Tried another identical card, same thing. I returned both cards as defective, got 2 new ones, and I had a hunch it was something oddball with that model so got a different more expensive one, a Sandisk Extreme Pro 256GB.
Get same thing happen with all of those too. Start copying data then after a while it just starts generating tons of IO errors in dmesg.
As a test, I took the SD card out of my camera and did the same copy. That one works flawlessly. It's too small though to copy everything I need, otherwise I'd just give them that one and keep the others.
The other thing that's weird, is the cards that get IO errors (5 so far) all work fine in cameras. I set my camcorder on record for over an hour and it never failed, and I was also able to pull the footage off with no errors, but I tried to copy the footage back and get errors. It's like these particular cards don't like having data written to them unless it's by a camera, which I don't understand because it's just a storage device, it shouldn't matter.
To rule out any file system related issues I even tried low level tools like dd and that eventually also fails. Fdisk also fails, when I write it just gets stuck at "the partition table has been altered". Basically no matter what I try to do to these new cards it basically either fails with IO errors or just flat out locks up.
So what is going on, why would some cards give IO errors and some not? To rule out my PC I tried my Windows machine too, but it won't even read the ones that are failing at all, but it reads my camera ones fine. Also these cards that are failing work fine in my cameras and I can retrive the pictures/video fine too on my PC, just not write to them. I'm at a loss here, what would be causing this?
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
That's what I'm using, I'm not sure of any other way. Since it works fine in the camera I also tried to put it in the camera then plug the USB cable from the camera but it doesn't show up as a mass storage device, it shows up more a special camera device. I see files but can't write, or mount it normally to a normal directory so can't use command line tools either.
It may be your card reader is at fault and that it just can not write to large capacity cards.
How old is it?
Is it builtin to the computer or separate USB device?
What size cards do you typically use for your camera?
Possibly, this was common with early card readers and there are a few threads here if you can still find them. If I remember it was at the 8GB point. Your reader may only be able to write to <=32GB cards i.e. SDHC versus SDXC
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
I dug deeper, and looks like it may very well be the issue.
I found a datasheet for what I presume is the chip used in the reader (got info from lsusb) and there is in fact a 32GB limit but also a 2TB one... Guess it depends what the card is. The one I'm using does say SDXC on it so it should fall under the 2TB limit I would think... but maybe it's somehow registering as SDHC?
Code:
Genesys Logic, Inc. GL827L SD/MMC/MS Flash Card Reader
Secure DigitalTM and MultiMediaCardTM
- Supports SD specification v1.0 / v1.1 / v2.0/ SDHC (Up to 32GB)
- Compatible with SDXC (Up to 2TB)
- Supports MMC specification v3.X / v4.0 / v4.1 / v4.2.
- x1 / x4 / x8 data transmission. (For QFN24 up to x4)
- Automatic CRC7 generation for command and CRC7 verification for response on CMD
- Support automatic CRC16 generation and verification on DAT0:7
- In addition to full packet transaction, optional single byte / bit operation on both CMD and DAT line /
lines
- Process data in block or byte
So guess that's my problem, I need to get another reader. I did not figure modern chips had such low limits, I though we were into the TB range when it came to that.
There are four SD card types described here: https://en.wikipedia.org/wiki/SD_card#Comparison, they are not downward compatible. Your reader supports only SDHC and so cannot read SDXC and UC cards. 32G for it is the limit.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
Wonder what the difference between "supports" and "compatible" in this case, because it does say compatible with SDXC. But it also has a 12Mhz clock, so would that even be enough for the 170MB/sec speed of the newer cards? Either way think I'll just buy another reader and see if the problem goes away.
I'd really recommend that anyone in the market for both SD cards and the readers that are needed to format and or extract data off of said cards. My chief recommendation is to stick to the well know brands like Samsung,San-disk,Patriot, Kingston and a few which I can't pull off of the top of my head at the current point in time.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
Ok so just to confirm it was in fact the reader,
The Anker one from Amazon was able to write to these no problem. The good news now is I guess I have 2 256GB SD cards now to add to my collection of much smaller ones, as I kept buying more thinking they were defective until I realized something must have been up, and it was the reader not supporting larger cards. Never figured there was a limitation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.