*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> createlabel (3)              
Title
Content
Arch
Section
 

createlabel(3)

Contents


NAME    [Toc]    [Back]

       createlabel  -  creates  a disk label structure for a disk
       device

SYNOPSIS    [Toc]    [Back]

       #include <sys/types.h> #include <sys/disklabel.h>

       int createlabel(
               char *devname,
               char *name,
               struct disklabel *disk,
               char *boot,
               int boot_len );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc.a)

PARAMETERS    [Toc]    [Back]

       Specifies the device special  file  name  of  the  device.
       Specifies  the name entry in the /etc/disktab file that is
       to be used for the label information.  Otherwise,  specify
       NULL  to indicate either that the name entry is not in the
       /etc/disktab file or that it should be ignored even if  it
       is  in  the  /etc/disktab  file.  Points to the disk label
       structure  that  is  filled  in  with  the  returned  disk
       description  on  successful  completion  of  the function.
       Points to the buffer that the function may use to  contain
       the  (optional)  primary and secondary bootstrap names for
       the disk label.  Specifies the length of the boot  buffer.
       The value must be set to the value of the BUFSIZ constant.

DESCRIPTION    [Toc]    [Back]

       The createlabel() function fills in the disk label  structure
  pointed to by the disk parameter. The resulting disk
       label can then be written to the disk in  order  to  label
       it.

       The function queries the device, using the devname parameter,
 to obtain the  disk's  geometry,  capacity,  and  any
       default partition information.

       The  function  checks  the name parameter. If name is nonnull,
 the function looks for an entry in the  /etc/disktab
       file that matches the name string and initializes the disk
       label structure from that entry. The function  then  overrides
  the  device  data  and  initializes  the disk label
       structure from the entry in the /etc/disktab file.

       If the name string is NULL or has no matching entry in the
       /etc/disktab  file, the function queries the device (using
       the devname parameter) to obtain the device's name string.
       The  function  then looks for an entry in the /etc/disktab
       file that matches that name string,  and  if  it  finds  a
       match,  it  initializes the disk label structure from that
       entry.

       If an /etc/disktab entry indicates that the device  has  a
       dynamic  geometry,  the function queries the device (using
       the devname parameter) to obtain the disk's true  geometry
       and  capacity  and  to  override  any  value  given  in an
       /etc/disktab entry associated with  the  device.  In  this
       case,   any   -1  lengths  encountered  in  the  partition
       specifications for the entry are replaced by a value equal
       to  the  device's total capacity minus the starting offset
       of the partition.

RETURN VALUES    [Toc]    [Back]

       Upon successful completion of the createlabel()  function,
       a  value  of  0  is  returned and the contents of the disk
       label structure are updated.

       Upon error, a value of -1 is returned and errno is set  to
       [EINVAL].

ERRORS    [Toc]    [Back]

       Either  disk  or boot is NULL, or boot_len is not equal to
       BUFSIZ.

FILES    [Toc]    [Back]

       Table of disk partition sizes for supported disks.

SEE ALSO    [Toc]    [Back]

      
      
       Commands: disklabel(8)

       Functions: getdiskbyname(3).

       Files: disklabel(4), disktab(4)



                                                   createlabel(3)
[ Back ]
 Similar pages
Name OS Title
disklabel Tru64 Reads and writes a disk pack label and formats disk partitions
set_usage Tru64 checks whether a disk partition is in use and sets the fstype of the partition in the disk label
disklabel Tru64 Disk pack label
disklabel OpenBSD disk pack label
bounds_check_with_label OpenBSD disk label management routines
writedisklabel OpenBSD disk label management routines
writedisklabel NetBSD disk label management routines
disklabel OpenBSD disk label management routines
setdisklabel NetBSD disk label management routines
bounds_check_with_label NetBSD disk label management routines
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service