Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Cixert

2 TiB limit size in MBR hard drives

Recommended Posts

8 hours ago, roytam1 said:

IIRC SCSIPORT.SYS (which UniATA uses) has 2TiB (2 199 023 255 552 bytes) limit if sector size == 512 bytes.

1 hour ago, dencorso said:

What about the carry big sliding into oblivion? :unsure:

UEFI_Drive_Partition_Limits_Fact_Sheet.pdf

hello does Storport do that ?

Share this post


Link to post
Share on other sites

Well, a 2TiB (2 199 023 255 552 bytes) limit if sector size == 512 bytes means a 32-bit sector count.
In such a case, by adding 1 to 2TiB, the carry slides into oblivion (= has no place to go) and the counter wraps-around to zero.
That's math. There's no avoiding it.

Share this post


Link to post
Share on other sites
16 minutes ago, dencorso said:

Well, a 2TiB (2 199 023 255 552 bytes) limit if sector size == 512 bytes means a 32-bit sector count.
In such a case, by adding 1 to 2TiB, the carry slides into oblivion (= has no place to go) and the counter wraps-around to zero.
That's math. There's no avoiding it.

And still NOONE with suitable hardware had the guts to try this:

http://www.msfn.org/board/topic/176480-2-tib-limit-size-in-mbr-hard-drives/?do=findComment&comment=1135913


 

Quote

A good question would be what happens if one creates on a (512 bytes/sector) hard disk two partitions, one starting on

 LBA 2048 and extending for (say) 4294967295-2049=4294965246 sectors

and a second one starting on

LBA 4294967294 and extending for 4294967295 sectors?

Would this move (with the limitation of the two partitions) the limit by another 2.2 Tib?

which is also "mathematical" but that needs to be tested, as the way access to sectors is implemented may have some other limit beyond the 32-bit field sizes.

jaclaz


 

Share this post


Link to post
Share on other sites

What is the hardware required? A 4TB+ disk or virtual disk? Or do you think such testing should only be performed on a single physical disk and not on RAID arrays or VM disks?

Share this post


Link to post
Share on other sites
21 minutes ago, Tripredacus said:

What is the hardware required? A 4TB+ disk or virtual disk? Or do you think such testing should only be performed on a single physical disk and not on RAID arrays or VM disks?

Either a 3 or a 4 Tb disk (real disk) BUT with 512 bytes sector (i.e. AF, not "native" 4K).

Both a virtual disk or a virtual machine may introduce whatever added layers/incompatibilites.

Instead a "normal" 3 or 4 Tb disk would do nicely.

The idea is that seemingly only the two fields in the MBR the "Sectors Before" or "LBA offset" and the "Sector number" or "LBA sectors" are 32 bit, as the NTFS bootsector (or $Boot) has 64 bit fields for LBA addresses.

Since the first partition/volume (that is the boot and system partition) is entirely within the 32 bit range there won't be any problem (just like there aren't any on any 2 tb disks with a single partition/volume) so anything in the booting sequence including NTLDR or BOOTMGR, etc. won't have any issue.

At this point the second partition/volume is only a "data partition" so it should work unless in some parts of the actual filesystem driver or related files *somehow* the LBA addresses (absolute) are summed up, in theory each and every address in the filesystem is (should be):

1) relative to the beginning of the volume

2) accessed by/through the cluster "grouping" so, since the whole volume is below the 32 bit limit in size, the cluster numbers will be well below any 32 but limit, since the typical NTFS cluster size of such a big volume should be anyway 8 sectors or 4 kb

jaclaz

 

 

Share this post


Link to post
Share on other sites

I have a 3TB Seagate Barracuda XT, ST33000651AS.

If you want, and if this is the correct type of disk, I can do any specific testing on it if you provide the commands I should use.

Share this post


Link to post
Share on other sites
30 minutes ago, Tripredacus said:

I have a 3TB Seagate Barracuda XT, ST33000651AS.

If you want, and if this is the correct type of disk, I can do any specific testing on it if you provide the commands I should use.

Yep, that is fine, it is a 512 byte sector disk.

Which OS do you want to install on it?

I can provide you with either a pre-made set of partition table entries, or a whole MBR or you can use a hex/disk editor.

But I need to know the total amount of sectors on disk, or, for the sake of the test, I can make a second partition around 600 Gb, that surely ends before the end of disk, see attached image.

jaclaz

 

morethan2Tb.jpg

Share this post


Link to post
Share on other sites
5 hours ago, jaclaz said:

Which OS do you want to install on it?

I can provide you with either a pre-made set of partition table entries, or a whole MBR or you can use a hex/disk editor.

Is it required to "install" an OS or can I just lay one onto it using DISM or Imagex? I am going to be mainly limited by the board I have available for doing the testing, which is currently going to be in the current 100 series (150/250) Intel Chipset. So if I use existing images, I may be able to boot Windows 7 or Windows 10. If I am to install an OS using the setup media, I can install any Windows version. If the hardware being used is a problem, I may be able to borrow an older (like 3 years or so) chipset board for testing.

I will look into this on Monday, and will see if I can get the sector count of the disk. For which tools to use, my primarily operating environments are WinPE v10 x64 or DOS 7.10. If something needs to be done in Windows then I would likely use Windows 7 to do it.

Share this post


Link to post
Share on other sites

Of course applying  a Wim would be OK.

The test makes sense with a 7, and actually more with a 7 32 bit, as the 64 bit version may have some "more" 64 bit fields/math in the code, even "accidentally".

Any tool that can access the MBR and write hex values to the partition table will be fine, possibly the simpler would be RPM (Ranish Partition Manager) in DOS 7.x, or you could run almost *any* disk edito or dd-like tool from the PE with which you apply the wim, or the simplest would be grub4dos, where the whole thing is a few commands:

partnew (hdx,0) 0x07 2048 4294965246

partnew (hdx,1) 0x07 4294967294 1258291200

makeactive (hdx,0)

should do.

As said I can provide you a complete (Windows 7) MBR to be deployed, with a *random* Disk Signature, and the partition data pre-written.

Then you have to format the two /partitions/volumes notmally from - say - diskpart of the PE.

jaclaz

 

Share this post


Link to post
Share on other sites

The delay to upload these images was making me nuts. Here is how Ranish Partition Manager sees this disk:

pMewGnNl.jpg

Zd1SMZXl.jpg

I had removed the existing partition with FDisk. I am not sure what to put into these fields to make the partition you want.

Share this post


Link to post
Share on other sites

I am not even sure it allows you to.

It seems like it sees the disk as being around 750 Gb.

It is possible that you will need the "experimental" later version than 2.40, either 2.43 or 2.44, in any case you need to switch to LBA view (press F4).

But you are running DOS, right?

Get the latest grub4dos here:

http://grub4dos.chenall.net/categories/downloads/

http://grub4dos.chenall.net/downloads/grub4dos-0.4.6a-2017-06-25/

http://dl.grub4dos.chenall.net/grub4dos-0.4.6a-2017-06-25.7z

from the .7z archive extract just grub.exe and copy it to your DOS disk/diskette.

Then run it.

At the grub> command prompt, first determine the number of the disk you want to edit,

In your RPM screenshot it is disk 2 (Ranish should number disks starting with 1, so it is second disk), in grub4dos notation that would be (hd1) (first disk is (hd0).

Make sure that it is the right disk by typing:

cat --hex skip=446 (hd1)+1

You should see all 00's and a final 55AA.

If you don't see the 00's it means that you have the wrong disk or that you didn't clear the partition table entries.

If you don't see the 55AA it means that the disk has not been (yet) initialized.

If (hd1) is the right disk, run:
 

partnew (hd1,0) 0x07 2048 4294965246

partnew (hd1,1) 0x07 4294967294 1258291200

makeactive (hd1,0)

Then run:

geometry (hd1)

It should give you a Partition 0 and a Partition 1 both "filesystem unknown", and "partition type 0x07".

If the disk is not initialized, just create a single primary partition NTFS in diskpart (size doesn't matter) and don't format it.

Then you can go to grub, and after having checked as above, clear the partition with "partnew (hd1,0) 0 0 0"

jaclaz

 

  • Like 1

Share this post


Link to post
Share on other sites

the command is like so:

cat --hex--skip=446 (hd1)+1

an error you've made in the past, however I found the correction here:
http://reboot.pro/topic/18611-vista-wont-boot-error-17-file-not-found/#entry173322

Of course, no one is immune from the scourge of typos:

53I08sDl.jpg

PS: the HDD shows as Disk 2 (or Disk 1) because my DOS is on a USB key. There was something up with how Fdisk deleted the partitions, which is why it was showing up as 782GB or so. When I booted into WinPE, Diskpart also showed no partitions and with that ~782GB as free space. I ran the CLEAN command and it returned to the 2700GB that is expected.

I will go about putting both Windows 7 Pro 64bit and 32bit on this disk, but it may be a bit of time because I may need to add a storage driver.

Share this post


Link to post
Share on other sites

I'm not home right now, so I cannot check it, but, IIRR, one has to use RPM 2.43 or 2.44, *not* 2.40, to work successfully with SATA HDD's... :unsure:

Share this post


Link to post
Share on other sites

I could have rechecked it with RPM after cleaning the disk in diskpart but did not.

Alas, Windows 7 64bit doesn't even boot, with and without BCDboot being used. Meaning, the board boots directly into the BIOS/Setup, no errors from the OS itself. I have attached the disk into from Diskpart after running the commands posted above in Grub.

Drive letter was N in the information due to a script that is run in my PE to change the C drive to N drive. You see I change it later on after formatting, and before I imaged that partition.

diskpart_info.txt

Share this post


Link to post
Share on other sites

Well, the diskpart txt seems just fine.

Why didn't you format the second partition?

I don't buy - with all due respect - that Windows doesn't boot.

In the sense that *something else* (BIOS? or setting in it?) is preventing the booting. (i.e. the BIOS having some limitation with the hard disk size).

Otherwise In the worst case, it would fail to boot with a bootBCD error (or however the error would come from the BOOTMGR).

For all the code knows the active partition is within the 2.2 Tb limit, so the MBR code will chainload its PBR without issues and the PBR will chainload the BOOTMGR without issues.

It is possible - in theory - (but very unlikely) that the presence of the second partition creates an issue, but I greatly doubt it.

In any case, you can alway try to clear the second partition entry and try again.

Even better, you could install a third party bootloader, like grub4dos to have more control in the booting phase.

BUT right now, you can boot from the USB stick, and run grub4dos grub.exe from its DOS.

At the grub> prompt, exchange drives:

map (hd0) (hd1) 

map (hd1) (hd0)

map --hook

then try (reboot and restart, and re-map the drive if it doesn't work)

1) chainloader (hd0)+1

boot

OR;

2) root (hd0,0)

chainloader +1

boot

OR:

3) root (hd0,0)

chainloader /bootmgr

boot

 

jaclaz

 

 

Edited by jaclaz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×