Text preview for : advfs admin[1].pdf part of muk muki unix/linux
Back to : advfs admin[1].pdf | Home
Tru64 UNIX
AdvFS Administration
Part Number: AA-RH96C-TE
June 2001
Product Version:
Tru64 UNIX Version 5.1A or higher
This manual provides task-based information and instruction for understanding, configuring, troubleshooting, and tuning the AdvFS file system. It is designed primarily for system administrators.
Compaq Computer Corporation Houston, Texas
© 2001 Compaq Computer Corporation COMPAQ, the Compaq logo and TruCluster are registered in the U. S. Patent and Trademark Office. Tru64 is a trademark of Compaq Information Technology Group, L.P. in the United States and other countries. UNIX and Motif are registered trademarks and The Open Group is a trademark of The Open Group in the United States and other countries. Other product names mentioned herein may be the trademarks of their respective companies. Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this publication is subject to change without notice and is provided "as is" without warranty of any kind. The entire risk arising out of the use of this information remains with recipient. In no event shall Compaq be liable for any direct, consequential, incidental, special, punitive, or other damages whatsoever (including without limitation, damages for loss of business profits, business interruption or loss of business information), even if Compaq has been advised of the possibility of such damages. The limited warranties for Compaq products are exclusively set forth in the documentation accompanying such products. Nothing herein should be construed as constituting a further or additional warranty.
Contents
About This Manual 1 Configuring the File System
1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.4 1.5 1.5.1 1.6 1.6.1 1.6.2 1.6.3 1.6.3.1 1.6.3.2 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.7.10 What is AdvFS? . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . License Registration . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . File System Design . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Filesets, Domains, and Volumes . . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Transaction log file . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . File Storage Allocation .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Setting Up an AdvFS File System . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Volumes .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Volume Attributes .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Domains .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Configuring Domains . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . The /etc/fdmns Directory . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Version 5.0 Domains .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Creating a Domain with DVN4 . . .. . .. . .. . .. . . .. . .. . .. . .. . Upgrading a Domain to DVN4 . . . .. . .. . .. . .. . . .. . .. . .. . .. . Displaying Domain Information . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Creating a Domain . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Increasing the Size of a Domain . . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Reducing the Size of a Domain .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Removing a Domain .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Renaming a Domain .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Filesets . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Configuring Filesets .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Designating Filesets in the /etc/fstab File .. . .. . . .. . .. . .. . .. . Displaying Fileset Information .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Creating a Fileset . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Upgrading a Fileset . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Mounting a Fileset . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Unmounting a Fileset . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Removing a Fileset . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Renaming a Fileset . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Changing the Characteristics of a Fileset . .. . .. . . .. . .. . .. . .. . 11 12 12 13 14 14 16 16 17 18 18 19 110 110 110 111 112 114 116 118 118 119 120 121 121 122 123 123 124 124 125 126
Contents iii
1.7.11 AdvFS Fileset Clones . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 1.7.11.1 Creating an AdvFS Fileset Clone . . .. . .. . .. . . .. . .. . .. . .. . 1.7.11.2 Mounting and Unmounting an AdvFS Fileset Clone . 1.7.11.3 Removing an AdvFS Fileset Clone . .. . .. . .. . . .. . .. . .. . .. . 1.7.11.4 Renaming an AdvFS Fileset Clone .. . .. . .. . . .. . .. . .. . .. . 1.8 Setting Up Trashcans .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 1.9 Configuring an AdvFS root File System . .. . .. . .. . .. . . .. . .. . .. . .. . 1.9.1 Mounting the root File System in Single-User Mode .. . .. . 1.9.2 Changing the Name of the root Domain .. . .. . .. . . .. . .. . .. . .. . 1.9.3 Changing the Name of the root Fileset .. . .. . .. . . .. . .. . .. . .. . 1.10 Using AdvFS with LSM . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 1.10.1 Setting Up AdvFS Using LSM Volumes . . .. . .. . . .. . .. . .. . .. . 1.10.2 Using LSM for Data Redundancy .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 1.10.3 Striping LSM Volumes and Striping AdvFS Files . .. . .. . .. .
126 128 128 128 129 129 130 131 131 131 133 134 135 135
2
Managing Quotas
2.1 Introducing Quotas . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.1.1 Quota Limits . . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.1.2 Grace Period .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2 User and Group Quotas . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.1 Quota Files . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.2 Setting Quotas and Grace Periods .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.2.1 Setting User Quotas . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.2.2 Setting the User Grace Period . . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.2.3 Setting Group Quotas . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.2.4 Setting the Group Grace Period . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.3 Setting Quotas for Multiple Users and Groups . . .. . .. . .. . .. . 2.2.3.1 Setting Quotas for Multiple Users . . .. . .. . .. . . .. . .. . .. . .. . 2.2.3.2 Setting Quotas for Multiple Groups .. . .. . .. . . .. . .. . .. . .. . 2.2.4 Verifying File and Disk Space Usage .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.4.1 Printing the Tag and Full Pathname for Each File . .. . 2.2.4.2 Summarizing Fileset Ownership .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.4.3 Displaying Disk Usage and Limits . .. . .. . .. . . .. . .. . .. . .. . 2.2.4.4 Verifying Quota Consistency . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.4.5 Summarizing Quotas by Fileset . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.5 Activating Quotas at System Start-Up . .. . .. . .. . . .. . .. . .. . .. . 2.2.6 Activating Quotas Manually .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.2.7 Deactivating Quotas .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.3 Fileset Quotas . . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.3.1 Quota Files . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 2.3.2 Setting Quotas and Grace Periods .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 21 22 23 24 24 25 26 27 28 28 29 210 210 211 212 212 212 213 214 215 216 217 217 217 217
iv Contents
2.3.2.1 2.3.2.2 2.3.3 2.3.4 2.3.4.1 2.3.4.2 2.3.4.3 2.3.4.4 2.3.5 2.3.6
Setting Fileset Quotas .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Setting the Grace Period .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Setting Quotas for Multiple Filesets . .. . .. . .. . .. . . .. . .. . .. . .. . Verifying File and Disk Space Usage .. . .. . .. . .. . . .. . .. . .. . .. . Displaying Fileset Space .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Displaying Fileset Limits . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Displaying Domain Space . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Displaying Domain and Fileset Space .. . .. . . .. . .. . .. . .. . Activating Quotas .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Deactivating Quotas .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. .
218 219 220 220 220 221 222 222 223 223
3
Backing Up and Restoring Data
3.1 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.2.10 3.3 3.4 3.5 3.5.1 3.5.2 3.5.3 3.5.4 3.6 Overview . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Backing Up Data .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Unique Features of the vdump Command .. . .. . . .. . .. . .. . .. . Backup Level . . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping to Tape . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping to Standard Output . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping Subdirectories . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping to a File or Disk Partition . .. . .. . .. . .. . . .. . .. . .. . .. . Compressing Savesets . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping with Error Protection .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Listing Saved Files . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Dumping and Restoring Files Remotely .. . .. . .. . . .. . .. . .. . .. . Cloning for Online Backup .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Cloning to Back Up Databases . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Restoring Data . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Unique Features of the vrestore Command . . .. . . .. . .. . .. . .. . Restoring Files . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Restoring Quotas . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Restoring from a Tape with Many Savesets . .. . . .. . .. . .. . .. . AdvFS and NetWorker . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 31 32 32 33 33 33 34 34 35 35 36 36 36 37 38 38 38 39 39 39
4
Optimizing and Tuning the AdvFS File System
4.1 4.2 4.3 4.4 4.4.1 4.4.2 Monitoring Performance .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Improving Performance by Disabling the Frag File . .. . .. . .. . .. . Improving Transaction Log File Performance .. . .. . . .. . .. . .. . .. . Improving Data Consistency . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Asynchronous I/O .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Asynchronous Atomic-Write Data Logging I/O . . .. . .. . .. . .. . 41 42 43 45 45 46
Contents v
4.4.2.1 4.4.2.2 4.4.3 4.4.4 4.5 4.6 4.7 4.8 4.8.1 4.8.2 4.9 4.10 4.10.1 4.10.2 4.11 4.12 4.12.1 4.12.2 4.13 4.13.1 4.13.2 4.13.3 4.14
Persistent Atomic-Write Data Logging . . .. . . .. . .. . .. . .. . Temporary Atomic-Write Data Logging . . .. . . .. . .. . .. . .. . Synchronous I/O . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Synchronous Atomic-Write Data Logging I/O . . . .. . .. . .. . .. . Data Cache Tuning .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Improving Data Transfer Rate with Direct I/O . . .. . . .. . .. . .. . .. . Changing Attributes to Improve System Performance .. . .. . .. . Defragmenting a Domain . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Choosing to Defragment . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Defragmenting Example . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Defragmenting a File . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Balancing a Multivolume Domain . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Choosing to Balance .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Balance Example . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Moving Filesets to Different Volumes .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Migrating Files to Different Volumes . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Choosing to Migrate .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Migrate Example . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Striping Files .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Choosing to Use AdvFS Striping on a File .. . .. . . .. . .. . .. . .. . AdvFS Stripe Example . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Removing AdvFS Striping .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Controlling Domain Panic Information . . . .. . .. . .. . .. . . .. . .. . .. . .. .
47 47 48 48 48 49 410 411 412 413 414 415 416 416 417 418 419 419 420 421 421 422 422
5
Troubleshooting
5.1 5.2 5.2.1 5.2.2 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.4 5.4.1 5.4.2 5.5 5.6 5.7 Checking Free Space and Disk Usage .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Preventative Maintenance . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Failing Disks .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Verifying File System Consistency . . . .. . .. . .. . .. . . .. . .. . .. . .. . Increasing the Size of an AdvFS root Domain . .. . .. . . .. . .. . .. . .. . Installing a New Disk for the root Domain . . .. . . .. . .. . .. . .. . Configuring a Device for Use as the root Volume . . .. . .. . .. . Backing up the Current root Domain .. . .. . .. . .. . . .. . .. . .. . .. . Recreating the root Domain on a Different Volume .. . .. . .. . Disk File Structure Incompatibility .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Utility Incompatibility . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Avoiding Metadata Incompatibility . . .. . .. . .. . .. . . .. . .. . .. . .. . Memory Mapping, Direct I/O, and Data Logging Incompatibility . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Invalid or Corrupt Saveset Format .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Improving Poor Performance . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 51 52 52 52 54 55 56 57 57 510 510 511 511 511 512
vi Contents
5.8 Fixing Disk Problems .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.1 Reusing Space . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.2 Limiting Disk Space Usage . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.3 Fixing On-Disk Metadata Corruptions . .. . .. . .. . . .. . .. . .. . .. . 5.8.4 Recovering File Data from a Corrupted Domain .. . .. . .. . .. . 5.8.4.1 Salvaging Data to Disk . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.4.2 Salvaging Data to Tape . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.4.3 Salvaging Data from a Corrupted root Domain . . .. . .. . 5.8.4.4 Salvaging Data Block by Block . . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.5 "Can't Clear a Bit Twice" Error Message . . .. . .. . . .. . .. . .. . .. . 5.8.6 Recovering from a Domain Panic . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.8.7 Recovering from Filesets That are Mounted Read-Only .. . 5.9 Restoring the /etc/fdmns Directory . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.9.1 Reconstructing the /etc/fdmns Directory Manually .. . .. . .. . 5.9.2 Reconstructing the /etc/fdmns Directory Using advscan .. . 5.10 Recovering from Corruption of a Domain .. . .. . .. . .. . . .. . .. . .. . .. . 5.11 Recovering from Corruption of an AdvFS root Domain . . .. . .. . 5.11.1 Identifying the Hardware Resources . .. . .. . .. . .. . . .. . .. . .. . .. . 5.11.1.1 SRM Console Names for CD-ROM Drive or Network Interface Device .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.11.1.2 SRM Console Boot Device Name . .. . .. . .. . .. . . .. . .. . .. . .. . 5.11.1.3 UNIX Device Names . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.11.2 Applying the Procedure . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.12 Restoring a Multivolume usr Domain .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.13 Recovering from a System Crash .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.13.1 Saving Copies of System Metadata . . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.13.2 Physically Moving an AdvFS Disk . . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.13.3 Log File Inconsistency . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 5.13.4 Recovering from Problems Removing Volumes . . .. . .. . .. . .. .
513 514 514 515 515 516 517 519 520 521 521 523 524 525 525 530 531 532 532 532 533 534 536 538 538 538 540 540
A B
Accessing File System Information with the SysMan Menu AdvFS Commands
B.1 B.2 B.3 AdvFS Base System Commands . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Utilities Commands .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Comparison of AdvFS and UFS Commands .. . .. . .. . . .. . .. . .. . .. . B1 B3 B4
C
Converting File Systems
C.1 C.1.1 Converting a /usr File System to AdvFS . .. . .. . .. . .. . . .. . .. . .. . .. . Using a Backup Tape . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . C1 C1
Contents vii
C.1.2 C.1.3 C.2 C.3 C.3.1 C.3.2 C.3.3 C.3.4 C.4 C.4.1 C.4.2
Using an Intermediate File . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Using a Second Disk .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Converting the root File System to AdvFS . . .. . .. . .. . . .. . .. . .. . .. . Converting a Data File System to AdvFS .. . .. . .. . .. . . .. . .. . .. . .. . Using a Backup Tape . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Using an Intermediate File . . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Using a Second Disk .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Using a Second System . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Converting from AdvFS to UFS . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Converting the root File System to UFS . . .. . .. . . .. . .. . .. . .. . Converting a Fileset to UFS . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. .
C3 C4 C5 C7 C7 C9 C10 C11 C12 C13 C14
D
Graphical User Interfaces
D.1 D.2 D.2.1 D.2.2 D.2.2.1 D.2.2.2 D.2.2.3 D.2.2.4 D.2.2.5 D.2.2.6 D.3 D.3.1 D.3.2 D.3.3 D.4 D.4.1 D.4.1.1 D.4.1.2 D.4.1.3 D.4.1.4 D.4.1.5 D.4.2 D.4.2.1 D.4.2.2 D.4.2.3 D.4.2.4 D.4.2.5 D.4.2.6 D.4.2.7 Installing the AdvFS GUI . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Components of the GUI . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . GUI Agent (advfsd) . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS GUI (dtadvfs) . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . GUI Security . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Ignoring Disks . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Log Files .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Help . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Monitoring Remote File Systems .. . .. . .. . .. . . .. . .. . .. . .. . Managing LSM Volumes .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Displaying File System Information . . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Choosing Units for Displaying Information . . .. . . .. . .. . .. . .. . Main Window . . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Devices and Volumes Window . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Performing File System Operations . . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Operations on a Domain . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Creating a Domain .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Setting a Free Space Alert for a Domain .. . . .. . .. . .. . .. . Enlarging a Domain . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Removing a Domain .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Renaming a Domain . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Operations on a Fileset . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Creating a Fileset . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Mounting a Fileset . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Unmounting a Fileset .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Setting a Free Space Alert for a Fileset . . .. . . .. . .. . .. . .. . Setting Fileset Quotas .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Removing a Fileset . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Renaming a Fileset .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D1 D2 D2 D3 D3 D4 D4 D5 D5 D5 D6 D7 D7 D8 D8 D8 D8 D9 D9 D10 D11 D11 D11 D12 D12 D13 D13 D13 D14
viii Contents
D.4.3 Operations on an AdvFS Fileset Clone . .. . .. . .. . . .. . .. . .. . .. . D.4.3.1 Creating an AdvFS Fileset Clone .. . .. . .. . .. . . .. . .. . .. . .. . D.4.3.2 Mounting a Clone . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.3.3 Unmounting a Clone . . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.3.4 Removing a Clone . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.4 Operations on a Volume .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.4.1 Setting a Free Space Alert for a Volume . .. . . .. . .. . .. . .. . D.4.4.2 Adding a Volume . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.4.3 Removing a Volume .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.5 Maintaining AdvFS . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.4.5.1 Balancing a Multivolume Domain . . .. . .. . .. . . .. . .. . .. . .. . D.4.5.2 Defragmenting a Domain . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . D.5 GUI Operation . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. .
D14 D14 D15 D15 D15 D16 D16 D16 D16 D17 D17 D17 D18
E Using Controller-Based Cloning and Snapshotting Glossary Index Figures
11 12 13 14 41 42 AdvFS File System Design . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Single-Volume Domain . . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Enlarging a Domain . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Cloning a Fileset .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Balancing a Domain . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Migrating Files . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 13 112 114 127 415 418
Tables
11 21 22 51 52 53 54 B1 Trashcan Commands . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Quota Size Limits . . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . User and Group Usage Commands .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Disk Space Usage Commands .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Fileset Anomalies and Corrections - Links Not Equal . .. . .. . .. . Fileset Anomalies and Corrections - Domain Volume Count Not Equal . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Fileset Anomalies and Corrections - Number of Partitions Not Equal . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Configuration Commands . . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . 129 22 211 51 527 528 528 B1
Contents ix
B2 B3 B4 B5 B6 B7 B8 D1 D2 D3
AdvFS Information Display Commands . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Backup Commands . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Check and Repair Commands .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Quota Commands . . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Disk Structure Commands . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . AdvFS Utilities Commands .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Comparison of AdvFS and UFS Commands .. . .. . .. . . .. . .. . .. . .. . AdvFS GUI Subsets . . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. . Disk Space Requirements for the AdvFS GUI .. . .. . . .. . .. . .. . .. . GUI Troubleshooting . .. . .. . . .. . .. . .. . .. . .. . . .. . .. . .. . .. . . .. . .. . .. . .. .
B1 B2 B2 B2 B3 B3 B4 D1 D2 D18
x Contents
About This Manual
This manual provides task-based information and instruction for understanding, configuring, troubleshooting, and tuning the Advanced File System (AdvFS) file system. AdvFS is the default file system for the Compaq Tru64TM UNIX operating system. For hardware and software requirements, see the Tru64 UNIX Software Product Description (SPD). AdvFS Utilities is a separately licensed product that provides additional file management capabilities and graphical user interfaces to simplify system administration. Logical Storage Manager Storage Administrator (LSMSA) provides a java-based graphical interface for managing LSM objects and the AdvFS file system (see Logical Storage Manager). The AdvFS GUI, which runs under the Common Desktop Environment (CDE), lets you perform AdvFS operations in a graphical environment.
Audience
This manual is designed primarily for system administrators. It describes the AdvFS file system and AdvFS Utilities. Administrators and programmers who are familiar with other UNIX systems can use this manual as a teaching guide for the AdvFS file system.
New and Changed Features
This manual documents the following features that are new in AdvFS in Version 5.1A: · · · A new domain recovery tool, fixfdmn, that examines metadata corruption (see Section 5.8.3). A new mount option for temporary atomic-write data logging for a file (see Section 4.4). Optional object safety (object reuse) protection. Pages on disk belonging to a fileset can be zero-filled and forced to disk before they are available to the file (see Section 1.7.10). The ability to turn frag files on and off by using the mkfset and chfsets commands (see Section 4.2).
·
The following features were added to AdvFS in previous Version 5 releases: · AdvFS cache tuning is done through the UBC parameters (see Section 4.5).
About This Manual xi
· · · · · · · · · ·
Improved disk structure that increases the number of files the domain can track (see Section 1.6.3) A disk salvage utility that can recover information at the block level from disks that have been damaged (see Section 5.8.4) An improved directory structure that increases the speed of file creation and access (see Section 1.6.3.2) Enhanced vdump and vrestore command capability (see Chapter 3) Remote device support for backup and restore (see Chapter 3) Increased quota limits (see Chapter 2) Direct I/O to allow unbuffered, synchronous I/O (see Section 4.6) Smooth sync option to promote continuous I/O (see Section 4.7) New utilities (such as vdf, which displays disk usage for domains and filesets) (see Section 2.3.4.4) Metadata display utilities (see Section 5.13.1)
You can review all documentation for all releases at http://www.tru64unix.compaq.com/docs/ Also at this site you can view the Technical Updates for any information not included in the documentation provided with your media.
Organization
This manual is organized as follows:
Chapter 1 Describes the volumes, domains, and filesets that make up the AdvFS file system and provides information for configuring the system Explains user and group quotas as well as fileset quotas, which are unique to the AdvFS file system Provides directions for backing up and restoring data Provides guidelines for optimizing and tuning your AdvFS file system Provides information to help you troubleshoot problems with your AdvFS file system Explains the use of the SysMan menu Lists all the AdvFS commands and compares them with UFS commands Provides an explanation and sample code for converting a file system to AdvFS
Chapter 2 Chapter 3 Chapter 4 Chapter 5 Appendix A Appendix B Appendix C
xii About This Manual
Appendix D Appendix E
Describes the AdvFS Graphical User Interface Describes using controller-based cloning and snapshotting
Related Documentation
Other useful documentation includes: · · · · · · System Administration describes the tasks you perform to administer the operating system running on a workstation or server. The Installation Guide describes how to install your operating system software. Logical Storage Manager provides information on storage management. The Programmer's Guide describes the development environment of the Tru64 UNIX operating system. The Technical Overview provides a brief overview of Tru64 UNIX and its components. Software License Management describes how to use the License Management Facility (LMF) to manage software licenses on a Tru64 UNIX system. System Configuration and Tuning provides information on system performance tuning and advanced kernel configuration. Cluster Administration describes how to manage systems that run TruCluster software. Best Practice documentation illustrates the optimal way to perform common administrative tasks. · System Limits, Release Notes, Software Product Descriptions for Tru64 UNIX and AdvFS Utilities, Best Practices, and other documentation are also available.
· ·
The Documentation Overview provides information on all of the books in the Tru64 UNIX documentation set. The Tru64 UNIX documentation is available on the World Wide Web at the following URL:
http://www.tru64unix.compaq.com/docs/
Icons on Tru64 UNIX Printed Books The printed version of the Tru64 UNIX documentation uses letter icons on the spines of the books to help specific audiences quickly find the books that
About This Manual xiii
meet their needs. (You can order the printed documentation from Compaq.) The following list describes this convention:
G S P D R Books for general users Books for system and network administrators Books for programmers Books for device driver writers Books for reference page users
Some books in the documentation help meet the needs of several audiences. For example, the information in some system books is also used by programmers. Keep this in mind when searching for information on specific topics. http://www.tru64unix.compaq.com/docs/ provides information on all of the books in the Tru64 UNIX documentation set.
Reader's Comments
Compaq welcomes any comments and suggestions you have on this and other Tru64 UNIX manuals. You can send your comments in the following ways: · · Fax: 603-884-0120 Attn: UBPG Publications, ZKO3-3/Y32 Internet electronic mail: [email protected] A Reader's Comment form is located on your system in the following location: /usr/doc/readers_comment.txt Please include the following information along with your comments: · · · · The full title of the manual and the order number. (The order number appears on the title page of printed and PDF versions of a manual.) The section numbers and page numbers of the information on which you are commenting. The version of Tru64 UNIX that you are using. If known, the type of processor that is running the Tru64 UNIX software.
The Tru64 UNIX Publications group cannot respond to system problems or technical support inquiries. Please address technical questions to your local system vendor or to the appropriate Compaq technical support office. Information provided with the software media explains how to send problem reports to Compaq.
xiv About This Manual
Conventions
This guide uses the following conventions: # % cat A number sign represents the superuser prompt. Boldface type in interactive examples indicates typed user input. Italic (slanted) type indicates variable values, placeholders, and function argument names. In syntax definitions, brackets indicate items that are optional and braces indicate items that are required. Vertical bars separating items inside brackets or braces indicate that you choose one item from among those listed. In syntax definitions, a horizontal ellipsis indicates that the preceding item can be repeated one or more times. A cross-reference to a reference page includes the appropriate section number in parentheses. For example, cat(1) indicates that you can find information on the cat command in Section 1 of the reference pages. This symbol indicates that you hold down the first named key while pressing the key that follows the slash.
file
[ |] { | }
...
cat(1)
Ctrl/x
About This Manual xv
1
Configuring the File System
The Advanced File System (AdvFS) is the default file system for the Compaq Tru64 UNIX operating system. This chapter introduces the file system and explains how to configure and AdvFS root file system: · · · · · · · · · · Section 1.1 compares AdvFS with UFS. Section 1.2 explains license registration for additional AdvFS functionality. Section 1.3 explains the design and components of an AdvFS file system. Section 1.4 is an overview for setting up the file system. Section 1.5 explains volumes, the storage units of AdvFS. Section 1.6 examines domains, the physical storage layer of the file system. Section 1.7 explains filesets, which form the directory hierarchy of AdvFS. Section 1.8 describes how to set up your system to make deleted files retrievable. Section 1.9 describes how to configure an AdvFS root file system. Section 1.10 introduces the use of LSM with AdvFS.
1.1 What is AdvFS?
The AdvFS file system differs from the traditional UNIX File System (UFS). The UFS model is rigid. Each disk (or disk partition) contains one separate file system; you mount the file system into the logical name space using mount points. The directory hierarchy layer of UFS is bound tightly to the physical storage layer. When a file system becomes full, this tight binding makes it impossible to move selected files onto another disk without changing the full pathnames of those files. The task of dividing a logical directory into directory subtrees and mapping the subtrees onto separate disks requires careful consideration. Even with extensive planning, adjustments to the directory structure are limited with the UFS model.
Configuring the File System
11
In contrast, with AdvFS you can modify your system configuration at any time without shutting down the system. As your system requirements change, AdvFS allows you to easily add or remove storage to meet your requirements. From a user's perspective, AdvFS looks like any other UNIX file system. End users can use the mkdir command to create new directories, the cd command to change directories, and the ls command to list directory contents. AdvFS logical structures, quota controls, and backup capabilities are based on traditional file system design. AdvFS replaces or eliminates several standard commands, such as newfs, dump, restore, and fsck. AdvFS commands and utilities, and a comparison of AdvFS and UFS commands are detailed in Appendix B. Without taking an AdvFS system off line, system administrators can backup, reconfigure, and tune file systems. End users can retrieve their own unintentionally deleted files from predefined trashcan directories or from AdvFS fileset clones without assistance from system administrators. AdvFS supports multivolume file systems, which enables file-level striping (spreading data to more than one volume) to improve file transfer rates for applications that require intensive I/O. Logical Storage Manager (LSM), which allows volume-level striping, can be incorporated into AdvFS configurations.
1.2 License Registration
AdvFS is the file system default on the operating system. AdvFS Utilities is a separately licensed product that provides additional processing capabilities. Before you can use the file system utilities, you must register a license product authorization key (PAK) for AdvFS Utilities. Contact your software support organization for additional information.
1.3 File System Design
The AdvFS file system consists of two distinct layers: the directory hierarchy layer and the physical storage layer. The directory hierarchy layer implements the file-naming scheme and POSIX-compliant functions such as creating and opening files, or reading and writing to files. The physical storage layer implements write-ahead logging, caching, file allocation, and physical disk I/O functions. The decoupled file system structure enables you to manage the physical storage layer apart from the directory hierarchy layer. This means that you can move files between a defined group of disk volumes without changing pathnames for your files. Because the pathnames remain the same, the action is completely transparent to end users.
12 Configuring the File System
AdvFS implements two unique file system concepts: filesets and domains. Filesets and domains enable the two-layer file system structure. Figure 11 is a representation of this structure. Figure 11: AdvFS File System Design
Fileset A
Fileset B
Domain
zs0820
Volume 1 Volume 2 Volume 3
AdvFS can incorporate Logical Storage Manager (LSM) volumes into the file system structure. When AdvFS is configured with LSM, file system reliability and availability improve because AdvFS can take advantage of LSM features (see Section 1.10).
1.3.1 Filesets, Domains, and Volumes
A fileset follows the logical structure of a traditional UNIX file system. It is a hierarchy of directory names and file names, and it is what you mount on your system. AdvFS goes beyond the traditional file system by allowing you to create multiple filesets that share a common pool of storage called a domain. See Section 1.7 for more information about filesets. A domain represents the physical storage layer. It is managed separately from the directory structure. You can add or remove volumes without affecting the directory structure. See Section 1.6 for more information about domains. A volume is any mechanism that behaves like a UNIX block device: an entire disk, a disk partition, or an aggregate volume provided by a logical storage manager (see Section 1.5). When first created, all domains consist of a single volume. If you have the optional AdvFS Utilities (see Section 1.2), you can transform a single-volume domain into a multivolume domain by adding one or more volumes.
Configuring the File System
13
1.3.2 Transaction log file
The AdvFS file system is a log-based file system that employs write-ahead logging to ensure the integrity of the file system. Modifications to the metadata (file system structures) are completely written to a transaction log file before the actual changes are written to disk. The contents of the transaction log file are written to disk at regular intervals. When you create a domain, AdvFS creates a transaction log file for it. During crash recovery, AdvFS reads the transaction log file to confirm file system transactions. All completed transactions are committed to disk and uncompleted transactions are undone. The number of uncommitted records in the log, not the amount of data in the file system, dictates the speed of recovery. This means that recovery usually takes only a few seconds. Traditional UNIX file systems rely on the fsck utility to recover from a system failure. The fsck utility can take hours to check and repair a large file system. By default, only file system structures are logged, but you can choose to log file data and change the way your system writes to storage (see Section 4.4). A file that has data logging turned on remains internally consistent in the event of a system crash. However, enabling data logging can slow system performance.
1.3.3 File Storage Allocation
Files are not static; their space requirements change over time. To maintain contiguous file placement without overallocating space on the disk, AdvFS uses a unique file storage allocation scheme. Key features of file storage allocation are: · Extents An extent is a contiguous area of disk space that AdvFS allocates to a file. Extents are composed of sets of one or more 8 KB pages. When storage is added to a file, it is grouped in extents. There is an extent map for each volume on which the file system resides. File I/O is most efficient when there are few extents. If a file consists of many small extents, it takes more I/O processing to read or write that file. Given the dynamic nature of a file system, the file storage allocation cannot always guarantee contiguous placement of pages. The following factors affect placement: Excessive disk fragmentation When a disk is fragmented there are many small free spaces, so AdvFS writes data to isolated physical pages, based on availability,
14 Configuring the File System
instead of writing to contiguous pages. This might result in files with many extents. Multiple users When there are many users on a system, requests for space increase, decreasing the likelihood of contiguous file allocation. If you have a domain with files containing many extents, you can decrease the number by running the defragment utility (see Section 4.8). · Preallocation Each time a file is appended, AdvFS adds pages to the file by preallocating one-fourth of the file size, up to 16 pages. Excess preallocated space is truncated when the file is closed. For multivolume domains, new files are allocated sequentially across volumes. Volumes that are more than 86% full (allocated) are not used for new file allocation unless all volumes are more than 86% full. When data is appended to existing files, storage is allocated on the volume on which the file was initially allocated until the volume is full. · Fragments AdvFS writes files to disk in sets of 8 KB pages. In files where holding the last bytes in an 8 KB page would represent a waste of more than 5% of the allocated space, a file fragment is created. The fragment, which ranges in size from 1 KB to 7 KB, is allocated from the fileset's frag file. This technique considerably reduces the amount of unused, wasted disk space but might affect file system performance (see Section 4.2). · Sparse files A sparse file is one that does not have disk storage reserved for some of its pages. Reading a sparse file at a page that does not have storage reserved returns zeroes. Writing to a page that does not have storage reserved allocates a page of disk storage. You can create a sparse file by setting a file's end-of-file using the ftruncate command or by using the lseek and write commands to skip over unwritten sections of the file. Core files are sparse files. They have large areas with no information and do not use disk blocks for locations where no data exists. Quota files are sparse because they are indexed by user ID. If there are gaps in the user IDs, there might be sections of the file with no data. In contrast, database applications generally reserve storage for the entire file even when data is not available. The applications generally write zeroes in the pages that have no useful data. By writing the data sequentially, the database application creates a database file with large sets of contiguous pages and a small number of extents.
Configuring the File System
15
To examine the length of a sparse file, including the pages that do not have disk storage, use the ls -l command. The ls -s command displays the amount of storage actually used by the file. The du command provides the same information as the ls -s command (see Section 5.1).
1.4 Setting Up an AdvFS File System
When planning your configuration, consider setting up the / (root) and /usr file systems on AdvFS. By using AdvFS for root and /usr, you increase configuration flexibility and significantly reduce system down time in the event of a system failure. You can set up AdvFS to resemble a traditional UFS configuration with one partition (volume) per domain and one fileset in each domain. If you have the optional AdvFS Utilities, when you need space, you can add volumes (except to the local root which is restricted to one volume) to increase the size of the domain without changing anything in the existing configuration. An active AdvFS file system requires one domain and one mounted fileset. To create an active domain: 1. 2. 3. 4. Create a domain and assign a volume to it (see Section 1.6.5). Create a fileset (see Section 1.7.4). Create a mount-point directory (see Section 1.7.6). Mount a fileset (see Section 1.7.6).
You can create one fileset per domain or you can create many. See Section 1.6.1 and Section 1.7.1 for guidelines. AdvFS is fully supported in the /etc/fstab file to automatically mount a fileset at system boot (see Section 1.7.2). Alternately, you can use a graphical interface or the SysMan Menu to perform this activity. See Appendix B for a complete list of AdvFS commands. For more detailed information on AdvFS configuration, see System Configuration and Tuning.
1.5 Volumes
An AdvFS volume can be a raw disk partition, an entire disk, an aggregate volume provided by LSM, or a hardware or software redundant array of independent disks (RAID) storage. Each volume in an AdvFS domain contains a bitfile metadata table (BMT), which stores file data structure (metadata), and a storage bitmap, which tracks free and allocated disk space. In addition, on one volume each
16 Configuring the File System
domain has a transaction log file, which stores all metadata changes until the changes are written to disk. A volume can be assigned to only one domain. It is associated with its domain by a domain ID, which is automatically stored in the domain-attributes record on the volume. If you have the optional AdvFS Utilities, you can add volumes to create a multivolume domain. Multivolume domains increase the storage available for the filesets and allow for preventative disk maintenance. You can add volumes immediately after creating the domain, even before creating and mounting filesets. To perform preventative disk maintenance, you can add a new volume to the domain, migrate your files to the new volume, and then remove the old volume. For AdvFS to function properly, the number of volumes in a domain with the same domain ID must remain consistent with the number of volumes stored in the domain-attributes record. In addition, each domain is defined by an entry in the /etc/fdmns directory (see Section 1.6.2). This directory must be up to date; that is, the domain entries must correctly reference the volumes associated with the domains. The number of links to the volumes in the /etc/fdmns directory must equal the number of volumes. To reuse a volume see Section 5.8.1.
1.5.1 Volume Attributes
You can configure AdvFS volumes with attributes that determine how data is read, cached, written, and consolidated. When an AdvFS volume is incorporated into a domain, either by creating the initial domain or by adding a volume, the default volume attributes are set. Modifying these default attributes might improve performance in some system configurations. You can run the chvol command Manage AdvFS Domains at any time to change the attributes of a volume in an active domain; the system does not have to be quiescent. To display or modify the current volume attributes, use the SysMan Manage an AdvFS Domain utility, or enter the chvol command from the command line: chvol device_name file_domain See Chapter 4 and System Configuration and Tuning for more complete information on modifying attributes to improve system performance.
Configuring the File System
17
1.6 Domains
A domain is the physical storage layer of the AdvFS file system. It is a defined pool of physical storage that can contain one or more volumes. Because this storage is managed separately from the directory structure (see Section 1.6.2), you can expand and contract the size of the domain by adding or removing volumes. You can move files between volumes in the domain without changing file pathnames. Changing the name of the domain does not affect the domain ID. The domain name is defined by a directory entry in the /etc/fdmns directory. This entry contains the links to the volumes that comprise the domain. Domain names must be unique. You cannot use slash (/), number (#), colon (:), asterisk (*), question mark (?), tab, newline, form feed, return, vertical tab, and space characters in a domain name.
1.6.1 Configuring Domains
How you configure domains depends on your organization's needs. You can assign all available storage to a few domains or you can group specific partitions or disks into many domains. You must also take into account how you configure your filesets (see Section 1.7.1). With AdvFS Utilities, you can assign multiple volumes to a domain and distribute the filesets and files across the volumes. Establishing multiple domains allows greater control over your physical resources. You can create domains for use by specific projects, groups of users, departments, or any division that makes sense for your organization. For example, you could create domains for each of your organization's departments, such as engineering, finance, and personnel. There are a number of factors to consider when configuring domains: · To maintain high performance, do not split a disk between two domains. For example, do not add partition g to one domain and partition h of the same disk to another domain. Adding one partition containing the entire disk (typically, partition c) to a domain is preferable to adding several partitions on the same disk. Adding several partitions might degrade performance. An error message is displayed if you try to assign overlapping partitions to a domain (see Section 1.6.6). Assuming the disks are the same type and speed, it is generally more efficient to spread your domain over several disks. For example, a domain with three volumes on separate disks is more efficient than one with three partitions on a single disk because the latter has only one I/O path.
·
·
18 Configuring the File System
· ·
Creating a domain on several volumes can increase the defragmentation speed because the defragment utility processes each volume in parallel. Combining multiple volumes within a single domain allows you to build larger domains and reduces the overall management effort because fewer domains require less administration. However, a single volume failure within a domain renders the entire domain inaccessible. Limiting the number of volumes decreases the risk of disk errors that can cause the entire domain to become inaccessible. To improve reliability, you can set up LSM mirrors. See Section 1.10 for information about setting up AdvFS with LSM. See Logical Storage Manager for LSM functionality.
·
The System Configuration and Tuning guide provides detailed guidelines for planning and configuring your file system. System Limits lists the limits for the AdvFS file system. The SysMan Manage an AdvFS Domain utility allows you to create and configure domains. See Appendix D to configure your domains using a graphical user interface.
1.6.2 The /etc/fdmns Directory
The /etc/fdmns directory defines domains by providing a subdirectory for each domain you create. The subdirectories contain a symbolic link to every volume in the domain. AdvFS automatically creates and maintains this directory when you use standard AdvFS commands. You must have a current /etc/fdmns directory in order to mount the filesets in a domain. When you create a domain, a soft link is created from the domain entry in the /etc/fdmns directory to the block device. You cannot create a domain by creating a link in the directory. Back up the /etc/fdmns directory regularly. If the contents of the directory become corrupt or if the directory is deleted, restore the directory from your most recent backup. A damaged directory prevents access to the domain because the information matching the domain to the physical volume containing the filesets is incorrect; the filesets are not affected. If you attempt to mount a fileset from a domain with a damaged directory, a message similar to the following for the domain accounts is displayed:
Volume count mismatch for domain accounts. accounts expects 2 volumes, /etc/fdmns/accounts has 1 links.
If the /etc/fdmns directory is damaged or if the volumes of a domain are moved to a different system, use the advscan utility to locate the volumes and reconstruct the directory (see Section 5.9).
Configuring the File System
19
1.6.3 Version 5.0 Domains
Domains in Version 5.0 and later of the operating system have an improved disk structure that provides support for quota values larger than 2 terabytes and increases performance for directories containing thousands of files. You do not need to adjust bitfile metadata table (BMT) allocations. All domains that were created in operating systems prior to Version 5.0 are recognized by later versions but are not automatically upgraded to the new structure. A domain version number (DVN) is associated with a domain. The Version 5.0 operating system is the first for which a new domain carries a DVN of 4. Domains created earlier carry a DVN of 3. You can mount a DVN3 fileset on a system running Version 5.0 or later. You cannot locally mount a fileset in a DVN4 domain created under Version 5.0 or later on a system running a Version 4 operating system. If you need to access a DVN4 fileset while running an earlier version of the operating system, NFS mount it from a server running Version 5 or later software (see Section 5.4). Therefore, if your application requires backward compatibility, you should not upgrade your domain to the new DVN. See Section 5.4.1 for a discussion of utility incompatibility. 1.6.3.1 Creating a Domain with DVN4 All domains created on Version 5.0 and higher operating systems have a DVN of 4. Therefore, if you do a full installation, all the domains created in the process have the new structure. If you perform an update installation from a system running a Version 4 operating system, all existing domains retain the DVN of 3. This means that /root, /usr, and /var also have a DVN of 3. There is no conversion utility. To move your data to a DVN4 domain, back up your data, create a new DVN4 domain, and restore it to the new domain. 1.6.3.2 Upgrading a Domain to DVN4 If you are running an application that requires quota limits larger than 2 terabytes or that uses directories containing thousands of files, you can improve performance by upgrading your old domain to a DVN4 domain. DVN4 domains automatically have an index created when the directory grows beyond a page, that is, about 200 files. Use the showfile command to determine if a directory is indexed. Use the -i option to display information about the index. See showfile(8) for more information. To upgrade a domain, create a new domain on a system running Version 5.0 or later software and copy all the information from the old domain to
110 Configuring the File System
it. If you are unfamiliar with creating domains, read Section 1.6.5 first. To upgrade a domain: 1. Back up the filesets in the domain to tape by using the vdump command. It is a good idea to use the -x option for additional protection from saveset errors. You lose all the data in your domain if you cannot restore it after creating a new domain. Remove the old domain by using the rmfdmn command. Create a new domain by using the mkfdmn command. The new domain has a DVN of 4. You do not need to use the -x and -p options for the mkfdmn command. DVN4 domains do not require additional of BMT allocations. Create the new filesets by using the mkfset command. Restore the filesets in the new domain by using the vrestore command.
2. 3.
4. 5.
For example, to upgrade the domain domain_p on /dev/disk/dsk1c containing filesets fset_p and fset_m and put them back on the same volume with the same names, enter the following commands:
# # # # # # # # # # # # # vdump -0 -N -x 8 /fset_p vdump -0 -N -x 8 /fset_m umount /fset_p umount /fset_m rmfdmn domain_p mkfdmn /dev/disk/dsk1c domain_p mkfset domain_p fset_p mkfset domain_p fset_m mount domain_p#fset_p /fset_p mount domain_p#fset_m /fset_m vrestore -x -D /fset_p mt fsf 1 vrestore -x -D /fset_m
You can create DVN3 domains on a Version 5 system. They are recognized by earlier versions of the operating system. See mkfdmn(8) for more information.
1.6.4 Displaying Domain Information
If a domain is active (at least one fileset is mounted), you can display detailed information about the domain and the volumes included in it by using the showfdmn command: showfdmn domain_name
Configuring the File System
111
For example, to display domain information for the domain_1 domain:
# showfdmn domain_1 Id Date Created LogPgs Version Domain Name 2bb0c594.00008570 Fri Mar 24 12:33 2000 512 4 domain_1 Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name 1L 2 8325 79210 90% on 832527 1684 98% on ------------------------1665054 80894 94% 128 128 128 /dev/disk/dsk1c 128 /dev/disk/dsk2c
1.6.5 Creating a Domain
The first step in setting up an AdvFS file system is creating a domain and assigning an initial volume to it. However, a domain is not a complete file system that you can mount. In order to mount an AdvFS file system, the domain must contain one or more filesets. You can access files as soon as you mount one or more filesets (see Section 1.7). Figure 12: Single-Volume Domain
Fileset A
Fileset B
Domain
zs0826
Volume 1
Creating a single-volume domain with a single fileset is equivalent to creating a traditional UFS file system. To set up an active, single-volume file system, as illustrated in Figure 12, use the SysMan Create a New AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the mkfdmn command from the command line: mkfdmn volume_name domain_name To create an active single-volume DVN4 domain: 1. Create a single-volume domain associated with a volume by using the mkfdmn command.
112 Configuring the File System
2. 3.
Create one or more filesets by using the mkfset command. Create the mount-point directory by using the mkdir command. It is convention to name the directory the same as the fileset. For example, if the fileset is tmp, name the mount-point directory /tmp. Mount each fileset by using the mount command.
4.
For information about creating a DVN3 domain, see mkfdmn(8). _____________________ Caution _____________________
Do not use the mkfdmn command on a volume containing data that you want to keep. Doing so destroys the data. If you have accidentally used the mkfdmn command, you might recover some of your data by using the salvage utility if the volume is an AdvFS volume (see Section 5.8.4). The following example creates a single-volume DVN4 domain, domain_2, and two filesets, fset_a and fset_b, in the domain. Because the domain has only one volume, the files in both filesets physically reside on one volume. This is allowed in AdvFS. The number sign (#) between the domain and fileset names is part of the naming syntax and does not represent a comment.
# # # # # # # mkfdmn /dev/disk/dsk2c domain_2 mkfset domain_2 fset_a mkfset domain_2 fset_b mkdir /fset_a mkdir /fset_b mount domain_2#fset_a /fset_a mount domain_2#fset_b /fset_b
You can set up a domain with an LSM storage by specifying an LSM volume. See Section 1.10 for information about using AdvFS with LSM. If you have AdvFS Utilities, you can change the size of your domain by adding more volumes. You can transform a single-volume domain (except the root domain) into a multivolume domain (see the Sysman Manage an AdvFS Domain utility, Section 1.6.6 and Appendix D). If you try to create a domain on a volume that is marked on the disk as in use in the disk label, the mkfdmn command fails if the volume is mounted or if it is a current swap partition. If the volume is unmounted, you get an warning message. You can override the message and create the domain. For example, if /dev/disk/dsk3g is in use and you try to create the domain usr_domain, the following message is displayed:
# mkfdmn /dev/disk/dsk3g usr_domain Warning: /dev/rdisk/dsk3g is marked in use for 4.2BSD.
Configuring the File System
113
If you continue with the operation you can possibly destroy existing data. CONTINUE? [y/n]
1.6.6 Increasing the Size of a Domain
You can expand a domain by replacing one of the volumes in the domain with a larger storage device or, if you have AdvFS Utilities, by adding another volume to the domain. Figure 13 shows a graphic illustration of adding volumes to a domain. Neither adding nor removing volumes affects the directory hierarchy layer; all pathnames for the files remain the same. Also, the file system can remain active during the disk exchange. Figure 13: Enlarging a Domain
Fileset A Fileset A
Fileset B
Fileset B
Domain
Domain
zs0821
Volume 1
Volume 1 Volume 2
There might be performance benefits if, instead of increasing the size of a DVN3 domain, you upgrade to the new file structure (see Section 1.6.3) and then increase its size. _____________________ Caution _____________________
If your domain is located on an LSM volume, do not use the LSM grow option to increase its size. A newly created domain consists of one volume, which can be a disk, disk partition, or logical volume. To add volumes, use the SysMan Manage an AdvFS Domain utility, a graphical user interface (see Appendix D), or enter the addvol command from the command line: addvol device_name domain_name For example, to add volume dsk3c to the domain resources: # addvol /dev/disk/dsk3c resources
114 Configuring the File System
You can add volumes immediately after creating a domain, or you can wait until the domain requires additional space. You can add a volume to an active domain while its filesets are mounted and in use. You cannot add a volume to the root domain unless you are running a cluster (see Cluster Administration). If you are running a cluster configuration, you add another root volume the same way that you add any volume. If you are not running a cluster and need to increase the size of the root domain, follow the procedure for recovering from a failure of the root domain (see Section 5.11) and attach a larger volume. _____________________ Caution _____