Rockbox General > Rockbox General Discussion

Empty MicroSD Card Appearing Full

<< < (2/2)

gbl08ma:
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?

saratoga:

--- 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.

--- End quote ---

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

gbl08ma:
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...

bluebrother:

--- 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.
--- End quote ---

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!).
--- End quote ---

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)?
--- End quote ---

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?

--- End quote ---

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?  

--- End quote ---

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.

saratoga:

--- 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.

--- End quote ---

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. 

Navigation

[0] Message Index

[*] Previous page

Go to full version