xref: /freebsd/share/man/man4/geom.4 (revision ba3eb872e46cf6815828aaa58191c6ddc25b56bc)
127c74787SPoul-Henning Kamp.\"
227c74787SPoul-Henning Kamp.\" Copyright (c) 2002 Poul-Henning Kamp
327c74787SPoul-Henning Kamp.\" Copyright (c) 2002 Networks Associates Technology, Inc.
427c74787SPoul-Henning Kamp.\" All rights reserved.
527c74787SPoul-Henning Kamp.\"
627c74787SPoul-Henning Kamp.\" This software was developed for the FreeBSD Project by Poul-Henning Kamp
727c74787SPoul-Henning Kamp.\" and NAI Labs, the Security Research Division of Network Associates, Inc.
827c74787SPoul-Henning Kamp.\" under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
927c74787SPoul-Henning Kamp.\" DARPA CHATS research program.
1027c74787SPoul-Henning Kamp.\"
1127c74787SPoul-Henning Kamp.\" Redistribution and use in source and binary forms, with or without
1227c74787SPoul-Henning Kamp.\" modification, are permitted provided that the following conditions
1327c74787SPoul-Henning Kamp.\" are met:
1427c74787SPoul-Henning Kamp.\" 1. Redistributions of source code must retain the above copyright
1527c74787SPoul-Henning Kamp.\"    notice, this list of conditions and the following disclaimer.
1627c74787SPoul-Henning Kamp.\" 2. Redistributions in binary form must reproduce the above copyright
1727c74787SPoul-Henning Kamp.\"    notice, this list of conditions and the following disclaimer in the
1827c74787SPoul-Henning Kamp.\"    documentation and/or other materials provided with the distribution.
1927c74787SPoul-Henning Kamp.\" 3. The names of the authors may not be used to endorse or promote
2027c74787SPoul-Henning Kamp.\"    products derived from this software without specific prior written
2127c74787SPoul-Henning Kamp.\"    permission.
2227c74787SPoul-Henning Kamp.\"
2327c74787SPoul-Henning Kamp.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
2427c74787SPoul-Henning Kamp.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2527c74787SPoul-Henning Kamp.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2627c74787SPoul-Henning Kamp.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2727c74787SPoul-Henning Kamp.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2827c74787SPoul-Henning Kamp.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2927c74787SPoul-Henning Kamp.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3027c74787SPoul-Henning Kamp.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3127c74787SPoul-Henning Kamp.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3227c74787SPoul-Henning Kamp.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3327c74787SPoul-Henning Kamp.\" SUCH DAMAGE.
3427c74787SPoul-Henning Kamp.\"
3527c74787SPoul-Henning Kamp.\" $FreeBSD$
3627c74787SPoul-Henning Kamp.\"
3727c74787SPoul-Henning Kamp.Dd March 27, 2002
38fc412d1bSRuslan Ermilov.Os
3927c74787SPoul-Henning Kamp.Dt GEOM 4
4027c74787SPoul-Henning Kamp.Sh NAME
4127c74787SPoul-Henning Kamp.Nm GEOM
4227c74787SPoul-Henning Kamp.Nd modular disk I/O request transformation framework.
4327c74787SPoul-Henning Kamp.Sh DESCRIPTION
44d773aebdSPoul-Henning KampThe GEOM framework provides an infrastructure in which "classes"
4527c74787SPoul-Henning Kampcan perform transformations on disk I/O requests on their path from
4627c74787SPoul-Henning Kampthe upper kernel to the device drivers and back.
4727c74787SPoul-Henning Kamp.Pp
4856cf50adSPoul-Henning KampTransformations in a GEOM context range from the simple geometric
49d773aebdSPoul-Henning Kampdisplacement performed in typical disk partitioning modules over RAID
5027c74787SPoul-Henning Kampalgorithms and device multipath resolution to full blown cryptographic
5127c74787SPoul-Henning Kampprotection of the stored data.
5227c74787SPoul-Henning Kamp.Pp
5327c74787SPoul-Henning KampCompared to traditional "volume management", GEOM differs from most
5427c74787SPoul-Henning Kampand in some cases all previous implementations in the following ways:
5527c74787SPoul-Henning Kamp.Bl -bullet
5627c74787SPoul-Henning Kamp.It
575203edcdSRuslan ErmilovGEOM is extensible.
585203edcdSRuslan ErmilovIt is trivially simple to write a new class
595203edcdSRuslan Ermilovof transformation and it will not be given stepchild treatment.
605203edcdSRuslan ErmilovIf
6127c74787SPoul-Henning Kampsomeone for some reason wanted to mount IBM MVS diskpacks, a class
6227c74787SPoul-Henning Kamprecognizing and configuring their VTOC information would be a trivial
6327c74787SPoul-Henning Kampmatter.
6427c74787SPoul-Henning Kamp.It
655203edcdSRuslan ErmilovGEOM is topologically agnostic.
665203edcdSRuslan ErmilovMost volume management implementations
6727c74787SPoul-Henning Kamphave very strict notions of how classes can fit together, very often
6827c74787SPoul-Henning Kampone fixed hierarchy is provided for instance subdisk - plex -
6927c74787SPoul-Henning Kampvolume.
7027c74787SPoul-Henning Kamp.El
7127c74787SPoul-Henning Kamp.Pp
7227c74787SPoul-Henning KampBeing extensible means that new transformations are treated no differently
7327c74787SPoul-Henning Kampthan existing transformations.
7427c74787SPoul-Henning Kamp.Pp
7527c74787SPoul-Henning KampFixed hierarchies are bad because they make it impossible to express
7627c74787SPoul-Henning Kampthe intent efficiently.
7727c74787SPoul-Henning KampIn the fixed hierarchy above it is not possible to mirror two
7856cf50adSPoul-Henning Kampphysical disks and then partition the mirror into subdisks, instead
7927c74787SPoul-Henning Kampone is forced to make subdisks on the physical volumes and to mirror
8027c74787SPoul-Henning Kampthese two and two resulting in a much more complex configuration.
8127c74787SPoul-Henning KampGEOM on the other hand does not care in which order things are done,
8227c74787SPoul-Henning Kampthe only restriction is that cycles in the graph will not be allowed.
8327c74787SPoul-Henning Kamp.Pp
8427c74787SPoul-Henning Kamp.Sh "TERMINOLOGY and TOPOLOGY"
853bdf3cd7SPawel Jakub DawidekGEOM is quite object oriented and consequently the terminology
8656cf50adSPoul-Henning Kampborrows a lot of context and semantics from the OO vocabulary:
8727c74787SPoul-Henning Kamp.Pp
8827c74787SPoul-Henning KampA "class", represented by the data structure g_class implements one
895203edcdSRuslan Ermilovparticular kind of transformation.
905203edcdSRuslan ErmilovTypical examples are MBR disk
9156cf50adSPoul-Henning Kamppartition, BSD disklabel, and RAID5 classes.
9227c74787SPoul-Henning Kamp.Pp
9327c74787SPoul-Henning KampAn instance of a class is called a "geom" and represented by the
945203edcdSRuslan Ermilovdata structure "g_geom".
955203edcdSRuslan ErmilovIn a typical i386 FreeBSD system, there
9627c74787SPoul-Henning Kampwill be one geom of class MBR for each disk.
9727c74787SPoul-Henning Kamp.Pp
9827c74787SPoul-Henning KampA "provider", represented by the data structure "g_provider", is
9927c74787SPoul-Henning Kampthe front gate at which a geom offers service.
10056cf50adSPoul-Henning KampA provider is "a disk-like thing which appears in /dev" - a logical
10127c74787SPoul-Henning Kampdisk in other words.
10256cf50adSPoul-Henning KampAll providers have three main properties: name, sectorsize and size.
10327c74787SPoul-Henning Kamp.Pp
10427c74787SPoul-Henning KampA "consumer" is the backdoor through which a geom connects to another
10556cf50adSPoul-Henning Kampgeom provider and through which I/O requests are sent.
10627c74787SPoul-Henning Kamp.Pp
10727c74787SPoul-Henning KampThe topological relationship between these entities are as follows:
10827c74787SPoul-Henning Kamp.Bl -bullet
10927c74787SPoul-Henning Kamp.It
11027c74787SPoul-Henning KampA class has zero or more geom instances.
11127c74787SPoul-Henning Kamp.It
11227c74787SPoul-Henning KampA geom has exactly one class it is derived from.
11327c74787SPoul-Henning Kamp.It
11427c74787SPoul-Henning KampA geom has zero or more consumers.
11527c74787SPoul-Henning Kamp.It
11656cf50adSPoul-Henning KampA geom has zero or more providers.
11727c74787SPoul-Henning Kamp.It
11827c74787SPoul-Henning KampA consumer can be attached to zero or one providers.
11927c74787SPoul-Henning Kamp.It
12027c74787SPoul-Henning KampA provider can have zero or more consumers attached.
12127c74787SPoul-Henning Kamp.El
12227c74787SPoul-Henning Kamp.Pp
12356cf50adSPoul-Henning KampAll geoms have a rank-number assigned, which is used to detect and
1245203edcdSRuslan Ermilovprevent loops in the acyclic directed graph.
1255203edcdSRuslan ErmilovThis rank number is
12627c74787SPoul-Henning Kampassigned as follows:
12727c74787SPoul-Henning Kamp.Bl -enum
12827c74787SPoul-Henning Kamp.It
12927c74787SPoul-Henning KampA geom with no attached consumers has rank=1
13027c74787SPoul-Henning Kamp.It
13156cf50adSPoul-Henning KampA geom with attached consumers has a rank one higher than the
13227c74787SPoul-Henning Kamphighest rank of the geoms of the providers its consumers are
13327c74787SPoul-Henning Kampattached to.
13427c74787SPoul-Henning Kamp.El
13557bd0fc6SJens Schweikhardt.Sh "SPECIAL TOPOLOGICAL MANEUVERS"
13656cf50adSPoul-Henning KampIn addition to the straightforward attach, which attaches a consumer
13757bd0fc6SJens Schweikhardtto a provider, and detach, which breaks the bond, a number of special
13857bd0fc6SJens Schweikhardttopological maneuvers exists to facilitate configuration and to
13927c74787SPoul-Henning Kampimprove the overall flexibility.
14027c74787SPoul-Henning Kamp.Pp
14127c74787SPoul-Henning Kamp.Em TASTING
14256cf50adSPoul-Henning Kampis a process that happens whenever a new class or new provider
143d773aebdSPoul-Henning Kampis created and it provides the class a chance to automatically configure an
14456cf50adSPoul-Henning Kampinstance on providers, which it recognize as its own.
14556cf50adSPoul-Henning KampA typical example is the MBR disk-partition class which will look for
14627c74787SPoul-Henning Kampthe MBR table in the first sector and if found and validated it will
14727c74787SPoul-Henning Kampinstantiate a geom to multiplex according to the contents of the MBR.
14827c74787SPoul-Henning Kamp.Pp
14956cf50adSPoul-Henning KampA new class will be offered to all existing providers in turn and a new
15027c74787SPoul-Henning Kampprovider will be offered to all classes in turn.
15127c74787SPoul-Henning Kamp.Pp
15227c74787SPoul-Henning KampExactly what a class does to recognize if it should accept the offered
15327c74787SPoul-Henning Kampprovider is not defined by GEOM, but the sensible set of options are:
15427c74787SPoul-Henning Kamp.Bl -bullet
15527c74787SPoul-Henning Kamp.It
15627c74787SPoul-Henning KampExamine specific data structures on the disk.
15727c74787SPoul-Henning Kamp.It
15827c74787SPoul-Henning KampExamine properties like sectorsize or mediasize for the provider.
15927c74787SPoul-Henning Kamp.It
16056cf50adSPoul-Henning KampExamine the rank number of the provider's geom.
16127c74787SPoul-Henning Kamp.It
16256cf50adSPoul-Henning KampExamine the method name of the provider's geom.
16327c74787SPoul-Henning Kamp.El
16427c74787SPoul-Henning Kamp.Pp
16527c74787SPoul-Henning Kamp.Em ORPHANIZATION
16627c74787SPoul-Henning Kampis the process by which a provider is removed while
16756cf50adSPoul-Henning Kampit potentially is still being used.
16827c74787SPoul-Henning Kamp.Pp
169c1c85751SPoul-Henning KampWhen a geom orphans a provider, all future I/O requests will
1705203edcdSRuslan Ermilov"bounce" on the provider with an error code set by the geom.
1715203edcdSRuslan ErmilovAny
17227c74787SPoul-Henning Kampconsumers attached to the provider will receive notification about
173c1c85751SPoul-Henning Kampthe orphanization when the eventloop gets around to it, and they
174d773aebdSPoul-Henning Kampcan take appropriate action at that time.
17527c74787SPoul-Henning Kamp.Pp
17656cf50adSPoul-Henning KampA geom which came into being as a result of a normal taste operation
177c1c85751SPoul-Henning Kampshould selfdestruct unless it has a way to keep functioning lacking
178c1c85751SPoul-Henning Kampthe orphaned provider.
179c1c85751SPoul-Henning KampGeoms like diskslicers should therefore selfdestruct whereas
180c1c85751SPoul-Henning KampRAID5 or mirror geoms will be able to continue, as long as they do
18127c74787SPoul-Henning Kampnot loose quorum.
18227c74787SPoul-Henning Kamp.Pp
183c1c85751SPoul-Henning KampWhen a provider is orphaned, this does not necessarily result in any
184c1c85751SPoul-Henning Kampimmediate change in the topology: any attached consumers are still
185c1c85751SPoul-Henning Kampattached, any opened paths are still open, any outstanding I/O
186c1c85751SPoul-Henning Kamprequests are still outstanding.
18727c74787SPoul-Henning Kamp.Pp
188c1c85751SPoul-Henning KampThe typical scenario is
189c1c85751SPoul-Henning Kamp.Bl -bullet -offset indent -compact
190c1c85751SPoul-Henning Kamp.It
191c1c85751SPoul-Henning KampA device driver detects a disk has departed and orphans the provider for it.
192c1c85751SPoul-Henning Kamp.It
193c1c85751SPoul-Henning KampThe geoms on top of the disk receive the orphanization event and
194c1c85751SPoul-Henning Kamporphans all their providers in turn.
195c1c85751SPoul-Henning KampProviders, which are not attached to, will typically self-destruct
196c1c85751SPoul-Henning Kampright away.
197c1c85751SPoul-Henning KampThis process continues in a quasi-recursive fashion until all
198c1c85751SPoul-Henning Kamprelevant pieces of the tree has heard the bad news.
199c1c85751SPoul-Henning Kamp.It
200c1c85751SPoul-Henning KampEventually the buck stops when it reaches geom_dev at the top
201c1c85751SPoul-Henning Kampof the stack.
202c1c85751SPoul-Henning Kamp.It
203c1c85751SPoul-Henning KampGeom_dev will call destroy_dev(9) to stop any more request from
204c1c85751SPoul-Henning Kampcoming in.
205c1c85751SPoul-Henning KampIt will sleep until all (if any) outstanding I/O requests have
206c1c85751SPoul-Henning Kampbeen returned.
207c1c85751SPoul-Henning KampIt will explicitly close (ie: zero the access counts), a change
208c1c85751SPoul-Henning Kampwhich will propagate all the way down through the mesh.
209c1c85751SPoul-Henning KampIt will then detach and destroy its geom.
210c1c85751SPoul-Henning Kamp.It
211c1c85751SPoul-Henning KampThe geom whose provider is now attached will destroy the provider,
212c1c85751SPoul-Henning Kampdetach and destroy its consumer and destroy its geom.
213c1c85751SPoul-Henning Kamp.It
214c1c85751SPoul-Henning KampThis process percolates all the way down through the mesh, until
215c1c85751SPoul-Henning Kampthe cleanup is complete.
216c1c85751SPoul-Henning Kamp.El
21727c74787SPoul-Henning Kamp.Pp
21856cf50adSPoul-Henning KampWhile this approach seems byzantine, it does provide the maximum
219c1c85751SPoul-Henning Kampflexibility and robustness in handling disappearing devices.
220c1c85751SPoul-Henning Kamp.Pp
221c1c85751SPoul-Henning KampThe one absolutely crucial detail to be aware is that if the
222c1c85751SPoul-Henning Kampdevice driver does not return all I/O requests, the tree will
223d773aebdSPoul-Henning Kampnot unravel.
22427c74787SPoul-Henning Kamp.Pp
22527c74787SPoul-Henning Kamp.Em SPOILING
22627c74787SPoul-Henning Kampis a special case of orphanization used to protect
22727c74787SPoul-Henning Kampagainst stale metadata.
22827c74787SPoul-Henning KampIt is probably easiest to understand spoiling by going through
22927c74787SPoul-Henning Kampan example.
23027c74787SPoul-Henning Kamp.Pp
23127c74787SPoul-Henning KampImagine a disk, "da0" on top of which a MBR geom provides
23227c74787SPoul-Henning Kamp"da0s1" and "da0s2" and on top of "da0s1" a BSD geom provides
23327c74787SPoul-Henning Kamp"da0s1a" through "da0s1e", both the MBR and BSD geoms have
23427c74787SPoul-Henning Kampautoconfigured based on data structures on the disk media.
23527c74787SPoul-Henning KampNow imagine the case where "da0" is opened for writing and those
23627c74787SPoul-Henning Kampdata structures are modified or overwritten: Now the geoms would
23727c74787SPoul-Henning Kampbe operating on stale metadata unless some notification system
23827c74787SPoul-Henning Kampcan inform them otherwise.
239d773aebdSPoul-Henning Kamp.Pp
24027c74787SPoul-Henning KampTo avoid this situation, when the open of "da0" for write happens,
24127c74787SPoul-Henning Kampall attached consumers are told about this, and geoms like
24227c74787SPoul-Henning KampMBR and BSD will selfdestruct as a result.
24327c74787SPoul-Henning KampWhen "da0" is closed again, it will be offered for tasting again
24427c74787SPoul-Henning Kampand if the data structures for MBR and BSD are still there, new
24527c74787SPoul-Henning Kampgeoms will instantiate themselves anew.
24627c74787SPoul-Henning Kamp.Pp
24727c74787SPoul-Henning KampNow for the fine print:
24827c74787SPoul-Henning Kamp.Pp
24927c74787SPoul-Henning KampIf any of the paths through the MBR or BSD module were open, they
25027c74787SPoul-Henning Kampwould have opened downwards with an exclusive bit rendering it
25127c74787SPoul-Henning Kampimpossible to open "da0" for writing in that case and conversely
25227c74787SPoul-Henning Kampthe requested exclusive bit would render it impossible to open a
25327c74787SPoul-Henning Kamppath through the MBR geom while "da0" is open for writing.
25427c74787SPoul-Henning Kamp.Pp
25527c74787SPoul-Henning KampFrom this it also follows that changing the size of open geoms can
256d773aebdSPoul-Henning Kamponly be done with their cooperation.
25727c74787SPoul-Henning Kamp.Pp
25827c74787SPoul-Henning KampFinally: the spoiling only happens when the write count goes from
25927c74787SPoul-Henning Kampzero to non-zero and the retasting only when the write count goes
260d773aebdSPoul-Henning Kampfrom non-zero to zero.
26127c74787SPoul-Henning Kamp.Pp
26227c74787SPoul-Henning Kamp.Em INSERT/DELETE
26327c74787SPoul-Henning Kampare a very special operation which allows a new geom
26427c74787SPoul-Henning Kampto be instantiated between a consumer and a provider attached to
26527c74787SPoul-Henning Kampeach other and to remove it again.
26627c74787SPoul-Henning Kamp.Pp
26727c74787SPoul-Henning KampTo understand the utility of this, imagine a provider with
26827c74787SPoul-Henning Kampbeing mounted as a file system.
26927c74787SPoul-Henning KampBetween the DEVFS geoms consumer and its provider we insert
27056cf50adSPoul-Henning Kampa mirror module which configures itself with one mirror
27127c74787SPoul-Henning Kampcopy and consequently is transparent to the I/O requests
27227c74787SPoul-Henning Kampon the path.
27327c74787SPoul-Henning KampWe can now configure yet a mirror copy on the mirror geom,
27456cf50adSPoul-Henning Kamprequest a synchronization, and finally drop the first mirror
27527c74787SPoul-Henning Kampcopy.
27627c74787SPoul-Henning KampWe have now in essence moved a mounted file system from one
27727c74787SPoul-Henning Kampdisk to another while it was being used.
27827c74787SPoul-Henning KampAt this point the mirror geom can be deleted from the path
27927c74787SPoul-Henning Kampagain, it has served its purpose.
28027c74787SPoul-Henning Kamp.Pp
28127c74787SPoul-Henning Kamp.Em CONFIGURE
28227c74787SPoul-Henning Kampis the process where the administrator issues instructions
2835203edcdSRuslan Ermilovfor a particular class to instantiate itself.
2845203edcdSRuslan ErmilovThere are multiple
28527c74787SPoul-Henning Kampways to express intent in this case, a particular provider can be
28627c74787SPoul-Henning Kampspecified with a level of override forcing for instance a BSD
28727c74787SPoul-Henning Kampdisklabel module to attach to a provider which was not found palatable
28827c74787SPoul-Henning Kampduring the TASTE operation.
28927c74787SPoul-Henning Kamp.Pp
29027c74787SPoul-Henning KampFinally IO is the reason we even do this: it concerns itself with
29127c74787SPoul-Henning Kampsending I/O requests through the graph.
29227c74787SPoul-Henning Kamp.Pp
29327c74787SPoul-Henning Kamp.Em "I/O REQUESTS
29427c74787SPoul-Henning Kamprepresented by struct bio, originate at a consumer,
29556cf50adSPoul-Henning Kampare scheduled on its attached provider, and when processed, returned
29627c74787SPoul-Henning Kampto the consumer.
29727c74787SPoul-Henning KampIt is important to realize that the struct bio which
29857bd0fc6SJens Schweikhardtenters through the provider of a particular geom does not "come
29927c74787SPoul-Henning Kampout on the other side".
30027c74787SPoul-Henning KampEven simple transformations like MBR and BSD will clone the
30156cf50adSPoul-Henning Kampstruct bio, modify the clone, and schedule the clone on their
30227c74787SPoul-Henning Kampown consumer.
30327c74787SPoul-Henning KampNote that cloning the struct bio does not involve cloning the
30427c74787SPoul-Henning Kampactual data area specified in the IO request.
30527c74787SPoul-Henning Kamp.Pp
306d773aebdSPoul-Henning KampIn total four different IO requests exist in GEOM: read, write,
307d773aebdSPoul-Henning Kampdelete, and get attribute.
30827c74787SPoul-Henning Kamp.Pp
30956cf50adSPoul-Henning KampRead and write are self explanatory.
31027c74787SPoul-Henning Kamp.Pp
31127c74787SPoul-Henning KampDelete indicates that a certain range of data is no longer used
31227c74787SPoul-Henning Kampand that it can be erased or freed as the underlying technology
31327c74787SPoul-Henning Kampsupports.
31427c74787SPoul-Henning KampTechnologies like flash adaptation layers can arrange to erase
31527c74787SPoul-Henning Kampthe relevant blocks before they will become reassigned and
31656cf50adSPoul-Henning Kampcryptographic devices may want to fill random bits into the
31727c74787SPoul-Henning Kamprange to reduce the amount of data available for attack.
31827c74787SPoul-Henning Kamp.Pp
31927c74787SPoul-Henning KampIt is important to recognize that a delete indication is not a
32027c74787SPoul-Henning Kamprequest and consequently there is no guarantee that the data actually
32127c74787SPoul-Henning Kampwill be erased or made unavailable unless guaranteed by specific
3225203edcdSRuslan Ermilovgeoms in the graph.
3235203edcdSRuslan ErmilovIf "secure delete" semantics are required, a
32427c74787SPoul-Henning Kampgeom should be pushed which converts delete indications into (a
32527c74787SPoul-Henning Kampsequence of) write requests.
32627c74787SPoul-Henning Kamp.Pp
327d773aebdSPoul-Henning KampGet attribute supports inspection and manipulation
32827c74787SPoul-Henning Kampof out-of-band attributes on a particular provider or path.
32927c74787SPoul-Henning KampAttributes are named by ascii strings and they will be discussed in
33027c74787SPoul-Henning Kampa separate section below.
33127c74787SPoul-Henning Kamp.Pp
33227c74787SPoul-Henning Kamp(stay tuned while the author rests his brain and fingers: more to come.)
333ba3eb872SScott Long.Sh DIAGNOSTICS
334ba3eb872SScott LongSeveral flags are provided for tracing GEOM operations and unlocking
335ba3eb872SScott Longprotection mechanisms via the
336ba3eb872SScott Long.Va kern.geom.debugflags
337ba3eb872SScott Longsysctl.
338ba3eb872SScott LongAll of these flags are off by default, and great care should be taken in
339ba3eb872SScott Longturning them on.
340ba3eb872SScott Long.Bl -tag -width FAIL
341ba3eb872SScott Long.It 0x01 (G_T_TOPOLOGY)
342ba3eb872SScott LongProvide tracing of topology change events.
343ba3eb872SScott Long.It 0x02 (G_T_BIO)
344ba3eb872SScott LongProvide tracing of buffer I/O requests.
345ba3eb872SScott Long.It 0x04 (G_T_ACCESS)
346ba3eb872SScott LongProvide tracing of access check controls.
347ba3eb872SScott Long.It 0x08 (unused)
348ba3eb872SScott Long.It 0x10 (allow foot shooting)
349ba3eb872SScott LongAllow writing to Rank 1 providers.
350ba3eb872SScott LongThis would, for example, allow the super-user to overwrite the MBR on the root
351ba3eb872SScott Longdisk or write random sectors elsewhere to a mounted disk.  The implications
352ba3eb872SScott Longare obvious.
353ba3eb872SScott Long.It 0x20 (G_T_DETAILS)
354ba3eb872SScott LongThis appears to be unused at this time.
355ba3eb872SScott Long.It 0x40 (G_F_DISKIOCTL)
356ba3eb872SScott LongThis appears to be unused at this time.
357ba3eb872SScott Long.It 0x80 (G_F_CTLDUMP)
358ba3eb872SScott LongDump contents of gctl requests.
359ba3eb872SScott Long.El
36027c74787SPoul-Henning Kamp.Sh HISTORY
36127c74787SPoul-Henning KampThis software was developed for the FreeBSD Project by Poul-Henning Kamp
36227c74787SPoul-Henning Kampand NAI Labs, the Security Research Division of Network Associates, Inc.
36327c74787SPoul-Henning Kampunder DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
36427c74787SPoul-Henning KampDARPA CHATS research program.
36527c74787SPoul-Henning Kamp.Pp
36627c74787SPoul-Henning KampThe first precursor for GEOM was a gruesome hack to Minix 1.2 and was
3675203edcdSRuslan Ermilovnever distributed.
3685203edcdSRuslan ErmilovAn earlier attempt to implement a less general scheme
36956cf50adSPoul-Henning Kampin FreeBSD never succeeded.
37027c74787SPoul-Henning Kamp.Sh AUTHORS
37127c74787SPoul-Henning Kamp.An "Poul-Henning Kamp" Aq phk@FreeBSD.org
372