SUPER-UX does not allow expansion of a file system size. This can cause insufficient disk space in a file system, although other file systems may have free space. When disk space is insufficient, the system administrator can examine disk space and file system use.
The following tasks should be done to investigate disk use.
Example:
The -t option causes all allocated blocks and inodes to be displayed, including free blocks and inodes. When a file system is not specified, information about all mounted file systems is displayed.
A combination of the tail(1) and mv(1) commands can be used to keep files at an acceptable size.
Example:
tail -50 /var/adm/sulog > /tmp/sulog
mv /tmp/sulog /var/adm/sulogThis sequence puts the last 50 lines of /var/adm/sulog into a temporary file and moves the temporary file to /var/adm/sulog.
Example:
find /usr -type f -size +50 -print > /tmp/bigfiles &
| Home |
|---|
Example:
du /usr/home
Example:
find /usr -type f -mtime +60 -print > /tmp/deadfiles &
The fsstat(1M), fsck(1M), and fsdb(1M) commands check and repair file systems. fsstat returns a code for each file system and indicates whether the fsck program, which provides consistency checking and repair, should be run. fsdb displays the contents of the file system and forces a change of data in the file system.
The fsck command checks and repairs inconsistencies in a file system. Except for the root file system, a file system should be unmounted while it is being checked. The root file system should be checked only when the computer is in single-user mode and no other activity is taking place on the computer.
When the virtual volume has a reallocation attribute, fsck invokes alcck(1M) to check it. When the file system is SFS/H, fsck invokes hfsck(1M).
The following is the format of the fsck command:
Table 6-1 describes the fsck command options.
| Option | Description |
|---|---|
| -y | Specifies a "yes" response for all questions. This is the normal choice when the command is run as part of a shell procedure. It causes fsck to try to correct all errors. |
| -n | Specifies a "no" response for all questions. fsck does not write the file system. |
| -b | Reboot the system if the file system being checked is the root (/) file system and changes have been made by fsck. If only minor fixable damage is found, the system is remounted. |
| -s | Specifies an unconditional reconstruction of the free list. Following reconstruction, reboot the system so that in-core copy of the superblock is updated (see the -b option). |
| -S | Specifies a conditional reconstruction of the free list, which is to be done only if corruption is detected. |
| -tfile | Specifies a scratch file to be used if the file system check requires additional memory. If this option is not specified, the process asks for a file name when more memory is needed. |
| -q | Specifies a "quiet" file system check. Output messages from the process are suppressed. |
| -D | Checks directories for bad blocks. This option is used to check file systems for damage after a system crash. |
| -f | Specifies that a fast file system check be done. Only Phase 1 (check blocks and size) and Phase 5 (check free list) are executed for a fast check. Phase 6 (reconstruct free list) is run only if necessary. |
| -e | Does not say "OKAY" in the state field in the superblock if an error could not be repaired successfully. |
| -o | Omits alcck(1M) and hfsck(1M). If this option is omitted, alcck(1M) and hfsck(1M) are invoked as necessary. |
| -m | Continues checking of the file system even if the MAGIC number on the superblock is wrong. If this option is not specified and the MAGIC number is wrong, fsck does not check the file system. |
| fsdevice | Names the special device file associated with a file system. If no device name is specified, fsck checks all file systems named in /etc/checklist. |
| Home |
|---|
The following examples show fsck checking the root file system and the user file system. No options are specified. The system response means that no inconsistencies were detected. The command operates in phases, some of which are run only if required or in response to a command line option. As each phase is completed, a message is displayed. At the end of the program a summary message is displayed showing the number of files (inodes), blocks, and free clusters.
Example 1:
# fsck -n /dev/dsk/000 /dev/dsk/000 File System: root Volume: root ** FSCK Phase 1-Check Blocks and Sizes ** FSCK Phase 2-Check Pathnames ** FSCK Phase 3-Check Connectivity ** FSCK Phase 4-Check Reference Counts ** FSCK Phase 5-Check Free List 7732 files 68838 blocks 1242 free #
| Home |
|---|
Example 2:
# fsck -n /dev/rdsk/010 /dev/rdsk/010 File System: Volume: ** FSCK Phase 1-Check Blocks and Sizes ** FSCK Phase 2-Check Pathnames ** FSCK Phase 3-Check Connectivity ** FSCK Phase 4-Check Reference Counts ** FSCK Phase 4b-Check ACL Bit Map ** FSCK Phase 5-Check Free List ** FSCK Phase 5b-Check Free ACL List 1092 files 7996 clusters 171817 free #
This section reviews the components of the SFS and describes the consistency checks applied to them.
If errors are found, fsck(1M) can optionally repair the problem as described in the following paragraphs.
A check is made to see that all clusters in the file system are found.
The first free-cluster list is in the superblock. The fsck(1M) program checks the list count for a value of less than 0 or greater than 893. It also checks each cluster number to make sure it is within the range bounded by the first and last data cluster in the file system. Each cluster number is compared to a list of previously allocated blocks. If the last flag is not on, the next free cluster is read and the process is repeated.
When all clusters have been accounted for, a check is made to see if the number of clusters in the free-cluster list plus the number of clusters claimed by the inodes equals the total number of clusters in the file system. If anything is wrong with the free-cluster list, fsck(1M) can rebuild it leaving out previously allocated blocks.
| Home |
|---|
If an inode is not one of these types, it is invalid. Inodes can be in one of three states: unallocated, allocated, and partially allocated. This last state includes all incorrectly formatted inodes. For example, an inode can reach this state if bad data is written into the inode list as a result of hardware failure. The only corrective action fsck(1M) can take is to clear the inode.
If the link count stored in the inode and the actual link count determined by fsck(1M) do not agree, the reason may be one of the following.
| Home |
|---|
While there is not enough information available to determine which inode is in error, most often the inode with the latest modification time is correct.
A large number of duplicate clusters in an inode can be caused by an indirect cluster not being written to the file system. fsck(1M) clears both inodes after prompting for permission.
If there are many bad cluster numbers for an inode, an indirect cluster might not have been written to the file system. fsck(1M) clears the inode after prompting for permission.
| A bad cluster number in a file system is not the same as a bad (unreadable) cluster on a hard disk. |
If the directory size is not a multiple of 64, fsck(1M) warns of directory misalignment. This is only a warning because not enough information can be gathered to correct the misalignment.
For a regular file, a rough check of the consistency of the size field of an inode can be performed. This is done by using the number of bytes shown in the size field to calculate how many clusters should be associated with the inode, and comparing that to the actual number of clusters claimed by the inode.
If the actual number of clusters does not match the computed number of clusters, fsck(1M) warns of a possible file-size error. This is only a warning. A check of the file is required to tell whether the error is real or not.
These consistency checks are described under "Duplicate Clusters'' and "Bad Cluster Numbers" in this section.\\
| Home |
|---|
If the directory inode numbers for "." and ".." are incorrect, fsck(1M) replaces them with the correct values.
| Home |
|---|
fsdb is a file system debugger used to repair the file system. fsdb changes the contents of specified addresses to specified values. Therefore, fsdb can repair a file system that fsck cannot.
fsdb is fully described in the SUPER-UX System Administrator's Reference Manual. This section describes the essential aspects of fsdb.
The format of the fsdb command is as follows:
fsdb (-) special
special is the name of a special device file for the file system.
fsdb recognizes certain symbols and maintains a value called the current address, which points to a certain position in the file system. All displays and changes to data are made at this current address.
The main functions of fsdb are as follows:
The operators and symbols shown in Table 6-2 can be used to change the current address. Numbers are considered decimal by default. Octal numbers must be prefixed with a zero.
| Symbol | Description |
|---|---|
| number | fsdb treats the number as the absolute byte address of the file system. |
| [number]b | fsdb treats the number as a block number of the file system. If the number is omitted, the content in the current address is treated as the block number. |
| [number]C | fsdb treats the number as a cluster number of the file system. If the number is omitted, the content in the current address is treated as the cluster number. |
| [number]i | fsdb treats the number as an inode number. That inode is located and the current address is set to the top of this inode. If the number is omitted, the same number as the current location is assumed. |
| +[number] | fsdb adds a specified number to the current address (or inode). The base of number is the present data type. |
| -[number] | fsdb subtracts a specified number from current address (or inode). The base of number is the present data type. |
| Carriage return | fsdb advances the current address in the data type (word, inode, directory entry) and displays the content of current. |
| mnemonic | fsdb locates the current address on a specified mnemonic of inode or directory entry. |
The results of some commands, such as displaying the contents of the current address, cause the current address to be changed to the address just beyond the end of the object displayed. For example, when fsdb displays a block's contents as short words (2 bytes), the current address points to the block's last 2 bytes.
| Home |
|---|
The p and f options display the contents of the current address. The display format is specified as described in Table 6-3.
| Option | Description |
|---|---|
| p[number] | Prints the contents after the current address for the specified format option number. For example, p4o prints four words (8 bytes) of data at the current address. The base of the number is different according to the option. If the number is 0, the contents of one block that contains the current address are printed. If the number is not specified, it is 1. |
| f[number] | Prints the data cluster contents associated with the current inode. number indicates the current inode's logical cluster number. If number is not specified, fsdb regards it as 0. One cluster contents is printed in the specified format. |
| Home |
|---|
Table 6-4 describes the print options.
| Option | Description |
|---|---|
| i | Print as inodes. It is necessary to locate the current address in the inode list block. |
| d | Print as a directory entry. It is necessary to locate the current address in the data cluster associated with the directory inode. |
| o | Print as octal short words (2 bytes). |
| e | Print as decimal short words (2 bytes). |
| c | Print as characters (1 byte). |
| b | Print as octal bytes (1 byte). |
The user can change the contents of the current address using equal-sign operators. The denominations depend on the present data type. A number is decimal by default. Octal numbers must be prefixed with a zero.
Table 6-5 describes the equal-sign operators that affect a current's content.
| Operator | Description |
|---|---|
| =number | Assign number to current's location. |
| =+number | Increments number at current address to number. |
| =-number | Decrements number at current address to number. |
| ="string | Assign string to current's location. |
Miscellaneous fsdb functions are described in the following paragraphs.
| Home |
|---|
| Symbol | Description |
|---|---|
| B | Change to byte mode |
| W | Change to word (short word) mode |
| D | Change to double (long word) mode |
| L | Change to long (long word) mode |
| Symbol | Description |
|---|---|
| d number | The current address is located in the directory entry that is in the specified slot number, and the directory entry contents are displayed. |
| nm | The name of the directory entry. |
| Symbol | Description |
|---|---|
| md | Mode |
| ln | Link count |
| uid | User ID |
| gid | Group ID |
| sz | File size |
| a# | Data block number |
| at | File access time |
| mt | File modification time |
| ct | Inode modification time |
| maj | Major device number |
| min | Minor device number |
| Symbol | Description |
|---|---|
| > | Save the current. |
| < | Restore the current that was last saved. |
Example:
| Home |
|---|
The BSD disk quota system can be used as a resource management system for file use. In this system, every user is validated for file system use capacity. For details, see the SUPER-UX System Administrator's Guide.
During SUPER-UX system booting, local file systems can be checked and mounted automatically. To check and mount file systems automatically, the file system names must be entered in the /etc/fstab file. For details on the fstab file format, see fstab(4).
The rc2 procedure executes the automatic file system check and mount. rc2 executes S01MOUNTFSYS in the /etc/rc2.d directory, which is linked to MOUNTFSYS in the /etc/init.d directory.
The root file system is checked in the /etc/bcheckrc procedure, which is executed during system initialization. In the /etc/bcheckrc procedure, the fsstat command checks the root file system. If fsstat returns an error, fsck checks and repairs the root file system.
| Home |
|---|
System buffers are used to shorten the response time of a delayed write. Data written into the system buffers is not written to disk immediately. As a result, data in the system buffers can be lost before it is written if the system fails.
To prevent this problem, the write-on-close function of SFS can be used.
This function writes the following information to disk during close processing:
When a program repeatedly opens and closes files, the cost of this feature can be high. To help control this cost, three modes can be selected. The write-on-close mode can be specified for each file system with the mount command. The write-on-close function has the following three modes:
Table 6-10 shows the data written in each mode during the closing of a file.
| Write Process | Synchronous Write Mode | Asynchronous Write Mode | Delayed Write Mode |
|---|---|---|---|
| Superblock | Synchronous write on closing each process | Asynchronous write on closing all processes | On the activation of a sync daemon |
| Inode | Synchronous write on closing each process | Asynchronous write on closing all process | Delayed write |
| File data | Asynchronous write on closing each process | Asynchronous write on closing all processes | Delayed write |
The delayed write mode does not perform writes when a file is closed. As such, the closed file data may not be written to disk. However, if a file is frequently opened or closed, this mode is the fastest.
The asynchronous write mode performs writes when a file is closed and no other processes have that file open.
After the last process that opened the file performs the close process, the write to disk is carried out. However, the close process does not wait for the disk writing process to terminate. Therefore, all data writing processes may not have ended when the close process terminates.
Whenever a process that has opened a file is performing the close process, the synchronous write mode carries out the write to disk. For synchronous write mode, the writing of the superblock and inode terminates when the close process ends. However, the writing of the file data may not end when the close process terminates. Although data consistency in synchronous write mode is high, the overhead for the write-on-close process needs to be considered. Files are repeatedly opened and closed.
The write-on-close function mode can be specified during the file system mount. For details on the mount command write-on-close specification, see the SUPER-UX System Administrator's Reference Manual.
| Home |
|---|
The sync daemon periodically writes system buffer data and file system information to disk. This daemon is created automatically when booting the system. The sync daemon writes the following information to disk:
The BDFLUSHR system parameter defines the interval between daemon start-ups. This value can be changed by the config command.
The management and maintenance of the Intelligent I/O Accelerator Subsystem (IAS) are handled by the devinfo command and the cache daemon.
The devinfo(1M) command obtains system status information, which can be used to manage and maintain virtual volumes.
devinfo provides information about read/write performance, the cache control facility and the reallocation facility.
For further information, see Section 4.9.3.
The data written into MMU is immediately transferred to disk or XM cache. Writing data in the XM cache to disk is delayed. The cache daemon updates the disks asynchronously.
The BDFLUSHR system parameter defines the cache daemon start-up interval. This value can be changed by the config command.
| Home |
|---|
Backup is one of the most important and crucial administration functions. The SUPER-UX operating system provides commands to backup and restore disk data at the following levels:
This section describes the method of backup and restore for each object.
The SUPER-UX operating system supports dump(1M), restore(1M), and 4.3 Berkeley commands, for full file system backup/restore and incremental file system backup/restore.
The dump command provides a system of levels, ranging from 0 to 9. Using the levels, you can specify either a full backup or an incremental backup. When a level 0 dump is specified, dump does a full backup. When you specify a level 1-9 to dump, it does incremental backup (backs up only files that changed since the last dump of a lower level). For example, if you did a "level 2" dump on Monday, followed by a "level 4" dump on Tuesday, a subsequent "level 3" dump on Wednesday would contain all files modified or added since the "level 2" (Monday) backup.
Table 6-11 gives an example backup strategy.
| Date | Level |
|---|---|
| First day of month | 0 |
| From Monday to Thursday | 9 |
| Friday | 5 |
If you use a strategy similar to that shown in Table 6-11 on Friday, files changed since the previous lower level dump (in this case the level 0 dump at the first day of the month) are copied to backup volumes. From Monday to Thursday, all files changed that week (since the level 5 dump was done the previous Friday) are copied. So, if the file system is damaged, you can recover from three different backup volumes. The fourth Friday's dump must save many files.
| Date | Level |
|---|---|
| First day of month | 0 |
| From Monday to Thursday | 9 |
| First Friday | 2 |
| Second Friday | 3 |
| Third Friday | 4 |
| Fourth Friday | 5 |
If you use a strategy similar to that shown in Table 6-12 on Friday, all files changed that week (since the previous lower level dump -- last Friday's dump) are saved. This method reduces the size of the Friday dumps. If the file system is damaged after the fourth Friday dump but before the next level 0 dump, the six restore operations are required: the level 0 dump volume, the level 2 through 5 dumps, and the daily dump volume.
| It is desirable that the dumped file system is unmounted while the dump is executed. If the files in the file system are modified during the dump, the dump command sometimes detects an error or unfortunately aborts. |
You can use the restore(1M) command to recover files from backup volumes created with the dump(1M) command.
| Home |
|---|
The following are some examples of dump(1M) and restore(1M) uses.
# umount /dev/dsk/300 # /etc/dump 0uf /dev/rqt/xxxxx /dev/dsk/300
# umount /dev/dsk/300 # /etc/dump 5uf /dev/rqt/xxxxx /dev/dsk/300
# mkfs /dev/rdsk/300 # mount /dev/dsk/300 /mnt # cd /mnt # /etc/restore rf /dev/rqt/xxxxx # /etc/restore xf /dev/rqt/xxxxx
# cd /mnt # /etc/restore xf /dev/rqt/xxxxx file1 file2 dir3
In addition to dump(1M)/restore(1M), SUPER-UX provides the volcopy(1M) command for full backup.
You can use tar(1) or cpio(1) to back up particular files used in system administration, such as account files and user home directories. This section shows an example of the tar(1) command use, which copies some files and directories to the tape controller.
Example 1 -- copying all the files in directory "dir1" to tape:
Example 2 -- recovering files and directories from tape to current directory:
See the SUPER-UX System Administrator's Reference Manual and the SUPER-UX User's Reference Manual for details of each command.
During system operation, if trouble occurs in XM cache, I/O requests to the virtual volume can result in undefined errors. Therefore, if XM cache trouble occurs, the latest data is lost and data inconsistency occurs. If this happens, immediately unmount the entire virtual volume and reboot the system. In the worst case, normal shutdown may not be possible. In this case, forced rebooting of the system is necessary.
| Home |
|---|
The fsck(1M) command internally calls and executes hfsck(1M) to check the SFS/H file system.
hfsck(1M) is used to check the consistency of the SFS/H file system and eliminate conflicts. hfsck(1M) alone cannot check all items. hfsck(1M) operates in cooperation with fsck(1M). In general, execute fsck(1M) rather than directly executing hfsck(1M).
When the SFS/H file system is consistent, the number of hybrid files, the number of clusters used in the data section, and the number of free clusters are reported. If the file system is inconsistent, it is corrected automatically after prompting the user. In most cases, data is lost to some extent when the file system is corrected.
Example -- executing fsck for the SFS/H file system:
#fsck /dev/rdsk/010
/dev/rdsk/010
** FSCK Phase 1 - Check Blocks and Sizes
** FSCK Phase 2 - Check Pathnames
** FSCK Phase 3 - Check Connectivity
** FSCK Phase 4 - Check Reference Counts
** FSCK Phase 5 - Check Free List
5 CLUSTER (S) MISSING
BAD FREE LIST
SALVAGE? y
** FSCK Phase 6 - Salvage Free List
4 files 1 cluster 23012 free
*** FILE SYSTEM WAS MODIFIED ***
hfsck is checking /dev/rdsk/010
** HFSCK Phase 1 - Check Superblock
FILE SYSTEM WILL BE MODIFIED
CONTINUE? y
INVALID FLAGS - SET HYBRID FLAG
** HFSCK Phase 2 - Check VVTOC
** HFSCK Phase 3 - Check inodes
CLUSTER 1564 IS IN FREELIST
CLUSTER 1565 IS IN FREELIST
CLUSTER 1566 IS IN FREELIST
CLUSTER 1567 IS IN FREELIST
CLUSTER 1568 IS IN FREELIST
2 Hfiles, 2524 clusters, 48677 free
*** SFS/H FILE SYSTEM WAS MODIFIED ***
#
| Home |
|---|
The following restrictions apply to I/O requests for hybrid files created in the SFS/H file system. If any one of the following is not satisfied, I/O performance may deteriorate.
Data in the area that is allocated by lseek(2)/llseek(2) without writing becomes undefined. Similarly, data in the area that is preallocated by fcntl(2) becomes undefined.
The major feature of SFS/H is to make use of the maximum performance of each device by issuing I/O requests based on the cylinder boundary of the device. In order to make this possible, the following points must be noted.
Only up to 1546 clusters can be allocated to one hybrid file. For this reason, when 1080 KB are specified in H-DCLST, the maximum size of the hybrid file is calculated from the following expression:
Keep this in mind when setting the cluster size of the data section.
| Home |
|---|
| Contents | Previous Chapter | Next Chapter | Index |