Announcing the beta release of lpartx - my Linux based partitioning tool for the xbox hdd. This is an open-source project.
This draws on:
1. My recent work on Xbpartitioner 1.2 RC
2. xboxdumper for Windows
3. friedgold's mini linux. With xpad-keyboard patch by Chimpanzee
4. Shallax's Gentoox Loader.
5. My incomplete xboxhdm3.
6. chimpanzee's chimp26.
Features:
1. Shows the actual cluster size used by extended partitions for safety. Highlights cluster sizes in error. ie 32K when 64K should have be used, 16K when 32K should have been used.
2. A subset of xbpartitioner partitioning capability for extended partitions. Aka the toggle of partitioning schemes in xbpartitioner via the A button etc.
CODE
partition type 1: F partition is capped at 137Gb or less
partition type 2: F partition occupies all space
partition type 3: G partition occupies space after 137Gb
partition type 4: F and G partitions splits space evenly
3. A simple dialog based GUI controlled by the d-pad and A button (as opposed to B,X,Y buttons) on the controller. Original MS controller may be needed.
4. Works on Xbox 1.6 as well. In fact I used one as my test machine.
5. Formats 32K and 64K FATX extended partitions.
6. Should work on 1TB hdd and beyond. But I can't test this myself.
7. Hidden chimp26's cloning/locking/unlocking capability in linux shell - untested.
8. A simple GUI to configure network.
9. Reboot and Shutdown options.
10. Possibility of going to Linux shell from the main menu. USB keyboard needed.
11. I think telnet and ftp daemons are started if you need them.
12. Option to display the xbox version and hardware details.
Usage instructions:
1. Place the unzipped files in E:\Apps\lpartx folder.
2. Place linuxboot.cfg at the root of E drive. This file must reside at this location. If you change the installation folder in step 1, edit this file.
3. Launch default.xbe in lpartx folder. This is actually Gentoox loader. Comes with a simple GUI.
4. Select FATX boot option.
5. Press A button on controller when prompted to start a login and hence launch the tool.
6. Use controller's d-pad up and down arrows to navigate menu. A button to select option. If you have USB keyboard it will work too.
7. Select Reboot or Shutdown options after you have formatted the extended partitions.
I will try to capture screenshots. Will also post my Linux source code in subsequent posts.
Doesn't work on my X-Box, after selecting FATX I get:
QUOTE
Booting ...
Boot: Loading kernel '/Apps/lpartx/linux24379'... [x]
And there it freezes. Though I suspect this is a problem with my X-Box, which also freezes on PBL. I have no idea why.
Machine is a 1.0, TSOP flashed with X2 5035. Oddly enough I have another machine which is pretty much the same - that works with PBL, but I don't have it to hand to test it with this (only difference I know of is the HDD, which is stock (dunno if it's WD or SG), as opposed to the 750gb SATA Samsung in the problem machine).
You might consider renaming the XBE's title from "Linux" to "Lpartx", if only for the sake of presentation. One way to do this is by hitting the white button over it while viewing it in XBMC's Programs menu, though I'm sure there are PC-based tools that can do this as well.
To my limited understanding, programs should be able to determine where their XBE is launching from, which would make the config file redundant (and also allow for a version that'd boot from any location). Though I dunno how that would be done without the XDK.
QUOTE(ldotsfan @ Jun 24 2010, 10:34 AM)

I had issues launching Linux from my 1.1 xbox with XBMC as dash at one stage and did a workaround by first launching unleashX then launching the Linux XBE from there. Maybe you could try launching through unleashX instead.
I'm just brain-dead as it turns out. I'd copied the app to the correct location, then immediately "corrected" myself by moving it to my usual apps folder - e:\apps\applications.
After fixing that, got a Linux init-type screen with a few errors in it:
QUOTE
PCI: Failed to allocate resource 2(f8000000-f7ffffff) for 01:00.0
Populating ramdisk...
Mounting hard drive partitions...
Starting network...
DHCP broadcast failed, falling back to static IP
IP Address: 10.0.0.100
Starting FTP Server...
Starting Telnet Server...
You may now connect using:
username:root
password:xbox
Please press Enter to activate this console. kmod: failed to exec /sbin/modprobe
-s -k net-pf-10, errno = 2
Dunno how much of that was expected. My console is networked and has access to a working DHCP server. I was able to ping to it on the static address (which I assume it picked up from what I'd set in the MS dash, 'cause that's the one I usually use anyway), but the FTP server didn't seem to be responsive. Though I doubt any of that matters.
Anyway, I pushed A on that screen and it jumped to the program. Option 2, "Xbox Info", worked fine: option 3, "Partition Info", gave me this:
QUOTE
Total Sectors -> 1465149168
Error reading partition table in /dev/hda
Error in listing partitions
(The drive is a Samsung HD753LJ (750gb SATA), with about 500gb assigned to F (32kb clusters) and 250gb assigned to G (16kb clusters). Each of these partitions has less then 10gb free.)
I went into the "Format Extended Partitions" menu and tried the "List Partitions" option there, that just flickered the screen and jumped back to the main menu again.
QUOTE(ldotsfan @ Jun 24 2010, 10:34 AM)

As for the title change, again Gentoox Loader needs to be recompiled. Not a priority but I'll get to it if I can find the piece of code to change

Er, no, I'm quite serious: XBMC can patch the titles embedded in compiled XBE files directly. I wasn't sure if it'd work on this specific one, so I even tested it before making my previous post.
(All of the above info about the new set of errors was with an unpatched XBE, of course. I also configured my console to boot directly to UnleashX and performed a hard-reset, but that didn't affect matters either).
QUOTE(ldotsfan @ Jun 24 2010, 08:46 PM)

1. Fixed DHCP problem in new version. My router assigned an IP to the xbox.
Yup, works correctly now.
QUOTE(ldotsfan @ Jun 24 2010, 08:46 PM)

3. Telnet should be working.
Didn't test this before, but I see it's working now.
QUOTE(ldotsfan @ Jun 24 2010, 08:46 PM)

4. Fixed "List Partitions" option.
5. The "Error reading partition table" is more serious. Basically what it does is to read the xbpartitioner inserted magic string which uniquely identifies the partition table existance at sector 0, offset 0.
CODE
****PARTINFO****
I suspect your xbox hdd partition table is somehow corrupted

but it seems that xbpartitioner/the bios isn't complaining

. I've hence relaxed the rule somehow by reading this partial magic string.
CODE
PARTINFO
Hopefully this will enable the List Partitions option to work.
It did, and also made a point that the "strict magic compare" failed. Though unlike your screenshots, my space figures display leading 0's (eg, 0000004882MB for E, instead of just 4884MB). Seems to be accurate though.
Regarding the "format" screen, option one doesn't mention what F is capped at, and option three is written as: "G occpies space beyond 137GB". Just a couple of minor typos there.
I managed to accidently hit a button over option one ("F is capped") and trash my filesystem. Er, um, a "warning: this will erase all data on both your extended partitions" message, with a confirmation prompt defaulting to "no", would be nice. Guess I'll be buying that new HDD earlier then I thought (I'll need it for data recovery).
After this the app no longer complained about the "strict magic compare" failing.
Regarding the pre-set layouts, obviously an option to set whatever sizes the user wants to use would be good, but I think the whole "F capped at 137gb" thing isn't very practical.
For example, preset options like these would be somewhat more efficient:
1) F takes 250gb, G takes rest
2) F takes 500gb, G takes rest
3) F takes 750gb, G takes rest
4) F takes all.
If a user's mod can't handle partitions like these, then they don't have any need for this app in the first place.
QUOTE(Bomb Bloke @ Jun 25 2010, 09:16 AM)

Regarding the "format" screen, option one doesn't mention what F is capped at, and option three is written as: "G occpies space beyond 137GB". Just a couple of minor typos there.
Corrected the typos. Grab new version 1.02
QUOTE(Bomb Bloke @ Jun 25 2010, 09:16 AM)

I managed to accidently hit a button over option one ("F is capped") and trash my filesystem. Er, um, a "warning: this will erase all data on both your extended partitions" message, with a confirmation prompt defaulting to "
no", would be nice. Guess I'll be buying that new HDD earlier then I thought (I'll need it for data recovery).
Sorry to hear of your unplanned formatting.
I've added the Confirm to format option defaulting to No for safety.
QUOTE(Bomb Bloke @ Jun 25 2010, 09:16 AM)

After this the app no longer complained about the "strict magic compare" failing.
I think we may have a bug in Xbpartitioner 1.1 somewhere. My 1.1 hdd was formatted with Xbpartitioner 1.0 and didn't have this issue. Anyway it's not a showstopper since the bios didn't bother.
QUOTE(Bomb Bloke @ Jun 25 2010, 09:16 AM)

Regarding the pre-set layouts, obviously an option to set whatever sizes the user wants to use would be good, but I think the whole "F capped at 137gb" thing isn't very practical.
For example, preset options like these would be somewhat more efficient:
1) F takes 250gb, G takes rest
2) F takes 500gb, G takes rest
3) F takes 750gb, G takes rest
4) F takes all.
I've tweaked the Configure Network - IP address GUI - Menu option 1 and recycled the GUI into a "Custom F size,G gets the rest" option. The GUI is working but I'm getting strange results for the created partition table. This feature will require more work.
QUOTE(ldotsfan @ Jun 25 2010, 04:36 PM)

I think we may have a bug in Xbpartitioner 1.1 somewhere. My 1.1 hdd was formatted with Xbpartitioner 1.0 and didn't have this issue. Anyway it's not a showstopper since the bios didn't bother.
If such a bug exists within 1.1, then it would also exist with 1.0. None of the code that does the actual "formatting" was modified in the update. I messed with the code for ensuring the cluster size was correct (which also allowed it to be set to 64kb), changed the way capacities were displayed to the user, and altered the version number. That's the full list of changes.
In short, if I formatted with 1.0, then the table should've been identical to that from 1.1. Assuming I actually used 1.1; I can't even remember.
Although I don't have much knowledge as to what this "magic string" thing is, I get the impression it should only be altered when a drive is formatted. So I suppose the "error" must have something to do with that (as opposed to just a bad shutdown or something during a file-write)?
QUOTE(Bomb Bloke @ Jun 25 2010, 05:24 PM)

In short, if I formatted with 1.0, then the table should've been identical to that from 1.1. Assuming I actually used 1.1; I can't even remember.
Although I don't have much knowledge as to what this "magic string" thing is, I get the impression it should only be altered when a drive is formatted. So I suppose the "error" must have something to do with that (as opposed to just a bad shutdown or something during a file-write)?
I'm at a loss to explain why things worked or did not. It's likely there's a bug in versions of xbpartitioner which only surfaced under certain unknown scenarios but I cannot explain see why the bios ignores the error value. I first noticed that the the first byte of the "****PARTINFO****" magic string was corrupted somehow in my testing for xboxdumper by doing comparisons with a hex editor. Hence my relaxed check in lpartx and your testing confirmed my suspicions of the bug's existance.
Since nightShd - author of xbpartitioner and oz_paulb author of LBA48 in bios are no longer active in the scene, we can only speculate. However I can test the tolerance of how far the corrupted magic value can go before xbpartitioner complains or the bios refuses to boot the hdd. That will determine how Linux based tools like lpartx, xboxhdm3 and the new kernel in xdsl 0.7 should react to the 'dirty' partition table magic value.
If we have more testers for lpartx, we may also be able to isolate the exact cause sooner.
QUOTE(ldotsfan @ Jun 25 2010, 04:36 PM)

I've tweaked the Configure Network - IP address GUI - Menu option 1 and recycled the GUI into a "Custom F size,G gets the rest" option. The GUI is working but I'm getting strange results for the created partition table. This feature will require more work.
Instead of an arbitary size for F, I thought, why not do a slider in term of percentage of total size to assign to F (and rest to G)?

Is this better for the user?