Disklabel on Multiboot Systems


When you are only using part of a hard drive for OpenBSD, you need to handle your OpenBSD partitions a little differently. Before you start to divide up your new MBR partition, take a look at the disklabel you're starting with.

 > p ... total sectors: 39179952 1 free sectors: 16643340 2 rpm: 3600 16 partitions: #    size  offset  fstype  [fsize bsize  cpg] 3 a:  16643340 14329980  unused    0   0 4 c:  39179952    0  unused    0   0 5 i:  14329917    63   MSDOS 

Normally, on an empty disk, you'll see that the total number of sectors equals the free sectors. You haven't installed any OpenBSD partitions on this disk, but the 1 total sectors and 2 free sectors are most certainly not equal. disklabel(8) has found the FAT32 MBR partition and adjusted the free space appropriately. Later on, you'll also see the 4 "c" partition that represents the whole disk is just what you would expect in a dedicated OpenBSD system.

There's also an 5 "i" partition with a file system type of MSDOS. Although this appears at the bottom of the disklabel, it has an offset of 63, so it's at the beginning of the disk. This is your Windows installation. You might want to make a note of the disklabel partition letter, as it will come in useful when you want to access that disk from OpenBSD, or you can read the disklabel later with disklabel(8). (See Chapter 18 for details.)

You also automatically get an 3 "a" partition, of the same size as the free space available on the system. The "a" partition is normally the root partition, but it's assigned a size that fills the entire MBR partition you've set aside for OpenBSD! Remember, your root partition must fit entirely within the first 8GB of disk, so you're going to need to re-create this partition with a proper size.

Note

A bit of addition will show that the existing partitions do not use up all the space available on this disk. We still don't have an MBR partition at the end of this disk for the second chunk of Windows space. After completing the OpenBSD install, we'll boot into Windows XP and use the Disk Manager MMC snap-in to partition and format the unpartitioned space.

So, start by deleting the "a" partition created by fdisk, and then add a new "a" partition.

 > d a > a a offset: [14329980] 1 size: [16643340] 2 500M Rounding to nearest cylinder: 1023876 FS type: [4.2BSD] mount point: [none] / > 

Here, we see that disklabel understands the 1 offset from the Windows partition, and it knows how many 2 sectors are available in the OpenBSD partition. Other than the unusual offset, this looks exactly like creating a root partition in a dedicated OpenBSD system.

The rest of the install process is absolutely identical to the standard OpenBSD install. Once you're finished, however, you'll need to find a way to tell your computer which operating system to boot. That's the job of a boot manager, as we'll see shortly.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net