Author Topic: How to format a CF or SD as ext3 under Cacko  (Read 6513 times)

ShiroiKuma

  • Hero Member
  • *****
  • Posts: 900
    • View Profile
How to format a CF or SD as ext3 under Cacko
« on: November 05, 2004, 01:41:04 pm »
Hello:

I'd like to format my CF or SD (don't know yet) as ext3. I have seen the new fdisk tools for Cacko and the step-by-step how-to for newbies.

However I'm not sure how to specify ext3.

Can anyone give me a siple step-by-step walk-through for doing this with the new utilities. And how do I specify CF or SD.

Also, it is mentioned in the above thread that for Cacko ext3 is better than ext2. Why?

Will there be any problems with mounting after suspend/resume?
[span style=\'font-size:8pt;line-height:100%\']Das ganze tschechische Volk ist eine Simulantenbande.[/font][/span]
Militäroberarzt Bautze

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
How to format a CF or SD as ext3 under Cacko
« Reply #1 on: November 05, 2004, 02:38:26 pm »
I can not think of any reason why ext3 should be "better" - except that ext3 may have a positive impact on global economy by making your flash cards more early defective and forcing you to buy new ones...
« Last Edit: November 05, 2004, 02:38:40 pm by Mickeyl »
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
How to format a CF or SD as ext3 under Cacko
« Reply #2 on: November 05, 2004, 04:51:26 pm »
The ext3 format is just ext2 with a journal. To get it, you add a "-j" to your ext2 format command. For example:
Code: [Select]
mke2fs -j /dev/mmcda1would format the first partition on your SD card as ext3.

The reason you might want ext3 vs. ext2 is that ext3 is a journaling filesystem and is better able to cope with things like unclean shutdowns or ejecting the card without unmounting it.

Reasons you might not want ext3 is that it's slower than ext2 and the journal uses up a percentage of the card's free space. As for flash wear, the journal won't significantly reduce card life on a high capacity card (256M+) if you always maintain at least 10M of free space for wear leveling. The fact is most people don't write data to the card all that often, so the journaling really doesn't have much negative impact (aside from the space it uses up).
« Last Edit: November 05, 2004, 04:51:47 pm by kopsis »

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
How to format a CF or SD as ext3 under Cacko
« Reply #3 on: November 08, 2004, 08:15:32 am »
Quote
...if you always maintain at least 10M of free space for wear leveling. ...
kopsis,

I'm interested in what you are saying about wear leveling, I can see the initial concept that you are talking about, however, what is the practicality of this working on a file system that exists for an extended period on a flash card ?

Surely if you ever fill the card it won't matter if you delete stuff to try to kick in the wear leveling again because most file systems don't erase data when you erase files - they will just unlink the inodes ? - or am I wrong ?

To ensure wear levelling assuming that the cards controller provides it, therefore wouldn't you have to guarantee that you don't fill the card and if you ever do you would want to zero it and start again ?

(I'm probably missing something from the basic concept here so please correct me if I'm wrong).

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
How to format a CF or SD as ext3 under Cacko
« Reply #4 on: November 09, 2004, 12:10:42 pm »
When it comes to wear leveling, there are actually two different elements at work -- wear leveling algorithms and host usage patterns.

At the bottom level you have wear leveling algorithms on the card. The way these work is far too complicated to explain here and even varies between manufacturers. The basic idea is that in addition to the sectors you see, there are also sectors hidden from the host. For example a 512 MB SanDisk card typically has 15 MB of sectors reserved for wear-leveling. Even when you fill the card (from the filesystem's perspective), those sectors remain free and subsequent writes continue to cycle through this "erase buffer". Usually the card is broken into zones (SanDisk typically uses 4 MB zones) and each zone gets a 3% erase buffer. Repeated writes to the same zone will cycle through that zone's erase buffer but won't be able to take advantage of erase buffers in other zones.

That's where host usage patterns come in. At the top level you have the filesystem that allocates requests for additional storage (either for new files or for growing existing files) from the file system free space on the card. By keeping a decent sized chunk of free space (larger than a single zone), you natuarally increase the odds of allocations being spread around the "disk". In our SanDisk example, 10MB of free space is guaranteed to span at least three zones helping to naturally randomize writes between different erase buffers.

There's a SanDisk Whitepaper that goes into a lot of detail on SanDisk's approach to wear leveling. It's pretty technical, but it has some good info. It's interesting to note that thier worst case example is a data logging operation using a 1GB card where a new 4kB file is written every five seconds. They factor in fixed areas of the filesystem, etc. and compute that the lifespan of the card will be 79.3 years.

Now, granted this is a SanDisk whitepaper and there may be much worse worst case examples, but I think it's safe to say that there's little justification for the high level of consumer concern over CF/SD write wear. In reality, the practical life of a memory card is probably no more than 5 years (at which point you'll want/need to upgrade to a higher capacity card) and with decent wear leveling algorithms, someone would have to really work at it to wear out a card in that timeframe.
« Last Edit: November 09, 2004, 12:12:17 pm by kopsis »

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
How to format a CF or SD as ext3 under Cacko
« Reply #5 on: November 09, 2004, 02:22:32 pm »
Dave,

Thank you so much for taking so much time in providing such a detailed response.

I'm quite interested in these things but don't always have the time to do all the 'legwork' these days and your response was very helpful.

Regards,

Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card