On Sat, Jul 29, 2000 at 07:46:40PM -0500, Matt Stegman wrote:
> On Sat, 29 Jul 2000, Charles Curley wrote:
> > OK, suppose the old hard drive has 35 sectors per track. If the new hard
> > drive has fewer, say, 30, then dd will write the 31st sector of a give
> > track somewhere else, Murphy only knows where, or it will error out and
> > refuse to write it. So you are hosed.
> [rest of post snipped, but read that before my reply]...

OK, I did some research on the Net. I still haven't found a coherent
picture of what LBA is or how it works, but a few things became a bit less
murky.

Start by reading http://www.linuxdoc.org/HOWTO/Large-Disk-HOWTO.html.

Unfortunately, I still haven't found out whether LBA mode can have the
kinds of holes in it that I described for CHS.

One of the things I did find in there is that the partition table has two
separate indicators of a partition geometry. One uses CHS for start and
end. The other uses 32 bit integers for start and length. They do not have
to agree with each other!!! Which means if you only run one OS and it
consistently uses one of the other, you are cool. But if you use multiple
OSs, one of which uses CHS (Mess-DOS, e.g.) and another of which uses the
linear values, you could be in trouble. I don't know which ones Linux
uses; the linear values I would guess.

> 
> I thought Linux ran at a high enough level over the hardware that this
> wasn't an issue.
> 
> CHS is old-style INT13 addressing, correct?

It goes back to the days when CHS actually meant something, in the days of
ST-506 interface hard drives, so called for one of Seagate's first
products, that used the interface.


> Most modern BIOS will address
> the drive via LBA, and the drive should appear to be a linear array of
> sectors (correct me if I'm wrong).

Correct if the BIOS is told that the drive is an LBA drive. You may have
to tell it that or it may be able to query the drive.

In Linux, the BIOS is relevant only until the kernel is running. Linux
hard drive drivers ignore the BIOS, as they should. I think Linux does its
own query to the hard drive, in which case it may run a hard drive in LBA
mode regardless of the BIOS setting.

> At any rate, I thought it was the
> kernel that handled the "where does this go on the drive" bit, not the
> userland copying software.

The hard drive driver, to be more specific.


> 
> Isn't the only difference between `dd` and `cp` that `dd` handles the
> data
> in "bs" sized blocks?

It may be simpler to just go ahead and try the experiment, to see if you
have a usable hard drive when you get done. Researching on the Net hasn't
turned up anything useful so far.


-- 

                -- C^2

No windows were crashed in the making of this email.

Looking for fine software and/or web pages?
http://w3.trib.com/~ccurley

PGP signature

Reply via email to