샤브의 블로그 RSS 태그 관리 글쓰기 방명록
전체 글 (234)
2010-09-04 23:56:08

Name

    mnttab– mounted file system table

Description

    The file /etc/mnttab is really a file system that provides read-only access to the table of mounted file systems for the current host. /etc/mnttab is read by programs using the routines described in getmntent(3C). Mounting a file system adds an entry to this table. Unmounting removes an entry from this table. Remounting a file system causes the information in the mounted file system table to be updated to reflect any changes caused by the remount. The list is maintained by the kernel in order of mount time. That is, the first mounted file system is first in the list and the most recently mounted file system is last. When mounted on a mount point the file system appears as a regular file containing the current mnttab information.

    Each entry is a line of fields separated by TABs in the form:

    special   mount_point   fstype   options   time
    

    where:

    special

    The name of the resource that has been mounted.

    mount_point

    The pathname of the directory on which the filesystem is mounted.

    fstype

    The file system type of the mounted file system.

    options

    The mount options. See respective mount file system man page in the See Also section below.

    time

    The time at which the file system was mounted.

    Examples of entries for the special field include the pathname of a block-special device, the name of a remote file system in the form of host:pathname, or the name of a swap file, for example, a file made with mkfile(1M).

ioctls

    The following ioctl(2) calls are supported:

    MNTIOC_NMNTS

    Returns the count of mounted resources in the current snapshot in the uint32_t pointed to by arg.

    MNTIOC_GETDEVLIST

    Returns an array of uint32_t's that is twice as long as the length returned by MNTIOC_NMNTS. Each pair of numbers is the major and minor device number for the file system at the corresponding line in the current /etc/mnttab snapshot. arg points to the memory buffer to receive the device number information.

    MNTIOC_SETTAG

    Sets a tag word into the options list for a mounted file system. A tag is a notation that will appear in the options string of a mounted file system but it is not recognized or interpreted by the file system code. arg points to a filled in mnttagdesc structure, as shown in the following example:

    uint_t  mtd_major;  /* major number for mounted fs */
    uint_t  mtd_minor;  /* minor number for mounted fs */
    char    *mtd_mntpt; /* mount point of file system */
    char    *mtd_tag;   /* tag to set/clear */

    If the tag already exists then it is marked as set but not re-added. Tags can be at most MAX_MNTOPT_TAG long.

    Use of this ioctl is restricted to processes with the {PRIV_SYS_MOUNT} privilege.

    MNTIOC_CLRTAG

    Marks a tag in the options list for a mounted file system as not set. arg points to the same structure as MNTIOC_SETTAG, which identifies the file system and tag to be cleared.

    Use of this ioctl is restricted to processes with the {PRIV_SYS_MOUNT} privilege.

Errors

    EFAULT

    The arg pointer in an MNTIOC_ ioctl call pointed to an inaccessible memory location or a character pointer in a mnttagdesc structure pointed to an inaccessible memory location.

    EINVAL

    The tag specified in a MNTIOC_SETTAG call already exists as a file system option, or the tag specified in a MNTIOC_CLRTAG call does not exist.

    ENAMETOOLONG

    The tag specified in a MNTIOC_SETTAG call is too long or the tag would make the total length of the option string for the mounted file system too long.

    EPERM

    The calling process does not have {PRIV_SYS_MOUNT} privilege and either a MNTIOC_SETTAG or MNTIOC_CLRTAG call was made.

Files

    /etc/mnttab

    Usual mount point for mnttab file system

    /usr/include/sys/mntio.h

    Header file that contains IOCTL definitions

See Also

Warnings

    The mnttab file system provides the previously undocumented dev=xxx option in the option string for each mounted file system. This is provided for legacy applications that might have been using the dev=information option.

    Using dev=option in applications is strongly discouraged. The device number string represents a 32-bit quantity and might not contain correct information in 64-bit environments.

    Applications requiring device number information for mounted file systems should use the getextmntent(3C) interface, which functions properly in either 32- or 64-bit environments.

Notes

    The snapshot of the mnttab information is taken any time a read(2) is performed at offset 0 (the beginning) of the mnttab file. The file modification time returned by stat(2) for the mnttab file is the time of the last change to mounted file system information. A poll(2) system call requesting a POLLRDBAND event can be used to block and wait for the system's mounted file system information to be different from the most recent snapshot since the mnttab file was opened.


2010-09-04 23:54:32

Name

    vfstab– table of file system defaults

Description

    The file /etc/vfstab describes defaults for each file system. The information is stored in a table with the following column headings:


    device       device       mount      FS      fsck    mount      mount
    to mount     to fsck      point      type    pass    at boot    options

    The fields in the table are space-separated and show the resource name (device to mount), the raw device to fsck (device to fsck), the default mount directory (mount point), the name of the file system type (FS type), the number used by fsck to decide whether to check the file system automatically (fsck pass), whether the file system should be mounted automatically by mountall (mount at boot), and the file system mount options (mount options). (See respective mount file system man page below in SEE ALSO for mount options.) A '-' is used to indicate no entry in a field. This may be used when a field does not apply to the resource being mounted.

    The getvfsent(3C) family of routines is used to read and write to /etc/vfstab.

    /etc/vfstab can be used to specify swap areas. An entry so specified, (which can be a file or a device), will automatically be added as a swap area by the /sbin/swapadd script when the system boots. To specify a swap area, the device-to-mount field contains the name of the swap file or device, the FS-type is "swap", mount-at-boot is "no" and all other fields have no entry.

Examples

    The following are vfstab entries for various file system types supported in the Solaris operating environment.


    Example 1 NFS and UFS Mounts

    The following entry invokes NFS to automatically mount the directory /usr/local of the server example1 on the client's /usr/local directory with read-only permission:


    example1:/usr/local - /usr/local nfs - yes ro

    The following example assumes a small departmental mail setup, in which clients mount /var/mail from a server mailsvr. The following entry would be listed in each client's vfstab:


    mailsvr:/var/mail - /var/mail nfs - yes intr,bg

    The following is an example for a UFS file system in which logging is enabled:


    /dev/dsk/c2t10d0s0 /dev/rdsk/c2t10d0s0 /export/local ufs 3 yes logging

    See mount_nfs(1M) for a description of NFS mount options and mount_ufs(1M) for a description of UFS options.



    Example 2 pcfs Mounts

    The following example mounts a pcfs file system on a fixed hard disk on an x86 machine:


    /dev/dsk/c1t2d0p0:c - /win98 pcfs - yes -

    The example below mounts a Jaz drive on a SPARC machine. Normally, the volume management software handles mounting of removable media, obviating a vfstab entry. Specifying a device that supports removable media in vfstab with set the mount-at-boot field to no (as shown below) disables the automatic handling of that device. Such an entry presumes you are not running volume management software.


    /dev/dsk/c1t2d0s2:c - /jaz pcfs - no -

    For removable media on a SPARC machine, the convention for the slice portion of the disk identifier is to specify s2, which stands for the entire medium.

    For pcfs file systems on x86 machines, note that the disk identifier uses a p (p0) and a logical drive (c, in the /win98 example above) for a pcfs logical drive. See mount_pcfs(1M) for syntax for pcfs logical drives and for pcfs-specific mount options.



    Example 3 CacheFS Mount

    Below is an example for a CacheFS file system. Because of the length of this entry and the fact that vfstab entries cannot be continued to a second line, the vfstab fields are presented here in a vertical format. In re-creating such an entry in your own vfstab, you would enter values as you would for any vfstab entry, on a single line.


    device to mount:  svr1:/export/abc 
    device to fsck:  /usr/abc 
    mount point:  /opt/cache 
    FS type:  cachefs 
    fsck pass:  7 
    mount at boot:  yes 
    mount options: 
    local-access,bg,nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache

    See mount_cachefs(1M) for CacheFS-specific mount options.



    Example 4 Loopback File System Mount

    The following is an example of mounting a loopback (lofs) file system:


    /export/test - /opt/test lofs - yes -

    See lofs(7FS) for an overview of the loopback file system.


See Also

2010-09-03 02:28:36

Name

    prtvtoc– report information about a disk geometry and partitioning

Synopsis

    prtvtoc [-fhs] [-t vfstab] [-m mnttab] device
    

Description

    The prtvtoc command allows the contents of the label to be viewed. The command can be used only by the super-user.

    The device name can be the file name of a raw device in the form of /dev/rdsk/c?t?d?s2 or can be the file name of a block device in the form of /dev/dsk/c?t?d?s2.

Options

    The following options are supported:

    -f

    Report on the disk free space, including the starting block address of the free space, number of blocks, and unused partitions.

    -h

    Omit the headers from the normal output.

    -m mnttab

    Use mnttab as the list of mounted filesystems, in place of /etc/mnttab.

    -s

    Omit all headers but the column header from the normal output.

    -t vfstab

    Use vfstab as the list of filesystem defaults, in place of /etc/vfstab.

Examples


    Example 1 Using the prtvtoc Command

    The following example uses the prtvtoc command on a 424-megabyte hard disk:


    example# prtvtoc /dev/rdsk/c0t3d0s2
    * /dev/rdsk/c0t3d0s2 partition map
    *
    * Dimension:
    *     512 bytes/sector
    *      80 sectors/track
    *       9 tracks/cylinder
    *     720 sectors/cylinder
    *    2500 cylinders
    *    1151 accessible cylinders
    *
    * Flags:
    *   1: unmountable
    *  10: read-only
    * *                           First    Sector   Last
    * Partition   Tag   Flags   Sector   Count    Sector   Mount Directory
         0         2     00          0    76320    76319   /
         1         3     01      76320   132480   208799
         2         5     00          0   828720   828719
         5         6     00     208800   131760   340559   /opt
         6         4     00     340560   447120   787679   /usr
         7         8     00     787680    41040   828719   /export/home
    example#

    The data in the Tag column above indicates the type of partition, as follows:

    Name

    Number

    UNASSIGNED 

    0x00 

    BOOT 

    0x01 

    ROOT 

    0x02 

    SWAP 

    0x03 

    USR 

    0x04 

    BACKUP 

    0x05 

    STAND 

    0x06 

    VAR 

    0x07 

    HOME 

    0x08 

    ALTSCTR 

    0x09 

    CACHE 

    0x0a 

    RESERVED 

    0x0b 

    The data in the Flags column above indicates how the partition is to be mounted, as follows:

    Name

    Number

    MOUNTABLE, READ AND WRITE 

    0x00 

    NOT MOUNTABLE 

    0x01 

    MOUNTABLE, READ ONLY 

    0x10 



    Example 2 Using the prtvtoc Command with the -f Option

    The following example uses the prtvtoc command with the -f option on a 424-megabyte hard disk:


    example# prtvtoc -f /dev/rdsk/c0t3d0s2
    FREE_START=0 FREE_SIZE=0 FREE_COUNT=0 FREE_PART=34


    Example 3 Using the prtvtoc Command on a Disk Over One Terabyte

    The following example uses uses the prtvtoc command on a disk over one terabyte:.


    example# prtvtoc /dev/rdsk/c1t1d0s2
    * /dev/rdsk/c1t1d0s2 partition map
    *
    * Dimensions:
    *     512 bytes/sector
    * 3187630080 sectors
    * 3187630013 accessible sectors
    *
    * Flags:
    *   1: unmountable
    *  10: read-only
    *
    *                          First     Sector    Last
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
    0      2    00         34    262144    262177
    1      3    01     262178    262144    524321
    6      4    00     524322 3187089340 3187613661
    8     11    00  3187613662     16384 318763004

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Availability 

    SUNWcsu 

See Also

Warnings

    The mount command does not check the "not mountable" bit.


2010-09-03 02:26:57

Name

    fmthard– populate label on hard disks

Synopsis

    SPARC

      fmthard -d data | -n volume_name | -s datafile [-i] /dev/rdsk/c? 
           [t?] d?s2

    x86

      fmthard -d data | -n volume_name | -s datafile [-i] /dev/rdsk/c? 
           [t?] d?s2

Description

    The fmthard command updates the VTOC (Volume Table of Contents) on hard disks and, on x86 systems, adds boot information to the Solaris fdisk partition. One or more of the options -s datafile, -d data, or -n volume_name must be used to request modifications to the disk label. To print disk label contents, see prtvtoc(1M). The /dev/rdsk/c?[t?]d?s2 file must be the character special file of the device where the new label is to be installed. On x86 systems, fdisk(1M) must be run on the drive before fmthard.

    If you are using an x86 system, note that the term ``partition'' in this page refers to slices within the x86 fdisk partition on x86 machines. Do not confuse the partitions created by fmthard with the partitions created by fdisk.

Options

    The following options are supported:

    -d data

    The data argument of this option is a string representing the information for a particular partition in the current VTOC. The string must be of the format part:tag:flag:start:size where part is the partition number, tag is the ID TAG of the partition, flag is the set of permission flags, start is the starting sector number of the partition, and size is the number of sectors in the partition. See the description of the datafile below for more information on these fields.

    -i

    This option allows the command to create the desired VTOC table, but prints the information to standard output instead of modifying the VTOC on the disk.

    -n volume_name

    This option is used to give the disk a volume_name up to 8 characters long.

    -s datafile

    This option is used to populate the VTOC according to a datafile created by the user. If the datafile is - (a hyphen), fmthard reads from standard input. The datafile format is described below. This option causes all of the disk partition timestamp fields to be set to zero.

    Every VTOC generated by fmthard will also have partition 2, by convention, that corresponds to the whole disk. If the input in datafile does not specify an entry for partition 2, a default partition 2 entry will be created automatically in VTOC with the tag V_BACKUP and size equal to the full size of the disk.

    The datafile contains one specification line for each partition, starting with partition 0. Each line is delimited by a new-line character (\n). If the first character of a line is an asterisk (*), the line is treated as a comment. Each line is composed of entries that are position-dependent, separated by white space and having the following format:

    partition tag flag starting_sector size_in_sectors

    where the entries have the following values:

    partition

    The partition number. Currently, for Solaris SPARC, a disk can have up to 8 partitions, 0-7. Even though the partition field has 4 bits, only 3 bits are currently used. For x86, all 4 bits are used to allow slices 0-15. Each Solaris fdisk partition can have up to 16 slices.

    tag

    The partition tag: a decimal number. The following are reserved codes: 0 (V_UNASSIGNED), 1 (V_BOOT), 2 (V_ROOT), 3 (V_SWAP), 4 (V_USR), 5 (V_BACKUP), 6 (V_STAND), 7 (V_VAR), and 8 (V_HOME).

    flag

    The flag allows a partition to be flagged as unmountable or read only, the masks being: V_UNMNT 0x01, and V_RONLY 0x10. For mountable partitions use 0x00.

    starting_sector

    The sector number (decimal) on which the partition starts.

    size_in_sectors

    The number (decimal) of sectors occupied by the partition.

    You can save the output of a prtvtoc command to a file, edit the file, and use it as the datafile argument to the -s option.

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Availability 

    SUNWcsu 

See Also

Notes

    Special care should be exercised when overwriting an existing VTOC, as incorrect entries could result in current data being inaccessible. As a precaution, save the old VTOC.

    For disks under two terabytes, fmthard cannot write a VTOC on an unlabeled disk. Use format(1M) for this purpose.

2010-09-03 02:25:10

Name

    metareplace– enable or replace components of submirrors or RAID5 metadevices

Synopsis

    /usr/sbin/metareplace -h
    
    /usr/sbin/metareplace [-s setname] -e mirror component
    
    /usr/sbin/metareplace [-s setname] mirror component-old component-new
    
    /usr/sbin/metareplace [-s setname] -e RAID component
    
    /usr/sbin/metareplace [-s setname] [-f] RAID component-old component-new
    

Description

    The metareplace command is used to enable or replace components (slices) within a submirror or a RAID5 metadevice.

    When you replace a component, the metareplace command automatically starts resyncing the new component with the rest of the metadevice. When the resync completes, the replaced component becomes readable and writable. If the failed component has been hot spare replaced, the hot spare is placed in the available state and made available for other hot spare replacements.

    Note that the new component must be large enough to replace the old component.

    A component may be in one of several states. The Last Erred and the Maintenance states require action. Always replace components in the Maintenance state first, followed by a resync and validation of data. After components requiring maintenance are fixed, validated, and resynced, components in the Last Erred state should be replaced. To avoid data loss, it is always best to back up all data before replacing Last Erred devices.

Options

    Root privileges are required for all of the following options except -h.

    -e

    Transitions the state of component to the available state and resyncs the failed component. If the failed component has been hot spare replaced, the hot spare is placed in the available state and made available for other hot spare replacements. This command is useful when a component fails due to human error (for example, accidentally turning off a disk), or because the component was physically replaced. In this case, the replacement component must be partitioned to match the disk being replaced before running the metareplace command.

    -f

    Forces the replacement of an errored component of a metadevice in which multiple components are in error. The component determined by the metastat display to be in the ``Maintenance'' state must be replaced first. This option may cause data to be fabricated since multiple components are in error.

    -h

    Display help message.

    -s setname

    Specifies the name of the diskset on which metareplace will work. Using the -s option will cause the command to perform its administrative function within the specified diskset. Without this option, the command will perform its function on local metadevices.

    mirror

    The metadevice name of the mirror.

    component

    The logical name for the physical slice (partition) on a disk drive, such as /dev/dsk/c0t0d0s2.

    component-old

    The physical slice that is being replaced.

    component-new

    The physical slice that is replacing component-old.

    RAID

    The metadevice name of the RAID5 device.

Examples


    Example 1 Recovering from Error Condition in RAID5 Metadevice

    This example shows how to recover when a single component in a RAID5 metadevice is errored.


    # metareplace d10 c3t0d0s2 c5t0d0s2

    In this example, a RAID5 metadevice d10 has an errored component, c3t0d0s2, replaced by a new component, c5t0d0s2.



    Example 2 Use of -e After Physical Disk Replacement

    This example shows the use of the -e option after a physical disk in a submirror (a submirror of mirror mymirror1, in this case) has been replaced.


    # metareplace -e mymirror1 c1t4d0s2

    Note: The replacement disk must be partitioned to match the disk it is replacing before running the metareplace command.


Exit Status

    The following exit values are returned:

    0

    Successful completion.

    >0

    An error occurred.

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Availability 

    SUNWmdu 

    Interface Stability 

    Stable 

See Also