샤브의 블로그 RSS 태그 관리 글쓰기 방명록
solaris10 (19)
2010-09-05 00:13:12

Name

    mount, umount– mount or unmount file systems and remote resources

Synopsis

    mount [-p | -v]
    mount [-F FSType] [generic_options] [-o specific_options] 
         [-O] special | mount_point
    
    mount [-F FSType] [generic_options] [-o specific_options] 
         [-O] special mount_point
    
    mount -a [-F FSType] [-V] [current_options] 
         [-o specific_options] [mount_point]...
    umount [-f] [-V] [-o specific_options] special | mount_point
    
    umount -a [-f] [-V] [-o specific_options] [mount_point]...

Description

    mount attaches a file system to the file system hierarchy at the mount_point, which is the pathname of a directory. If mount_point has any contents prior to the mount operation, these are hidden until the file system is unmounted.

    umount unmounts a currently mounted file system, which may be specified either as a mount_point or as special, the device on which the file system resides.

    The table of currently mounted file systems can be found by examining the mounted file system information file. This is provided by a file system that is usually mounted on /etc/mnttab. The mounted file system information is described in mnttab(4). Mounting a file system adds an entry to the mount table; a umount removes an entry from the table.

    When invoked with both the special and mount_point arguments and the -F option, mount validates all arguments except for special and invokes the appropriate FSType-specific mount module. If invoked with no arguments, mount lists all the mounted file systems recorded in the mount table, /etc/mnttab. If invoked with a partial argument list (with only one of special or mount_point, or with both special or mount_point specified but not FSType), mount will search /etc/vfstab for an entry that will supply the missing arguments. If no entry is found, and the special argument starts with "/", the default local file system type specified in /etc/default/fs will be used. Otherwise the default remote file system type will be used. The default remote file system type is determined by the first entry in the /etc/dfs/fstypes file. After filling in missing arguments, mount will invoke the FSType-specific mount module.

    Only a super-user can mount or unmount file systems using mount and umount. However, any user can use mount to list mounted file systems and resources.

Options

    -F FSType

    Used to specify the FSType on which to operate. The FSType must be specified or must be determinable from /etc/vfstab, or by consulting /etc/default/fs or /etc/dfs/fstypes.

    -a [ mount_points. . . ]

    Perform mount or umount operations in parallel, when possible.

    If mount points are not specified, mount will mount all file systems whose /etc/vfstab "mount at boot" field is "yes". If mount points are specified, then /etc/vfstab "mount at boot" field will be ignored.

    If mount points are specified, umount will only umount those mount points. If none is specified, then umount will attempt to unmount all file systems in /etc/mnttab, with the exception of certain system required file systems: /, /usr, /var, /var/adm, /var/run, /proc, /dev/fd and /tmp.

    -f

    Forcibly unmount a file system.

    Without this option, umount does not allow a file system to be unmounted if a file on the file system is busy. Using this option can cause data loss for open files; programs which access files after the file system has been unmounted will get an error (EIO).

    -p

    Print the list of mounted file systems in the /etc/vfstab format. Must be the only option specified. See BUGS.

    -v

    Print the list of mounted file systems in verbose format. Must be the only option specified.

    -V

    Echo the complete command line, but do not execute the command. umount generates a command line by using the options and arguments provided by the user and adding to them information derived from /etc/mnttab. This option should be used to verify and validate the command line.

    generic_options

    Options that are commonly supported by most FSType-specific command modules. The following options are available:

    -m

    Mount the file system without making an entry in /etc/mnttab.

    -g

    Globally mount the file system. On a clustered system, this globally mounts the file system on all nodes of the cluster. On a non-clustered system this has no effect.

    -o

    Specify FSType-specific options in a comma separated (without spaces) list of suboptions and keyword-attribute pairs for interpretation by the FSType-specific module of the command. (See mount_ufs(1M).) When you use -o with a file system that has an entry in /etc/vfstab, any mount options entered for that file system in /etc/vfstab are ignored.

    The following options are supported:

    devices | nodevices

    Allow or disallow the opening of device-special files. The default is devices.

    If you use nosuid in conjunction with devices, the behavior is equivalent to that of nosuid.

    exec | noexec

    Allow or disallow executing programs in the file system. Allow or disallow mmap(2) with PROT_EXEC for files within the file system. The default is exec.

    nbmand | nonbmand

    Allow or disallow non-blocking mandatory locking semantics on this file system. Non-blocking mandatory locking is disallowed by default.

    If the file system is mounted with the nbmand option, then applications can use the fcntl(2) interface to place non-blocking mandatory locks on files and the system enforces those semantics. If you enable this option, it can cause standards conformant applications to see unexpected errors.

    Do not use the nbmand option with /, /var and /usr.

    You should not use the remount option to change the nbmand disposition of the file system. The nbmand option is mutually exclusive of the global option. See -g.

    ro | rw

    Specify read-only or read-write. The default is rw.

    setuid | nosetuid

    Allow or disallow setuid or setgid execution. The default is setuid.

    If you specify setuid in conjunction with nosuid, the behavior is the same as nosuid.

    nosuid is equivalent to nosetuid and nodevices. When suid or nosuid is combined with setuid or nosetuid and devices or nodevices, the most restrictive options take effect.

    This option is highly recommended whenever the file system is shared by way of NFS with the root= option. Without it, NFS clients could add setuid programs to the server or create devices that could open security holes.

    suid | nosuid

    Allow or disallow setuid or setgid execution. The default is suid. This option also allows or disallows opening any device-special entries that appear within the filesystem.

    nosuid is equivalent to nosetuid and nodevices. When suid or nosuid is combined with setuid or nosetuid and devices or nodevices, the most restrictive options take effect.

    This option is highly recommended whenever the file system is shared using NFS with the root=option, because, without it, NFS clients could add setuid programs to the server, or create devices that could open security holes.

    -O

    Overlay mount. Allow the file system to be mounted over an existing mount point, making the underlying file system inaccessible. If a mount is attempted on a pre-existing mount point without setting this flag, the mount will fail, producing the error “device busy”.

    -r

    Mount the file system read-only.

Usage

    See largefile(5) for the description of the behavior of mount and umount when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

Files

    /etc/mnttab

    Table of mounted file systems.

    /etc/default/fs

    Default local file system type. Default values can be set for the following flags in /etc/default/fs. For example: LOCAL=ufs

    LOCAL:

    The default partition for a command if no FSType is specified.

    /etc/vfstab

    List of default parameters for each file system.

Attributes

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

    ATTRIBUTE TYPE

    ATTRIBUTE VALUE

    Availability

    SUNWcsu

See Also

Notes

    If the directory on which a file system is to be mounted is a symbolic link, the file system is mounted on the directory to which the symbolic link refers, rather than on top of the symbolic link itself.

Bugs

    The mount -p output is incorrect for cachefs.


2010-09-05 00:11:23

Solaris System Configuration Files Reference

For details about the files and commands summarized here, consult the appropriate man pages.

  • /etc/bootparams Contains information regarding network boot clients.
  • /etc/cron.d/cron.allow
    /etc/cron.d/cron.deny
    Allow access to crontab for users listed in this file. If the file does not exist, access is permitted for users not in the /etc/cron.d/cron.deny file.
  • /etc/defaultdomain NIS domain set by /etc/init.d/inetinit
  • /etc/default/cron Sets cron logging with the CRONLOG variable.
  • /etc/default/login Controls root logins via specification of the CONSOLE variable, as well as variables for login logging thresholds and password requirements.
  • /etc/default/su Determines logging activity for su attempts via the SULOG and SYSLOG variables, sets some initial environment variables for su sessions.
  • /etc/dfs/dfstab Determines which directories will be NFS-shared at boot time. Each line is a share command.
  • /etc/dfs/sharetab Contains a table of resources that have been shared via share.
  • /etc/group Provides groupname translation information.
  • /etc/hostname.interface Assigns a hostname to interface; assigns an IP address by cross- referencing /etc/inet/hosts.
  • /etc/hosts.allow
    /etc/hosts.deny
    Determine which hosts will be allowed access to TCP wrapper mediated services.
  • /etc/hosts.equiv Determines which set of hosts will not need to provide passwords when using the "r" remote access commands (eg rlogin, rsh, rexec)
  • /etc/inet/hosts
    /etc/hosts
    Associates hostnames and IP addresses.
  • /etc/inet/inetd.conf
    /etc/inetd.conf
    Identifies the services that are started by inetd as well as the manner in which they are started. inetd.conf may even specify that TCP wrappers be used to protect a service.
  • /etc/inittab inittab is used by init to determine scripts to for different run levels as well as a default run level.
  • /etc/logindevperm Contains information to change permissions for devices upon console logins.
  • /etc/magic Database of magic numbers that identify file types for file.
  • /etc/mail/aliases
    /etc/aliases
    Contains mail aliases recognized by sendmail.
  • /etc/mail/sendmail.cf
    /etc/sendmail.cf
    Mail configuration file for sendmail.
  • /etc/minor_perm Specifies permissions for device files; used by drvconfig
  • /etc/mnttab Contains information about currently mounted resources.
  • /etc/name_to_major List of currently configured major device numbers; used by drvconfig.
  • /etc/netconfig Network configuration database read during network initialization.
  • /etc/netgroup Defines groups of hosts and/or users.
  • /etc/netmasks Determines default netmask settings.
  • /etc/nsswitch.conf Determines order in which different information sources are accessed when performing lookups.
  • /etc/path_to_inst Contents of physical device tree using physical device names and instance numbers.
  • /etc/protocols Known protocols.
  • /etc/remote Attributes for tip sessions.
  • /etc/rmtab Currently mounted filesystems.
  • /etc/rpc Available RPC programs.
  • /etc/services Well-known networking services and associated port numbers.
  • /etc/syslog.conf Configures syslogd logging.
  • /etc/system Can be used to force kernel module loading or set kernel tuneable parameters.
  • /etc/vfstab Information for mounting local and remote filesystems.
  • /var/adm/messages Main log file used by syslogd.
  • /var/adm/sulog Default log for recording use of su command.
  • /var/adm/utmpx User and accounting information.
  • /var/adm/wtmpx User login and accounting information.
  • /var/local/etc/ftpaccess
    /var/local/etc/ftpconversions
    /var/local/etc/ftpusers
    wu-ftpd configuration files to set ftp access rights, conversion/compression types, and a list of userids to exclude from ftp operations.
  • /var/lp/log Print services activity log.
  • /var/sadm/install/contents Database of installed software packages.
  • /var/saf/_log Logs activity of SAF (Service Access Facility).

2010-09-05 00:09:20

Network File System (NFS)

News Recommended Links Sun Documentation Tutorials Reference RPC RFCs NFS performance tuning
share command dfshares Command dfstab File Mounting NFS Resources /etc/vfstab File AutoFS and automountd daemon NFS Security Nfsstat
NFS logging Troubleshooting Linux NFS SFU NFS implementation History Tips Humor Etc
 

NFS is a network filesystem originally developed by Sun (version 2, see RFC1094) and later enhanced by Network Appliance and other companies (version 3 and 4 of NFS). It works well for sharing file systems between multiple clients, but is slower then some other network filesystems (samba). It is also more fault tolerant then most other network file systems.

 

. With NFS, when a file or directory is shared from a remote machine, it appears to be part of your filesystem.  Every time you access the NFS-linked area, you're going over the network to the other machine, but that's all transparent to you (except for some delays). Because of its popularity, implementations of NFS have been created on other operating systems, for example Windows and Netware. A competing file sharing protocol called SAMBA which originated in Windows was ported and became popular on Unix. 

NFS defines an abstract model of a file system. Each OS applies the NFS model to its file system semantics and implement reading and writing operations as though they are accessing a local file.  NFS is also statelessness. You can reboot a server and the client won't crash. It won't be able to access files on the server's export while the server is down, but once it returns, you'll pick up right where things left off. Other network file sharing systems are not so resilient.

NFS is based on a client-server model. One computer works as a server and offers filesystems to other systems. This is called exporting or sharing and the filesystems offered are called "exports." The clients can mount server exports using an extension of mount command used to mount local filesystems.

File systems shared through NFS software can also be mounted automatically. Autofs, a client-side service, is a change directory intercept mechanism that catches the cases when user changes to NFS directory and transparently mounts it.  the list of mount points should be provided to Autofs as a configuration file. Essentially any I/O operation on s program notifies the automount daemon, automountd,  and it mounts it and then if there is long period of inactivity unmounts it. The automountd, daemon transparently performs mounting and unmounting of remote directories listed it Autofs configuration file on an as-needed basis. The NFS is in turn based on the Remote Procedure Call (RPC) protocol. For this reason, the RPC server daemon must be running for NFS to be implemented. You can check whether RPC is active by issuing this command at the shell prompt:

rpcinfo -p

The NFS service makes the physical location of the file system irrelevant to the user. You can use the NFS implementation to enable users to see all the relevant files regardless of location. Instead of placing copies of commonly used files on every system, the NFS service enables you to place one copy on one computer's disk and have all other systems access it across the network. Under NFS operation, remote file systems are almost indistinguishable from local ones.

Writable NFS-sharable file systems should generally be a separate disk or partition (on server). By having file systems on a separate partition of a harddisk, we can ensure that malicious users can not simply fill up the entire harddisk by writing large files onto it. This will then be able to crash other services running on the same harddisk. Prevent normal users on an NFS client from mounting an NFS file system (on server)

NFS controls who can mount an exported file system based on the host making the mount request, not the user that will actually use the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than file and directory permissions. In other words, once a file system is exported via NFS, any user on any remote host connected to the NFS server can access the shared data. To limit the potential risks, administrators can only allow read-only access or squashing users to a common user and groupid. But these solutions may prevent the NFS share from being used in the way it was originally intended.

Additionally, if an attacker gains control of the DNS server used by the system exporting the NFS file system, the system associated with a particular hostname or fully qualified domain name can be pointed to an unauthorized machine. At this point, the unauthorized machine is the system permitted to mount the NFS share, since no username or password information is exchanged to provide additional security for the NFS mount. The same risks hold true to compromised NIS servers, if NIS netgroups are used to allow certain hosts to mount an NFS share. By using IP addresses in /etc/exports, this kind of attack is more difficult.

Wildcards should be used sparingly when granting exporting NFS shares as the scope of the wildcard may encompass more systems than intended.

Once the NFS file system is mounted read-write by a remote host, the only protection each shared file has is its permissions. If two users that share the same userid value mount the same NFS file system, they will be able to modify each others files. Additionally, anyone logged in as root on the client system can use the su - command to become a user who could access particular files via the NFS share.

The default behavior when exporting a file system via NFS is to use root squashing. This sets the userid of anyone accessing the NFS share as the root user on their local machine to a value of the server's nobody account. Never turn off root squashing.

If exporting an NFS share read-only, consider using the all_squash option, which makes every user accessing the exported file system take the userid of the nobody user.

Before file systems or directories can be accessed (that is, mounted) by a client through NFS, they must be shared or  exported Once shared, authorized NFS clients can mount the resources. This term most often reflected in directory names for NFS resources such as /export/home or /export/swap.

To start the NFS server daemons or to specify the number of concurrent NFS requests that can be handled by the nfsd daemon, use the /etc/rc3.d/S15nfs.server script. 

You need several daemons to support NFS activities. These daemons can support both NFS client and NFS server activity, NFS server activity alone, or logging of the NFS server activity. To start the NFS server daemons or to specify the number of concurrent NFS requests that can be handled by the nfsd daemon, use the /etc/rc3.d/S15nfs.server script. There are six daemons that support NFS:

  1. mountd Handles file system mount requests from remote systems, and provides access control (server)
  2. nfsd Handles client file system requests (both client and server)
  3. statd Works with the lockd daemon to provide crash recovery functions for the lock manager (server)
  4. lockd Supports record locking operations on NFS files
  5. nfslogd  Provides filesystem logging. Runs only if one or more filesystems is mounted with log attribute.

You can detect most NFS problems from console messages or from certain symptoms that appear on a client system. Some common errors are:

  1. The rpcbind failure error incorrect host Internet address or server overload
     
  2. The server not responding error network connection or server is down
     
  3. The NFS client fails a reboot error a client is requesting an NFS mount using an entry in the /etc/vfstab file, specifying a foreground mount from a non-operational NFS server.
     
  4. The service not responding error an accessible server is not running the NFS server daemons.
     
  5. The program not registered error  an accessible server is not running the mountd daemon.
     
  6. The stale file handle error [file moved on the server]. To solve the stale NFS file handle error condition, unmount and mount the resource again on the client.
     
  7. The unknown host error the host name of the server on the client is missing from the hosts table.
     
  8. The mount point error check that the mount point exists on the client
     
  9. The no such file error unknown file name on the server
     
  10. No such file or directory  the directory does not exists on the server

NFS Server Commands

  • share Makes a local directory on an NFS server available for mounting. Without parameters displays the contents of the
    /etc/dfs/sharetab file.
  • unshare Makes a previously available directory unavailable for client side mount operations.
  • shareall Reads and executes share statements in the /etc/dfs/dfstab file.
  • unshareall Makes previously shared resources unavailable.
  • dfshares Lists available shared resources from a remote or local NFS server.
  • dfmounts Displays a list of NFS server directories that are currently mounted.

NFS resources can be shared using the share command and unshared using the unshare command. In addition, any resources identified in the /etc/dfs/dfstab file are automatically shared at system boot or when the shareall command is used. Shared resources are automatically recorded in the /etc/dfs/sharetab file. When the unshareall command is used, all resources listed in the /etc/dfs/sharetab file are automatically unshared.

The share command is used to share NFS resources so that NFS clients can mount and access them. At a minimum, the full pathname of the directory (or mount point of the file system) to be shared is specified as a command-line argument. In addition, three other command-line arguments are supported:

  • The -d command-line argument is followed by a description of the data being shared.

  • The -F nfs command-line argument is used to specify the type of file system. If not specified, the default file system type listed in the /etc/dfs/fstypes file (NFS) is assumed.

  • The -o command-line argument is followed by one or more NFS-specific options (separated by commas).

For example:

# share -F nfs -o public,ro /export/home

If the share command is used without any command-line arguments, the currently shared resources will be listed.
 

!

NFS server is started on  run level 3.The resources are unshared and the NFS server is stopped when the system run level changes to any level other than 3. The NFS client is started at run level 2.

The unshare command is used to stop the sharing of NFS resources so that NFS clients can no longer mount and access them. At a minimum, the full pathname of a directory (or mount point of the file system) that is currently shared is specified as a command-line argument.

Only one other command-line argument is supported: the -F nfs command-line argument, which is used to specify the type of file system. If not specified, the default file system type listed in the /etc/dfs/fstypes file (NFS) is assumed.

The following listing shows using the unshare command to stop the sharing of the /export/home file system:

# unshare -F nfs /export/home

Solaris uses six configuration files to support NFS server: Three common, one specific for client and two specific for the server

  Server Client
1. /etc/dfs/dfstab Lists share commands to share at boot time. Similar to /etc/vfstab for local filesystems.  shareall is essentially sh /etc/dfs/dfstab  Same thing

 

2. /etc/dfs/sharetab (autofile)Dynamically lists directories currently being shared by the NFS server. Same thing
3.

 

/etc/dfs/fstypes List of the default file system types for each remote file systems. Same thing
4. /etc/rmtab (autofile) Lists  remotely mounted file systems

 

 
5. /etc/nfs/nfslog.conf Defines the location of configuration logs used for NFS server logging.  
6. /etc/default/nfslogd Configuration of the nfslogd daemon.  

NFS Logging  is accomplished by nfslogd  daemon with the configuration stored in /etc/nfs/nfslog.conf and  /etc/default/nfslogd. The functions of the nfslogd daemon:

  • Converts the raw data from the logging operation into ASCII records, and stores the raw data in ASCII log files.
  • Resolves IP addresses to host names and UIDs to login names.
  • Maps the file handles to path names, and records the mappings in a file-handle-to-path mapping table. Each tag in the /etc/nfs/nfslog.conf file corresponds to one mapping table.

The NFS Logging Daemon monitors and analyzes RPC operations processed by the NFS server. If enabled, each RPC operation is stored in the NFS log file as a record that contains:

  • Time stamp

  • IP address or hostname of client

  • File or directory affected by operation

  • Type of operation: input, output, make directory, remove directory, or remove file

The NFS server logging consists of two phases. The first phase is performed by the kernel; it records RPC requests in a work buffer. The second phase is performed by the daemon; it reads the work buffer, constructs and writes the log records. The amount of time the daemon waits before reading the work buffer along with other configurable parameters are specified in the /etc/default/nfslogd file. /etc/default/nfslogd file can contain a number of parameters (the initial nfslogd provided with the Solaris 9 system contains only comments):

  • CYCLE_FREQUENCY� Amount of time (in hours) of the log cycle (close current log and open new one). This is to prevent the logs from getting too large.

  • IDLE_TIME� Amount of time (in seconds) that the logging daemon will sleep while waiting for data to be placed in the work buffer.

  • MAPPING_UPDATE_INTERVAL� The amount of time (in seconds) between updates of the file handle to pathname mapping database.

  • MAX_LOGS_PRESERVE� The maximum number of log files to save.

  • MIN_PROCESSING_SIZE� Minimum size (in bytes) of the work buffer before the logging daemon will process its contents.

  • PRUNE_TIMEOUT� The amount of time (in hours) the access time of a file associated with a record in the pathname mapping database can remain unchanged before it is removed.

  • UMASKumask used for the work buffer and file handle to pathname mapping database.

The /etc/nfs/nfslog.conf file is used to specify the location of log files, file handle to pathname mapping database, and work buffer, along with a few other parameters.  Set of parameters can be grouped together and associated with a tag. this way multiple configurations can be specified in the configuration file. The default configuration has the tag global . the following NFS logging parameters can be set:

  • buffer� Specifies location of working buffer.

  • defaultdir� Specifies the default directory of files. If specified, this path is added to the beginning of other parameters that are used to specify the location of files.

  • fhtable� Specifies location of the file handle to pathname mapping database.

  • log� Specifies location of log files.

  • logformat� Specifies either basic (default) or extended logging.

For example:

#ident  "@(#)nfslog.conf        1.5     99/02/21 SMI"
#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
# NFS server log configuration file.
#
# <tag> [ defaultdir=<dir_path> ] \
# [ log=<logfile_path> ] [ fhtable=<table_path> ] \
# [ buffer=<bufferfile_path> ] [ logformat=basic|extended ]
#

global  defaultdir=/var/nfs log=nfslog fhtable=fhtable buffer=nfslog_workbuffer

Logging is enabled on a per-share (file system/directory) basis, by adding the -o log option to the share command. 

Note:

  • The configuration file that controls the number of NFS logs created and the permissions on the log files is named atypically:  /etc/default/nfslogd

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

2010-09-03 02:23:53

NAME

ifconfig - configure network interface parameters

SYNOPSIS

/sbin/ifconfig interface [ address_family ] [ address [ dest_address ] ] [ up ] [ down ] [ auto-revarp ] [ netmask mask ] [ broadcast address ] [ metric n ] [ mtu n ] [ trailers | -trailers ] [ private | -private ] [ arp | -arp ] [ plumb ] [ unplumb ]
/usr/sbin/ifconfig interface [ address_family ] [ address [ dest_address ] ] [ up ] [ down ] [ auto-revarp ] [ netmask mask ] [ broadcast address ] [ metric n ] [ mtu n ] [ trailers | -trailers ] [ private | -private ] [ arp | -arp ] [ plumb ] [ unplumb ]

AVAILABILITY

SUNWcsr

DESCRIPTION

ifconfig is used to assign an address to a network interface and/or to configure network interface parameters. ifconfig must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters. Used without options, ifconfig displays the current configuration for a network interface. If a protocol family is specified, ifconfig will report only the details specific to that protocol family. Only the super-user may modify the configuration of a network interface.
The interface parameter is a string of the form name unit, for example le0 or ie1. Three special interface names, -a ,-ad and -au, are reserved and refer to all or a subset of the interfaces in the system. If one of these interface names is given, the commands following it are applied to all of the interfaces that match:
-a
Apply the commands to all interfaces in the system.
-ad
Apply the commands to all ``down'' interfaces in the system.
-au
Apply the commands to all ``up'' interfaces in the system.
Since an interface may receive transmissions in differing protocols, each of which may require separate naming schemes, the parameters and addresses are interpreted according to the rules of some address family, specified by the address_family parameter. The address families currently supported are ether and inet. If no address family is specified, inet is assumed.
For the TCP/IP family (inet), the address is either a host name present in the host name data base (see hosts(4)) or in the Network Information Service (NIS) map hosts, or a TCP/IP address expressed in the Internet standard "dot notation". Typically, an Internet address specified in dot notation will consist of your system's network number and the machine's unique host number. A typical Internet address is 192.9.200.44 ,where 192.9.200 is the network number and 44 is the machine's host number.
For the ether address family, the address is an Ethernet address represented as x: x: x: x: x: xwhere x is a hexadecimal number between 0 and FF.
If the dest_address parameter is supplied in addition to the address parameter, it specifies the address of the correspondent on the other end of a point to point link.

OPTIONS

arp
Enable the use of the Address Resolution Protocol in mapping between network level addresses and link level addresses (default). This is currently implemented for mapping between TCP/IP
addresses and 10Mb/s Ethernet addresses.
-arp
Disable the use of the Address Resolution Protocol.
auto-revarp
Use the Reverse Address Resolution Protocol (RARP) to automatically acquire an address for this interface.
down
Mark an interface "down". When an interface is marked "down", the system will not attempt to transmit messages through that interface. If possible, the interface will be reset to disable reception as well. This action does not automatically disable routes using the interface.
plumb
Open the device associated with the interface name and setup the streams needed for TCP/IP to use the device. Before this is done the interface will not show up in the output of ifconfig -a .
unplumb
Destroy any streams associated with this device and close the device. After this command is executed the device name should not show up in the output of ifconfig -a .
private
Tells the in.routed routing daemon that the interface should not be advertised.
-private
Specify unadvertised interfaces.
trailers
This flag used to cause a non-standard encapsulation of inet packets on certain link levels. Drivers supplied with this release no longer use this flag, but it is ignored for compatibility.
-trailers
Disable the use of a "trailer" link level encapsulation.
up
Mark an interface "up". This happens automatically when setting the first address on an interface. The up option enables an interface after an ifconfig down, reinitializing the hardware.
broadcast address
(inet only.) Specify the address to use to represent broadcasts to the network. The default broadcast address is the address with a host part of all 1's. A + (plus sign) given for the broadcast value causes the broadcast address to be reset to a default appropriate for the (possibly new) address and netmask. Note: The arguments of ifconfig are interpreted left to right, and therefore
ifconfig -a netmask + broadcast +
and
ifconfig -a broadcast + netmask +
may result in different values being assigned for the interfaces' broadcast addresses.
metric n
Set the routing metric of the interface to n, default 0 . The routing metric is used by the routing protocol Higher metrics have the effect of making a route less favorable; metrics are counted as addition hops to the destination network or host.
mtu n
Set the maximum transmission unit of the interface to n. For many types of networks the mtu has an upper limit, for example, 1500 for Ethernet.
netmask mask
(inet only.) Specify how much of the address to reserve for subdividing networks into sub-networks. The mask includes the network part of the local address and the subnet part, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number with a leading 0x, with a dot-notation address, or with a pseudo-network name listed in the network table networks(4). The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part. The mask should contain at least the standard network portion, and the subnet field should be contiguous with the network portion. If a `+' (plus sign) is given for the netmask value, the mask is looked up in the netmasks database using the interface network number as the key. Netmask data may be located in the local /etc/netmasks file, or the NIS or NIS+ netmasks.byaddr map. The system administrator may configure the source and lookup order in the netmasks database via the name service switch.

EXAMPLES

If your workstation is not attached to an Ethernet, the ie0 interface should be marked "down" as follows:
example% ifconfig ie0 down
To print out the addressing information for each interface, use the following command:
example% ifconfig -a
To reset each interface's broadcast address after the netmasks have been correctly set, use the next command:
        example% ifconfig -a broadcast +
To change the Ethernet address for interface ie0, use the following command:
        example% ifconfig le0 ether aa:1:2:3:4:5

FILES

/etc/netmasks
netmask data

SEE ALSO

in.routed(1M), netstat(1M), ethers(3N), hosts(4), netmasks(4), networks(4), nsswitch.conf(4), arp (7)

DIAGNOSTICS

Messages indicating the specified interface does not exist, the requested address is unknown, or the user is not privileged and tried to alter an interface's configuration.

NOTES

It is recommended that the names broadcast, down, private, trailers, up, and the other possible option names not be selected when choosing host names. Choosing anyone of these names as host names will cause bizarre problems that can be extremely difficult to diagnose.

2010-09-03 02:22:45

Name

    rmtab– remote mounted file system table

Synopsis

    /etc/rmtab
    

Description

    rmtab contains a table of filesystems that are remotely mounted by NFS clients. This file is maintained by mountd(1M), the mount daemon. The data in this file should be obtained only from mountd(1M) using the MOUNTPROC_DUMP remote procedure call.

    The file contains a line of information for each remotely mounted filesystem. There are a number of lines of the form:

    hostname:fsname
    

    The mount daemon adds an entry for any client that successfully executes a mount request and deletes the appropriate entries for an unmount request.

    Lines beginning with a hash (' #') are commented out. These lines are removed from the file by mountd(1M) when it first starts up. Stale entries may accumulate for clients that crash without sending an unmount request.

Files

    /etc/rmtab

See Also


2010-09-03 02:21:32

Name

    newfs– construct a UFS file system

Synopsis

    newfs [-NSBTv] [mkfs-options] raw-device
    

Description

    newfs is a "friendly" front-end to the mkfs(1M) program for making UFS file systems on disk partitions. newfs calculates the appropriate parameters to use and calls mkfs.

    If run interactively (that is, standard input is a tty), newfs prompts for confirmation before making the file system.

    If the -N option is not specified and the inodes of the device are not randomized, newfs calls fsirand(1M).

    You must be super-user or have appropriate write privileges to use this command, except when creating a UFS file system on a diskette. See EXAMPLES.

    Creating a Multiterabyte UFS File System

      Keep the following limitations in mind when creating a multiterabyte UFS file system:

      • nbpi is set to 1 Mbyte unless you specifically set it higher. You cannot set nbpi lower than 1 Mbyte on a multiterabyte UFS file system.

      • fragsize is set equal to bsize.

Options

    The following options are supported:

    -N

    Print out the file system parameters that would be used to create the file system without actually creating the file system. fsirand(1M) is not called here.

    -S

    Sends to stdout a human-readable version of the superblock that would be used to create a filesystem with the specified configuration parameters.

    -B

    Sends to stdout a binary (machine-readable) version of the superblock that would be used to create a filesystem with the specified configuration parameters.

    -T

    Set the parameters of the file system to allow eventual growth to over a terabyte in total file system size. This option sets fragsize to be the same as bsize, and sets nbpi to 1 Mbyte, unless the -i option is used to make it even larger. If you use the -f or -i options to specify a fragsize or nbpi that is incompatible with this option, the user-supplied value of fragsize or nbpi is ignored.

    -v

    Verbose. newfs prints out its actions, including the parameters passed to mkfs.

    mkfs-options

    Options that override the default parameters are:

    -a apc

    The number of alternate sectors per cylinder to reserve for bad block replacement for SCSI devices only. The default is 0.

    This option is not applicable for disks with EFI labels and is ignored.

    -b bsize

    The logical block size of the file system in bytes, either 4096 or 8192. The default is 8192. The sun4u architecture does not support the 4096 block size.

    -c cgsize

    The number of cylinders per cylinder group, ranging from 16 to 256. The default is calculated by dividing the number of sectors in the file system by the number of sectors in a gigabyte. Then, the result is multiplied by 32. The default value is always between 16 and 256.

    mkfs can override this value. See mkfs_ufs(1M) for details.

    This option is not applicable for disks with EFI labels and is ignored.

    -C maxcontig

    The maximum number of logical blocks, belonging to one file, that are allocated contiguously. The default is calculated as follows:


    maxcontig = disk drive maximum transfer size / disk block size
    

    If the disk drive's maximum transfer size cannot be determined, the default value for maxcontig is calculated from kernel parameters as follows:

    If maxphys is less than ufs_maxmaxphys, which is typically 1 Mbyte, then maxcontig is set to maxphys. Otherwise, maxcontig is set to ufs_maxmaxphys.

    You can set maxcontig to any positive integer value.

    The actual value will be the lesser of what has been specified and what the hardware supports.

    You can subsequently change this parameter by using tunefs(1M).

    -d gap

    Rotational delay. This option is obsolete in the Solaris 10 release. The value is always set to 0, regardless of the input value.

    -f fragsize

    The smallest amount of disk space in bytes that can be allocated to a file. fragsize must be a power of 2 divisor of bsize, where:

    bsize / fragsize is 1, 2, 4, or 8.

    This means that if the logical block size is 4096, legal values for fragsize are 512, 1024, 2048, and 4096. When the logical block size is 8192, legal values are 1024, 2048, 4096, and 8192. The default value is 1024.

    For file systems greater than 1 terabyte or for file systems created with the -T option, fragsize is forced to match block size (bsize).

    -i nbpi

    The number of bytes per inode, which specifies the density of inodes in the file system. The number is divided into the total size of the file system to determine the number of inodes to create.

    This value should reflect the expected average size of files in the file system. If fewer inodes are desired, a larger number should be used. To create more inodes, a smaller number should be given. The default for nbpi is as follows:


    Disk size                 Density
    
    Less than 1GB             2048
    Less than 2GB             4096
    Less than 3GB             6144
    3GB to 1 Tbyte            8192
    Greater than 1 Tbyte  
       or created with -T     1048576 

    The number of inodes can increase if the file system is expanded with the growfs command.

    -m free

    The minimum percentage of free space to maintain in the file system, between 0% and 99%, inclusively. This space is off-limits to users. Once the file system is filled to this threshold, only the super-user can continue writing to the file system.

    The default is ((64 Mbytes/partition size) * 100), rounded down to the nearest integer and limited between 1% and 10%, inclusively.

    This parameter can be subsequently changed using the tunefs(1M) command.

    -n nrpos

    The number of different rotational positions in which to divide a cylinder group. The default is 8.

    This option is not applicable for disks with EFI labels and is ignored.

    -o space | time

    The file system can either be instructed to try to minimize the time spent allocating blocks, or to try to minimize the space fragmentation on the disk. The default is time.

    This parameter can subsequently be changed with the tunefs(1M) command.

    -r rpm

    The rotational speed of the disk in revolutions per minute. The default is driver- or device-specific.

    Note that you specify rpm for newfs and rps for mkfs.

    This option is not applicable for disks with EFI labels and is ignored.

    -s size

    The size of the file system in sectors. The default is to use the entire partition.

    -t ntrack

    The number of tracks per cylinder on the disk. The default is taken from the disk label.

    This option is not applicable for disks with EFI labels and is ignored.

Operands

    The following operands are supported:

    raw-device

    The name of a raw special device residing in the /dev directory (for example, /dev/rdsk/c0t0d0s6) on which to create the file system.

Usage

    See largefile(5) for the description of the behavior of newfs when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

Examples


    Example 1 Displaying the Parameters for the Raw Special Device

    The following example verbosely displays the parameters for the raw special device, c0t0d0s6. It does not actually create a new file system:


    example# newfs -Nv /dev/rdsk/c0t0d0s6
    mkfs -F ufs -o N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60
    2048 t 0 -1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in
    1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl
    groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups
    (for fsck -b #) at:
    32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, . . .


    Example 2 Creating a UFS File System

    The following example creates a UFS file system on a diskette that is managed by a volume manager that makes use of the mount point /vol.


    example% newfs /vol/dev/aliases/floppy0
    newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
    /vol/dev/aliases/floppy0: 2880 sectors in 80 cylinders of 2 tracks,
    18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
    32, 640, 1184, 1792, 2336, . . .


    Example 3 Creating a UFS File System That Will Eventually Be Grown to a Multiterabyte UFS File System

    The following example creates a UFS file system that will eventually be grown to a multiterabyte UFS file system.

    This command creates a 800-Gbyte file system on the volume, /dev/md/rdsk/d99.


    # newfs -T /dev/md/rdsk/d99
    newfs: construct a new file system /dev/md/rdsk/d99: (y/n)? y
       /dev/md/rdsk/d99: 1677754368 sectors in 45512 cylinders of 
       144 tracks, 256 sectors
       819216.0MB in 1821 cyl groups (25 c/g, 450.00MB/g, 448 i/g) . . .

    Then, if you increase the volume size for this file system, you can use the growfs command to expand the file system. The file system is grown to 1.2 terabytes in this example:


    # growfs -v /dev/md/rdsk/d99
    /usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d99 2516631552 /dev/md/rdsk/d99:
       2516631552 sectors in 68268 cylinders of 144 tracks, 256  sectors
       1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g). . .

Exit Status

    The following exit values are returned:

    0

    The operation was successful.

    1, 10

    Usage error or internal error. A message is output to STDERR explaining the error.

    Other exit values may be returned by mkfs(1M), which is called by newfs.

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Availability 

    SUNWcsu 

See Also

Diagnostics

    newfs: No such file or directory

    The device specified does not exist, or a disk partition was not specified.

    special: cannot open

    You must write access to the device to use this command.


2010-09-03 02:19:01

Name

    fssnap– create temporary snapshots of a file system

Synopsis

    fssnap [-F FSType] [-V] -o special_options /mount/point
    
    fssnap  -d [-F  FSType] [-V] /mount/point | dev
    
    fssnap -i [-F FSType] [-V] [-o special_options] 
         [/mount/point | dev]

Description

    The fssnap command creates a stable, read-only snapshot of a file system when given either an active mount point or a special device containing a mounted file system, as in the first form of the synopsis. A snapshot is a temporary image of a file system intended for backup operations.

    While the snapshot file system is stable and consistent, an application updating files when the snapshot is created might leave these files in an internally inconsistent, truncated, or otherwise unusable state. In such a case, the snapshot will contain these partially written or corrupted files. It is a good idea to ensure active applications are suspended or checkpointed and their associated files are also consistent during snapshot creation.

    File access times are not updated while the snapshot is being created.

    A path to the virtual device that contains this snapshot is printed to standard output when a snapshot is created.

Options

    The following options are supported:

    -d

    Deletes the snapshot associated with the given file system.

    -F FSType

    Specifies the file system type to be used. The FSType should either be specified here or be determined by matching the block special device with an entry in the /etc/vfstab table, or by consulting /etc/default/fs.

    -i

    Displays the state of any given FSType snapshot. If a mount-point or device is not given, a list of all snapshots on the system is displayed. When a mount-point or device is specified, detailed information is provided for the specified file system snapshot by default. The format and meaning of this information is file-system dependent. See the FSType-specific fssnap man page for details.

    -o special_options

    See the FSType-specific man page for fssnap.

    -V

    Echoes the complete command line, but does not execute the command.

Operands

    The following operands are supported:

    /mount/point

    The directory where the file system resides.

Examples

    See FSType-specific man pages for examples.

Exit Status

    The following exit values are returned:

    0

    Successful completion.

    >0

    An error occurred.

Files

    /etc/vfstab

    Specifies file system type.

    /etc/default/fs

    Specifies the default local file system type.

Attributes

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

    ATTRIBUTE TYPE 

    ATTRIBUTE VALUE 

    Availability 

    SUNWcsu 

See Also

Notes

    This command might not be supported for all FSTypes.