O.k., here is what I did (and it worked!)...
I used OpenBSD 2.8-release for these tests -- I don't anticipate any
differences with -current, snapshots, but if you go back to a much
older release, you may find variations. Or you may not. 8-)
First, I took a brand new IBM 14G drive (o.k., brand new means I
opened the package. The drive was probably sitting on my supplier's
shelf for a while) and installed it on a system with a BIOS that
supports IDE drives larger than 20G (the largest I've had on it).
This procedure may well NOT work for systems with BIOS limitations,
but most of the people asking this question lately have been working
with newer hardware. IF you are running a system with a 504M, 2G, or
8G limit and slap a >8G drive, you will have to do some
experimentation. Keep in mind that if you wish to break the BIOS
limit, you have to come up with something that all your OSs can agree
upon..but that's not our topic. 8)
O.k., here's what I did...
You need an accurate count of the number of sectors on the drive. My
IBM drive had a label on it which said:
CHS: 16383/16/63
LBA: 28,229,040 sectors
If you do the math on the CHS numbers, you will find they come to
16383*16*63 = 16514064, and at 0.5k/sector, that comes to 8G --
obviously, this is what we are trying to AVOID! So, that LBA number
is our friend, that CHS info is there just to screw us up (well, not
really, but it certainly doesn't help)
Now, I don't have any other big drives I can easily pull out to check,
but I'm pretty sure not all drives are marked so nicely. Good news,
though: dmesg comes through Yet Again, and will tell you exactly what
you need to know. Also, if you look closely while booting, you can
probably jot the number down before it goes flying off the screen (at
least I could on my AMD K6-350). The part I am interested in is this:
> wd0 at pciide0 channel 0 drive 0: <IBM-DTTA-371440>
> wd0: can use 32-bit, PIO mode 4, DMA mode 2, Ultra-DMA mode 2
> wd0: 16-sector PIO, LBA, 13783MB, 16383 cyl, 16 head, 63 sec, 28229040 sectors
[NB: *I* can snip my dmesg, because I'm offering advice. People
ASKING advice don't get to snip dmesg! 8-)]
See? Last line about the drive, the number of sectors!
Now, to use the info...
Let the system finish booting, when it asks if you want to Install,
Upgrade or Shell, choose "Shell". We need to run fdisk manually here.
First, let's just look around:
(yeah, do this on your system)
# fdisk wd0
Disk: wd0 geometry: 1023/255/63 [16434495 sectors]
Only LBA values are valid in ending cylinder for partition #1.
Offset: 0 Signatures: 0xAA55,0x0
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
-------------------------------------------------------------------------
0: 0B 0 1 1 - 382 254 63 [ 63 - 6152832] Win95
FAT-32
*1: 00 0 0 1 - 0 0 0 [ 0 - 0] unused
2: 00 0 0 1 - 0 0 0 [ 0 - 0] unused
3: 00 0 0 1 - 0 0 0 [ 0 - 0] unused
See the first line, "geometry: 1023/255/63 [16434495 sectors]"?
First, we see our bogus 8G numbers again, but more importantly (at the
moment), we see the system is treating the drive AS IF it had 255
heads and 63 sectors per track. (remember, all these specs are bogus,
the drive actually has probably between two and eight heads, a lot
more cylinders, and a variable number of sectors per track, but the OS
and the BIOS have to agree on a common set of bogus numbers...and
these are them)
This is an important thing to note: We can mess with the number of
CYLINDERS, but NOT the heads (H) or sectors per track (S)! Messing
with the H and S numbers seem to render the disk unbootable, and as
our goal is to have the system not just loaded but booting, this is
bad. 8-)
I do not know if you will always see the 1023/255/63 on all systems
with >8G support (though I guess you will), use what you see on YOUR
system.
Now we need to work out the NEW number of cylinders (C)...
Take the number of sectors on the disk, divide by the number of
sectors per cylinder. The number of sectors per cylinder is the
number of heads times the number of sectors per track, so in my case,
we do:
28229040 / (255 * 63) = 28229040 / 16065 = 1757.1765
You can't have a fractional cylinder, so this becomes 1757. Yeah,
even if it worked out to 1757.99, you still round down. Yes, that may
mean you could be throwing away up to 8M of disk space (excuse me
while I reminisce back to when I was installing 10M HDs in computers
for $2000/ea...yeah, throwing 8M away hurts) but if I can get over it,
so can you.
O.k., now we start fdisk with manual drive parameters:
> # fdisk -c 1757 -h 255 -s 63 -e wd0
(use YOUR numbers here, not mine!)
You see a message which look like the following:
> Only LBA values are valid in ending cylinder for partition #1.
That's fine, that's what we are doing here, LBA stuff. 8-)
Now, you can create your partition as you desire, flag it active, and
'q', saving your changes to the disk. Note, you will probably need
your calculator here to create this partition. Hmm... 50+G drives
would probably need more than an 8 digit calculator, too...
Now, at the command prompt, run the install program:
# install
and it will take off into something that hopefully looks familiar to
you.
When it asks if you want to use the entire disk for OpenBSD, the
answer is most certainly "No" -- if that was an acceptable response,
you could have skipped reading all my ramblings and digressions. Have
I ever told you about...oh, sorry... 8-)
Anyway, install will drop you into fdisk -- just 'q' without changing
anything, which will take you to disklabel -- which will now see and
respect your new OpenBSD partition, and will apparently try to keep
you out of your other partitions on the disk. Here is what I ended up
with:
> # fdisk -c 1757 -h 255 -s 63 wd0
> Disk: wd0 geometry: 1757/255/63 [28226205 sectors]
> Only LBA values are valid in ending cylinder for partition #1.
> Offset: 0 Signatures: 0xAA55,0x0
> Starting Ending
> #: id cyl hd sec - cyl hd sec [ start - size]
> -------------------------------------------------------------------------
> 0: 0B 0 1 1 - 382 254 63 [ 63 - 6152832] Win95 FAT-32
> *1: A6 383 0 1 - 1023 254 63 [ 6152895 - 22073310] OpenBSD
> 2: 00 0 0 1 - 0 0 0 [ 0 - 0] unused
> 3: 00 0 0 1 - 0 0 0 [ 0 - 0] unused
(note, when just looking, you don't need to worry about the -c, -h,
and -s parameters, I used 'em basically because they were still in the
paste buffer. 8-)
Note that my partition #1 is shown to "end" at cylinder 1023 -- but
that's the meaning of that "Only LBA values are valid in ending
cylinder for partition #1". If you look at the sector numbers, and
add the starting sector to the size sector (6152895 + 22073310) you
end up with the displayed number of sectors calculated from
1757*255*63 (Hmm..looks like it is good I displayed the partition
table with the -c -h -s parameters, eh? And yes, that doesn't match
what was shown in dmesg, as we had to round down our number of
cylinders...). Of course, doing math like that only counts if the
OpenBSD slice is the last partition on the disk.
At this point, you should have a system that will boot off whatever
partition is flagged as the active partition. In testing here, I used
the fdisk of Windows 98 and OpenBSD to set the active partition so I
could flip back and forth between them, you may wish to use a boot
manager program of some type, this is left as an exercise for the
reader. 8-)
Nick.
Nick Holland wrote:
<snip>
> "I have an elegant solution which time does not permit me to post now"
> (maybe. We'll see)
That's elegant? Ha!
--
http://www.holland-consulting.net/
|