changing the partition order in a faster way

Discussion in 'Wii - Hacking' started by PsyBlade, Jul 2, 2012.

Jul 2, 2012
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    some wii tools can only access the first partition on a drive
    this is a problem if your partitions already are in a different order
    or if you want to create an aditional partition to be first
    most tools to shrink partition leave the free space after the original one too
    copying all the data to change the order is possible but takes a lot of time

    I would like to try a faster way

    there are actually two orders to the partitions
    the order in which thier content is stored in on the drive (physical)
    and the order in which the pointers to this content are stored (logical)
    the canonical way is to have both match

    eg:
    primary partition 1: 0GB - 900GB
    primary partition 2: 900GB - 1000GB
    primary partition 3: unused
    primary partition 4: unused

    the problem with this is that changing the physical order means reading 1TB and writing 1TB
    using usb that takes a while
    but changing the logical order is done in only 512 Bytes (!)

    the idea is to stray from the canonical way and only change the logical order and leave the physical as it is
    in most cases this should work and have the order appear different
    only partitioning tools might get confused (really bad ones) or feel obliged to "fix" this (but good ones should ask)

    eg:
    primary partition 1: 900GB - 1000GB
    primary partition 2: 0GB - 900GB
    primary partition 3: unused
    primary partition 4: unused

    I would like some knowledgeable people to try this aproach and discuss their findings

    I wrote a little tool to demonstrate this
    if you can't make heads or tails of what to do with this keep away for now
    the code appears to work but curently has almost no saveguards, is really ugly and was only barely tested
    IF it works reasonably well I will apply more polish

    http://www.unix-ag.uni-kl.de/~t_schmid/partorder/
    Wiimm, tmv_josue and AACThaKid like this.
    • Member

    tueidj I R Expert

    Member Since:
    Jan 8, 2009
    Message Count:
    2,569
    Country:
    Pacific Ocean
    There's no reason why it shouldn't work, I've hex-edited the MBR to do something similar (inserted a FAT partition entry before a GPT to use it with a non-GPT capable device).
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    I know that in general it works. I had partitions it the wrong order in the past (by accident).
    I only "tested" it on linux, worked so flawlessly I only noticed it when fdisk suggested I fix it.
    But there might be any number of programs, operating systems and standalone devices that do not like it.
    • Member

    AACThaKid Dark Wolf is watching

    Member Since:
    Jul 2, 2012
    Message Count:
    113
    Location:
    Manchester, Ohio
    Country:
    United States
    i like the idea i just have no clue how to use or where to put the coding you have posted
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    at this time I only (barely) tested on linux
    but if you know how to do the respective steps in windows it should work there too

    with python 2 installed
    save it as a executable .py file
    unmount all partitions on the device
    run it with the device as sole argument
    use "sync"
    reread the partition table (eg reinsert the device)

    if there is interest from more people I will probably continue working on it
    • Member

    XFlak Considering Wii-tirement...

    Member Since:
    Sep 12, 2009
    Message Count:
    9,091
    Location:
    Ontario
    Country:
    Canada
    sounds cool, and would probably be helpful for a bunch of people :D
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    since I was already at some other just for fun coding give me a few hours and I see if I can get something together that someone without experience can run on windows
    but don't expect to much besides being guineapigs
    atm this is more to find out if it can work
    • Member

    AACThaKid Dark Wolf is watching

    Member Since:
    Jul 2, 2012
    Message Count:
    113
    Location:
    Manchester, Ohio
    Country:
    United States
    can't wait..... i just wanna play GC games on USB, i got 8gb sdcard so i can't play much GC games, and i do NOT have the money to even go to ebay and get a bigger SD lmao

    like i said i just dont know how to add it, run it or where to put the code, so please keep me in the loop lol... i run on Windows Vista 32-bit
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    I compiled a windows version of 0.0.2
    get it at http://www.unix-ag.uni-kl.de/~t_schmid/partorder/

    for now its a bit complicated to use

    start a windows command prompt (eg win-r:cmd)
    it probably needs admin rights
    change to the dir where you extracted it to(with "cd whereever")
    make sure nothing else accesses the drive

    run "partorder \\.\PHYSICALDRIVEn"
    where n is the drive number
    you should find it in where you can create partitions in windows
    or by trial and error (unless you use "s" to save it writes absolutely nothing to the drive)

    size is in sectors so you need to multiply by 512B or 4KiB to get the partition size (depends on drive)
    type 0x07 is ntfs or exfat
    type 0x0b or 0x0c should be fat16 or fat32

    after you saved wait a bit then disconnect it

    a backup is created in the dir, don't delete it by accident (restore will be implemented as needed)


    edit:
    please remember to report your experiences
    I need to know what works and what not
    no feedback means no development
    1 people like this.
    • Member

    AACThaKid Dark Wolf is watching

    Member Since:
    Jul 2, 2012
    Message Count:
    113
    Location:
    Manchester, Ohio
    Country:
    United States
    me and my brother are gonna take a shot Hopefully in the next few days, its a little crazy here lol

    as soon as i do anything i will post, hopefully others are trying aswell!
    • Member

    MassiveRican GBATemp's Unofficial Vigilante

    Member Since:
    Aug 2, 2011
    Message Count:
    1,985
    Location:
    Creeping in the Shadows
    Country:
    United States
    This sounds good and useful, unfortunately I don't have a drive I can sacrifice if anything goes wrong lol. I'll see if I can get a hold of a spare drive and test it out! I'll talk to my bud tonight and post my findings here.
    • Newcomer

    bleucheese7 New Member

    Member Since:
    Jul 16, 2009
    Message Count:
    3
    Country:
    United States
    Hi, i was following this guide, http://gbatemp.net/topic/329628-how-to-play-gamecube-games-off-a-usb-hdd/, and ran into the black screen problem since i had 3 partitions on my hard drive. I was able to fix my problem by changing which partition is primary and which partitions are logical. I was able to use EaseUS to convert my Gamecube game partition to primary and my other two partitions, including my Wii game partition, to logical. I've tested it once, but both gamecube and wii games seem to be working. Hope this helps.
    1 people like this.
    • Member

    reprep New Member

    Member Since:
    Jul 5, 2012
    Message Count:
    415
    Country:
    Turkey
    Just tried this program but unfortunately i am unsuccessful. My hdd has 2 partitions.1st is NTFS and 2nd is FAT and there is some unallocated space too. The program shows the partitions in the correct order (and shows 2 more partitions with 0 bytes), i switched the FAT and NTFS one, as FAT32 will be the first one. But gamecube games still didn't work on wii.

    I also tried bleucheese7's method, and it did exactly the same this program does. Meaning it made my FAT partition show as the first one (i confirmed this by running this partition order changer program again.) Again it didn't work.

    I assume my hdd has something to do with it. It is a 1.5 tb 3.5 inch Seagate which i don't remember the exact model though it is an old one.
    EDIT: Ooops, sorry. I forgot to force interlace on usbloader gx. That is why both 2 games i tried blackscreened on me. After turning this option on, it works wonders.I can confirm both methods work equally same and does the same thing ultimately. Change the order of first 2 partitions.It is easier to use bleucheese7's method. The logical partitions are placed on 5th and later partion numbers. So this makes my NTSC partition come later than my FAT partiton (flagged as primary and active partition) and solve our problem.
    • Newcomer

    nashismo New Member

    Member Since:
    Jun 5, 2013
    Message Count:
    1
    Country:
    Austria
    I will also confirm that using EaseUS, I have managed to swap partition order. My Wii partition was NTFS and was the first and was named H:. My second partition was I: and FAT32. Both were primary according to EaseUS.
    What I did first was changing the drive letter using EaseUS, now my NTFS partition was I: and my fat was H:. Then I changed, also using EaseUS, the NTFS partition to logical.

    Now everything is working great! Cheers.
    • Newcomer

    PirateHD New Member

    Member Since:
    May 30, 2013
    Message Count:
    18
    Country:
    United States
    I have a WD 1.5 TB drive with 3 Partitions, NTFS, FAT32 & WBFS in that order. Found USB Loader GX was not playing the GameCube games from my FAT32 partition, it was detecting it as USB2. I used EaseUS to convert the first NTFS Partition to Logical, now the Wii is detecting the FAT32 drive as USB1 and am able to play GC games. Thanks.

    EDIT: Not sure if its related or not...but after I disconnected my external drive and rebooted the PC I got error "BootMGR Missing" & couldn't boot into Windows, couldn't repair it with the windows repair disk so I had to reinstall my OS.
    Last edited by PirateHD, Jun 18, 2013
    • Global Moderator

    Cyan GBATemp's lurking knight

    Member Since:
    Oct 27, 2002
    Message Count:
    9,120
    Location:
    Engine room, learning
    Country:
    France
    Drive letters are only used inside Windows OS as naming convention for microsoft's program. it doesn't affect other operating system or the Wii, and it doesn't change the physical partition order on the drive.
    DIOS MIOS (Lite) is loading the first primary partition of the drive, so making the first partition an extended one, the second partition became the first Primary partition on your drive.

    I thought USBLoaderGX would still detect the FAT32 as USB2. I'm curious about this.
    Maybe the primary to extended conversion swapped the order the partitions are defined in the table?
    • Member

    PsyBlade Snake Charmer

    Member Since:
    Jul 30, 2009
    Message Count:
    2,204
    Location:
    Sol III
    Country:
    Germany
    Very likely that this was done. E.g. old windows versions assumed that order and would not work otherwise.
    No one knows what else adopted that behaviour.

    Best practice is to have the 4 entries in the order:
    1. 1-4 primaries
    2. 0-1 extended
    3. 0-3 unused

    Anything else is rather hit and miss.

    (Got a config once that, while working perfectly normal otherwise, would cause windows disk management to display 4 primaries followed by one extended.
    Which is of course not possible.)
    Cyan likes this.
    • Newcomer

    MacGuffin3 New Member

    Member Since:
    Jul 15, 2013
    Message Count:
    21
    Country:
    United States
    My first partition is WBFS and Easus and Windows see it as 'unformatted' there is no option to change it to logical. Looks like I'm out of luck unless I buy a new HDD and partition it in the reverse order and then copy everything over.

Share This Page