Cannot read files from SD card which works fine under windows
I have a SanDisk 256GB extreme pro SD card for my camera. It works perfectly fine with the camera and with windows, but when I instert it into the card reader on linux (fedora 38) I can't copy any files from it:
cp: Fehler beim Lesen von '.../DCIM/112_FUJI/DSCF2001.RAF': Eingabe-/Ausgabefehler
Loosely translated:
cp: error while reading from '.../DCIM//112_FUJI/DSCF2001.RAF': input/output error
the card is automatically mounted and shows up in the file explorer.
I’ll have to look into it. I think my fstab is still referencing ntfs-3g.
Found this:
Note:
All officially supported kernels with versions 5.15 or newer are built with CONFIG_NTFS3_FS=m and thus support it. Before 5.15, NTFS read and write support is provided by the NTFS-3G FUSE file system. Or you can use backported NTFS3 via ntfs3-dkmsAUR.
Paragon Software, the author of the kernel module, has not yet released userspace utilities for NTFS3. You can use NTFS-3G userspace utilities without NTFS-3G driver via ntfsprogs-ntfs3AUR.
Which partition is the one automatically mounted? That sdcard seems weird, it has 4 partitions occupying the same space. Also I would try to mount all 4 partitions manually and check if one of them works.
The partition type column is a bit strange with SpeedStor. I only found this information on that
61 SpeedStor
Storage Dimensions SpeedStor Volume. This is a Non-Standard DOS Volume. (Disk Manager type utility software)
It is also strange that all four partitions seem to occupy the same space and have the same size which is also significantly larger than the 256GB you mention.
You might not get an I/O error for the partition table but I don't think it is reading an actual partition table describing the SD card.
Have you tried formatting a different SD card in your camera and seeing if it has the same issues? This would help rule out an issue with the card itself.
I have, but I didn't look at that one yet. It is even more strange. It doesn't recognize even one partition on it... (I also know that this one works, I imported files from it yesterday on my windows laptop and it worked perfectly fine, no files are corrupted
Is your Linux laptop dual-booting Windows? I am wondering if you are using the same SD-Card reader to read the card on both Windows and Linux?
This is relevant because if your Linux laptop is different it could be a problem with the SD-Card reader on your Linux machine.
Assuming your card reader works fine on Windows but not Linux, it is probably a driver issue. Linux is clearly reading the SD-Card boot sector since it is reporting information about the partitions. But if it is a hardware issue (not likely if it is working on Windows with the same card reader), it may start to read the card and then fail as soon as it starts to draw too much power or heat the card up or something.
@BentiGorlich
It's a bit weird, it looks like the output of fdisk -l /dev/sdg indicates that your SD card is formatted with an HPFS/NTFS/exFAT file system, which is not the typical format for camera SD cards. Camera SD cards are usually formatted as FAT32 or exFAT.
I recommend that you backup everything on that sd card and reformat it to exfat or fat32 yourself on a linux system.
I just reformatted it on my linux machine. So I choose exFAT again, because thats what it was before, that's what I know the camera can handle and I have the exact same problem... I think I just surrender and import my photos on my laptop all the time...
The partition type after a format is btw still NTFS/exFAT/HPFS. So that is just a compatibility thing for it to work on basically all systems I think...
Try wiping the drive and then reinserting it. If it still looks the same you either have a failing card or its been put in read only mode at a hardware level.
@BentiGorlich
Check for Errors: Run a file system check on the exFAT partition to identify and repair any potential filesystem errors.
$ fsck.exfat -y /dev/sdg1
Try mounting the SDcard with different mount options. Create a directory where you want to mount the card, and then use the mount command with specific options. For example:
$ sudo mount -t exfat -o ro,umask=000 /dev/sdg1 /mnt/sdcard
This mounts the SD card as read-only (ro) with a more permissive umask. Adjust the options as needed