# Cannot write to micro sd card



## Grell (Dec 22, 2016)

Hello, this is not necessarily a FreeBSD specific problem but this is the only tech forum I am registered to so hopefully someone here can help me out.  Anyways, I am having an issue where I have a 128gb micro sd card for my mp3 player which is a FiiO X1, which is using an msdosfs filesystem.  Basically for some strange reason I cannot write or delete anything on the card.  I have tried plugging it into my Debian system and also my Windows XP system.  What happens is that I will write to it, say like put a new directory of mp3s or write something as simple as a textfile that says "Hello."  I write to it, then I unmount it and when I go to check if the file is there, it is not, it is as though I didn't put anything new onto the card.  I have even plugged it into my FreeBSD system and ran 
	
	



```
dd if=/dev/zero of=/dev/da0
```
 to zero out the card, it runs fine, I unplug it, plug it back in, and see that the entire directory structure is still intact.  I even tried using the sd card adapter and plugging it in via the adapter onto my Debian laptop and get the same issue.  It was working fine about a week ago and I would hate to have to get a new card as the 128gb ones are rather expensive.  Any ideas?  Thanks.


----------



## ASX (Dec 22, 2016)

Some SD card has a READ-ONLY switch at one side ... check it, although I would expect a "write error" or something like that in such case.

Because it is a 128 GB, it should be an SDXC, some hardware is limited to SDHC (max 32 GB), therefore check your hardware specs, after that some OS software/driver definitely doesn't support size greater than 32 GB, that's surely the case for winXP (Vista and win7 may need an updated driver).

You wrote it was working fine until a week ago, did you exceeded the 32 GB size at the time ? And using what filesystem type ?


----------



## Grell (Dec 22, 2016)

I have about 83 gigs of mp3s on the card and have had it working fine for the past year and a half or so that I have had it.  I did not recently pass the 32 gig mark, in fact I have had over 80 gigs on there for the whole time I've owned it.  It is the msdosfs filesystem which I suppose is very similar if not the same as vfat?  Also the read-only switch is on the sd adapter which I wasn't using at all until I finally check to see if the sd card adapter would work on my laptop, it is not a matter of having to switch it from read-only setting.

In the worst case scenario, I just checked online and the 128gb cards have dropped in price substantially, I may just reorder it but I would like to know what the problem is so that this does not happen again.

edit:  I forgot to mention that right before it stopped working I was writing data to it and I believe I tried to kill the process that was writing and when that didn't work I unplugged the device and in so doing my entire FreeBSD machine just crashed and shutdown as soon as that happened, ever since then it has been messed up.


----------



## SirDice (Dec 23, 2016)

Grell said:


> It is the msdosfs filesystem which I suppose is very similar if not the same as vfat?


msdosfs(5) is FAT12/FAT16/FAT32.


----------

