Jump to content


  • Please log in to reply

wbfs2fat.py

, WBFS to FAT32 conversion - no request - code (Go to first unread post)
PsyBlade Post #1 Posted 03 May 2011 - 10:40 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

wbfs2fat.py - WBFS to FAT32 conversion
version 0.8.3 - 2012-02-17
© 2011-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

New in 0.7:
previous version were a bit overcautious in scanning WBFS for possible errors
please try again if you aborted because of "error 6"

additionally option "ignore-error-6" is now included to deal with actual errors
see error description below


New in 0.8.1:
changed folder naming to /wbfs/TITLE [ID6]/ID6.wbfs, which is the default one in WBM
Title is taken from disc, title.txt might come in the future


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


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 <device>" to convert


FAQ 

Exit Codes and Error descriptions 

Licence 

Links:
Download wbfs2fat-0.8.3.tar.bz2
Homepage/Discussion Thread
Detailed Tutorial/Howto
GUI demo video

If you have questions/suggestions/comments just ask.
Especially patches are welcome.

Edited by PsyBlade, 17 February 2012 - 06:09 PM.



kylster Post #2 Posted 03 May 2011 - 10:52 PM

    mich weich töten


  • Group: Members
  • Posts: 1,116
  • Member No.: 261,783
  • Joined: 11-September 10
  • Location: Fr33D0M R1N6

  •  

could you post a windows copy? i would like to try it but alas im not linux friendly LoL



PsyBlade Post #3 Posted 03 May 2011 - 11:33 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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



kylster Post #4 Posted 04 May 2011 - 02:05 AM

    mich weich töten


  • Group: Members
  • Posts: 1,116
  • Member No.: 261,783
  • Joined: 11-September 10
  • Location: Fr33D0M R1N6

  •  

Well that sucks frown.gif 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 frown.gif


PsyBlade Post #5 Posted 04 May 2011 - 01:16 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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



ManFranceGermany Post #6 Posted 04 May 2011 - 01:36 PM

    GBAtemp Advance Fan

  • PipPipPipPipPip

  • Group: Members
  • Posts: 620
  • Member No.: 267,377
  • Joined: 15-November 10

  •  

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/

Edited by ManFranceGermany, 04 May 2011 - 01:37 PM.


PsyBlade Post #7 Posted 05 May 2011 - 01:01 AM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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 <cluster size> -l <badblocks file> <device>
fsck.vfat -a <device>
mount umask=000 <device> <dir>
umount <dir>

python code or program calls will both do


PsyBlade Post #8 Posted 06 May 2011 - 11:08 AM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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.


Rydian Post #9 Posted 06 May 2011 - 05:49 PM

    Resident Furvert


  • Group: Members
  • Posts: 15,815
  • Member No.: 244,492
  • Joined: 04-February 10
  • Location: Virginia

  •  

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.


XFlak Post #10 Posted 06 May 2011 - 06:16 PM

    Batch File King


  • Group: Members
  • Posts: 8,510
  • Member No.: 198,223
  • Joined: 12-September 09
  • Location: Ontario

  •  

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.


PsyBlade Post #11 Posted 06 May 2011 - 07:37 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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 + <100M backup file) and time (50G in 40s).
That is all it was ever intended to do.

For extracting games from WBFS partitions and converting between the formats there are already wiimms wit tools.
No need for anything else. And much to much work too.

My prime motivation was the challenge.
I never expected a big audience for it, in fact I expected the problem too hard to be fun and thus never releasing anything usable.
Now that I done it I thought I might as well share it.

While I'm not going to to easily abandon anyone wanting do do anything with it (running, developing, porting, ...),
I see no point in doing further work on it if there is no one who is considering to ever use it.
Thats why I asked. If someone wants help, I'm willing to help, if not I do something else. I reached my main goal anyway.

I would like to see a windows port too, but the only way I could do it without help is via VirtualBox,Vmware,...
And considering you that most users are only going to run it one single time, a live CD/DVD/USB is much easier for everyone.

@XFlak: are you sure about WBM? I don't know it but I really thought I did something new.

Edited by PsyBlade, 06 May 2011 - 07:52 PM.


PabloACZ Post #12 Posted 06 May 2011 - 11:39 PM

    I like turtles.

  • PipPipPipPipPip

  • Group: Members
  • Posts: 605
  • Member No.: 180,929
  • Joined: 30-May 09
  • Location: Cabimas, Zulia, 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.


PsyBlade Post #13 Posted 09 May 2011 - 01:46 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

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


oggzee Post #14 Posted 09 May 2011 - 02:30 PM

    GBAtemp Addict


  • Group: Members
  • Posts: 2,311
  • Member No.: 173,040
  • Joined: 11-April 09

  •  

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! smile.gif
Or even if it works differently it's still amazing wink.gif
What is backed up? Only the first couple of sectors or everything?



PsyBlade Post #15 Posted 09 May 2011 - 03:53 PM

    Snake Charmer


  • Group: Members
  • Posts: 1,374
  • Member No.: 190,003
  • Joined: 30-July 09

  •  

QUOTE(oggzee @ May 9 2011, 03:30 PM) <{POST_SNAPBACK}>
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! smile.gif
Or even if it works differently it's still amazing wink.gif
What is backed up? Only the first couple of sectors or everything?


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

Edited by PsyBlade, 09 May 2011 - 03:59 PM.







Users browsing this topic

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users