Return to BSD News archive
Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!news.clark.edu!netnews.nwnet.net!reuter.cse.ogi.edu!uwm.edu!cs.utexas.edu!uunet!dziuxsolim.rutgers.edu!igor.rutgers.edu!farside.rutgers.edu!hedrick From: hedrick@farside.rutgers.edu (Charles Hedrick) Newsgroups: comp.os.386bsd.development Subject: Re: Coexisting on the PC Message-ID: <Mar.20.13.43.01.1994.22215@farside.rutgers.edu> Date: 20 Mar 94 18:43:01 GMT References: <CLz6un.A9G@rex.uokhsc.edu> <2l3nvj$fpc@u.cc.utah.edu> <1994Mar10.090638.1364@softwords.bc.ca> <2lpf0mINNnh@godzilla.zeta.org.au> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 56 >> Apparently, Linux uses wd0i for the whole physical disk and >>wd0[j-m] for the BIOS style partitions. I think that this is an >>interesting idea that is worth considering. To mount a DOS partition, >>you would simply type something like 'mount -t msdos /dev/wd0j /DOS'. >Er, wd0[i-m] are for FreeBSD-1.1. They correspond to hda[0-4] in >linux. Just for completeness, let me describe what Linux actually does: it has no partitioning scheme of its own. It uses DOS partitions directly. This simplifies coexistence with DOS, and allows space to be reallocated between different operating systems fairly easily. Either DOS fdisk or Linux fdisk can be used to create or change partitions, though the Linux fdisk is more flexible and will probably be used by most people. (Linux fdisk allow you to set the partition type code to any value; DOS fdisk will only create partitions that claim to be DOS partitions. Linux will happily put a file system on a DOS partition, but for safety's sake it's best to change the type code to Linux. That way DOS won't try to play with it.) At least on my system (which could be out of date) /dev/hda is the whole disk as a raw device, /dev/hda1-4 are the 4 possible primary partitions, and /dev/hda5 and up are "logical partitions" inside a DOS "extended partition" if you have one. (Note that there can be only one extended partition.) Each logical partition has its own partition type, so it's quite possible to have DOS, OS/2 and Linux logical partitions inside a single extended partition. Any of these partitions can be mounted directly by Linux, assuming that the kernel knows about the file system type. The Linux kernel knows about DOS, OS/2's HPFS (read-only) and several different System V-derived file system types. The major limitations are that it does not know about NT or BSD file systems. The Linux bootstrap is also fairly flexible about coexisting with DOS. While you can use it to write a bootstrap directly in the master boot block if you want to, I normally use a DOS master boot block. I put a Linux boot in the partition containing Linux. Then by changing which partition is active I can get either DOS or Linux. In fact I normally leave Linux active, and have the Linux bootstrap set up so that it will boot either DOS or Linux on request. I've been trying to test netbsd 0.9, and so far have been unable to figure out how to get it to coexist with DOS and Linux. It seems to want to write its bootstrap to the master boot block. That's not real friendly. (I'm also alarmed by suggestions in some documentation that if the phase of the moon is wrong, the OS may decide to write a dump someplace other than the bsd partition. I'd rather lose a dump than take a chance on blowing away some other operating system.) In order to coexist cleanly, you should write your boot block to the boot area in your own partition, thus allowing several OS's to have their own boot blocks. It could of course be that I'm missing something. Unfortunately one disadvantage of netbsd's portability is that the man pages don't describe how the netbsd label and booting relate to the DOS partitioning and boot blocks. The "disklabel" man page looks like it would be great for a VAX. That seems to be carrying portability a bit too far, guys.