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.
156 .Bd -literal -offset indent
169 void (*private_free)(void*);
170 void *(*private_clone)(void*);
176 field can be one of the following values:
177 .Ql whole, unknown, fat, freebsd, extended, part, unused .
183 .Bl -tag -offset indent -width CHUNK_AUTO_SIZEXX
185 This chunk should be aligned.
189 is a rootfs, allocate partition
192 This is the active slice in the MBR.
194 Force a dedicated disk for
196 bypassing all BIOS geometry considerations.
198 This chunk was auto-sized and can fill out any deleted following chunks.
200 newfs pending, used to enable auto-resizing on delete (along with AUTO_SIZE).
208 fields are for data private to the application, and the management
210 If the functions are not provided, no storage management is
211 done, cloning will just copy the pointer and freeing will just forget
215 will open the named disk, and return populated tree.
218 frees a tree made with
224 prints the content of the tree to
228 sets the geometry the bios uses.
231 frees a chunk of disk_space.
236 are experimental, do not use.
239 creates a chunk with the specified parameters.
244 chunk covering the entire disk; if
246 is set, bypass all BIOS geometry considerations.
251 to warnings about broken design rules in this disklayout.
256 with all disk's names (wd0, wd1 ...).
257 You must free each pointer, as
258 well as the array by hand.
261 sets this boot-manager for use on this disk.
267 sets the boot-blocks for use on this disk.
273 writes all the MBRs, disklabels, bootblocks and boot managers.
278 is aligned on a cylinder according to the BIOS geometry.
283 up to next cylinder according to the BIOS geometry.
288 down to previous cylinder according to the BIOS geometry.
293 is aligned on a track according to the BIOS geometry.
295 .Fn Next_Track_Aligned
298 up to next track according to the BIOS geometry.
300 .Fn Prev_Track_Aligned
303 up to previous track according to the BIOS geometry.
305 .Fn Create_Chunk_DWIM
306 creates a partition inside the given parent of the given size, and
307 returns a pointer to it.
308 The first unused chunk big enough is used.
311 makes the device nodes for this chunk.
314 makes the device nodes for all chunks on this disk.
317 returns a string to show flags.
321 function takes the enumerated chunk type and returns its name.
323 replaces the old external array
327 returns the name strings associated with the specified
332 returns "unknown" for slices it is not familiar with.
337 library was written by
338 .An Poul-Henning Kamp .
340 This manual page was written by