Page 1 of 1

SD Card Problem

Posted: Thu Oct 19, 2017 1:42 am
by olwen
I have Linux Mint 18.1 Cinnamon
There is an issue with the SD Card from my camera mounting.

It mounted earlier today. I opened a file from it saved it to the SD Card. Then copied it to the hard drive and deleted it. Accidentally moved some fresh pictures to the hard drive rather than copying them.

Removed SD Card and replaced it back in camera. Went out and took more pictures which I can view in the camera. But the card now doesn't mount on the the PC.

lsusb does not show it.
Disks shows (it's actually an 8Gb card)
Screenshot from 2017-10-19 18-37-51.png
I assume I have messed it up somehow - probably being in a hurry and not unmounting it. I would really like to repair it without destroying the data.

Re: SD Card Problem

Posted: Thu Oct 19, 2017 8:49 pm
by jackcq
Hi,

I very much doubt, that forgetting to unmount your flash card would render it unreadable.
Maybe the card reader or the card just isn't connected properly. Can you check if the operating
system recognizes your card at all? Do the following:
open a terminal and after you plugged in the card type dmesg
This should tell you whether the card is recognized, for example:
[12014.956192] usb 2-2: new high-speed USB device number 5 using ehci-pci
[12015.114341] usb 2-2: New USB device found, idVendor=18a5, idProduct=0302
[12015.114346] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[12015.114349] usb 2-2: Product: STORE N GO
[12015.114351] usb 2-2: Manufacturer: Verbatim
[12015.114353] usb 2-2: SerialNumber: 07BB0101AE6B1F46
[12015.116075] usb-storage 2-2:1.0: USB Mass Storage device detected
[12015.117579] scsi host6: usb-storage 2-2:1.0
[12016.173011] scsi 6:0:0:0: Direct-Access Verbatim STORE N GO 5.00 PQ: 0 ANSI: 4
[12016.173824] sd 6:0:0:0: Attached scsi generic sg3 type 0
[12017.666891] sd 6:0:0:0: [sdc] 31248384 512-byte logical blocks: (16.0 GB/14.9 GiB)
[12017.667506] sd 6:0:0:0: [sdc] Write Protect is off
[12017.667508] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
[12017.668129] sd 6:0:0:0: [sdc] No Caching mode page found
[12017.668132] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[12017.706823] sdc: sdc1
[12017.710885] sd 6:0:0:0: [sdc] Attached SCSI removable disk
This shows up on dmesg for me when I plug in a flashdrive.

Re: SD Card Problem

Posted: Fri Oct 20, 2017 10:17 pm
by olwen
What I'm seeing with dmesg looks nothing like that. I hope I have copied all that is needed.

Other SD Cards work.

I plugged in one that works, it is automounted and a directory window opened. A 16 GB card formatted in this machine and modified by the camera.
89562.674002] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[89562.680878] sdc: sdc1
[89563.208852] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91629.430720] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91629.437355] sdc: sdc1
[91630.738669] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91739.010575] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91739.017203] sdc: sdc1
[91739.642221] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91790.842723] VFS: Dirty inode writeback failed for block device sdc1 (err=-5).
[91812.731318] sd 8:0:0:1: [sdc] 1024 512-byte logical blocks: (524 kB/512 KiB)
[91861.378945] sd 8:0:0:1: [sdc] 1024 512-byte logical blocks: (524 kB/512 KiB)
[91995.559933] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91995.566811] sdc: sdc1
[91995.975851] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Then took that out and put the one the computer doesn't recognise although the camera does. It's an 8Gb card.
[89562.674002] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[89562.680878] sdc: sdc1
[89563.208852] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91629.430720] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91629.437355] sdc: sdc1
[91630.738669] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91739.010575] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91739.017203] sdc: sdc1
[91739.642221] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[91790.842723] VFS: Dirty inode writeback failed for block device sdc1 (err=-5).
[91812.731318] sd 8:0:0:1: [sdc] 1024 512-byte logical blocks: (524 kB/512 KiB)
[91861.378945] sd 8:0:0:1: [sdc] 1024 512-byte logical blocks: (524 kB/512 KiB)
[91995.559933] sd 8:0:0:1: [sdc] 30547968 512-byte logical blocks: (15.6 GB/14.6 GiB)
[91995.566811] sdc: sdc1
[91995.975851] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[92369.873858] sd 8:0:0:1: [sdc] 1024 512-byte logical blocks: (524 kB/512 KiB)

Re: SD Card Problem

Posted: Sun Oct 22, 2017 1:05 pm
by BG405
Have you tried putting it back in the computer and then unmounting it again?

Re: SD Card Problem

Posted: Sun Oct 22, 2017 2:22 pm
by olwen
BG405 wrote:Have you tried putting it back in the computer and then unmounting it again?
Several times. I've rebooted the computer, lots of that sort of thing.

Re: SD Card Problem

Posted: Sun Oct 22, 2017 4:56 pm
by BG405
OK reason I asked is if you put it straight back in (before rebooting) it usually works. Same issue when I put my netbook to sleep & forgot to unmount a shared directory; the other machine wouldn't unmount it until I woke the netbook again. Thinking it would be similar to any other mounted device.

Try sudo fsck -NV /dev/sdc1 (make sure it's actually sdc1 using lsblk) and post the results. It's a simulation so won't change anything unless you remove the "N".

Re: SD Card Problem

Posted: Sun Oct 22, 2017 5:04 pm
by olwen
I would expect it on sdc1 (that's where other SD cards are)

But this is what I get.
olwen-Veriton-X4610G olwen # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 450M 0 part
├─sda2 8:2 0 99M 0 part /boot/efi
├─sda3 8:3 0 16M 0 part
├─sda4 8:4 0 170.6G 0 part
├─sda5 8:5 0 290.7G 0 part /
└─sda6 8:6 0 3.9G 0 part [SWAP]
sdc 8:32 1 512K 0 disk
sr0 11:0 1 1024M 0 rom
olwen-Veriton-X4610G olwen # fsck -NV /dev/sdc
fsck from util-linux 2.27.1
[/sbin/fsck.ext2 (1) -- /dev/sdc] fsck.ext2 /dev/sdc

Re: SD Card Problem

Posted: Wed Oct 25, 2017 11:25 am
by jackcq
Hmm ... from the dmesg and lsblk output I would guess that your computer doesn't recognize any partitions
on that card.
Can you read that card on another computer, maybe a windows machine?
You could try to mount the block device manually without a partition:

Code: Select all

sudo mount /dev/sdc /mnt 
(this might need a -t vfat option).
Maybe you could connect the card through the camera to your computer via
USB to rescue your images and reformat the card. Or move the images you
want to rescue to the internal storage (if it has any) of your camera and
back to another card?
If all of that fails, you could recreate the partition with fdisk,
theoretically changing the partitions should not touch any data on your
sd-card, but it's still invasive and dangerous to do so. I would wait for
more input from more experienced folks here, before trying that.
Also, when using fsck, you probably need fsck.vfat not ext2, as the file system
is most likely vfat.

Re: SD Card Problem

Posted: Wed Oct 25, 2017 12:00 pm
by BG405
jackcq wrote:Also, when using fsck, you probably need fsck.vfat
+1. I should have mentioned that :oops: