Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2009 16:29:56 +1100 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Fbsd1 <fbsd1@a1poweruser.com>
Cc:        Jerry McAllister <jerrymc@msu.edu>, Polytropon <freebsd@edvax.de>, freebsd-questions@freebsd.org
Subject:   Re: re-write is this booting info correct?
Message-ID:  <20091229134453.G81420@sola.nimnet.asn.au>
In-Reply-To: <20091228230618.7FB7310656F1@hub.freebsd.org>
References:  <20091228230618.7FB7310656F1@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-697707090-1262064596=:81420
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8BIT

In freebsd-questions Digest, Vol 291, Issue 3, Message: 1
On Mon, 28 Dec 2009 21:04:57 +0800 Fbsd1 <fbsd1@a1poweruser.com> wrote:

 > Content-Type: text/plain; charset=windows-1252; format=flowed

First up, you'd be better off using a non-Windows charset here, as they 
use weird characters just for ordinary things like quotes, as below.

 > How is this rewrite correct?
 > 
 > Users with Microsoft/Windows knowledge of how a hard drive is configured 
 > may have a terminology issue with FreeBSD. Microsoft/Windows and FreeBSD 
 > use the word partition to mean different (but related) things.
 > 
 > The Microsoft/Windows fdisk program is used to allocate partitions on 
 > the hard drive. This program allocated two types of partitions “primary 
 > dos partition” and “extended dos partition”.
 > A single “primary dos partition” occupying all the space on the hard 
 > drive would be assigned drive letter C. You can also sub-divide the hard 
 > drive into multiple “primary dos partition” each one being assigned a 
 > drive letter C, D, E, F,

Not exactly, and I assume you're hoping to be exact.  Disclaimer: I know 
nothing about Vista or its successor Windows 7, nor do I care to, but 
I've used many DOS versions - 3, 5, 6 (base of Win 3.1), 7 (under Win95 
through to XP) - in both MS and IBM variants, plus IBM OS/2 v2 and v3, 
and have had some exposure to NT (4 and 5), the latter having been being 
merged into Win2k and XP to some degree, including of course its NTFS.

All of these, at least from DOS 3 (c. '86?) use the same MBR setup, a 
maximum of 4 Primary Partitions, one (and only one) of which may be an 
Extended DOS Partition, containing as many Logical Drives as you like; 
they're formed as a linked list, though I never used past Drive J: with 
OS/2 (HPFS).  (I'm using caps here to refer to the DOS nomenclature)

In all of these, you can't access more than one Primary Partition from 
any DOS-based OS; if you wish to have drives D:, E:, F: (etc) then these 
_must_ be in the single Extended Partition - so your statement above is 
not correct in that respect.

 > An alternate method is to allocate an “extended dos partition” and then 
 > sub-divide it into logical dos drives lettered C, D, E, F. One of these 

Not limited to F: as above (adding the DOS colon as Polytropon suggests)

 > “primary dos partitions” or one of the logical dos drives in the 
 > “extended dos partition” must be set as the active partition to boot 
 > from.

I don't think even XP can boot from a Logical Drive in the Extended 
Partition.  OS/2 can be installed to and booted from a Logical Drive 
(though only by using the OS/2 Boot Manager or Grub ono), as can most? 
varieties of Linux.  I'm not sure about NT, but certainly DOS 3 to 7 
cannot boot from other than drive C: - though DOS Drive C: need not be 
the first physical disk partition, indeed there can be several, though 
only the first one marked Active is called C: by DOS on any one boot.

 > In a multiple partition allocation only one partition can be 
 > marked as bootable at one time. Typically legacy Microsoft/Windows 
 > Win3.1, Win95, Win98, WinMe, and Win2000 defaulted to a single “primary 
 > dos partition”. Starting with XP, PC manufactures started to provide 
 > support for their PC’s operating system by having a second  “primary dos 
 > partition” where the original factory version of the system was hidden 
 > and used to restore the C drive back to the factory version when 
 > corrupted by a virus.

Again, not exactly or always correct.  Compaq at least were providing a 
'hidden' Primary Partition as early as '98 on laptops, for a diagnostics 
boot (running DOS 6.2 with a mini-Win 3.1 'desktop', FWIW).  And while 
most OEMs and computer shops were in that 'default' habit of installing 
a single C: partition (and many still are), that was an install choice; 
most people with a clue were using multiple DOS Drives, requiring use of 
the Extended Partition, since DOS 3.

 > Microsoft/Windows provides no native method of 
 > selecting which partition to boot from in a multiple partition allocation.

At least NT, Win2k and XP can multiboot .. W2k uses C:\boot.ini listing 
bootable OSes, and as I recall it's called \NTLDR.something on XP.

 > FreeBSD’s fdisk program allocates disk space into slices. A FreeBSD 
 > slice is the same thing as a Microsoft/Windows  “primary dos partition”. 
 > FreeBSD has nothing akin to an “extended dos partition”. The 

Although FreeBSD can mount and access the multiple Logical Drives as 
slices 5 and up.  I'm not sure if FreeBSD has any limit to the number of 
such slices it can access, but I've recovered multiple HPFS 'drives' 
that way, and you can access DOS FAT, NTFS, HPFS (requires compiling 
code still in the tree at 8.0-R) and Linux ext2 and ext3 filesystems.

It's true that sysinstall can't access such slices, there are comments 
in the code suggesting it should maybe be added, though unlikely now :)

 > Microsoft/Windows partition and the FreeBSD slice is where the operating 
 > system software is installed. Microsoft/Windows operating system creates 
 > default folders that share the space in the partition.  The FreeBSD 

It's not clear what you mean here by 'folders that share the space'?

 > ‘disk label’ program is used to sub-divide the slice into smaller chunks 
 > called partitions. In a standard install of FreeBSD, these partitions 
 > are the default directory names used by the operating system.

It's 'disklabel', and I defer to Polytropon's clarification of this bit.

 > The motherboard standard which was created in the days before windows 
 > desktop were even though of yet and at which time Microsoft DOS (disk 
 > operating system) was the only thing available. This legacy standard has 

And IBM PCDOS of course, though it and MSDOS were pretty much the same.

 > continued un-updated to this current time and contributes to the 
 > limitations imposed on booting, disk layout and selection of which 
 > allocation on the hard disk to boot from.
 > 
 > The motherboard BIOS ROM chip at power up inquires each device 
 > (floppies, cdrom, hard drive, usb memory stick) you selected in the BIOS 
 > menu to boot from.
 > 
 > The hard drive has a MBR (Master Boot Record) a (512 byte block) located 
 > in sector-0 of the first physical track on the hard drive. This MBR 
 > contains bootstrap code and the disk partition table created by the 
 > fdisk program. The BIOS boot code reads the MBR code and disk partition 
 > table into memory and then transfers control to it. This MBR code is 
 > responsible for parsing the partition table and finding the bootable 
 > slice/partition that is marked 'active'.  The MBR code then sets up the 
 > disk-address-offset information for the bootable slice/partition, and 
 > reads 'relative sector zero' from that slice/partition, and transfers 
 > control to that one-sector block of code that contains the unique 
 > operating system code to load it into memory.

That's all about right.  Some (eg OS/2 Boot Manager, maybe grub?) locate
loader code after the MBR on track 0, side 0, but that's not so common.

 > This hard drive 512-byte MBR is where all the limitations are. Do to 
 > it’s size the MBR partition table is limited to 4 entries. This means no 
 > matter how large your hard drive is (20MG or 200GB) you can only 
 > sub-divide it into a maximum 4 slices/partitions.

Well, ignoring the fact that one of these can be an Extended Partition 
with any number of 'Logical Drives' and/or FreeBSD slices on it, but 
except for Linux and OS/2 (that I know of), these are generally not 
bootable slices, yet fine for data and sharing with other installed OS.

And with FreeBSD of course you can have up to 4 slices, each with its 
own partitions, so you can boot say FreeBSD 6, 7, 8 and 9, or DOS and 7 
and 8, plus any number of Linux varieties from the Extended Partition. 
On my Thinkpad I run DOS (w2k, solely for BIOS upgrades :), 7.2-S and 
8.0-R, plus room for Debian, either as a Primary or Extended slice.

 > The default MBR code written by the Microsoft/Windows fdisk program is 
 > hard coded to boot the C drive. The FreeBSD fdisk program has option to 
 > write a simple boot menu program to the MBR.

No, it's boot0cfg not fdisk that writes the boot program to disk (though 
DOS's 'FDISK /MBR' will!).  And don't forget that setting boot0cfg boot 
slice to 5 transfers control to the boot sector on a second hard drive.

 > There are MBR boot menu programs in the FreeBSD ports collection that 
 > you can load into the MBR on the first physical cabled hard drive to 
 > scan for other bootable primary-partitions/slices on this hard drive and 
 > any other hard drives cabled to the PC. It displays a menu giving you 
 > the option to choose which one you want to boot from. This gives you the 
 > ability to have more that one operating system installed on your PC at 
 > one time.

Indeed.

HTH, Ian
--0-697707090-1262064596=:81420--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091229134453.G81420>