Subject: Extended partitions and ext2fs
To: None <port-i386@NetBSD.ORG>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: port-i386
Date: 11/01/1997 12:34:25
-----BEGIN PGP SIGNED MESSAGE-----


  I finished setting my replacement Xterm up yesterday. It got a
1.3Alpha SSTO kernel installed, the 1.2G snapshot, and then my rebuilt
1.3 from my workhorse machine.

  [This is my first attempt to do proper multiboot. On my wife's
machine, which also has Win95, NetBSD and Linux, I use dosboot.exe and
loadlin.exe to get the other OSes loaded, and load the kernel from the
DOS partition to avoid the 1024 cylinder problem.]

  I also installed win95 and RedHat on it (how better to get all the
right files installed for emulation? Plus, I might have to play video games.)

  I have appened my partition table and disklabel below. I did:
	1. 100 Mb NetBSD root
	2. 100 Mb RedHat root
	3. 400 Mb Win95

  Problem 1: Linux needs a DOS extended partition to do
slices. Partition 4 then became a 590Mb extended partition for Linux,
and partition 2 was left empty. I was going to expand #1 to fill the 
space since Win95 was already installed. 

  Then, I discovered while reconfiguring osbs to have Linux, that
extended partitions can not be bootable. I then returned to Linux,
newfs'ed partition 2, and installed lilo on partition 2. (Telling lilo
to use partition "5" as its root). I then installed NetBSD. I had to
muck about a whole bunch, since I 
	a) wanted NetBSD to live in a partition and not think it is
	the entire disk.
	b) wanted to use the space after partition 4 for NetBSD.

  I had to go back and forth between Linux fdisk, pfdisk.exe and
NetBSD disklabel to get it right. Linux fdisk wanted to protect me
from overlapping partitions. pfdisk.exe didn't mind me doing my own
thing, but it doens't let me import partitions into BSD labels. I'm
going to check out the licensing on the Linux pfdisk and see if I can
add a "I am not only an expert, but I really know what I'm doing"
flag. Linux fdisk would not import a partition as a BSD slice unless
the partition was big enough (this might be wrong, since I thought I
did this on another machine)

  Partition 2 is now my /var/tmp, an ext2fs on both Linux and NetBSD.
  I'd like to have partition 4's slices available. I edited things in
to my disklabel, but I get: 

varrus# mount -t ext2fs /dev/wd0h /emul/linux
ext2fs: /dev/wd0h on /emul/linux: incorrect super block

  Where does an extended partition start? I imagine that some number
of blocks are used in the extended partition to put the "slice"
(logical) table. 

varrus# fdisk
******* Working on device /dev/rwd0d *******
Warning: BIOS sector numbering starts with sector 1
parameters extracted from in-core disklabel are:
cylinders=847 heads=64 sectors/track=63 (4032 sectors/cylinder)

parameters to be used for BIOS calculations are:
cylinders=847 heads=64 sectors/track=63 (4032 sectors/cylinder)

Information from DOS bootblock is:
0: sysid 165 (NetBSD or FreeBSD or 386BSD)
    start 4032, size 3407040 (1663 MB), flag 0x80
        beg: cylinder    1, head   0, sector  1
        end: cylinder  845, head  63, sector 63
1: sysid 131 (Linux native)
    start 205632, size 201600 (98 MB), flag 0x80
        beg: cylinder   51, head   0, sector  1
        end: cylinder  100, head  63, sector 63
2: sysid 6 (Primary 'big' DOS, 16-bit FAT (> 32MB))
    start 407232, size 806400 (393 MB), flag 0x80
        beg: cylinder  101, head   0, sector  1
        end: cylinder  300, head  63, sector 63
3: sysid 5 (Extended DOS)
    start 1213632, size 1209600 (590 MB), flag 0x0
        beg: cylinder  301, head   0, sector  1
        end: cylinder  600, head  63, sector 63
varrus# disklabel wd0
# /dev/rwd0d:
type: ST506
disk: SSW17
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 64
sectors/cylinder: 4032
cylinders: 847
total sectors: 3415104
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   193536     4032    4.2BSD     1024  8192    16   # (Cyl.    1 - 48)
  b:   157248  2423232      swap                        # (Cyl.  601 - 639)
  c:   197568     4032    unused        0     0         # (Cyl.    1 - 49)
  d:  3415104        0    unused        0     0         # (Cyl.    0 - 846)
  e:   830592  2580480    4.2BSD     1024  8192    16   # (Cyl.  640 - 845)
  f:   201600   205632   unknown                        # (Cyl.   51 - 100)
  g:   806400   407232     MSDOS                        # (Cyl.  101 - 300)
  h:   850752  1213632   unknown                        # (Cyl.  301 - 511)

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQB1AwUBNFtoHKZpLyXYhL+BAQEt2wL/aIXnm6XCFV7unh7P06TiXjsHH8QFUTZ4
7zITPeA2EVKKf2yCDZLka1r8Q3JjPq8p2te4OYq0Eap1tmJ24ZS2ffePFoPt5rbh
2MLTEohnUIY2+r2PsQa3hf0aCbwDQRO5
=SxIH
-----END PGP SIGNATURE-----