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_AUTO_SIZEXX
186 This chunk should be aligned.
190 is a rootfs, allocate partition
193 This is the active slice in the MBR.
195 Force a dedicated disk for
197 bypassing all BIOS geometry considerations.
199 This chunk was auto-sized and can fill out any deleted following chunks.
201 newfs pending, used to enable auto-resizing on delete (along with AUTO_SIZE).
209 fields are for data private to the application, and the management
211 If the functions are not provided, no storage management is
212 done, cloning will just copy the pointer and freeing will just forget
216 will open the named disk, and return populated tree.
219 frees a tree made with
225 prints the content of the tree to
229 sets the geometry the bios uses.
232 frees a chunk of disk_space.
237 are experimental, do not use.
240 creates a chunk with the specified parameters.
245 chunk covering the entire disk; if
247 is set, bypass all BIOS geometry considerations.
252 to warnings about broken design rules in this disklayout.
257 with all disk's names (wd0, wd1 ...).
258 You must free each pointer, as
259 well as the array by hand.
262 sets this boot-manager for use on this disk.
268 sets the boot-blocks for use on this disk.
274 writes all the MBRs, disklabels, bootblocks and boot managers.
279 is aligned on a cylinder according to the BIOS geometry.
284 up to next cylinder according to the BIOS geometry.
289 down to previous cylinder according to the BIOS geometry.
294 is aligned on a track according to the BIOS geometry.
296 .Fn Next_Track_Aligned
299 up to next track according to the BIOS geometry.
301 .Fn Prev_Track_Aligned
304 up to previous track according to the BIOS geometry.
306 .Fn Create_Chunk_DWIM
307 creates a partition inside the given parent of the given size, and
308 returns a pointer to it.
309 The first unused chunk big enough is used.
312 makes the device nodes for this chunk.
315 makes the device nodes for all chunks on this disk.
318 returns a string to show flags.
322 function takes the enumerated chunk type and returns its name.
324 replaces the old external array
328 returns the name strings associated with the specified
333 returns "unknown" for slices it is not familiar with.
338 library was written by
339 .An Poul-Henning Kamp .
341 This manual page was written by