logoalt Hacker News

rep_lodsblast Saturday at 3:43 PM2 repliesview on HN

Supposedly the problem is that these adapters only work with LBA, which wasn't supported by every drive in the very early days of IDE.

But maybe some of these cheap adapters do in fact work with CHS, or that specific 40 MB drive with LBA?


Replies

gattilorenzlast Saturday at 4:33 PM

I mean, I’m sure there _are_ drive adapters without CHS support; in my sample size of 1, a cheap no-name adapter bought from Amazon a few years ago, it works just fine (I’m assuming the very early IDE drive I used didn’t use LBA, but I don’t have it anymore).

For what is worth the adapter is one of those half-red half-black vertical-insertion ones with a cursed USB-A to USB-A cable, connections for SATA and PATA (2.5 and 3.5”) and a sliding “Molex” connector for the 3.5 PATA drive. Not a quality item…

fuzzfactorlast Saturday at 5:40 PM

It may very well depend on how the HDD was set up originally.

Before the HDDs had Integrated Drive Electronics (IDE), it required you to add an interface card to one of your ISA slots which you then connected the HDD to.

Each HDD factory had a documented CHS geometry for their products, but it didn't take long for this to no longer try to represent the actual physical geometry on the platters any more.

Either way, you set the jumpers on the interface card for that particular geometry according to the documentation, and that was the only way to correctly address the sectors in the most reliable way, if at all.

With the arrival of IDE, the interface card was no longer needed because that logic was handled inside the HDD after that, and motherboards arrived with built-in connections for HDDs, not only floppies any more.

You would set the HDD geometry in BIOS and all seemed OK until CMOS corruption occurred from something like a power surge, when the setting reverted to default.

The IDE got smarter in tandem with the BIOS's advances, and eventually the default "automatic" BIOS setting was smart enough to correctly pick up the effective geometry. Whether the HDD was flexible enough to have been commissioned with something other than its "native" geometry or not. By this time almost all new HDDs were, but the older PIO-0 HDDs were still the most abundant, and for people moving it to a new motherboard this made it work seamlessly most of the time.

Once LBA came out it was layered on top of that but you still had fixed CHS options in BIOS if you wanted it. Otherwise CHS was handled automatically as established. Never was exactly the same under every BIOS.

With a lesser USB adapter it may or may not be able to pick up geometry correctly, depending on how the data appears. And it can still be various different things, detecting and utilizing the structure found on the HDD, or re-partioning and formatting a HDD that still contains its previous data like that and having layout & structure come out the same, or not quite. But setting up a completely zeroed HDD may not end up with the same CHS as any of that either. In that situation the factory geometry prevails since there is nothing other than zeros to autodetect data structure from.

To avoid this I still do like to zero (the first 100mb at least) of the HDD first, remove it from all power for at least an hour to allow internal capacitors which store any non-default geometry to discharge, then partition & format on a vintage Intel-based PC with highly compatible BIOS.

That drive will then be more compatible with anything it connects to, but if a zeroed HDD was commissioned from USB to start it still can be just fine.

Booting is another thing to layer on, then you may or may not have to pay attention to sector alignment in addition to geometry, even if plain storage use works there are other obstacles to booting that may come up.

Now it does seem like the only advantage of a something like a Pi in the process would not be more helpful to access data from a properly established old HDD, but maybe one of the only ways to set up an old HDD using something other than that HDDs inbuilt default. But this was to be avoided back then too, it was better to have the HDD set up as default rather than unique "custom" CHS which amounts to "weird" and after that it may not be possible to connect to anything else and be recognized.

Unless you can manually set CHS in BIOS to match, which a USB adapter won't let you do anything you want like BIOS. A Pi could substitute for that but it was never really a good idea, mainly useful to set a non-default CHS on one drive to match the default CHS on an established drive when both are plugged into the same motherboard.

If I was being very skeptical, I would say it's possible the coder didn't even know that USB adapters exist. Prompted his AI to come up with one and this is the first untested draft.

show 1 reply