Well, it appears that Ubuntu's "Disks" formats everything (SSDs, SD cards, USB sticks) with the first partition start at block 2048.
Typical example (a 16GB card I use in DSTWO+, not DSTWO):
Code:
sudo fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 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
Disklabel type: dos
Disk identifier: 0xb847d94e
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 31116287 31114240 14.9G c W95 FAT32 (LBA)
I had used a friend's windows 10 computer to use the windows version of the SD formatter to format my uSD for the Supercard DSTWO and it did not even have a partition table: it mounts as /dev/mmcblck0 and fdisk -l reports nothing at all except for "Disklabel type: dos"
Ubuntu Disks says the filesystem type is FAT32 (32-bit) type b.
The article linked below says an SD data parition should start on an erase block boundary and the the FTL(controller, voodoo, whatever you wanna call it) assumes there is a FAT and gives special priority to those first couple blocks. Crazy.
Are you doing something like
this (summarized here for convenience):
0. Set heads and sectors to sane (I guess) value (sudo fdisk -H 255 -S 63 -u -c /dev/mmcblk0)
1. Use flashbench to determine erase_block_size (or just guess 4MB (8192 blocks) or 8MB (16384 blocks)
2. Determine FAT_size (using dosfsck)
3. data_start_block = erase_block_size - 2*FAT_size
4. sudo mkdosfs -n NAME -s 128 -R data_start_block -v /dev/mmcblk0p1
I tried this on a well-used Sandisk Cruzer Blade 8GB USB stick. Flashbench seemed to indicate that the erase block size was 8MB, so I used 16384 for erase block size. I threw a few large files at it and there was no huge speed difference. Then I tried it with probably wrong erase block size of 8192. It seemed a little slower, but nothing to go crazy over.
All of this is for MBR + FAT32 SD cards. I wonder what to do with ext4?
EDIT: It looks like emunand9 guesses 4MB
here:
Code:
#define PARTITION_ALIGN ((4 * 1024 * 1024) / 0x200) // align at 4MB
Do all (u)SD cards likely to be used in (n)3DS (eg. 8-32GB) have 4MB erase block size?
I guess so. I have 2,4,8,16 GB Sandisk and Lexar cards and they all say this when I stick them in a linux pc:
Code:
cat /sys/block/mmcblk0/device/preferred_erase_size
4194304