2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH READ_VTOC 3EXT "Oct 7, 2008"
8 read_vtoc, write_vtoc \- read and write a disk's VTOC
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ladm\fR [ \fIlibrary\fR ... ]
15 \fBint\fR \fBread_vtoc\fR(\fBint\fR \fIfd\fR, \fBstruct vtoc *\fR\fIvtoc\fR);
20 \fBint\fR \fBwrite_vtoc\fR(\fBint\fR \fIfd\fR, \fBstruct vtoc *\fR\fIvtoc\fR);
25 \fBint\fR \fBread_extvtoc\fR(\fBint\fR \fIfd\fR, \fBstruct extvtoc *\fR\fIextvtoc\fR);
30 \fBint\fR \fBwrite_extvtoc\fR(\fBint\fR \fIfd\fR, \fBstruct extvtoc *\fR\fIextvtoc\fR);
36 The \fBread_vtoc()\fR and \fBread_extvtoc()\fR functions return the VTOC
37 (volume table of contents) structure that is stored on the disk associated
38 with the open file descriptor \fIfd\fR. On disks larger than 1 TB
39 \fBread_extvtoc()\fR must be used.
42 The \fBwrite_vtoc()\fR and \fBwrite_extvtoc()\fR function stores the VTOC
43 structure on the disk associated with the open file descriptor \fIfd\fR. On
44 disks larger then 1TB \fBwrite_extvtoc()\fR function must be used.
47 The \fIfd\fR argument refers to any slice on a raw disk.
51 Upon successful completion, \fBread_vtoc()\fR and \fBread_extvtoc()\fR return a
52 positive integer indicating the slice index associated with the open file
53 descriptor. Otherwise, they return a negative integer indicating one of the
61 An I/O error occurred.
67 \fB\fBVT_ENOTSUP\fR\fR
70 This operation is not supported on this disk.
79 An unknown error occurred.
85 \fB\fBVT_OVERFLOW\fR\fR
88 The caller attempted an operation that is illegal on the disk and may overflow
89 the fields in the data structure.
94 Upon successful completion, \fBwrite_vtoc()\fR and \fBwrite_extvtoc()\fR return
95 0. Otherwise, they return a negative integer indicating one of the following
100 \fB\fBVT_EINVAL\fR\fR
103 The VTOC contains an incorrect field.
112 An I/O error occurred.
118 \fB\fBVT_ENOTSUP\fR\fR
121 This operation is not supported on this disk.
130 An unknown error occurred.
136 \fB\fBVT_OVERFLOW\fR\fR
139 The caller attempted an operation that is illegal on the disk and may overflow
140 the fields in the data structure.
146 See \fBattributes\fR(5) for descriptions of the following attributes:
154 ATTRIBUTE TYPE ATTRIBUTE VALUE
162 \fBfmthard\fR(1M), \fBformat\fR(1M), \fBprtvtoc\fR(1M), \fBioctl\fR(2),
163 \fBefi_alloc_and_init\fR(3EXT), \fBattributes\fR(5), \fBdkio\fR(7I)
167 The \fBwrite_vtoc()\fR function cannot write a \fBVTOC\fR on an unlabeled
168 disk. Use \fBformat\fR(1M) for this purpose.