Help on WBFS for dual partitions in SDHC card

Discussion in 'Wii - Hacking' started by pcfree, Apr 25, 2009.

Apr 25, 2009
  1. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
    I have manually partition my 16GB SDHC card with 2 partitions both as primary ones. However, the Windows (Vista) cannot map the 2nd partition to any drive letter, no matter the ID of the unformatted 2nd partition is FAT32 or NTFS. Without drive mapping, all Windows based wbfs tools such as WBFS Manager cannot work on this 2nd partition, although the Wii SD/USB loader actually works on it. The only workable one is the old 1st generation wbfswin which is directly port from linux but still with delete-bug. I did some search works trying to find the old source code to fix it, but seems not easy to find.

    I have also tried an external USB HDD with dual partitions. The Vista can map both partitions and new WBFS tools work for it. Is this the problem that Vista only recognizes 1st partition for removable media such as SD card on card reader?

    The old wbfswin can auto search 1st available WBFS partition in the system w/o drive mapping. Would any WBFS Windows port be able to kindly add smiliar function? Or if any already works?

    ----------------------------------------------------------------------------------------------------------------
    A small Win32 Console app demos how to auto search WBFS by directly scan \\.\PhysicalDrive#. It may help Win WBFS tools developers to handle non-Windows created WBFS (partition id not Fat/Ntfs) or SD dual partitions problem.

    1st release: ScanWbfs.zip (exe+source code)
    http://www.mediafire.com/download.php?nwctdgyddkz
    Scan all drives except drive 0

    2nd release: ScanWbfs02.zip (exe+source code)
    http://www.mediafire.com/download.php?jxzzizynqle
    Scan only USB devices
     
  2. calimero100582

    Newcomer calimero100582 Member

    Joined:
    Nov 5, 2008
    Messages:
    31
    Country:
    Canada
    Can you use this version for me I have no sdcard with 2 partitions to test

    wbfsGUI v13 Beta

    It will not work, but if it show you at the bottom right after loading that theres is unmounted volumes, I'll have something to work with, and make a new version that will mount unmounted volume, or access them in some other way
     
  3. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
    it won't show unmounted volumes message!

    I guess it might be necessary to directly scan partition table for all \\.\PhysicalDrive#.
     
  4. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
    @calimero

    I have just written a little Win32 console program to scan all available unformatted and WBFS partitions by opening all \\.\PhysicalDrive# (except 0 for safety). This is a new way to find/access WBFS, no matter they are mounted/mapped or not. This method needs no drive letter assignment to access WBFS, and can be used to auto-search existing WBFS and/or unformatted (therefore suitable to be used as WBFS) partitions.

    It would be great for me if any WBFS developer would like to implement such function in their applications.

    My ScanWbfs.c/exe link:
    http://www.mediafire.com/download.php?nwctdgyddkz
     
  5. calimero100582

    Newcomer calimero100582 Member

    Joined:
    Nov 5, 2008
    Messages:
    31
    Country:
    Canada
    I will take a look a this.

    If it work correctly I may convert it to mount all unmounted partition on windows without the need of driver

    Thanks
     
  6. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
    @calimero
    add some missing comments in the C code:

    // basic information for partition table
    // size: 0x200 (512 bytes)
    // partition magic # (word): 0xaa55 @ 0x1fe
    // partition entry count: 4
    // partition entry size: 0x10 (16 bytes)
    // partition entry @ 0x1be,0x1ce,0x1de,0x1ee
    // for each partition entry structure:
    // partition id (byte) @ 0x04
    // starting sector (dword) (lba) @ 0x08
    // partition size in sectors (dword) @ 0x0c

    In addition, parameter FILE_ATTRIBUTE_NORMAL in CreateFile() should be changed to 0, although both work.

    BTW, I think it would be more safe to add check if it is an USB device. I'll try to add some USB check code later.
     
  7. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
  8. calimero100582

    Newcomer calimero100582 Member

    Joined:
    Nov 5, 2008
    Messages:
    31
    Country:
    Canada
    Yeah I've been able to manage this, but I'm not sure it's a good way to limit only to USB.
    If Everything go well I'll give you a test application tonight (for me in about 12 hours)
     
  9. calimero100582

    Newcomer calimero100582 Member

    Joined:
    Nov 5, 2008
    Messages:
    31
    Country:
    Canada
    For other person who may be interested

    Here a version of wbfsGUI that can read/write to SD card or USB flash drive with multiple partition, even if windows don't see them

    wbfsGUI v13 Beta 2
     
  10. pcfree
    OP

    Newcomer pcfree Advanced Member

    Joined:
    Mar 29, 2009
    Messages:
    59
    Country:
    Taiwan
    test it OK, thanks!
     
  11. huns28

    Newcomer huns28 Member

    Joined:
    Jan 14, 2009
    Messages:
    19
    Country:
    United States
    it worked for me:
    kingston traveldrive 4.0 gb
    1 gb main partition

    3 gb logical partion, unassigned letter , transfered 1 one ( world at war) and works fine so far
     
  12. mousex

    Member mousex GBAtemp Advanced Fan

    Joined:
    Jan 23, 2009
    Messages:
    987
    Country:
    United States
    Can anyone reupload it? On this server there is only v14 which cannot access drives without letters.
     

Share This Page