LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   SD card 35% full, no space left (https://www.linuxquestions.org/questions/linux-hardware-18/sd-card-35-full-no-space-left-610438/)

pickarooney 01-01-2008 05:16 PM

SD card 35% full, no space left
 
I got a 2GB memory card to store music on for listening to in my car stereo. When I bought it, there were a load of junk files on there, some kind of maps of Europe or whatnot. Naturally enough I chucked them off and started filling the card with MP3s. When I got to 35% full, copying stopped, saying there was no space left on the device. In my file manager and bash there's over a Gig left, but yet I can't copy anything over. I thought there must be some hidden .trash folder but couldn't find one, so I formatted the card (to vfat) with mkfs and was then able to copy over as much as I liked.

However, the stereo was unable to read any files from the card. I deleted all but one file - same result.

So, I used my digital camera to format the card this time. The camera reckons there's 2 GB of space on there, as does the PC, but once again I can't copy more than about 700MB of data onto it before I run out of space.


df -i for this disk gives me
Code:

/dev/sdb1                  0      0      0    -  /media/disk
by the way. No inodes at all apparently.

Any ideas how to resolve this?

jschiwal 01-01-2008 05:40 PM

I think you need to create a new filesystem on it.

pickarooney 01-02-2008 01:16 AM

That's what I did with mkfs, but as a result the card couldn't be read in the player. It's a bit Catch-22 unless I can find a solution that works for both the PC and player.

jschiwal 01-02-2008 01:35 AM

Can you format the card in the player? If not, you might have better luck using the mtools' mformat program.

To use mtools, you will need to add an entry to /etc/mtools.conf to map a device letter to a linux device.
First determine the device that the card uses. Then add a line like:
drive e: file="/dev/sdc1"

If the card is really bad off, you may need to delete the partition first and recreate it before formatting.

dracolich 01-02-2008 09:19 AM

Quote:

...so I formatted the card (to vfat) with mkfs and was then able to copy over as much as I liked.

However, the stereo was unable to read any files from the card. I deleted all but one file - same result.
Did you delete the original partition and create a new one before using mkfs?

Quote:

Naturally enough I chucked them off and started filling the card with MP3s. When I got to 35% full, copying stopped, saying there was no space left on the device.
What file/folder structure are you using when copying your mp3 files to the card? If you haven't used subfolders I think that'll solve your problem. As jschiwal suggests, try to format the card in the player, or the digital camera, then start copying some files again using subfolders. Start with just a few then try the card in the player to make sure it's working before copying any more files.

IIRC, memory cards and flash drives (mp3 players included) use FAT16 and not FAT32, and therefore are susceptible to FAT's not-well-documented limit for the root of the partition. The limit is 512 files/folders assuming the 8.3 naming convention. However, when using long names, every 13 characters takes up a file storage unit so it's easy to reach the limit with ~200 - 300 files. I've experienced this with a Memory Stick card, a Sansa m240 mp3 player and at least 2 different flash drives. Using subfolders at the root solves the problem because subfolders aren't affected by the limit.

pickarooney 01-02-2008 01:11 PM

Quote:

Originally Posted by dracolich (Post 3008559)
Did you delete the original partition and create a new one before using mkfs?

No, actually. So in all likelihood the partition was still there, but with no files in it when I tried to read it in the player?

Quote:

What file/folder structure are you using when copying your mp3 files to the card? If you haven't used subfolders I think that'll solve your problem. As jschiwal suggests, try to format the card in the player, or the digital camera, then start copying some files again using subfolders. Start with just a few then try the card in the player to make sure it's working before copying any more files.
I started with a flat structure, then tried to make subdirs when the disk was apparently full (this is after reformatting with my camera), but I guess it was a little late for that then.

Quote:

IIRC, memory cards and flash drives (mp3 players included) use FAT16 and not FAT32, and therefore are susceptible to FAT's not-well-documented limit for the root of the partition. The limit is 512 files/folders assuming the 8.3 naming convention. However, when using long names, every 13 characters takes up a file storage unit so it's easy to reach the limit with ~200 - 300 files. I've experienced this with a Memory Stick card, a Sansa m240 mp3 player and at least 2 different flash drives. Using subfolders at the root solves the problem because subfolders aren't affected by the limit.

That makes a lot of sense. I wondered about the number of files, but thought I was safe up to about 1000. If it's <FAT32 I can see why I might reach that limit sooner.

Once I get sick of my current compilation, I'll try both wiping the partition before using mkfs to create a new one and making subdirs.

Actually, I've just remembered, I originally started just copying whole albums across, then realised I'd be better of mixing them up myself than letting the random play feature do it for me. I'm pretty sure I had close to a gigabyte copied when I abandoned that idea.

Thanks very much for the help with this :)


All times are GMT -5. The time now is 05:56 AM.