Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.mel.connect.com.au!news.syd.connect.com.au!gidora.zeta.org.au!not-for-mail From: bde@zeta.org.au (Bruce Evans) Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: Fun with slices and partitions Date: 28 Jul 1996 23:40:23 +1000 Organization: Kralizec Dialup Unix Lines: 67 Message-ID: <4tfqk7$kfq@godzilla.zeta.org.au> References: <uybk7b3br.fsf@losira.ppe.bb-data.de> NNTP-Posting-Host: godzilla.zeta.org.au In article <uybk7b3br.fsf@losira.ppe.bb-data.de>, Martin Ibert <mib@bb-data.de> wrote: >In article <SCOTT.96Jul16124600@crux.dcs.qmw.ac.uk> scott@crux.dcs.qmw.ac.uk (Scott Mitchell) writes: > >: Yep, wrong way around. Four _slices_ per disk (what DOS fdisk calls >: partitions), and a bunch of BSD _partitions_ in each slice (8, IIRC). > >*sigh* Yes, strangely enough, FreeBSD choose to pervert the >well-established name hierarchy of top-level partitions and >second-level slices and do it the other way around. How would you do it? You have to support the well-established 4.4BSD name hierarchy of 8 top level partitions and 0 second level slices. You have to support the well-established 4.4BSD disklabel format for storing the partition information. This must work on disks without a 4.4BSD disklabel and on disks with arbitrarily foreign formats for the partition information. You have to support nth-level partitions in foreign partition formats (n = 2 occurs in practice for (DOS) logical drives within (DOS) extended partitions). >system". Windows NT, OS/2, Linux and of course MS-DOS (which I would >easily agree is not an operating system) all can use more than one >fdisk partition (either primary or extended, which means a set of smaller fdisk >partitions inside a big primary fdisk partition -- to get around the limit >of 4 primary fdisk partitions per drive) and do not employ any >OS-specific substructuring -- each fdisk partition becomes a block >device of its own, for a file system (or swap space, or >what-have-you). So can FreeBSD. E.g., to put a file system on /dev/rsd0s5 (the first "extended" fdisk partition): newfs -s 12345678 /dev/rsd0s5 dummylabel Here I had to specify the file system size and a dummy label because there is no label on the disk. >support extended ones). Also, integration with other filesystems is a >lot easier that way; there is a canonical and easily understood way of >addressing the hard disk areas used by other operating >systems. Mounting DOS fdisk partitions from Linux is practically >hassle-free, for example. No, there is no canonical way of: (1) naming DOS drives. The names change when you a add a drive in the middle and when a drive in the middle dies. (2) numbering primary partitions. Old versions of DOS (3.0?) number them back to front. (3) addressing logical drives within extended partitions. Extended partitions form a quaternary tree. Operating systems should only create degenerate forms of the tree that are equivalent to linked lists, but all forms should be accepted and there is only a canonical traversal order for degenerate forms. (4) handling huge numbers of partitions. DOS can only handle 26 partitions (A: - Z:) on all drives. Linux can only handle 11 logical drives (5-15) per drive. FreeBSD can only handle 26 logical drives (s5-s30) per drive. Thus mounting DOS fdisk partitions from Linux is only practically hassle free in the usual case :-). Mounting DOS fdisk partitions from FreeSBD is essentially the same: Linux: mount -t msdos /dev/sda5 /mnt FreeBSD: cd /dev; sh MAKEDEV sd0s5 # if necessary mount -t msdosfs /dev/sd0s5 /mnt -- Bruce Evans bde@zeta.org.au