How to format SD card for the best performance?

Discussion in '3DS - Console, Accessories and Hardware' started by SomeGamer, May 24, 2016.

?

Best method of formatting SD card?

  1. SDFormatter

    4 vote(s)
    40.0%
  2. 64k cluster size

    6 vote(s)
    60.0%
  1. SomeGamer
    OP

    SomeGamer GBAtemp Guru

    Member
    5,750
    2,703
    Dec 19, 2014
    Hungary
    I just got a brand new 64GB SDXC Class 10 UHS card. Did a quick search on how I can get the fastest read / write speed out of it. Many recommended using SDFormatter, but here on GBAtemp people were talking about formatting for 64k cluster size. Obviously I can only do one of them.
    So which is better? I don't want to start moving my games over just yet, knowing I might have to reformat it later.
    Take your choice in the poll above and thanks a lot for your help!
    EDIT: Don't use SDformatter, see Featured Post #5
     
    Last edited by SomeGamer, Sep 18, 2016
  2. driverdis

    driverdis I am Justice

    Member
    2,383
    901
    Sep 21, 2011
    United States
    1.048596β
    Format with SD Formatter than reformat as 64k cluster size.

    Also, SD Formatter will format as ExFAT so it is useless for 3DS without reformatting. This is because SDXC specs have ExFAT as the filesystem and not FAT32.
     
    Last edited by driverdis, May 26, 2016
  3. SomeGamer
    OP

    SomeGamer GBAtemp Guru

    Member
    5,750
    2,703
    Dec 19, 2014
    Hungary
    I completely forgot about the SDXC ExFAT thing! So it's 64k cluster size with some third party formatting tool. Thanks!
     
  4. sudloa

    sudloa Member

    Newcomer
    10
    0
    Jul 19, 2015
    Thailand
  5. driverdis

    driverdis I am Justice

    Member
    2,383
    901
    Sep 21, 2011
    United States
    1.048596β
    Of course they did. Nintendo only supports SD Cards 32GB and under in the 3DS, which SD Formatter will format them as FAT32 as per SD/SDHC specs.

    However, any cards larger than 32GB will be formatted as ExFAT by SD Formatter as per the SDXC specs and will not work in the 3DS until formatted as FAT32.

    SD Formatter is designed to guarantee maximum compatibility with devices as it formats SD Cards exactly to meet the SD/SDHC/SDXC specs.
    SDXC specs are ExFAT, not FAT32 so that is what SD Formatter will use.
     
    Last edited by driverdis, May 26, 2016
  6. Duo8

    Duo8 I don't like video games

    Member
    3,440
    1,139
    Jul 16, 2013
    If you want to go really far with this, run benchmarks to determine the card's erase block size, then align partitions to it. With this, you may also notice certain quirks your card may have.
     
  7. SomeGamer
    OP

    SomeGamer GBAtemp Guru

    Member
    5,750
    2,703
    Dec 19, 2014
    Hungary
    Which program would you recommend for benchmarking?
     
  8. consecrated

    consecrated Member

    Newcomer
    32
    5
    May 10, 2016
    United States
    I spoke with someone from /r/3dshacks on discord and they recommended I use emunand9 to format it.
     
  9. Duo8

    Duo8 I don't like video games

    Member
    3,440
    1,139
    Jul 16, 2013
    The process is actually very involved: (Not everything is relevant, read FAT Optimization) https://wiki.linaro.org/WorkingGrou...WorkingGroups/Kernel/Projects/FlashCardSurvey
    Also: https://raspberrypi.stackexchange.c...erformance-for-record-size-8-128-kb-drops-bel
    Benchmark tool: (Read above first) https://github.com/bradfa/flashbench

    In reality it doesn't really matter how you format it. If it works it most likely works well enough, anything else will just give negligible advantages, if any at all.
     
    Ailuros27 and SomeGamer like this.
  10. Selver

    Selver 13,5,1,14,9,14,7,12,5,19,19

    Member
    203
    276
    Dec 22, 2015
    A relatively simple optimization, presuming your use is 90% read-only (true for 3DS usage):

    After the SD card is mostly or fully setup with the files you will normally use, the following steps will optimize the layout slightly. I'll use drive letter S:\ as the one for the SD card, and temporary folder D:\TempSD\ as the temporary location on your computer for files....
    1. REM -- Copy the files from the SD card into the temporary holding area
      Robocopy S:\ D:\TempSD /E
    2. REM -- Re-format the SD card
      (e.g., using EmuNAND9 on 3DS)
    3. REM -- Create the file system structures with zero-byte placeholder files
      Robocopy D:\TempSD S:\ /E /CREATE
    4. REM -- Now copy the actual file data back to the SD card
      Robocopy D:\TempSD S:\ /E
    Specifically, the above achieves two results:
    • The file system's metadata is stored contiguously at the start of the SD card. This can reduce the number of actual reads required to locate data on the card. This portion is most useful when used on media that has been heavily used, and thus has fragmented the file system. For example, the 3DS often will lookup directories 4+ levels deep, requiring one logical read per level. If the file system metadata is contiguous, it may require fewer actual reads.
    • All file data is stored contiguously. This minimizes the number of actual reads required to read the contents of files.
    There's actually a whole lot of additional micro-optimizations that you can do. For example, knowing which files are read, and in which order, you can layout the file system such that the data requested is physically contiguous. You can ensure the most-often used directories (such as "Nintendo 3DS") are in the first sector of each directory (avoiding multiple reads to find the subdirectory of interest). Etc.

    Formatting the media is useful, but most improvement (vs. well-used card with same data) will come from defragmentation. The above steps are the simplest method to do this, without use of 3rd party tools, at the cost of time moving the data off the card and back on.
     
    bjaxx87, Sobliv, Aglaophotis and 3 others like this.