Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2000 04:22:17 +0900
From:      "Daniel C. Sobral" <dcs@newsguy.com>
To:        Marc Tardif <intmktg@CAM.ORG>
Cc:        freebsd-hackers@FreeBSD.ORG, freebsd-fs@FreeBSD.ORG
Subject:   Re: device naming convention
Message-ID:  <39C66B69.96E57728@newsguy.com>
References:  <Pine.LNX.4.10.10009181358450.1921-100000@Gloria.CAM.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help
Marc Tardif wrote:
> 
> This is what I have in fdisk (from /stand/sysinstall):
>  Offset       Size        End     Name  PType       Desc  Subtype Flags
>       0         63         62        -      6     unused        0
>      63    1937565    1937627    wd0s1      3    freebsd      165     C
> 1937628     191268    2128895        -      6     unused        0
> 
> At this point, the second slice does not exist yet so I can't use it. For
> problems in defining a slice, see next question.

Really? I wouldn't expect FreeBSD to worry about the type being
"unused".

> When I define a slice, I need to specify what fdisk (from sysinstall)
> calls a "partition type". In the case of my FreeBSD slice, I selected
> "165". In the case of a slice I will use for raw io, is there any reason I
> should use one partition type rather than another?

A type serves to, well, check the type. :-) If you don't care about the
type, nothing else will... in theory. I certainly can't see
open("/dev/ad0s2", flags) checking the type for anything. Perhaps, it
will, indeed, fail for "unused". But nothing more than that.

Other things do worry about type, of course. boot0 will identify slices
to be booted by their type. loader will list a slice's type, and try to
find the disklabel for FreeBSD slices.

> Got rid of raw devices in later versions of FreeBSD? What if I purposely
> want unbuffered io? There are instances, such as with databases, where the
> buffer cache is useless.

Oh, sorry, I got things confused. You should verify the hour at which a
message is replied for reliability... ;-)

Anyway, raw devices are character devices, unbuffered. Then, there were
the "block" devices, which were buffered. We got rid of the _block_
devices, not the raw devices. But, as we no longer have two types, we no
longer prefix them with "r".

> I understand that in many cases, databases using the raw device
> practically reinvent the wheel by programming what is effectively another
> filesystem (which, by the way, is most likely slower than bsd's ffs). Even
> Oracle, which used to be one of the "you gotta use a raw partition if you
> want any speed at all" type, has moved into the "use a normal partitoin or
> regular file unless you do things like sharing a RAID between two hosts"
> camp.
> 
> Yet, there are still isolated cases where raw io can be beneficial. What
> should I do for raw io in later versions of FreeBSD?

Actually, there is little benefit in buffered device access. Buffering
is better handled elsewhere and by other means.

> > Anyway, you should be using /dev/wd0s2. Unless you partition the slice,
> > and want to use the "a" partition.
> >
> If I will be storing a few tables in /dev/wd0s2 of a predefined block
> aligned size, would it be advisable to use the 165 partition type for
> /dev/wd0s2 and create labels which will effectively become my tables? If
> this actually makes sense (fat chance), is there any reason I should be
> creating mount points? Or, if it would be better to define the labels as
> swap (assuming I already have a swap label in /dev/wd0s1), could FreeBSD
> inadvertently use those swap partitions and overwrite my data?

Well, you could, indeed, use slice type 165, and partition it. We are
limited, though, to 6 partitions. c must always be the whole slice
(minus the disklabel :), and d is better left unused for historical
reasons.

OTOH, using a partition (try to avoid using c -- if you want the whole
slice, create a partition with the same data as c) would be cleaner,
from the point of view of various utilities, than using a slice. You do
lose a few sectors.

-- 
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-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39C66B69.96E57728>