7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29
30 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
31 /* All Rights Reserved */
32
33
34 #ifndef _SYS_VTOC_H
35 #define _SYS_VTOC_H
36
37 #include <sys/dklabel.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /*
44 * Note: the VTOC is not implemented fully, nor in the manner
45 * that AT&T implements it. AT&T puts the vtoc structure
46 * into a sector, usually the second sector (pdsector is first).
62 #define V_NUMPAR NDKMAP /* The number of partitions */
63 /* (from dkio.h) */
64
65 #define VTOC_SANE 0x600DDEEE /* Indicates a sane VTOC */
66 #define V_VERSION 0x01 /* layout version number */
67 #define V_EXTVERSION V_VERSION /* extvtoc layout version number */
68
69 /*
70 * Partition identification tags
71 */
72 #define V_UNASSIGNED 0x00 /* unassigned partition */
73 #define V_BOOT 0x01 /* Boot partition */
74 #define V_ROOT 0x02 /* Root filesystem */
75 #define V_SWAP 0x03 /* Swap filesystem */
76 #define V_USR 0x04 /* Usr filesystem */
77 #define V_BACKUP 0x05 /* full disk */
78 #define V_STAND 0x06 /* Stand partition */
79 #define V_VAR 0x07 /* Var partition */
80 #define V_HOME 0x08 /* Home partition */
81 #define V_ALTSCTR 0x09 /* Alternate sector partition */
82 #define V_CACHE 0x0a /* Cache (cachefs) partition */
83
84 /* Tags for EFI/GPT labels */
85 #define V_RESERVED 0x0b /* SMI reserved data */
86 #define V_SYSTEM 0x0c /* EFI/GPT system partition */
87 #define V_BIOS_BOOT 0x18 /* BIOS Boot partition */
88
89 #define V_UNKNOWN 0xff /* Unknown partition */
90
91 /*
92 * Partition permission flags
93 */
94 #define V_UNMNT 0x01 /* Unmountable partition */
95 #define V_RONLY 0x10 /* Read only */
96
97 /*
98 * error codes for reading & writing vtoc
99 */
100 #define VT_ERROR (-2) /* errno supplies specific error */
101 #define VT_EIO (-3) /* I/O error accessing vtoc */
102 #define VT_EINVAL (-4) /* illegal value in vtoc or request */
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 *
25 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
28 */
29
30
31 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
32 /* All Rights Reserved */
33
34
35 #ifndef _SYS_VTOC_H
36 #define _SYS_VTOC_H
37
38 #include <sys/dklabel.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*
45 * Note: the VTOC is not implemented fully, nor in the manner
46 * that AT&T implements it. AT&T puts the vtoc structure
47 * into a sector, usually the second sector (pdsector is first).
63 #define V_NUMPAR NDKMAP /* The number of partitions */
64 /* (from dkio.h) */
65
66 #define VTOC_SANE 0x600DDEEE /* Indicates a sane VTOC */
67 #define V_VERSION 0x01 /* layout version number */
68 #define V_EXTVERSION V_VERSION /* extvtoc layout version number */
69
70 /*
71 * Partition identification tags
72 */
73 #define V_UNASSIGNED 0x00 /* unassigned partition */
74 #define V_BOOT 0x01 /* Boot partition */
75 #define V_ROOT 0x02 /* Root filesystem */
76 #define V_SWAP 0x03 /* Swap filesystem */
77 #define V_USR 0x04 /* Usr filesystem */
78 #define V_BACKUP 0x05 /* full disk */
79 #define V_STAND 0x06 /* Stand partition */
80 #define V_VAR 0x07 /* Var partition */
81 #define V_HOME 0x08 /* Home partition */
82 #define V_ALTSCTR 0x09 /* Alternate sector partition */
83 #define V_CACHE 0x0a /* CacheFS partition (obsolete) */
84
85 /* Tags for EFI/GPT labels */
86 #define V_RESERVED 0x0b /* SMI reserved data */
87 #define V_SYSTEM 0x0c /* EFI/GPT system partition */
88 #define V_BIOS_BOOT 0x18 /* BIOS Boot partition */
89
90 #define V_UNKNOWN 0xff /* Unknown partition */
91
92 /*
93 * Partition permission flags
94 */
95 #define V_UNMNT 0x01 /* Unmountable partition */
96 #define V_RONLY 0x10 /* Read only */
97
98 /*
99 * error codes for reading & writing vtoc
100 */
101 #define VT_ERROR (-2) /* errno supplies specific error */
102 #define VT_EIO (-3) /* I/O error accessing vtoc */
103 #define VT_EINVAL (-4) /* illegal value in vtoc or request */
|