Contidos dentro
Localizar Mais Documentação
Destaques de Recursos de Suporte
| Fazer download desta apostila em PDF
File-System Administration
9
- This chapter familiarizes you with changes to file system layout and the changes to file systems, virtual file systems, directories, and files. The chapter also describes changes to file system administration including:
-
- Mounting file systems
- Monitoring file systems
- Sharing file systems
- Creating new file systems
- Checking file systems
- Backing up and restoring files
- This chapter contains the following sections:
-
- For more information on understanding and managing file systems, see File System Administration.
File-System Changes
- SunOS release 5.4 and SunOS release 4.x file systems are similar, but there are changes in the locations and names of system directories and files; there are also new file systems and new pseudo file systems, and one directory was removed.
- Some of the changes to file system locations and names are:
-
- The /dev directory has changed from a flat directory to a hierarchical one.
- The /etc directory has changed and contains specific system configuration information. Several files and subdirectories have been added, removed, or changed in SunOS release 5.4.
- The /etc/vfstab tab file replaces /etc/fstab.
- The /etc/lp directory replaces /etc/printcap.
- The SunOS release 5.4 /sbin directory contains the rc scripts used to alter system run levels as well as the rcs script used to initialize the system prior to mounting file systems.
- The SunOS release 5.4 /usr directory contains sharable files and executables provided by the system.
- The /var directory contains files that change size during normal operation. Several files and subdirectories in the /var directory have been added, removed, or changed in SunOS release 5.4.
- The /var/mail directory replaces /var/spool/mail.
- The /sys directory is no longer needed because the kernel is dynamically loaded.
- The /RFS file system has been removed.
- The terminfo database replaces termcap.
Pseudo File Systems
- The TFS pseudo file system is not included in the SunOS release 5.4.
- The added pseudo file systems in SunOS release 5.4 are:
-
- The CACHEFS pseudo file system can be used to improve performance of slow devices such as CD-ROM.
-
- The PROCFS pseudo file system resides in memory and contains a list of active processes, by process number, in the /proc directory. See the proc(4) manual page.
- The FDFS pseudo file system provides explicit names for opening files using file descriptors.
- The FIFOFS pseudo file system contains pipe files that give processes common access to data.
- The NAMEFS pseudo file system is used mostly by STREAMS for dynamic mounts of file descriptors on top of files.
- The SWAPFS pseudo file system is the default swap device when the system boots or you create additional swap space.
Added File Systems
- The following file systems are included in the SunOS release 5.4 directory structure:
-
- The kernel, now called unix, and the kernel modules, are stored in the /kernel directory.
- The optional /opt file system can be used to store third-party or unbundled software. If /opt is not a separate file system, it may be a symbolic link to /usr/opt.
- The /vol file system provides the default file system for the volume management daemon, vold(1M). See the volfs(7) man page.
Default File Systems and Directories
- The SunOS release 5.4 file system is hierarchical. Figure 9-1 graphically depicts SunOS release 5.4 default directories and file systems (indicated by dotted lines).
- Subdirectories shown are just a sample of what the directory or file system actually holds. Figure 9-1 gives a brief description of each.

Figure 9-1
- Solaris 2.4 software contains a default set of file systems and directories, and uses a set of conventions to group similar types of files together. Table 9-1 lists SunOS release 5.4 default file systems and directories with a brief description.
-
Table 9-1
| File System or Directory Type | Description |
-
-
/ File
- The top of the hierarchical file tree. The root directory
- system contains the directories and files critical for system operation, such as the kernel (/kernel/unix), the device drivers, and the programs used to boot the system. It also contains the mount point directories where local and remote file systems can be attached to the file tree.
-
/etc...DirectoryContains system files used in system administration
-
-
/usr File
- Contains architecture-dependent and -independent
- system sharable files. Files such as man pages that can be used on all types of systems are in /usr/share.
-
-
/home File
- The mount point for the users' home directories, which
- system store users' work files. By default, /home is now an automounted file system.
-
-
/var Directory
- Contains system files and directories that are likely to change or grow over the life of the local system. These include system logs, vi and ex backup files, and uucp files.
-
-
/opt File
- Mount point for optional third-party software. On some
- system systems /opt may be a ufs file system on a local disk partition.
-
-
/tmp File
- Temporary files, cleared each time the system is booted or
- system /tmp is unmounted
-
-
/vol File
- Contains directories for removable media, managed by
- system vold(1M)
-
-
/proc File
- Contains a list of active system processes, by number. Does
- system not use any disk space
-
-
/sbin Directory
- Essential executables used in the booting process and in manual system recovery
Virtual File-System Architecture
- SunOS release 5.4 features a virtual file system (VFS) architecture that simplifies file system management for systems that support multiple file systems.
- Over the years, several different UNIX file systems were developed, each with its own set of commands for file system management. Learning all the variations can be confusing and difficult. SunOS release 5.4 addresses this issue with a set of generic commands for file system management. These commands comprise a common VFS interface that makes differences between file systems transparent with respect to maintenance. The subsections below list a summary of supported file systems and the generic file system commands.
Supported File-System Types
- Most file system types included in SunOS release 4.x are also included in SunOS release 5.4. There is one exception: The translucent file system (TFS) type has been withdrawn from SunOS release 5.4. Table 9-2 summarizes file-system type availability in SunOS release 4.x and SunOS release 5.4.
-
Table 9-2
Category |
Name |
Description | SunOS
Release
4.x | SunOS
Release
5.4 |
| Disk-based | UFS | UNIX file system | Yes | Yes |
| HSFS | CD-ROM file system | Yes | Yes |
| PCFS | PC file system | Yes | Yes |
| Network-based | NFS | Sun's distributed computing file system | Yes | Yes |
| Pseudo | SPECFS | Device Special file system | Yes | Yes |
| TMPFS | /tmp Temporary file system | Yes | Yes |
| LOFS | Loopback file system | Yes | Yes |
| TFS | Translucent file system | Yes | No |
| PROCFS | Process Access file system | No | Yes |
| FDFS | File Descriptor file system | No | Yes |
-
Table 9-2
Category |
Name |
Description | SunOS
Release
4.x | SunOS
Release
5.4 |
| FIFOFS | FIFO/Pipe file system | No | Yes |
| NAMEFS | Name file system | No | Yes |
| SWAPFS | Swap file system | No | Yes |
| CACHEFS | Cache file system | No | Yes |
- For more information on file systems, see the proc(4) and fd(4) man pages and File System Administration.
The Cache File System (CACHEFS)
- The Cache File System can be used to improve performance of remote file systems or slow devices such as CD-ROM. When a file system is cached, the data read from the remote file system or CD-ROM is stored in a cache on the local system.
Swap File Changes
-
SWAPFS is SunOS release 5.4's default swap device when the system boots or you create additional swap space. This swap device uses physical memory as swap space, but also requires physical swap space on disk.
- In SunOS release 4.x systems, the default physical swap device depends on the system configuration. Standalone systems default sd0b and diskless systems get their swap files from the bootparam server. SunOS release 5.4 uses the swap file as the default dump device instead of specifying a file on disk.
Unsupported SVR4 File System Types
-
Table 9-3 shows SVR4 file system types that are not supported in SunOS release 5.4.
-
Table 9-3
| Name | Description |
| BFS | Boot file system |
| S5 | System V file system |
| xnamefs | XENIX semaphore file system |
Generic File-System Commands
- Most file system administration commands have a generic and a file system component. Use the generic commands, which call the file system component. Table 9-4 lists the generic file system administrative commands, which are located in the /usr/bin directory.
-
Table 9-4
| Command | Description |
| clri(1M) | Clears inodes |
| df(1M) | Reports the number of free disk blocks and files |
| ff(1M) | Lists file names and statistics for a file system |
| fsck(1M) | Checks the integrity of a file system and repairs any damage found |
| fsdb(1M) | File system debugger |
| fstyp(1M) | Determines the file-system type |
| labelit(1M) | Lists or provides labels for file systems when copied to tape (for use by the volcopy command only) |
| mkfs(1M) | Makes a new file system |
| mount(1M) | Mounts file systems and remote resources |
| mountall(1M) | Mounts all file systems specified in a file-system table |
| ncheck(1M) | Generates a list of path names with their i-numbers |
| umount(1M) | Unmounts file systems and remote resources |
| umountall(1M) | Unmounts all file systems specified in a file-system table |
-
Table 9-4
| Command | Description |
| volcopy(1M) | Makes an image copy of a file system |
- Most of these commands also have a file system counterpart.
-
Caution - Do not use the file system commands directly. If you specify an operation on a file system that does not support it, the generic command displays this error message: command: Operation not applicable for FSType type.
Syntax of Generic Commands
- Most of these commands use this syntax: command [-F type] [-V] [generic-options] [-o specific-options] [special|mount-point] [operands]
- The options and arguments to the generic commands are:
-
-F type Specifies the type of file system. If you do not use this option, the command looks for an entry that matches special or mount point in the /etc/vfstab file. Otherwise, the default is taken from the file /etc/default/fs for local file systems and from the file /etc/dfs/fstypes for remote file systems.
-
-
-V
- Echoes the completed command line. The echoed line may include additional information derived from /etc/vfstab. Use this option to verify and validate the command line. The command is not run.
-
generic-options
- Options common to different types of file systems.
-
-o specific-options A list of options specific to the type of file system. The list must have the following format: -o followed by a space, followed by a series of keyword [=value] pairs separated by commas with no intervening spaces.
-
special|mount-point Identifies the file system. The name must be either the mount point or the special device file for the slice holding the file system. For some commands, the special file must be the raw (character) device and for other commands it must be the block device. In some cases, this argument is used as a key to search the file /etc/vfstab for a matching entry from which to obtain other information. In most cases, this argument is required and must come immediately after specific-options. However, it is not required when you want a command to act on all the file systems (optionally limited by type) listed in the /etc/vfstab file.
-
operands
- Arguments specific to a type of file system. See the specific man page of the command (for example, mkfs_ufs) for a detailed description.
System-wide Default File-System Type
- The default remote file system type is /etc/dfs/fstype. The default local file system type is /etc/default/fs. See the default_fs(4) man page for more information.
Command Locations
- In previous SunOS releases, all file-system commands were located in the /etc directory. In SunOS release 5.4, file-system commands are organized into separate hierarchies for convenience. All of the file-system commands are included in /usr/lib/fs/fstype. Commands needed before /usr is mounted are duplicated in /etc/fs/fstype.
- All of the generic commands are located in /usr/sbin. The commands needed before /usr is mounted are duplicated in /sbin.
-
Table 9-5 lists the locations of the file system commands.
-
Table 9-5
Type | Location of
Primary Version | Location of Duplicate
Version (root) |
| Generic | /usr/sbin | /sbin |
| Specific | /usr/lib/fs | /etc/fs |
Directory and File Changes
- This section describes the changes to directories and files between SunOS release 4.x and SunOS release 5.4.
/dev Directory
- The /dev directory has changed from a flat directory to a hierarchical one. Table 9-6 describes the subdirectories that have been added.
-
Table 9-6 /dev
| Subdirectory | Description |
| /dev/dsk | Contains block disk devices |
| /dev/rdsk | Contains raw disk devices |
| /dev/pts | Contains pseudo terminal (pty) slave devices |
| /dev/rmt | Contains raw tape devices |
| /dev/sad | Contains entry points for the STREAMS Administrative Driver |
| /dev/term | Contains terminal devices |
/etc Directory
- The /etc directory contains system configuration information. Several files and subdirectories in the SunOS release 4.x /etc directory have been added, removed, or changed in SunOS release 5.4.
-
- File system commands, such as mount*, have been moved to subdirectories of the /usr/lib/fs directory.
- The SunOS release 4.x /etc/fstab file has been replaced by /etc/vfstab.
- Initialization scripts, such as rc, rc.boot, rc.local, and rc.single, are not available in SunOS release 5.4. They are replaced by the scripts shown in Table 9-7 which are run by their corresponding run control files.
-
Table 9-7
| Scripts | Run Control Files |
| /etc/rc0.d | /sbin/rc0 |
| /etc/rc1.d | /sbin/rc1 |
| /etc/rc2.d | /sbin/rc2 |
| /etc/rc3.d | /sbin/rc3 |
| /etc/rc4.d | /sbin/rc4 |
| /etc/rc5.d | /sbin/rc5 |
| /etc/rc6.d | /sbin/rc6 |
| /etc/rcS.d | /sbin/rcS |
-
Table 9-8 describes the subdirectories that have been added to the /etc directory for SunOS release 5.4.
-
Table 9-8 /etc
| Subdirectory | Description |
| /etc/default | Defines default system configuration |
| /etc/inet | Defines Internet services configuration |
| /etc/lp | Defines LP system configuration |
| /etc/opt | Defines installed optional software |
| /etc/rcn.d | Defines run-state transition operations |
| /etc/saf | Defines Service Access Facility (SAF) configuration |
The /etc/vfstab File
- In SunOS release 5.4, the virtual file system file /etc/vfstab replaces the /etc/fstab file. In the virtual file system architecture, the /etc/vfstab file provides default file system parameters used by the generic commands for file system management. For information about these commands, see "Generic File-System Commands" on page 88.
- In addition to the name change, the /etc/vfstab file is different from the /etc/fstab file in the following ways:
-
- A device to fsck field has been added to specify the names of raw devices to be checked by fsck.
- An automount field has been added to control the routine mounting of file system by mountall (the automount daemon does not use this field).
- The freq field, which specified the number of days between dumps, has been eliminated.
- The file-system table has seven fields, each separated by a tab. Table 9-9 explains the field entries.
-
Note - You must have an entry in each field in the /etc/vfstab file. If there is no value for a field, be sure to type a dash (-).
-
Table 9-9 /etc/vfstab
| Field Name | Content |
| device to mount | The entry in this field may be any of the following: The block special device for local ufs file systems (for example, /dev/dsk/c0t0d0s0) The resource name for remote file systems (for example, myserver:/export/home for an nfs system) The name of the slice on which to swap (for example, /dev/dsk/c0t3d0s1)
The /proc directory and proc file system type CD-ROM as hsfs file system type
/dev/diskette as pcfs or ufs file system type This field is also used to specify swap file systems. For more information on remote file systems, see NFS Administration Guide.
|
| device to fsck | The raw (character) special device that corresponds to the file system identified by the device to mount field (for example, /dev/rdsk/c0t0d0s0). This field determines the raw interface that is used by fsck. Use a dash (-) when there is no applicable device, such as for a read-only file system or a network-based file system. |
| mount point | The default mount point directory (for example, /usr for /dev/dsk/c0t0d0s6). |
| FS type | The type of file system identified by the device to mount field. |
-
Table 9-9 /etc/vfstab
| Field Name | Content |
| fsck pass | The pass number used by fsck to determine whether to check a file system. When the field contains a dash (-), the file system is not checked. When the field contains a value of 1 or more, the file system is checked; non-ufs file systems with a 0 fsck pass are checked. For ufs file systems only, when the field contains a 0, the file system is not checked. When fsck is run on multiple ufs file systems that have fsck pass values greater than 1 and the preen option (-o p) is used, fsck automatically checks the file systems on different disks in parallel to maximize efficiency. When the field contains a value of 1, the file system is checked sequentially. Otherwise, the value of the pass number does not have any effect. In SunOS 5.3 system software, the fsck pass field does not explicitly specify the order in which file systems are checked. |
| automount? | yes or no for whether the file system should be automatically mounted by mountall when the system is booted. An auto in the fourth column of your SunOS release 4.x /etc/fstab would translate to a "yes" in this column; a noauto, a "no." Note that this field has nothing to do with the automount program. |
| mount options | A list of comma-separated options (with no spaces) that are used in mounting the file system. Use a dash (-) to show no options. See the mount(1M) man page for a list of the available options. |
-
Figure 9-2 is an example of a SunOS release 5.4 /etc/vfstab file.
-
#device device mount FS fsck auto mount
#to mount to fsck point type pass mount? options
#
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
/proc - /proc proc - no -
swap - /tmp tmpfs - yes -
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 2 no -
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files7 ufs 3 no -
oak:/export/home1/ignatz - /home/ignatz nfs - yes rw,intr
|
-
Figure 9-2 SunOS Release 5.4 /etc/vfstab file
- For detailed information about the /etc/vfstab file, see File System Administration.
The /etc/shadow File
- The /etc/shadow file, new to SunOS release 5.4, includes entries that force password aging for individual user login accounts. The /etc/shadow file also contains encrypted passwords. The /etc/shadow file does not have general read permissions. This prevents general access to the encrypted passwords that formerly appeared in the /etc/passwd file.
/sbin Directory
- The SunOS release 5.4 /sbin directory contains the rc scripts used to alter system run levels as well as the rcs script used to initialize the system prior to mounting file systems. See the rc man pages in man Pages(1M): System Administration Commands and "Changing System Run Levels" on page 76 for a description of the scripts.
/usr Directory
- The SunOS release 5.4 /usr directory contains sharable files and executables provided by the system. Table 9-10 describes the subdirectories that have been added to the SunOS release 4.x /usr directory for SunOS release 5.4.
-
Table 9-10 /usr
| Subdirectory | Description |
| /usr/ccs | C compilation systems |
| /usr/snadm | Executables and other files used by admintool |
-
Table 9-11 shows files that have been moved from the SunOS release 4.x /usr directory in SunOS release 5.4.
-
Table 9-11 /usr
| SunOS Release 4.x Location | SunOS Release 5.4 Location |
| /usr/5bin | /usr/bin |
| /usr/5include | /usr/include |
| /usr/5lib | /usr/lib |
| /usr/etc | /usr/sbin |
| /usr/old | Contents removed |
| /usr/xpg2bin | /usr/bin |
| /usr/xpg2lib | /usr/lib |
| /usr/xpg2include | /usr/include |
-
Appendix E, "/ and /usr File Systems Changes," contains tables with detailed information about the directories and files in each of these file systems.
-
/var Directory
- The /var directory contains files that change sizes during normal operation. Several files and subdirectories in the /var directory have been added, removed, or changed for SunOS release 5.4.
-
-
The /var/opt/packagename directory contains software package objects that change sizes, such as log and spool files.
-
- The /var/sadm directory contains databases maintained by the software package management utilities.
- The /var/saf directory contains Service Access Facility (SAF) logging and accounting files.
- The SunOS release 4.x /var/spool/mail directory has been moved to /var/mail in SunOS release 5.4.
- Two directories were added to SunOS release 5.x file system: /kernel and /opt.
/kernel Directory
- The SunOS release 5.4 /kernel directory contains the operating system kernel and kernel-level object modules, which were in /sys in SunOS release 4.x. Table 9-12 describes the subdirectories that have been added to the /kernel directory for the SunOS release 5.4.
-
Table 9-12 /kernel
| Subdirectory | Description |
| /kernel/drv | Device driver and pseudo-device driver modules |
| /kernel/exec | Kernel modules to run ELF or a.out executable files |
| /kernel/fs | Kernel modules that implement file systems such as ufs, nfs, proc, fifo, etc. |
| /kernel/misc | Miscellaneous modules |
| /kernel/sched | Modules containing scheduling classes and corresponding dispatch tables |
| /kernel/strmod | STREAMS modules |
| /kernel/sys | Loadable system calls such as system accounting and semaphore operations |
| /kernel/unix | Operating system kernel, loaded at boot time |
/opt Directory
- The SunOS release 5.4 /opt directory contains optional add-on application software packages. These packages were installed in /usr on SunOS release 4.x.
/sys Directory
- The /sys directory has been retired. Its files, used to reconfigure the kernel, have been made obsolete by the dynamic kernel.
Using File System Administration Commands
- The file system administration commands that have changed from SunOS release 4.x to SunOS release 5.4 include those for:
-
- Mounting file systems
- Monitoring file systems
- Sharing file systems
- Creating a new file system
- Checking a file system
- Backing up and restoring files
- When you are ready to administer file systems on your SunOS release 5.4, see File System Administration for details on performing the tasks involved.
Mounting File Systems and autofs
- The biggest change to the mounting capability is automatic mounting or autofs. The autofs program automatically mounts directories when you access them using, for example cd(1) or ls(1). This capability includes file hierarchies, CD-ROM, and diskette file systems.
-
autofs starts automatically when the system enters run level 3, or you can invoke it from a shell command line.
- The autofs works with the file systems specified in maps. These maps can be maintained as NIS, NIS+, or local files. The autofs maps can specify several remote locations for a particular file. This way, if one of the servers is down, autofs can try to mount from another system. You can specify which servers are preferred for each resource in the maps by assigning each server a weighting factor.
- Mounting some file hierarchies with autofs does not exclude the ability to mount others with the mount command. A diskless system must have entries for / (root), /usr, and /usr/kvm in the /etc/vfstab file. Because shared file systems should always remain available, do not use autofs to mount /usr/share.
- The following example shows how to manually mount a file system listed in the /etc/vfstab file using the mount command.
-
-
Change to the directory in which you want to create the mount point.
-
Create the mount-point directory.
-
Specify either the mount point or the block device.
It is usually easier to specify the mount point. The rest of the information is read from /etc/vfstab.
-
Become root and give the mount command, specifying either the mount point or the block device.
It is usually easier to specify the mount point. The rest of the information is read from /etc/vfstab.
# mount mount-point
- The file system is now mounted.
- For instructions showing how to mount different types of file systems using mount with or without options, see File System Administration.
Changes to the mount Command
- Some of the names and forms of the SunOS release 5.4 mount commands are different from those in SunOS release 4.x as shown in Table 9-13.
-
Table 9-13 mount
| SunOS Release 4.x | SunOS Release 5.4 |
| mount | mount |
| mount -a | mountall |
| umount | umount |
-
Table 9-13 mount
| SunOS Release 4.x | SunOS Release 5.4 |
| umount -a | umountall |
| exportfs | share |
| exportfs -u | unshare |
| showmount -a | dfmounts |
| showmount -e | dfshares |
- See Appendix A, "Commands Reference Table," for more information on changes to these commands.
Automatic Mounting of /cdrom and /floppy
- In this release, the CD-ROM and diskette file systems are automatically mounted in /cdrom and /floppy when removable media is inserted into these drives. Since these file systems are now managed by the Volume Management daemon, vold(1M), you cannot mount these devices yourself. See "Using Volume Management" on page 70 for more information.
Specifying File Systems in the /etc/vfstab File
- In the SunOS release 5.4 system, you need to list file systems that you want mounted at system startup in your /etc/vfstab, instead of in the SunOS release 4.x /etc/fstab file. The format of /etc/vfstab differs from that of /etc/fstab. For a discussion of the /etc/vfstab file, see "The /etc/vfstab File" on page 93.
Monitoring File Systems
-
Table 9-14 shows the file and directory monitoring commands and changes, where they apply.
-
Table 9-14
| Command | Information Provided | Change (if applicable) |
| ls | Size, age, permissions, owner of files | None |
| du | Total size of directories and their contents | None |
| df | Disk space occupied by file systems, directories, or mounted resources; used and available disk space | The SunOS release 4.x version of this command provides a different output format containing somewhat different output than the SunOS release 5.4 df command. The SunOS release 5.4 -k option provides output formats similar to those in the SunOS release 4.x command. The SunOS release 4.x df -t filesystem type reports on files of the specified type, whereas the SunOS release 5.4 df -t command prints full listings with totals. |
| quot | Number of blocks owned by users | None |
| find | Names of files meeting search criteria | The following SunOS release 4.x option is not available in the SunOS release 5.4 command: -n cpio-device Write the current file on device in cpio -c format. |
Sharing File Systems
- File systems were "exported" in SunOS release 4.x to make them available to other systems. This was done through the /etc/exports file and the exportfs command. However, only NFS systems could be exported.
- In SunOS release 5.4, this same concept is referred to as "sharing resources," and it has been expanded to include more file systems. File systems are shared with the share(1M) and shareall(1M) commands. The share command is similar to the exportfs pathname command, while shareall is similar to the exportfs -a command.
- The share -F fstype option specifies the type of file system to be shared. If the -F option is not specified, share uses the first file-system type listed in the /etc/dfs/dfstab file.
- File systems that you want to be shared automatically should have share command entries in the /etc/dfs/dfstab file (which replaces the /etc/export file). The commands specified in this file are run automatically when the system enters run level 3 (multiuser mode with network file sharing).
Example of /etc/dfs/dfstab file entries
- The following entry gives clients on mercury, venus, and mars read-write access to /export/home1; the second entry gives clients on saturn and jupiter read-only access to /export/news.
-
share -F nfs -o rw=mercury:venus:mars -d "Home Dir" /export/home1
share -F nfs -o ro=saturn:jupiter -d "News Postings" /export/news
|
- When the system is running in multiuser mode, these file systems are available to the clients listed. The share command displays all resources shared by the local system:
-
% share
- /export/home1 rw=mercury:venus:mars "Home Dir"
- /export/news ro=saturn:jupiter "News Postings"
|
Creating New File Systems
- You define, specify, and create a new file system using either the newfs(1M) or the mkfs(1M) command. The following sections highlight changes in the newfs and mkfs commands.
The newfs Command
- The SunOS release 5.4 newfs command is a convenient front end to the mkfs command. The newfs command does not support the virtual file system architecture; it is intended for creating ufs-type file systems only. When you use newfs, it calls and passes arguments to mkfs, which does the real work when creating a ufs file system.
- The newfs command accepts only names that conform to the SunOS release 5.4 device naming conventions (see "Device Naming Conventions" on page 65).
The mkfs Command
- The SunOS release 5.4 mkfs command differs significantly from the SunOS release 4.x version of the command. The SunOS release 5.4 version provides for different file-system types, and its command syntax is entirely different (see "Generic File-System Commands" on page 88). Like newfs, mkfs accepts only names conforming to the SunOS release 5.4 device naming conventions.
- Although mkfs now supports different types of file systems, in practice it is almost always used to create ufs file systems. However, mkfs isn't usually run directly; it is usually called by the newfs command.
- See man Pages(1): User Commands for additional details.
Checking File Systems
- The SunOS release 5.4 fsck(1M) command differs significantly from the SunOS release 4.x version of the command. In keeping with the virtual file-system (VFS) architecture, the fsck file-checking utility has two parts:
-
- A generic command that is called first, regardless of the type of file system.
-
- In addition, fsck accepts only names conforming to the SunOS release 5.4 device naming conventions. For more information about the SunOS release 5.4 device naming conventions, see "Device Naming Conventions" on page 65.
- The fsck command performs faster consistency checks at mount time. In addition, the SunOS release 5.4 software does not require you to reboot the system after running fsck on the root and /usr file systems. This results in faster system start up compared to previous SunOS releases. The fsck -m command enables you to skip checking for file systems that are clean. See man Pages(1): User Commands for additional details.
Backing Up and Restoring Files
- This section discusses the changes to backup and restore commands between SunOS release 4.x and SunOS release 5.4 and describes how to use ufsdump, ufsrestore, dd, tar, and cpio commands.
- SunOS release 4.x supported several utilities for backing up and restoring files: dump, restore, tar, cpio, dd, and bar, as well as the unbundled Backup CoPilot program. This release supports all of these utilities except bar and Backup CoPilot. SunOS release 4.x bar files can be restored on a SunOS release 5.4 system, but you cannot create new bar files. The dump(8) and restore(8) commands were renamed ufsdump(1M) and ufsrestore(1M). Files created with the SunOS release 4.x dump command can be restored on a SunOS release 5.4 system with ufsrestore.
- SunOS release 5.4 has two additional utilities for copying file systems: volcopy(1M) and labelit(1M).
The ufsdump Command
- The ufsdump command accepts the same command syntax as the SunOS release 4.x dump command. ufsdump also accepts options listed in Table 9-15.
-
Table 9-15 ufsdumpdump
| Option | Function |
| -l | Autoload. When reaching the end of a tape (before completing the dump), take the drive off line and wait up to two minutes for the tape drive to be ready again. This gives autoloading (stackloader) tape drives a chance to load a new tape. If the drive is ready within two minutes, continue. If it is not ready after two minutes, prompt an operator to load another tape, as usual, and wait. |
| -o | Off line. When finished with a tape or diskette (completing the dump or reaching the end of the medium), take the drive off line. In the case of a diskette drive, also eject the diskette. In the case of a tape drive, also rewind the tape. This prevents another process that rushes in to use the drive from inadvertently converting the data. |
| -S | Estimate size of dump. Determine the amount of space that is needed to perform the dump, without actually doing it, and output a single number indicating the estimated size of the dump in bytes. This is most useful for incremental backups. |
- Unlike dump, ufsdump can detect the end of medium, so it is no longer necessary to use the -s size option to force dump programs to move to the next tape before reaching the end. Nevertheless, to ensure compatibility with older versions of the restore command, the -s option has been retained in ufsdump.
- Even though ufsdump now can detect the end of medium, it has no way to predict the number of diskettes or tapes needed for a dump--unless you specify the medium size with the -s option. Therefore, the messages displayed at the start of a backup do not indicate the number of diskettes or tapes required, unless you have specified the medium size.
- The -w and -W options behave a little differently in SunOS release 5.4. In SunOS release 4.x, these options list all file systems that are scheduled for backup according to the backup frequencies specified in the /etc/fstab file. Since the SunOS release 5.4 equivalent file, /etc/vfstab, has no provision for
- specifying backup frequencies, these options now assume that each file system will be backed up daily. Therefore, they now list any file systems that have not been backed up within a day.
- When performing backups across the network (backing up local file systems to a remote tape drive), use the device naming convention that's appropriate for the system with the tape drive. If the system with the tape drive is a SunOS release 5.4 system, use the device naming convention to identify the tape drive; otherwise, use the SunOS release 4.x convention.
The ufsrestore Command
- The ufsrestore command in SunOS release 5.4 is similar to the restore command in SunOS release 4.x. You will be able to restore all of your old backups made with the SunOS release 4.x dump command, with one exception: you cannot restore multi volume backups from diskette. If you have backup scripts that invoke restore, change them to invoke ufsrestore instead.
The dd Command
- In the SunOS release 4.x version of the dd command, the size suffix w (words) denotes a size unit of 4 bytes. In the SunOS release 5.4 version, w denotes a unit of 2 bytes. In addition, the SunOS release 5.4 version now supports the unblock and block conversion options.
tar and cpio Commands
- Because they use a nonbinary format, the tar and cpio commands are the only utilities to successfully interchange data between SVR4 implementations. Other backup utilities, such as ufsdump and dd, are unique to the vendor, and are not guaranteed to work successfully from one SVR4 implementation to another.
- The tar command is unchanged in this release; it accepts the same options and command syntax as the SunOS release 4.x command. However, since the device naming scheme has changed in SunOS release 5.4, the tarfile (or device)
- argument is affected. When using the f function modifier, specify the device argument as /dev/rmt/unit, where unit is a tape drive number and density. Table 9-16 shows the tape drive density characters in tape device names.
-
Table 9-16
| Density | Description |
| Null | Default "preferred" (highest) density |
| l | Low |
| m | Medium |
| h | High |
| c | Compressed |
| u | Ultra |
- The tar command no longer uses /dev/rmt8 as its default output device. When the f modifier is not used, and the TAPE environment variable is not set, the tar command uses the defaults set in the /etc/default/tar file.
- The SunOS release 5.4 cpio command supports the SunOS release 4.x options and command syntax. cpio has been expanded to include many new options as shown in Table 9-17.
-
Table 9-17 cpio
| Option | Command Available 1 With Option | Description |
| -A | cpio -o | Appends files to an archive |
| -k | cpio -i | Attempts to skip corrupt file headers and I/O errors encountered. This option lets you copy files from a medium that is corrupted or out of sequence. |
| -L | cpio -o or cpio -p | Follows symbolic links |
| -V | cpio -i, cpio -o, or
cpio -p | Special verbose. Prints a dot for each
file read or written. This option assures
you that cpio is working, without
printing all file names. |
-
Table 9-17 cpio
| Option | Command Available 1 With Option | Description |
| -C bufsize | cpio -i or cpio -o | Blocks I/O bufsize bytes to the record, where bufsize is a positive integer. When neither -C nor -B is specified, the default buffer size is 512 bytes. |
| -E filename | cpio -i | Specifies and inputs file containing a list of file names to be extracted from the archive |
| -H header | cpio -i or cpio -o | Reads or writes header information in header format. header can be one of: bar (read only), crc, CRC, odc, tar, TAR, ustar, or USTAR. |
| -I filename | cpio -i | Reads filename as an input archive |
| -M message | cpio -i -I filename orcpio -o -O filename | Define a message to use when switching media |
| -O filename | cpio -o | Directs the output to filename |
| -R userid | cpio -i or cpio -p | Reassigns ownership and group information for each file to userid |
- 1. cpio requires one of three mutually exclusive options to specify the action to take: -i (copy in), -o (copy out), or -p (pass).
|
|