Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

For about a day now I can only create/cp/mv (through terminal or various GUI programs) files on my FAT16 formatted USB stick, of about a few bytes. Doing so with larger files reports cannot create regular file 'XXX': No space left on device

I have a NTFS drive, and a USB stick with 2 FAT16 formatted partitions on it, attached to the computer.

  • /dev/sda1 is the NTFS
  • /dev/sdb1 is one of the FAT 16 formatted partitions
  • /dev/sdc1 is the other the FAT 16 formatted partitions (Prior and after unplugging the USB stick while PC was pm-suspend'd, to clear space on the full drive - Seems this may have caused part/all of this issue in hindsight)
  • /dev/sdb1 is the other the FAT 16 formatted partitions (After unplugging the USB stick while PC was pm-suspend'd

df reported:

    Filesystem  1K-blocks   Used   Available  Use%  Mounted on
    /dev/sdc1    1999360  1999360      0      100%  /media/sdc1
    /dev/sdd1    1999360   822400   1176960   42%   /media/sdd1

df -i reported:

    Filesystem  Inodes  IUsed  IFree  IUse%  Mounted on
    /dev/sdc1      0      0      0      -    /media/sdc1
    /dev/sdd1      0      0      0      -    /media/sdd1

Sub question: Any idea why there are no inodes reported??

df -i /dev/sda1 reported:

    Filesystem  Inodes   IUsed   IFree    IUse%  Mounted on
    /dev/sda1   5539908  171718  5368190    4%   /media/sda1

umount'ng /dev/sdc1 didn't change the counts.

I have verified through Windows that space available more-or-less marries with the 42% listed for the latest mounted device (/dev/sdd1).

Any ideas on what is going on?

Edit 1:

The output of du -k --max-depth=1 /media/sdc1 is:

   1856 /media/sdc1/dir1
     32 /media/sdc1/dir2
   1440 /media/sdc1/dir3
  18144 /media/sdc1/dir4
   8512 /media/sdc1/dir5
  54304 /media/sdc1/dir6
   3200 /media/sdc1/dir7
  27200 /media/sdc1/dir8
  41088 /media/sdc1/dir9
  11520 /media/sdc1/dir10
    128 /media/sdc1/dir11
    128 /media/sdc1/dir12
   1216 /media/sdc1/dir13
   2464 /media/sdc1/dir14
  12032 /media/sdc1/dir15
   5824 /media/sdc1/dir16
  29600 /media/sdc1/dir17
  20928 /media/sdc1/dir18
   5856 /media/sdc1/dir19
   4352 /media/sdc1/dir20
 659200 /media/sdc1/dir21
 121600 /media/sdc1/dir22
  22688 /media/sdc1/dir23
    128 /media/sdc1/dir24
   2144 /media/sdc1/dir25
   6912 /media/sdc1/dir26
  19968 /media/sdc1/dir27
   9632 /media/sdc1/dir28
    960 /media/sdc1/dir29
   1088 /media/sdc1/dir30
   2624 /media/sdc1/dir31
    480 /media/sdc1/dir32
1142944 /media/sdc1
share|improve this question
    
Does this persist after a reboot? –  terdon Jun 8 '13 at 16:10
    
Unfortunately I can't reboot as am on a live CD mounted distro, and the flash drive is the only clean FS to write important data to. –  user66001 Jun 8 '13 at 16:16
    
What is the output of du -k --max-depth=1 /media/sdc1? –  Hauke Laging Jun 8 '13 at 16:17
    
1856 /media/sdc1/ 32 /media/sdc1/ 1440 /media/sdc1/ 18144 /media/sdc1/ 8512 /media/sdc1/ 54304 /media/sdc1/ 3200 /media/sdc1/ 27200 /media/sdc1/ 41088 /media/sdc1/ 11520 /media/sdc1/ 128 /media/sdc1/ 128 /media/sdc1/ 1216 /media/sdc1/ 2464 /media/sdc1/ 12032 /media/sdc1/ 5824 /media/sdc1/ 29600 /media/sdc1/ 20928 /media/sdc1/ 5856 /media/sdc1/ 4352 /media/sdc1/ 659200 /media/sdc1/ 121600 /media/sdc1/ 22688 /media/sdc1/ 128 /media/sdc1/ 2144 /media/sdc1/ 6912 /media/sdc1/ 19968 /media/sdc1/ 9632 /media/sdc1/ 960 /media/sdc1/ 1088 /media/sdc1/ 2624/media/sdc1/ 480/media/sdc1/ 1142944 /media/sdc1 –  user66001 Jun 8 '13 at 16:41
    
Directory names removed to fit into comment + for privacy. –  user66001 Jun 8 '13 at 16:41

2 Answers 2

FAT16 can hold a very limited number of files on the root directory. My guess is that you are hitting that. Create a directory and put files in it.

share|improve this answer

There are no inodes on most non-Unix file systems (like vfat). It's normal that none are shown. For the rest of the problem we need more info.

Edit 1:

From the du output we now know that there are 1999360-1142944=856416 blocks missing. With Linux file systems such differences can occur if an open file is deleted. You do not see it in the file system any more (thus du cannot count it). ... In order to make this less theoretical I just gave it a try: It's the same on vfat. You can find deleted open files with this command (as root):

find /proc/*/fd -lname '/media/sdc1/* (deleted)'

The other possibility are file system errors. Thus if you cannot identify deleted open files as the problem then it would be good if you could unmount and check the file system.

share|improve this answer
    
As stated, /dev/sda1 is NTFS, and is reporting iNodes. –  user66001 Jun 8 '13 at 16:17
    
@user66001 OK, "non-Unix" was too broad then. vfat doesn't though. I checked that before. –  Hauke Laging Jun 8 '13 at 16:19
    
Okay, so seeing as fat16 is now excluded from your statement, any ideas as to why no inodes are showing? –  user66001 Jun 8 '13 at 16:38
    
@user66001 Why should fat16 be excluded from my statement? –  Hauke Laging Jun 8 '13 at 16:48
1  
I would agree if I wanted to use another OS's tools to gather this info, but I want to use Linux tools, with the Linux drivers that are facilitating access to the FS and adhering to the rules of it. Perhaps I should try starting a new question with just this subject. –  user66001 Jun 8 '13 at 19:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.