On 07/07/2014 06:31 AM, Marcel Partap wrote:
Salut, for housing a debian chroot in my android phone, I want to set up a 2.5G partition on this new micro sd card. For that, I want to figure out which parameters to give to mke2fs, as in
mkfs.ext4 -E stride=2,stripe-width=2048 -L debian_chroot /dev/sdb2
Finding the erase block size in order to align the partitions is more important than the mkfs parameters and will make a much larger impact on performance than setting ideal stride and stripe.
Now to figure out the internal erase block size, flashbench was recommended. But I can not quite make sense of my result..
# fdisk.distrib -l /dev/sdb
Disk /dev/sdb: 15.9 GB, 15931539456 bytes 255 heads, 63 sectors/track, 1936 cylinders, total 31116288 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000604f9
Device Boot Start End Blocks Id System /dev/sdb1 2048 25890815 12944384 b W95 FAT32 /dev/sdb2 25890816 31115263 2612224 83 Linux
andrew@boomboom:~$ factor 15931539456 15931539456: 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 7 1447
So possibly a base 2 MiB erase block size, but also possibly masked by SanDisk's controller as in some other SanDisk cards.
# flashbench -va /dev/sdb --blocksize=1024 |(echo "align,pre [µs],on [µs],post [µs],diff [µs]" && sed -r 's/\w+ //g;s/\t/,/g;s/[0-9]+ns*/0/g;s/µs//g')|tee flashbench-16gb-sandisk-extreme-microsdhc-blocksize-1024.csv # flashbench -va /dev/sdb --blocksize=$[3*1024] |(echo "align,pre [µs],on [µs],post [µs],diff [µs]" && sed -r 's/\w+ //g;s/\t/,/g;s/[0-9]+ns*/0/g;s/µs//g')|tee flashbench-16gb-sandisk-extreme-microsdhc-blocksize-$[3*1024].csv
resulting CSV files attached.. I created a spreadsheet chart showing a drop.. does this mean the erasure block size is 128KB?
That would give a stripe-width of 128KB/(2*4KB)=16?
Likely the card does not have an erase block size smaller than 2 MiB due to the amount of flash in it, so 128 kiB is probably not the correct erase block size. Most larger sized cards have 2, 4 or 8 MiB erase blocks these days.
It's probably easier for those who read this list to see raw output of flashbench rather than looking at csv files or plots in order to assist with interpreting your results.
If you see a drop in the times when doing a read test, this often will indicate the size of the erase block, but not always. It's just a first pass test which is quick to run and does not damage contents of the card.
If you would prefer to pick a size to use which may not be the exact size of your erase blocks but should be a multiple, use 24 MiB to align your partitions. 24 is the least common multiple of 1.5, 2, 3, 4, 6, and 8 MiB (which are the most common erase block sizes in my experience) and on most disks will result in aligned partitions but does possibly throw away more space as unused than finding the exact erase block size.
And I have not at all grokked the benefit/applicability of open-au/open-au-nr for practical purposes.. Any clarification greatly appreciated.
The open-au tests will show you how many open erase blocks the card can handle. For example, if only one open-au is possible on a card, it may have to finish up doing the read-erase-write or read-write-erase garbage collection action before it will accept another write. This can slow writes of small sizes.
Arnd wrote up a good overview: http://lwn.net/Articles/428584/
Please see one of my flashbench results to give you some ideas on the commands to run and the meaning of the results. This is a Samsung card which is not very good: http://lists.linaro.org/pipermail/flashbench-results/2013-August/000452.html
Thanks, Andrew