Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Empty MicroSD Card Appearing Full
« previous next »
  • Print
Pages: [1]

Author Topic: Empty MicroSD Card Appearing Full  (Read 5279 times)

Offline dabrams

  • Member
  • *
  • Posts: 4
Empty MicroSD Card Appearing Full
« on: June 20, 2011, 05:17:58 AM »
My 8GB microSD card in my Sansa Clip shows up as full (in Properties) when it's really empty.
How can I empty it?!
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Empty MicroSD Card Appearing Full
« Reply #1 on: June 20, 2011, 11:18:46 AM »
Check the file system for corruption.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Empty MicroSD Card Appearing Full
« Reply #2 on: June 20, 2011, 11:24:01 AM »
And check for a recycle bin created by Windows (or similar).
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline gbl08ma

  • Member
  • *
  • Posts: 249
    • My blog
Re: Empty MicroSD Card Appearing Full
« Reply #3 on: June 20, 2011, 02:13:06 PM »
The best way to check that both events suggested by Chronon and bluebrother aren't happening is to use a partition manager (GParted does fine on GNU/Linux) and put the card in an almost-factory-new mode:
First delete all the partitions that exist in the card (and be careful to not wipe your hard drive)
Then create a new partition table. Now create a new FAT32 (which I think is what Rockbox uses, it not then format as FAT) partition that fills the entire card.

Now you can be sure that the filesystem is not corrupt (unless your card has bad blocks, which is unlikely) and that there are no hidden recycle bins or other hidden folders. Obviously this wipes all your data, but as you're saying the card's empty... ;)
Logged
http://gbl08ma.com | http://i.tny.im

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Empty MicroSD Card Appearing Full
« Reply #4 on: June 20, 2011, 02:34:53 PM »
Quote from: gbl08ma on June 20, 2011, 02:13:06 PM
The best way to check that both events suggested by Chronon and bluebrother aren't happening is to use a partition manager (GParted does fine on GNU/Linux) and put the card in an almost-factory-new mode:
First delete all the partitions that exist in the card (and be careful to not wipe your hard drive)
Then create a new partition table. Now create a new FAT32 (which I think is what Rockbox uses, it not then format as FAT) partition that fills the entire card.

I wouldn't recommend doing this.

Flash memory works in blocks. When formatting flash based memory you need to take that into account, and a lot of formatting tools don't do this. Ignoring the block boundaries will make the card much slower, so I'd avoid formatting it as much as possible. Besides, there is really no need to format the card -- formatting won't tell you about filesystem errors, and checking for hidden files can be done without too.

And the file format used on SDHC cards is FAT32 as per SDHC standard.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline gbl08ma

  • Member
  • *
  • Posts: 249
    • My blog
Re: Empty MicroSD Card Appearing Full
« Reply #5 on: June 20, 2011, 03:01:05 PM »
So, should we never format flash memory? This way, filesystem trash starts to accumulate: recycle bins, hidden files, etc.

I was suggesting format as an easy way to wipe a card/flash disk. Deleting all files takes much more time than formatting, specially on Windows (up to four hours to delete 4GB of data!). And by the way, if the filesystem has errors but it is entirely deleted (and a new partition table is created), do the errors still exist (assuming the mass storage has no bad blocks)?

I didn't know that memory devices (e.g. SD card) specs also include the filesystem it should be formatted as. Too bad, it seems my 16GB SDHC is not 100% SDHC as I have already formatted it as ext4. Who cares...

Do you know of any way or any specific application that formats flash disks while respecting default block boundaries?
Logged
http://gbl08ma.com | http://i.tny.im

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Empty MicroSD Card Appearing Full
« Reply #6 on: June 20, 2011, 03:23:59 PM »
Quote from: bluebrother on June 20, 2011, 02:34:53 PM
I wouldn't recommend doing this.

Flash memory works in blocks. When formatting flash based memory you need to take that into account, and a lot of formatting tools don't do this. Ignoring the block boundaries will make the card much slower, so I'd avoid formatting it as much as possible. Besides, there is really no need to format the card -- formatting won't tell you about filesystem errors, and checking for hidden files can be done without too.

And the file format used on SDHC cards is FAT32 as per SDHC standard.

With SDHC writes are always aligned to multiplies of 16KB write units, so shouldn't fat32 automatically be aligned to block boundaries? 
Logged

Offline gbl08ma

  • Member
  • *
  • Posts: 249
    • My blog
Re: Empty MicroSD Card Appearing Full
« Reply #7 on: June 20, 2011, 03:49:07 PM »
I think this all explains why certain cards and usb disks are slower when formatted as, for example, ext4 instead of FAT32 (the default). It might also explain the filesystem corruption I got when I did tests with ext4 on a card...
Logged
http://gbl08ma.com | http://i.tny.im

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Empty MicroSD Card Appearing Full
« Reply #8 on: June 20, 2011, 04:02:28 PM »
Quote from: gbl08ma on June 20, 2011, 03:01:05 PM
So, should we never format flash memory? This way, filesystem trash starts to accumulate: recycle bins, hidden files, etc.

Deleting filesystem trash doesn't require formatting the filesystem. While you can format the filesystem it's simply a bit over the top since you can reach the same result with less intrusive methods (that would also preserve wanted data on the filesystem).

Quote
I was suggesting format as an easy way to wipe a card/flash disk. Deleting all files takes much more time than formatting, specially on Windows (up to four hours to delete 4GB of data!).

Never had such times. By deleting I'm referring to deleting, not moving into the trash (which is the default on Windows!) and that can take quite some time.

Quote
And by the way, if the filesystem has errors but it is entirely deleted (and a new partition table is created), do the errors still exist (assuming the mass storage has no bad blocks)?

To fix filesystem errors you should check the filesystem for errors, not delete or format it :)

Quote
Do you know of any way or any specific application that formats flash disks while respecting default block boundaries?

I've used a program by HP in the past but wasn't able to find that at their website anymore.

Quote from: saratoga on June 20, 2011, 03:23:59 PM
With SDHC writes are always aligned to multiplies of 16KB write units, so shouldn't fat32 automatically be aligned to block boundaries?  

You need to align to the underlying flash blocks, and I don't see that to be guaranteed to a specific size. The article at http://www.zdnet.com/blog/storage/five-things-you-never-knew-about-flash-drives/147 suggests that the common block size is 128k.
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Empty MicroSD Card Appearing Full
« Reply #9 on: June 20, 2011, 04:52:33 PM »
Quote from: bluebrother on June 20, 2011, 04:02:28 PM
You need to align to the underlying flash blocks, and I don't see that to be guaranteed to a specific size.

Section 4.13.1.2 of the SD physical layer spec defines a recording unit as a block that is a multiple of 16KB and aligned to the start of the allocation unit.  I think that means fat sectors would be automatically aligned unless the SD driver is going out of its way to remap aligned loads to unaligned addresses. 
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Empty MicroSD Card Appearing Full
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.095 seconds with 15 queries.