From owner-freebsd-fs Mon Sep 18 8:56: 2 2000 Delivered-To: freebsd-fs@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id ACFBA37B422; Mon, 18 Sep 2000 08:55:53 -0700 (PDT) Received: from newsguy.com (p03-dn03kiryunisiki.gunma.ocn.ne.jp [210.232.224.132]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id AAA11656; Tue, 19 Sep 2000 00:55:43 +0900 (JST) Message-ID: <39C63ACD.441658CC@newsguy.com> Date: Tue, 19 Sep 2000 00:54:53 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,pt-BR MIME-Version: 1.0 To: Marc Tardif Cc: freebsd-hackers@FreeBSD.ORG, freebsd-fs@FreeBSD.ORG Subject: Re: device naming convention References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Marc Tardif wrote: > > What is the FreeBSD naming convention for devices of disk slices and > labels? Considering my system is installed on the first partition of > /dev/wd0 (non-dedicated), these are the block-device interfaces I > have to my disk: > > wd0 wd0c wd0f wd0s1 wd0s1c wd0s1f wd0s2 > wd0a wd0d wd0g wd0s1a wd0s1d wd0s1g wd0s3 > wd0b wd0e wd0h wd0s1b wd0s1e wd0s1h wd0s4 That's for up to 3.x. From 4.x, the device name is ad. > Questions: > 1. What are wd0[a-h] used for? 1) Dangerously Dedicated Disks (no slices). 2) Compatibility mode (an ugly hack) alias for the first FreeBSD slice on that disk. > 2. If wd0s1 is my first slice, why isn't it named wd0s0? Because a slice is what DOS calls a "partition table". They are numbered from 1 on, so we decided to keep the numbering to make things less confusing (which, if you think of it, is pretty silly with the partition/slice confusion). > 3. If I format wd0s2 as any type (Xenix for example), > will /dev now contain wd0s2[a-h]? No. 1. /dev is not a "magical" directory. It contains only what you put in there. 2. If you happened to have devfs, which _is_ "magical", partitions still require that a partition table exists in the slice. > Assuming /dev/wd0s2 contains a few blocks, ie /dev/wd0s1 > doesn't span to the end of disk: > 4. If I want to use /dev/wd0s2 as a raw slice for reading > and writing, what are the steps to follow? None. You just use it. > 4a. Do I need to format the partition as any type? If so > is there a recommended type (perhaps one which won't > be recognised by the bootloader would be preferable)? No, you don't need to format it, nor do you need to worry about it's type. Just make sure the slice does exist. > 4b. Should I then be using /dev/rwd0s2 or /dev/rwd0s2a > for reading and writing (of course, this is assuming > block i/o of multiples of 512 bytes)? Nope, using raw devices is almost always wrong, and we even got rid of raw device in latter versions of FreeBSD. A "raw" device is an _unbuffered_ device. It has nothing to do with formats or types. Anyway, you should be using /dev/wd0s2. Unless you partition the slice, and want to use the "a" partition. > Lastly, where else could I have found this information other > than asking on the FreeBSD mailing list? Beats me, but it _should_ be in the handbook. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.secret.bsdconspiracy.net "I demand that my picture show a handsome face, even if it doesn't look like me." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message