LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-01-2008, 05:16 PM   #1
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Rep: Reputation: 15
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?
 
Old 01-01-2008, 05:40 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
I think you need to create a new filesystem on it.
 
Old 01-02-2008, 01:16 AM   #3
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Original Poster
Rep: Reputation: 15
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.
 
Old 01-02-2008, 01:35 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
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.

Last edited by jschiwal; 01-02-2008 at 01:36 AM.
 
Old 01-02-2008, 09:19 AM   #5
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,230

Rep: Reputation: 57
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.
 
Old 01-02-2008, 01:11 PM   #6
pickarooney
Member
 
Registered: Aug 2003
Distribution: (X)ubuntu Maverick
Posts: 152

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by dracolich View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a "No space left on device" message on a non-full partition... sugar2 Linux - Hardware 12 07-06-2007 01:43 AM
No space left on device even though it has free space? enine Linux - General 8 05-30-2007 04:22 PM
space left on HD??? E.M.P99 Linux - Newbie 4 04-26-2006 04:14 PM
no space left in / fallen26 Linux - General 1 08-10-2004 07:00 AM
"no space left on device" - But df shows free space! monita Linux - General 7 03-30-2004 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration