SD card inexplicably full

This may be more of a linux question, but I’m relatively Debian savvy and I can’t sort out what’s happening.

The output of df shows the sd card full. I’m not keeping anything on it other than the OSMC backup, which currently consumes 652MB, so I’m at a loss to understand what happened to the rest of the space.

df:
/dev/mmcblk1p1 60G 60G 463M 100% /media/osmc_sd

ls:
drwxrwxrwx 1 osmc osmc 128K May 8 2019 .fseventsd
-rw-rw-rw- 1 osmc osmc 652M Jun 4 22:37 OSMCBACKUP_2021_06_04_22_33_05.tar.gz
drwxrwxrwx 1 osmc osmc 128K May 8 2019 .Spotlight-V100

.fseventsd is 512k and .Spotlight is 8M.

I’m not super familiar with OSMC’s use of the SD card, but can I format it without any ill effects?

try sudo du -hd1 at the top level for a start.

Installing and running ncdu is usually my go-to at times like this

Those tools are how I got the folder sizes…

I’ll try the reformat route.

Well you haven’t told which folder occupies the 60G?
Why not just delete them instead of reformat.
If it fills up once it will fill up again.

Perhaps I wasn’t clear enough in my first post. Those are ALL the folders on the card, yet somehow it is reporting full. Makes no sense. :man_shrugging:t2:

Well there are at least too hidden directories which could contain many files.
So recommendation is install ncdu (sudo apt-get install ncdu) and run ncdu /media/osmc_sd that will give you all the info needed.

1 Like

Its probably a hardware problem and the SD card has failed. Try another card, or try a full reformat of your current SD card (where bad blocks/sectors are marked as do not use) and then check the identified size.

In those cases it normally would not show the size as “used”

ncdu shows exactly the same list of files/folders I posted.

At this point I’m inclined to think it’s a hardware issue as well. @thechrisgregory, is it a command within parted that will skip bad blocks during a format?

parted sets up the partition tables, it doesn’t set up the file system (i.e. format) & potentially check the integrity of the blocks allocated to those partitions. You can do this with other commands such as ‘badblocks’ badblocks(8) - Linux manual page and ‘fschk’ fsck(8): check/repair file system - Linux man page. Its ‘simpler’ on Windows, where the (full) format command can be used to set up the blocks of a partition and mark them bad as necessary.

I would suggest you try another SD card and see if you get the same problem, to eliminate the possibility of a hardware problem.

But what is the space used the ncdu shows for those folders? The ls command only shows the directory entry.

If you believe you have broken SD card use h2testw to test it.

OP has folder sizes, they for sure aren’t hiding 60G worth of data. du was the first thing I ran to try to track this down. Thanks for the h2testw tip.