write_vtoc man page on SmartOS

Printed from http://www.polarhome.com/service/man/?qf=write_vtoc&af=0&tf=2&of=SmartOS

READ_VTOC(3EXT)						       READ_VTOC(3EXT)

NAME
       read_vtoc, write_vtoc - read and write a disk's VTOC

SYNOPSIS
       cc [ flag ... ] file ... -ladm [ library ... ]
       #include <sys/vtoc.h>

       int read_vtoc(int fd, struct vtoc *vtoc);

       int write_vtoc(int fd, struct vtoc *vtoc);

       int read_extvtoc(int fd, struct extvtoc *extvtoc);

       int write_extvtoc(int fd, struct extvtoc *extvtoc);

DESCRIPTION
       The  read_vtoc()	 and  read_extvtoc() functions return the VTOC (volume
       table  of contents)  structure  that is stored on  the disk  associated
       with  the open file descriptor fd. On disks larger than 1 TB read_extv‐
       toc() must be used.

       The write_vtoc() and write_extvtoc() function stores the VTOC structure
       on  the	disk  associated  with	the  open file descriptor fd. On disks
       larger then 1TB write_extvtoc() function must be used.

       The fd argument refers to any slice on a raw disk.

RETURN VALUES
       Upon successful completion, read_vtoc()	and  read_extvtoc()  return  a
       positive	 integer  indicating  the slice index associated with the open
       file descriptor. Otherwise, they return a negative  integer  indicating
       one of the following errors:

       VT_EIO
		      An I/O error occurred.

       VT_ENOTSUP
		      This operation is not supported on this disk.

       VT_ERROR
		      An unknown error occurred.

       VT_OVERFLOW
		      The caller attempted an operation that is illegal on the
		      disk and may overflow the fields in the data structure.

       Upon successful completion, write_vtoc() and write_extvtoc() return  0.
       Otherwise, they return a negative integer indicating one of the follow‐
       ing errors:

       VT_EINVAL
		      The VTOC contains an incorrect field.

       VT_EIO
		      An I/O error occurred.

       VT_ENOTSUP
		      This operation is not supported on this disk.

       VT_ERROR
		      An unknown error occurred.

       VT_OVERFLOW
		      The caller attempted an operation that is illegal on the
		      disk and may overflow the fields in the data structure.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌───────────────┬─────────────────┐
       │ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
       ├───────────────┼─────────────────┤
       │MT-Level       │ Unsafe		 │
       └───────────────┴─────────────────┘

SEE ALSO
       fmthard(1M),	    format(1M),		prtvtoc(1M),	     ioctl(2),
       efi_alloc_and_init(3EXT), attributes(5), dkio(7I)

BUGS
       The write_vtoc() function cannot write a	 VTOC on  an  unlabeled	 disk.
       Use format(1M) for this purpose.

				  Oct 7, 2008		       READ_VTOC(3EXT)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net