Does anyone happen to know the organisation of a SunOS
4.x hard
drive?
Well, I've worked with SunOS 4 quite a bit, in a previous job.
Looking at the disklabel under Linux, I get the
following:
| Disk /dev/sdb (Sun disk label): 15 heads, 131
sectors, 1701
| cylinders Units = cylinders of 1965 * 512 bytes
|
| Device Flag Start End Blocks Id System
| /dev/sdb1 0 48 47160 0 Empty
| /dev/sdb2 48 152 102180 0 Empty
| /dev/sdb3 0 1701 1671232+ 0 Empty
| /dev/sdb4 152 264 110040 0 Empty
| /dev/sdb7 264 1701 1411852+ 0 Empty
(ignoring the 'empty' - think that must be a
bug in Linux fdisk as I
know there's a valid OS on the disk)
Note that Sun disklabels (certainly Sun disklabels of that era) do not
have any partition typing.
Googling shows the first entry to be the root
partition on such a
drive, second entry to be swap, third to be the whole disk entry, and
the rest to presumably be aux partitions...
Normally, yes. I don't think root _had_ to be the a partition, or swap
b, but those certainly were the normal way. c being the whole-disk
partition was, I think, not optional.
However, obviously some space is taken up by the
partition table
itself, so the first (root) partition can't start at block zero.
Not true, actually. The partition table occupies sector 0 of the drive
(actually, only part of the first sector, but the whole first sector is
given over to it). Any bootable partition has bootcode in sectors 1
through 15. SunOS 4's filesystem, like the Berkeley FFS that it
basically is, avoid doing anything with the first 16 sectors on its
partition specifically to make room for bootcode (and, later, partition
tables - the 16-sector carveout dates back to real BSD, farther back
than on-disk partition tables). Yes, this means wasting 8K of space on
partitions that are neither bootable nor first-on-disk, but that was
apparently considered acceptable.
Furthermore, Sun disklabels, while they store partition sizes as sector
counts, store partition start points as cylinder counts, so you can't
easily just skip the first 16 sectors - you'd have to skip the whole
first cylinder. (You could, today, lie in the sector and track counts
to get small cylinders, but back then, if you did that your disk likely
wouldn't work right - some disks were addressed by <cyl,head,sect>
triples rather than linear block numbers.)
What I'm trying to find out is the offset that it
does actually start
at, so that I can mount the root partition from Linux.
As in the disk label. If your Linux system can't mount it, it must not
support that filesystem type.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse at rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B