2 .\" Copyright (c) 1996 Joerg Wunsch
4 .\" All rights reserved.
6 .\" This program is free software.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
17 .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
18 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 .Nm Next_Cyl_Aligned ,
50 .Nm Prev_Cyl_Aligned ,
52 .Nm Next_Track_Aligned ,
53 .Nm Prev_Track_Aligned ,
54 .Nm Create_Chunk_DWIM ,
60 .Nd library interface to slice and partition labels
68 .Fn Open_Disk "const char *devname"
70 .Fn Free_Disk "struct disk *disk"
72 .Fn Debug_Disk "struct disk *disk"
74 .Fn Set_Bios_Geom "struct disk *disk" "u_long cyl" "u_long heads" "u_long sects"
76 .Fn Delete_Chunk "struct disk *disk" "struct chunk *"
78 .Fn Collapse_Disk "struct disk *disk"
80 .Fn Collapse_Chunk "struct disk *disk" "struct chunk *chunk"
82 .Fn Create_Chunk "struct disk *disk" "daddr_t offset" "daddr_t size" "chunk_e type" "int subtype" "u_long flags" "const char *sname"
84 .Fn All_FreeBSD "struct disk *d" "int force_all"
86 .Fn CheckRules "const struct disk *"
90 .Fn Set_Boot_Mgr "struct disk *d" "const u_char *bootmgr" "const size_t bootmgr_size"
92 .Fn Set_Boot_Blocks "struct disk *d" "const u_char *boot1" "const u_char *boot2"
94 .Fn Write_Disk "const struct disk *d"
96 .Fn Cyl_Aligned "struct disk *d" "daddr_t offset"
98 .Fn Next_Cyl_Aligned "const struct disk *d" "daddr_t offset"
100 .Fn Prev_Cyl_Aligned "const struct disk *d" "daddr_t offset"
102 .Fn Track_Aligned "const struct disk *d" "daddr_t offset"
104 .Fn Next_Track_Aligned "const struct disk *d" "daddr_t offset"
106 .Fn Prev_Track_Aligned "const struct disk *d" "daddr_t offset"
108 .Fn Create_Chunk_DWIM "struct disk *d" "struct chunk *parent" "daddr_t size" "chunk_e type" "int subtype" "u_long flags"
110 .Fn MakeDev "struct chunk *c" "const char *path"
112 .Fn MakeDevDisk "struct disk *d" "const char *path"
114 .Fn ShowChunkFlags "struct chunk *c"
116 .Fn chunk_name "chunk_e type"
118 .Fn slice_type_name "int type" "int subtype"
122 is just for the use of
124 You should consider using
131 library provides an interface to the low-level disk slice and partition labels.
132 Most functions operate with arguments of the types
137 While both types are mostly opaque to the programmer, the internal
138 structure is mentioned below for the sake of completeness.
139 .Bd -literal -offset indent
149 struct chunk *chunks;
153 The only flag value by now is
155 meaning that this disk is handled by the On-Track Disk Manager.
157 .Bd -literal -offset indent
170 void (*private_free)(void*);
171 void *(*private_clone)(void*);
177 field can be one of the following values:
178 .Ql whole, unknown, fat, freebsd, extended, part, unused .
184 .Bl -tag -offset indent -width CHUNK_BSD_COMPATXX
186 This chunk cannot be booted from because it extends past cylinder 1024.
189 .Bx Ns -compatibility ,
190 and has a short name too, i.e.\&
193 This chunk should be aligned.
197 is a rootfs, allocate partition
200 This is the active slice in the MBR.
202 Force a dedicated disk for
204 bypassing all BIOS geometry considerations.
212 fields are for data private to the application, and the management
214 If the functions are not provided, no storage management is
215 done, cloning will just copy the pointer and freeing will just forget
219 will open the named disk, and return populated tree.
222 frees a tree made with
228 prints the content of the tree to
232 sets the geometry the bios uses.
235 frees a chunk of disk_space.
240 are experimental, do not use.
243 creates a chunk with the specified parameters.
248 chunk covering the entire disk; if
250 is set, bypass all BIOS geometry considerations.
255 to warnings about broken design rules in this disklayout.
260 with all disk's names (wd0, wd1 ...).
261 You must free each pointer, as
262 well as the array by hand.
265 sets this boot-manager for use on this disk.
271 sets the boot-blocks for use on this disk.
277 writes all the MBRs, disklabels, bootblocks and boot managers.
282 is aligned on a cylinder according to the BIOS geometry.
287 up to next cylinder according to the BIOS geometry.
292 down to previous cylinder according to the BIOS geometry.
297 is aligned on a track according to the BIOS geometry.
299 .Fn Next_Track_Aligned
302 up to next track according to the BIOS geometry.
304 .Fn Prev_Track_Aligned
307 up to previous track according to the BIOS geometry.
309 .Fn Create_Chunk_DWIM
310 creates a partition inside the given parent of the given size, and
311 returns a pointer to it.
312 The first unused chunk big enough is used.
315 makes the device nodes for this chunk.
318 makes the device nodes for all chunks on this disk.
321 returns a string to show flags.
325 function takes the enumerated chunk type and returns its name.
327 replaces the old external array
331 returns the name strings associated with the specified
336 returns "unknown" for slices it is not familiar with.
341 library was written by
342 .An Poul-Henning Kamp .
344 This manual page was written by