xboxscene.org forums

Pages: 1 [2] 3 4 5

Author Topic: Idea On How To Format Large Hard Drive With 64k Clusters  (Read 283 times)

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #15 on: March 09, 2008, 03:41:00 AM »

QUOTE("PartInfo.cpp")
case 3:
if (g_iFunction == 2)
{
g_iClusterSize = g_iClusterSize == 16 ? 32 : 16;
m_iWaitRelease = 1;
}
break;

If it was tweaked like this:

QUOTE("PartInfo.cpp")
case 3:
if (g_iFunction == 2)
{
if (g_iClusterSize == 256) {g_iClusterSize = 1;}
else if (g_iClusterSize == 128) {g_iClusterSize = 256;}
else if (g_iClusterSize == 64) {g_iClusterSize = 128;}
else if (g_iClusterSize == 32) {g_iClusterSize = 64;}
else if (g_iClusterSize == 16) {g_iClusterSize = 32;}
else if (g_iClusterSize == 8) {g_iClusterSize = 16;}
else if (g_iClusterSize == 4) {g_iClusterSize = 8;}
else if (g_iClusterSize == 2) {g_iClusterSize = 4;}
else if (g_iClusterSize == 1) {g_iClusterSize = 2;}

m_iWaitRelease = 1;
}
break;

Then... Well, using it might break the X-Box. Or it could allow partitions up to about 4tb. One or the other.

Keeping in mind that the maximum partition size (in gigabytes) equals the cluster size multiplied by sixteen.

Don't ask me how to compile it though, or blame me if you use it to wreck your system. tongue.gif
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #16 on: March 10, 2008, 08:24:00 PM »

QUOTE(Bomb Bloke @ Mar 9 2008, 02:17 AM) View Post

NghtShd's code looks to be fairly easy to modify. From line 1151:
If it was tweaked like this:
Then... Well, using it might break the X-Box. Or it could allow partitions up to about 4tb. One or the other.

Keeping in mind that the maximum partition size (in gigabytes) equals the cluster size multiplied by sixteen.

Don't ask me how to compile it though, or blame me if you use it to wreck your system. tongue.gif

well i compiled it, and it was able to format the drive, and cluster size options were 1k-256k

however when i formatted with 256k clusters it ended up using 32k, and 64k seems to have used 128k

its a bit hard to gauge, im trying to find an app that will tell me size-on-disk for the files or show slack space
Logged

evilsanta666

  • Recovered User
  • Full Member
  • *
  • Posts: 108
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #17 on: March 10, 2008, 08:26:00 PM »

OK, i worked and worked with the paragon programs and they cant be used for creating 64k clusters on a fatx partition. i tried everything i could think of, even connecting an unlocked xbox hdd to the computer but it just wouldn't recognize it.

for the last 2 days i have been working on getting everything together to recompile xbpartitioner with the ability to use up to 256k clusters in the manner that Bomb Bloke stated. i looked through and rechecked everything in that file and a few others as well. from what i saw it should work.

i will keep everyone updated as i progress. PM me with any questions or comments.

-evilsanta-

EDIT:

damn you lordvader129 laugh.gif
you beat me to it  biggrin.gif
i will look through and try to find the bugs you mentioned.
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #18 on: March 10, 2008, 10:18:00 PM »

QUOTE(wildonrio @ Mar 10 2008, 08:09 PM) View Post

Wow you did it.  And if you at least figured out 128k then congratulations, you're the first person to ever have a partition larger than 512gb without corruption.

You must be minutes away from discovering 64k, have you tried the options like picking 128k and seeing what it ends up actually doing?  Maybe one of the other ones will do 64k, it seems random enough based on your results picking 256k and 64k...

well it was bomb blokes changes that worked, i just shoved it in a compiler

also i was just testing on a stock 10gb HD, so i really cant make sure it doesnt corrupt

i didnt play around with it much though
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #19 on: March 10, 2008, 10:20:00 PM »

Took another look at the code, thought there might've been an overflow causing a wrap around... But I can't see anything that'd suggest it'd work in the way described.

How about trying it with 1kb clusters? That should hit corruption as soon as you try to put more then 16gb on there, probably the easiest way to test it.

One unknown factor is how much space the actual file index takes up, and whether the dashboards we use factor that into the free space calculations. I get the impression the thing is spread around the drive and becomes fragmented as you stick more files on there (this'd explain why drive corruption doesn't always wipe all files from the drive).
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #20 on: March 10, 2008, 10:31:00 PM »

QUOTE(Bomb Bloke @ Mar 10 2008, 08:56 PM) View Post

Took another look at the code, thought there might've been an overflow causing a wrap around... But I can't see anything that'd suggest it'd work in the way described.

How about trying it with 1kb clusters? That should hit corruption as soon as you try to put more then 16gb on there, probably the easiest way to test it.

One unknown factor is how much space the actual file index takes up, and whether the dashboards we use factor that into the free space calculations. I get the impression the thing is spread around the drive and becomes fragmented as you stick more files on there (this'd explain why drive corruption doesn't always wipe all files from the drive).

i checked the cluster size by putting a 150 byte file on the drive and comparing total space to free space (difference was 32768 byte and 131072 bytes respectively) so im not sure how accurate it was
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #21 on: March 10, 2008, 10:51:00 PM »

Sounds pretty accurate...

Beats me as to what's going on.  unsure.gif
Logged

evilsanta666

  • Recovered User
  • Full Member
  • *
  • Posts: 108
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #22 on: March 11, 2008, 12:04:00 AM »

QUOTE(wildonrio @ Mar 11 2008, 12:30 AM) View Post

I have a 750gb in my xbox.  If you guys are having trouble seeing how much space each file is taking up, what I'd be willing to do is format my hdd with your xbpartitioner using 64k clusters and then flood my hard drive past 512gb to see if corruption occurs.  This is a little less efficient I understand but at least we'll know for sure if it works or not.

Just an offer, I'm sure there are better ways.

i would say we would have to test it that way once we have xbpartitioner working to our standards.

once that is done, we have then made our foot print in the world of multi-tarabyte partitioning.

keep working hard everyone cool.gif

-evilsanta-
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #23 on: March 13, 2008, 08:28:00 PM »

QUOTE(wildonrio @ Mar 12 2008, 11:49 PM) View Post

Any updates?

it seems to format with the right cluster sizes, albeit not with the cluster size it says its using

QUOTE
else if (g_iClusterSize == 64) {g_iClusterSize = 128;}

im not too god with programming, but that seems to be saying "if the cluster size is 64 then change it to 128" which is what it did for me when i formatted, i wouldnt know how to make it right though, i dont recognize what nghtshd is doing in the original code:
QUOTE
g_iClusterSize = g_iClusterSize == 16 ? 32 : 16;




also, i dont have a drive large enough (750gb) to do a proper test, so theres not much else i can do here unless someone can suggest new code (i can compile, just not write smile.gif )
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #24 on: March 13, 2008, 11:12:00 PM »

QUOTE(lordvader129 @ Mar 14 2008, 02:04 PM) View Post
im not too good with programming, but that seems to be saying "if the cluster size is 64 then change it to 128" which is what it did for me when i formatted,

Yes, that's exactly what the code is saying... But that code is only supposed to be executed when you hit the Y button... Not when you actually do the format.

Plus 256kb clusters are supposed to change to 1kb next... You found they came out as 32kb after the format, so something's odd there too.

QUOTE(lordvader129 @ Mar 14 2008, 02:04 PM) View Post
i wouldnt know how to make it right though, i dont recognize what nghtshd is doing in the original code:
QUOTE
g_iClusterSize = g_iClusterSize == 16 ? 32 : 16;

This handy little function (or statement, whatever it's called) lets you return a value based on a condition:

<condition>?<if condition is true return this>:<if condition is false return this>

So the original line follows this logic:

Let "g_iClusterSize" equal (32 if "g_iClusterSize" equals 16) or (16 if "g_iClusterSize" does not equal 16).

Makes a little more sense if I take the original line and stick brackets in it:

g_iClusterSize = ( (g_iClusterSize == 16) ? (32) : (16) );

I expanded it out into separate "if" statements to keep it readable with all the extra cluster settings.

The code in concern is extremely simple, so I just don't see the room for error. When XBPartitioner goes to do the actual format it multiplies the cluster size by 1024 to get the size in bytes, and passes that to the formatter... I was thinking there might've been an overflow there (32kb is the highest byte count you can stick in two bytes), but if that was the case you shouldn't have managed to get 128kb clusters...

And for all I know the "int" type is more then two bytes anyway. It wasn't back in the day, but that was back in the day...

But hey, whatever, I can't think of anything else to try, so:

QUOTE("Line 66")
int g_iClusterSize = 16;

Change it to this:

QUOTE("Line 66")
ULONG g_iClusterSize = 16;
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #25 on: March 14, 2008, 09:49:00 AM »

QUOTE(wildonrio @ Mar 13 2008, 11:27 PM) View Post

I think we're making the code a little too complicated by trying to give options from 1kb all the way to 256kb.  Since we're having problems, what if we simplify the code by changing the line:
to
In theory, wouldn't this just change the options from 16k and 32k to 32k and 64k?  I mean let's face it, no one's gonna want 16k anymore since hard drives are not gonna be less than 256gb for much longer (and if they really want it they can use xbpartitioner 1.0), and no one presently needs anything more than 64k since there are no internal hard drives bigger than 1TB for sale.

Does that code work Bomb Bloke?  Once we get this working we can try and figure out up to 256k so in the future when there are 10TB drives there won't be people suffering just like we are now with partition size limitations.  (And with all due respect to the xbox, by that time I don't know how many people will still be modding them anyway.)

i dont even think 1tb drive are in IDE, just SATA, but if 360 uses the same FATx filesystem this could be useful there too if and when we get homebrew working

EDIT: tried your code, it formatted my (2gb) F drive with 32k clusters, theoretically it should do a 256+ (or 512+?) drive with 64k, but i dont have one i can test with
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #26 on: March 14, 2008, 10:57:00 AM »

QUOTE(lordvader129 @ Mar 15 2008, 03:25 AM) View Post
tried your code, it formatted my (2gb) F drive with 32k clusters, theoretically it should do a 256+ (or 512+?) drive with 64k, but i dont have one i can test with

But... but... that code has nothing to do with what XBPartitioner will default to with a given partition size! It only affects what settings you can have by pressing the Y button.

The lines that "auto-detect" the "correct" cluster size are 1270 and 1278 (for the original source, anyway). I don't see any point in updating these until XBPartitioner formats with the cluster size it says it's going to use.

You should be able to force 64kb regardless of your partition size, using either wildonrio's or my own code.

Regardless of which patch you take, the default settings should remain the same... With a 2gb partition, unless you pressed the Y button, you should've ended up with 16kb clusters...
Logged

lordvader129

  • Archived User
  • Hero Member
  • *
  • Posts: 5860
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #27 on: March 14, 2008, 11:09:00 AM »

QUOTE(Bomb Bloke @ Mar 14 2008, 09:33 AM) View Post

But... but... that code has nothing to do with what XBPartitioner will default to with a given partition size! It only affects what settings you can have by pressing the Y button.

The lines that "auto-detect" the "correct" cluster size are 1270 and 1278 (for the original source, anyway). I don't see any point in updating these until XBPartitioner formats with the cluster size it says it's going to use.

You should be able to force 64kb regardless of your partition size, using either wildonrio's or my own code.

Regardless of which patch you take, the default settings should remain the same... With a 2gb partition, unless you pressed the Y button, you should've ended up with 16kb clusters...

well with wildonrios what i got when i hit Y was 16k as the only option, but it used 32k, so thats why i assumed that when it tries to use 32k it will end up with 64k
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #28 on: March 14, 2008, 12:26:00 PM »

So the Y button did nothing?  ohmy.gif

Bah, it's too late for me to be thinking, but I could swear pushing that button should've toggled between 32kb and 64kb clusters.

Did you try changing that other line I mentioned?
Logged

Bomb Bloke

  • Archived User
  • Hero Member
  • *
  • Posts: 2398
Idea On How To Format Large Hard Drive With 64k Clusters
« Reply #29 on: March 14, 2008, 06:13:00 PM »

I already quoted the line that sets the initial cluster size to 16kb.

If you want to find lines that mess with the cluster size, you search for the relevant variable... "g_iClusterSize".
Logged
Pages: 1 [2] 3 4 5