wbfs2fat.py

Discussion in 'Wii - Backup Loaders' started by PsyBlade, May 3, 2011.

May 3, 2011

wbfs2fat.py by PsyBlade at 10:40 PM (90,332 Views / 14 Likes) 245 Comments

    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    wbfs2fat.py - WBFS to FAT32 conversion
    version 0.8.6 - 2012-07-27
    © 2012 by PsyBlade - all rights reserved
    http://gbatemp.net/t291320-wbfs2fat-py

    Features:
    • converts a WBFS partition into a Fat32 partition - on the fly/in place
    • keeps Games as 4GiB splited ID6.wbfs files in wbfs folder
    • blazing fast - over 10GiB/s! (50GiB Test in 4.27s)
    • needs very little space on other drives
      only ~0.0125% of the partition size for Backup and RAM
    • Windows + Linux (with some adjustments everything that runs python)
    • both GUI and CLI available
    • designed with security in mind
      only modifies disk after all other computations
      creates backup of modified data
    Requirements:
    Windows(.exe): nothing!
    Linux(.py): python (+PyQt4 for GUI)
    Windows(.py): python + pywin32 + WMI for python (+PyQt4 for GUI)
    Windows(Cygwin .py): Cygwin + its python package
    (The versions marked "update" need to be copied over the next earlier full version)

    Usage GUI:
    run wbfs2fat without options (e.g. double click)
    Select partition from list
    Click "convert to Fat32"

    Usage CLI:
    "wbfs2fat --help" to see all options
    "wbfs2fat -m scan" to list of all wbfs partitions
    "wbfs2fat -m convert " to convert

    FAQ
    WARNING! Spoilers inside!

    Exit Codes and Error descriptions
    WARNING! Spoilers inside!

    Licence
    WARNING! Spoilers inside!

    Links:
    Download wbfs2fat
    Homepage/Discussion Thread
    Detailed Tutorial/Howto
    GUI demo video

    If you have questions/suggestions/comments just ask.
    Especially patches are welcome.
    Last edited by PsyBlade, Dec 9, 2012


    • Member

    kylster mich weich töten

    Member Since:
    Sep 11, 2010
    Message Count:
    1,354
    Location:
    Fr33D0M R1N6
    Country:
    United States
    could you post a windows copy? i would like to try it but alas im not linux friendly LoL
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    no sorry no windows version from me
    I'm not opposed to include patches for windows
    but I dont know how to do it

    I'm invoke mkfs.vfat, fsck.vfat, mount, umount & sudo and dont know a windows alternative for any of them. Plus I dont use windows
    • Member

    kylster mich weich töten

    Member Since:
    Sep 11, 2010
    Message Count:
    1,354
    Location:
    Fr33D0M R1N6
    Country:
    United States
    Well that sucks [IMG] tried running ubuntu from cd but all i get is a install program type screen. I cannot actually do anything on linux using the cd boot [IMG]
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    at the moment you will need knowledge of linux and python to make use of this
    this release is intended for review not for actual use

    but a live cd/usb should do fine running it - no need to install anything
    • Member

    ManFranceGermany Atheist, Socialist and pro EU!

    Member Since:
    Nov 14, 2010
    Message Count:
    624
    Country:
    Germany
    can't u run this very easily with a python lib for windows?

    well, if you can't here a list with Live CDs (Damn Small Linux and NimbleX are nice): http://www.livecdlist.com/
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    the linux dependency is only really basic stuff, any distri should be able to do it
    any other decent OS should too, but I dont use anything else

    I dont use any fancy python libs too afaik

    I think I need only the the following 4 lines ported for Windows support:
    mkfs.vfat -I -f1 -F32 -R32 -s -l
    fsck.vfat -a
    mount umask=000
    umount

    python code or program calls will both do
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    Is there any interest in this?
    While I do code for fun, Im not going to do the more boring stuff like usage guide, code documentation, cleanup, UI and such if no one will ever bother to take a look at it.
    • Member

    Rydian Resident Furvert™

    Member Since:
    Feb 4, 2010
    Message Count:
    27,886
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    I'm sorry if you feel discouraged. I asked a few people if they'd know anything about porting it, but the people I asked aren't familiar enough with the concepts to do it easily, or have bigger projects they're working on.
    • Member

    XFlak Considering Wii-tirement...

    Member Since:
    Sep 12, 2009
    Message Count:
    9,095
    Location:
    Ontario
    Country:
    Canada
    I wouldn't worry about porting this to Windows, Windows users already have access to WiiBackupManager for Windows, which can do exactly what this app does and more. This app might be faster than WBM when transferring\converting games from a WBFS partition, I'm not sure, I've never tested the speed of that function of WBM b4.

    My point is, I'm sure people who run linux would find this app useful cuz they can't use WBM (which only works on Windows), but for this app to be truly useful it should support converting games to\from cISO, ISO, WBFS partitions and WBFS files (and perhaps discex extracted format for s/uneek+di). From what I gather, in it's current form this app will only be useful for people running linux and would like to switch from a WBFS formatted HDD to FAT32... but these days most people don't use WBFS partitions anymore so u probably won't see a lot of demand for this app in it's current form.

    Don't be discouraged, you're working on this and sharing it out of the kindness of your heart, as long as it doesn't corrupt ppls data (and I'm not saying it does) then you can do no wrong.
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    Yes the scope of this program is quite limited.
    It converts a WBFS partition into a FAT32 partition while keeping the games and using very little space (some megs ram +
    • Member

    DarkMatterCore I like turtles.

    Member Since:
    May 30, 2009
    Message Count:
    724
    Location:
    Cabimas, Zulia, Venezuela.
    Country:
    Venezuela
    You did. WBM doesn't have that function, AFAIK (I believe XFlak misundertood your description and thought this program is for converting Wii game image files to the WBFS format).

    In any case, good luck trying to port this to Windows.
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    just upped a windows version
    see first post

    I reimplemented all required functionality in python
    but you will need cygwin because I dont know how to open partitions using the windows api
    I would be glad if someone fixed this

    plus its much faster now
    • Member

    oggzee New Member

    Member Since:
    Apr 11, 2009
    Message Count:
    2,335
    Country:
    Slovenia
    So this thing creates the FAT filesystem in place and links the files to the data without moving any data?
    If I understood this correctly then you've done an amazing work, good job! [IMG]
    Or even if it works differently it's still amazing [IMG]
    What is backed up? Only the first couple of sectors or everything?
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    Yes, essentially it keeps the data in place and creates fitting metadata
    For this I need some additional space in the beginning of the drive so I have to move some blocks around
    The original state of this start area is backed up (6M on a 50G drive)
    The backup is not needed, its only for disaster recovery and to allow a quick reset for testing
    Skipping it is not implemented but can done easily if space is really tight
    • Member

    XFlak Considering Wii-tirement...

    Member Since:
    Sep 12, 2009
    Message Count:
    9,095
    Location:
    Ontario
    Country:
    Canada
    So if I'm understanding correctly now... this will allow users with a wbfs partition to switch to using a FAT32 partition (and wbfs files) without needing to first backup the games on the wbfs partition to another drive, reformat the wbfs partition as FAT32 and copy the games back? Instead this app can take a wbfs partition and directly convert it to FAT32 while retaining all the games\data that was on the wbfs partition to begin with... right?

    If I understand this correctly... that's pretty sweet and has never been done before.
    • Global Moderator

    Cyan GBATemp's lurking knight

    Member Since:
    Oct 27, 2002
    Message Count:
    10,468
    Location:
    Engine room, learning
    Country:
    France
    I find this tool interesting, but I'm a little afraid of using it and loosing my partition, or corrupting the other partitions. (I have a dual FAT32 + WBFS).
    And, my wbfs partition is working fine, I like the "don't fix it if it's not broken".

    I'll wait until some users report their result.
    But thank you for all your work on making this tool, it was asked a lot of time.
    It's just too bad it's a little late in the scene, many users would have use it when FAT32 became possible.

    There's certainly a lot of users like me with their WBFS partitions wishing to convert it.
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    @XFlak: yes you do understand correctly

    @Cyan:
    Loosing another partition is near impossible; I only open a partition, not the entire drive.
    The operating system then enforces it boundaries, even if I try to access outside of it.
    You will just end up with two fat32 partitions, but other tools might join them.
    I remember "Partition Magic" from over 10 years ago.
    But loosing the partition is a danger yes. but Im pretty confident the backup feature will save you.

    Yes the tool is a bit late to the party, but I switched to fat32 almost immediately and have no need


    I and potential users would be grateful for any test results.
    A test does not need to be on live data, it can be done on partitions created only for the test.
    If you already have Python or Cygwin installed it will take little time.
    A test on 4KiB sector drives would be really great, since I don’t know how to emulate or have them.
    • Member

    Gabelvampir Free Mars!

    Member Since:
    Mar 17, 2009
    Message Count:
    451
    Location:
    K-Town
    Country:
    Germany
    (Full disclore: I'm a friend of the author)

    I just tried the program and it worked for me. But since I use FAT32 for my Wii USB HDD for some time now I used a wbfs on a 2GB USB stick to test it with only 3 games on it.
    So it is not really a realistic case, but it worked and should work in most real cases as far as I understand it. I also tried the recovery via dd and that worked too.
    I mostly ignored his instructions a I know my way around a Unix system, although it was my first time using CygWin.
    A little bit of advice: 1) If you have Windows 7 or Vista and have the UAC activated run CygWin a an administrator (right click->run as adminstrator). It is not really necessary but some CygWin device handling stuff is a bit weird if you don't do that and the dd recovery does not work.
    2) Give program the optional Windows mount point for your device. Saves a bit of file renaming, but will probably want to use some manage to give the file human readable names and/or directories. But if you let the program rename the files a bit they at least work in a USB loader, they don't if you do nothing as they are not in the right dir and do not have any supported name scheme.

    Stuff my test case did not account for:
    1) Devices full to the brim with images.
    2) Splitted images (for games over 4GB).
    3) Devices with 4 kB sectors.
    4) probably some other stuff I don't think of right now.
    • Member

    nunavat2010 New Member

    Member Since:
    Mar 13, 2011
    Message Count:
    195
    Location:
    Canada
    Country:
    United States
    I'll try this tonight, I use ubuntu 11.04, have dual layer games, will report result. Just one question, you can't go back to wbfs format just like the XP tool to convert Fat to NTFS?

    One more thing. Is there an easy way to add *.iso to fat partition, if they are bigger than the file size limit? Right now my main USB disk is ntfs (not /ext1/ etc) formatted. So when I have several iso files in it I use
    Code:
    wwt add *.iso --part /dev/sdb2
    where /dev/sdb2 is my wbfs partition. What single line command would I use in ubuntu after converting it to fat? Sorry, If I am deviating from the main point.

SPONSORED LINKS
 

Share This Page