Trying to transfer files to flash drive, but getting 'no space left on device' despite having over 77 GB of free space

I’m trying to free up a little space on one of my drives by moving some files over to a flash drive. However, after several files, I get a message saying “Error opening file “[FILENAME]”. No space left on device”. Thunar says there’s about 77 GB left on the device. What should I do in order to fix this?

Do you happen to have a trash folder on the storage?
Also what do other programs show is available on it?

You could show the output of

df -hT

and tell which of the partitions is the target.

One thought here… it is possible to space for files to exist, but no space left for allocating handles (filenames, sort of) due to incredibly numerous filenames (VERY small files?). I forget (getting old) the command that shows this if present, but even a human-powered look through the ls command might well tell you if you have thousands of similar filenames in there - the kind you might get from disk repair/recovery operations, or from temporary files that weren’t removed due to a crash or improper shutdown. Might be worth a scan :grin:

1 Like

The output of df -hT listed this (which is the flash drive I’m using rn):
/dev/sdb1 vfat 115G 38G 77G 33% /run/media/arthurzw/CE81-01BE

What about the number of files on your flash drive (see @freebird54 ) ? Maybe

ls -al | wc -l

on your flash drive can help to get this information.

I haven’t counted them all up, but I can tell you it’s a lot of files in total - several thousand of them at least, though the command seems to list 3 or 4 more than the number of files the file system lists (where Thunar will say there’s 250 files the command will say there’s 253, for example).

Can you reformat the flash drive to, say, ext4 instead of vfat?
That way you can preserve the file permissions too.

1 Like

The command lists (and count) also the directory (.) and the parent directory (…), that’s okay. I think it’s the wrong filesystem for your project. Or you have to create a directory (maybe named “Data”) where you move all your files, because there’s a limit of maximum file- / directorynames in the root of your flash drive with vfat. And with many little files you’ve reached this number. I don’t use flash drives with vfat, so it’s just a thing I remembered from a few years ago.

I hadn’t thought of it being formatted vfat! DEFINITELY a limitation on filename counts, especially in the root of the drive if that’s the case. ext4 is the easiest way to go… :grin:

I probably should’ve looked at the format before trying to use the flash drive (I just bought this from a store). I’ll reformat the flash drive in the morning and let you know how things go.

Tried to format the disk but I get the message: Warning: Partition(s) on /dev/mmcblk0p1 are being used. Ignore/Cancel? I Warning: The existing disk label on /dev/mmcblk0p1 will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? Y Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/mmcblk0p1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? I Information: You may need to update /etc/fstab. Please ignore, I think I just did something wrong. I’ll let you know how the format goes.

After reformatting to Ext4 it works for me now.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.