Beruflich Dokumente
Kultur Dokumente
Course Guide
EYX794ESG.0003
Course Guide
EYX794ESG.0003
Notice
The information in this publication is subject to change without notice.
COMPAQ COMPUTER CORPORATION SHALL NOT BE LIABLE FOR TECHNICAL OR
EDITORIAL ERRORS OR OMISSIONS CONTAINED HEREIN, NOR FOR INCIDENTAL OR
CONSEQUENTIAL DAMAGES RESULTING FROM THE FURNISHING, PERFORMANCE, OR
USE OF THIS MATERIAL.
This guide contains information protected by copyright. No part of this guide may be photocopied or
reproduced in any form without prior written consent from Compaq Computer Corporation.
The software described in this guide is furnished under a license agreement or nondisclosure agreement.
The software may be used or copied only in accordance with the terms of this agreement.
Other product names mentioned herein may be trademarks and/or registered trademarks of their
respective companies.
2000 Compaq Computer Corporation. All rights reserved. Printed in the USA.
Aero, ALPHA, ALPHA AXP, AlphaServer, AlphaStation, Armada, BackPaq, COMPAQ, Compaq
Insight Manager, CompaqCare logo, Counselor, DECterm, Deskpro, DIGITAL, DIGITAL logo,
DIGITAL Alpha Systems, Digital Equipment Corporation, DIGITAL UNIX, DirectPlus, FASTART,
Himalaya, InfoPaq, Integrity, LicensePaq, Ministation, NetFlex, NonStop, OpenVMS, PaqFax,
Presario, ProLiant, ProLinea, ProSignia, QuickBack, QuickFind, Qvision, RDF, RemotePaq, RomPaq,
ServerNet, SERVICenter, SmartQ, SmartStart, SmartStation, SolutionPaq, SpeedPaq, StorageWorks,
Systempro/LT, Tandem, TechPaq, TruCluster, Tru64 UNIX, registered in United States Patent and
Trademark Office.
Atalla, C-Series, Expand, FOX, Guardian, iTP, Measure, Netelligent, and PointView are trademarks of
Compaq Computer Corporation.
Microsoft, Windows, and Windows NT are registered trademarks of Microsoft Corporation.
MIPS is a trademark of MIPS Computer Systems. Motif, OSF and OSF/1 are registered trademarks of
the Open Software Foundation. NFS is a registered trademark of Sun Microsystems, Inc. Oracle is a
registered trademark and Oracle7 is a trademark of Oracle Corporation. POSIX is a registered
trademark of the Institute of Electrical and Electronics. PostScript is a registered trademark of Adobe
Systems, Inc. UNIX is a registered trademark licensed exclusively through X/Open Company Ltd. X
Window System is a trademark of the Massachusetts Institute of Technology. Intel, Pentium, and Intel
Inside are registered trademarks and Xeon is a trademark of Intel Corporation.
UNIX is a trademark in the US and other countries, licensed exclusively through X-Open Company
Ltd.
AdvFS Internals and Troubleshooting
Course Guide
January 2000
Contents
iv
Bitfile-Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-9
Reusing Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-9
Describing BAS On-Disk Metadata Bitfiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-10
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-10
Domain and Volume Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-10
Per Domain Bitfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-11
Per Volume Bitfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-12
Per Fileset Bitfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
Reserved Bitfile Special Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-15
Metadata BitfileTags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-16
.tags for Directory Entries for Metadata Bitfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
Bitfile Metadata Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
Mcell Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-19
Mcell Page Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-20
RBMT Page 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
BMT Page 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
BMT Page Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
Mcell Addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-22
Reserved Mcell Addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-22
Mcell Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-23
Mcell Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-23
Utilities for Viewing Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-24
Using Extent Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Extent Maps for Nonreserved Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Extent Maps for Reserved Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Encoding of Extents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
Using Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Tag File Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-27
Tag File Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-29
Tagmap Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
Root Tag File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
Fileset Tag File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
Cloning through Fileset Tag File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
Utility for Viewing Tag Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-33
UNIX Directories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35
POSIX Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35
AdvFS Tagfiles and Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
Assigning Fragments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Fragment Bitfile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Fragment Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
Fragment Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-38
Fragment Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-39
Fragments and Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-41
Defining the Storage Bitmap Bitfile and Miscellaneous Bitfile . . . . . . . . . . . . . . . . . . . . . . . . . .2-43
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-43
Storage Bitmap Bitfile Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-43
SBM Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-44
Miscellaneous Bitfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-47
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-48
Introducing AdvFS On-Disk Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-48
Describing BAS On-Disk Metadata Bitfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-49
Using Extent Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-49
v
vi
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-36
5 Troubleshooting AdvFS
About This Chapter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Case Study Format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
Describing AdvFS Troubleshooting Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3
AdvFS Commands and Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-3
Troubleshooting Tips and Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
Troubleshooting File System Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
Recognizing File System Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
Causes of AdvFS Corruption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
No Valid File System Error Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
Mount File System Operation Crashes the System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
Localized Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10
Generalized Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-11
Domain Panic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-12
Resolving Known AdvFS Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Log Half-Full Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Fixing Log Half-Full Problems: Reducing Fragmentation . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Determining Appropriate Log Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
Fixing Log Half Full Problems: Increasing Log Size Using switchlog. . . . . . . . . . . . . . . . .5-15
Fixing Log Half Full Problems: Increasing Log Size Using mkfdmn. . . . . . . . . . . . . . . . . .5-16
BMT Exhaustion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
Avoiding BMT Exhaustion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
BMT Extent Map Allocations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
BMT Exhaustion: Fixing the Problem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-18
Case Study 1: RBMT Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Problem Statement: Case Study 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Configuration: Case Study 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Problem Description: Case Study 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-20
Case Study 2: Fragment-Free List Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Problem Statement: Case Study 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Configuration: Case Study 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Problem Description: Case Study 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-30
Things Attempted: Case Study 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
Final Solution/Summary: Case Study 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
Case Study 3: Corruption and System Panic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
viii
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Problem Statement: Case Study 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Configuration: Case Study 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Problem Description: Case Study 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35
Things Attempted: Case Study 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48
Final Solution/Summary: Case Study 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48
Using the salvage Utility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
What is salvage? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
salvage Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
When to Use salvage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
Using salvage in Conjunction with Backup Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
Using salvage in the Absence of Backup Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-54
Using salvage in the Case of Very Large Domains. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-54
Using salvage in the Case of Massive Metadata Corruption. . . . . . . . . . . . . . . . . . . . . . . . .5-54
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-55
Describing AdvFS Troubleshooting Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-55
Troubleshooting File System Corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-55
Resolving Known AdvFS Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-55
Performing Case Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-56
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-58
Describing AdvFS Troubleshooting Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-58
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-59
Describing AdvFS Troubleshooting Practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-59
rmfset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
rmvol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
salvage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
savemeta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
shblk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
shfragbf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
showfdmn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
showfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
showfsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
stripe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
switchlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
tag2name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vbmtchain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vbmtpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
verify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vfilepg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vfragpg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vlogpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vlsnpg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vrestore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vsbmpg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
vtagpg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A-32
A-33
A-34
A-36
A-37
A-37
A-38
A-39
A-41
A-42
A-42
A-43
A-44
A-44
A-45
A-46
A-48
A-50
A-50
A-53
A-53
A-53
A-54
A-57
A-59
Tables
0-1
0-2
1-1
2-1
2-2
5-1
5-2
5-3
5-4
xi
Figures
0-1
1-1
1-2
1-3
1-4
1-5
1-6
1-7
1-8
1-9
2-1
2-2
2-3
2-4
2-5
2-6
2-7
2-8
2-9
2-10
2-11
2-12
2-13
2-14
3-1
3-2
3-3
xii
xiii
Prerequisites the skills and knowledge needed to ensure your success in this
course
Course goals and nongoals what skills or knowledge the course will and will
not provide
Course map the sequence in which you should take each chapter
Time schedule an estimate of the amount of time needed to cover the chapter
material and lab exercises
Resources manuals and books to help you successfully complete this course
Course Description
This lecture-lab course focuses on the internals of the Advanced File System
(AdvFS). Practical troubleshooting training on AdvFS is also presented.
Place in Curriculum
This course is part of the UNIX advanced curriculum for system administration and
support personnel.
Target Audience
This course is designed for system administrators and support engineers who
service or support AdvFS configurations.
xiv
Prerequisites
To get the most from this course, you should be able to:
Set up and manage the LSM, AdvFS, and hardware Redundant Arrays of
Independent Disks (RAID) using the command line or graphical user interface.
Course Goals
To support customers with complex configurations using AdvFS, you should be
able to:
Nongoals
This course does not cover the following topics:
xv
The text of each chapter, which includes outlines, tables, figures, and examples.
The exercises enable you to practice your skills and measure your mastery of the
information learned during the course.
Course Map
The Course Map shows how each chapter is related to other chapters and to the
course as a whole. Before studying a chapter, you should master all of its
prerequisite chapters. The prerequisite chapters are depicted before the following
chapters on the Course Map. The direction of the arrows determines the order in
which the chapters should be covered.
xvi
Figure 0-1:
Course Map
Advanced FileSystem
Concepts
AdvFS On-Disk
Structures
AdvFS In-Memory
Structures
Troubleshooting AdvFS
advfsi01
Chapter Descriptions
A brief description of each chapter is listed below.
AdvFS System Calls and Kernel Interfaces an overview of the entries into
AdvFS. It follows startup and recovery, storage management, cloning, file
migration and threads.
xvii
Time Schedule
The amount of time required for this course depends on each student's background
knowledge, experience, and interest in the various topics.
Use the following table as a guideline.
Table 0-1: Course Schedule
Day
Chapter/
Appendix
Number
Chapter/Appendix Name
Lecture/
Reading
Hours
1 hours
2 hour
1 hour
2 hours
2 hours
1 hour
1 hour
Troubleshooing AdvFS
1 hour
Lab/
Exercise
Hours
1 hour
Course Conventions
This book uses the following conventions.
Table 0-2: Course Conventions
Convention
keyword
example
command(n)
[key]
This symbol indicates that the named key on the keyboard is pressed.
.
.
.
In examples, a vertical ellipsis indicates that not all lines in the example are
shown.
[ ]
variable
xviii
Description
Italics indicate new terms as well as items that are variable (in syntax
descriptions).
Resources
For more information on the topics in this course, see the following:
POLYCENTER Advanced File System and Utilities for DIGTIAL UNIX; Guide
to File System Administration
xix
xx
1
Advanced File System Concepts
Resources
For more information on topics in this chapter as well as related topics, see the
following:
Introducing AdvFS
Introducing AdvFS
Overview
To study the internals of AdvFS, the basic concepts must be understood. This
section reviews the following AdvFS terms and concepts:
AdvFS characteristics
AdvFS capabilities
Volumes
Filesets
File domain is a named set of one or more volumes that provides a shared pool
of physical storage.
AdvFS Characteristics
The pools of storage called domains within AdvFS are characteristics that make
AdvFS an advanced file system. Most other file systems lack the ability to draw
storage from a pool shared among multiple filesets.
AdvFS goes beyond UFS by allowing you to create multiple filesets that share a
common pool of storage within a defined file domain.
Introducing AdvFS
You can mount filesets like you can mount file systems.
AdvFS separates the directory layer from the storage layer. It allows management
of the physical storage separately from the directory hierarchy. The directory
hierarchy handles file naming and the file system interface opening and reading
files.
The physical storage layer handles write-ahead logging, file allocation, and physical
disk I/O functions. It can move a file from one disk to another within a storage
domain without changing its pathname.
AdvFS Capabilities
Some special capabilities are available within AdvFS, such as filesets, which offer
features not provided by other file systems:
You can clone a fileset and back it up while users are still accessing the original.
The most basic advancement provided by AdvFS is the ability to create a fileset that
can span multiple volumes.
The following figure depicts two filesets that draw their disk storage from the three
volumes within the domain.
Introducing AdvFS
Figure 1-1:
Volumes
Fileset A
Fileset B
Introducing AdvFS
Figure 1-2:
Filesets
Filesets != Partitions
Commands associated with domains, volumes and filesets are: mkfdmn, mkfset,
addvol, rmvol, showfdmn, showfsets.
Volumes
Volumes represent the basic storage building block for AdvFS. They are sometimes
referred to as virtual disks because they function as a disk would in less
sophisticated file systems.
An AdvFS volume is:
Note that the contents of /etc/fdmns should not be changed manually. Any
changes should be introduced using AdvFS utilities (such as addvol, rmvol,
mkfdmn, and so forth).
The following example shows a symbolic link in a directory under the
/etc/fdmns directory pointing to the volume (actual disk storage) that composes
this domain. If the domain had more than one volume, there would be multiple links
shown. Note that there are directories under /etc/fdmns for each domain.
Introducing AdvFS
Filesets
Filesets are the mountable entities within AdvFS. They function similarly to UFS
file systems.
A fileset is:
The following example shows a simple /etc/fstab file with the last line
representing a request to mount the usr fileset, which is within the usr_domain
domain on the /usr mount point.
Example 1-2:
# cat /etc/fstab
/dev/disk/dsk2a /
/proc
/proc
usr_domain#usr
/usr
ufs
procfs
advfs
rw
rw
rw
1
0
0
1
0
2
Extent concepts
Extent Concepts
Any attempt to create a file with content involves allocating some disk space from
the volumes within the domain. These chunks of disk space are referred to as file
extents.
AdvFS always attempts to write each file to disk as a set of contiguous pages called
an extent.When a file consists of a few large extents and file access is sequential,
I/O performance should be optimal.
An extent map translates the bitfile pages (8192 bytes each) to disk blocks (512
bytes each). The AdvFS storage allocation policy adds pages to a file by
preallocating one-fourth of the file size up to 16 pages each time the file is
appended. This fosters larger extents. When the file is closed, excess preallocated
space is truncated, so space is not wasted. When a file uses only part of the last page,
a file fragment is created.
Rather than wasting the rest of the page in the extent, the space is allocated from a
special file, the fileset fragment file. Each fileset has a frag file, containing seven
groups of fragments, from 1Kb to 7Kb in size. A fragment is allocated from the
appropriately sized group.
The following figure shows the relationship between the logical file, the extent map,
and the actual disk space.
Figure 1-3:
Extent-Based Storage
extent 1
extent 2
logical file
Extent Map
Disk Space
extent 1
extent 2
The following example shows a file with a single extent of three pages in size.
Vol
1
PgSz
16
Pages
3
extentMap: 1
pageOff
pageCnt
0
3
extentCnt: 1
XtntType
simple
vol
1
Segs
**
SegSz
**
volBlock
576496
I/O
Perf
async 100%
File
disktab
blockCnt
48
The following example shows an empty striped file with two stripes.
Example 1-4: Using showfile to Display a Striped File with Two Stripes
# showfile -x /usr/dennis/stripe1
Id
c.8001
Vol
2
PgSz
16
Pages
0
XtntType
stripe
Segs
2
SegSz
8
I/O
Perf
async 100%
extentMap: 1
pageOff
pageCnt
extentCnt: 0
volIndex
volBlock
blockCnt
extentMap: 2
pageOff
pageCnt
extentCnt: 0
volIndex
volBlock
File
stripe1
blockCnt
The showfile command cannot display attributes for symbolic links or nonAdvFS files.
This example shows the limitations of showfile when used on a UFS file.
Vol
**
PgSz
**
Pages
**
XtntType
ufs
Segs
**
SegSz
**
I/O
**
Perf
**
File
vmunix
A simple file has one extent map while a striped file has more than one extent map.
extentMap: 1
pageOff
pageCnt
0
3
extentCnt: 1
vol
1
volBlock
576496
blockCnt
48
pageCnt
vol
Number indicating which volume within the domain contains this file
volBlock
blockCnt
extentCnt
Number of extents
Logging
Logging
Overview
A characteristic of AdvFS is that the recovery time after a power failure or crash is
minimal. This section introduces AdvFS logging.
Why logging
Logging a transaction
AdvFS logging
Why Logging
Another distinguishing characteristic of AdvFS is metadata logging. AdvFS tracks
alterations to on-disk metadata by logging the transaction as it occurs. Many file
system operations involve several widely separated writes to disk.
A transaction usually consists of more than one write. A crash in between the writes
leaves the on-disk file system inconsistent.
The two main benefits of using transactions and logging are:
Logging
Logging a Transaction
The following figure shows the event sequence when a transaction is logged.
Figure 1-4:
"log"
tagN
Directory
2
Tag Directory
Log
intentions
Commit
commit record
Storage is allocated in the bitfile metadata table (BMT) (log record 1).
The bitfile tag slot is allocated (log record 2).
The directory entry is changed (log record 3).
The transaction is committed (log record 4).
The buffered log records are written to disk.
The buffered bitfile pages are written to disk and the log pages are removed.
AdvFS Logging
AdvFS logging consists of:
Not user file data (unless atomic write data logging has been enabled using
chfile -L)
Writes a series of log records describing all changes for an operation to disk.
In case of crash, on restart, the on-disk log indicates which transactions are
complete.
Logging
The transaction log records changes to metadata (bitfile and directory data). For
example, file creation requires modifying more than one on-disk structure:
Cloning
Cloning
Overview
To allow the uninterrupted use of AdvFS data while maintenance operations are in
progress, a temporary clone of the file system can be requested. This section will
introduce cloning concepts.
Fileset clones
Cloning issues
2.
3.
4.
5.
Creating a bitfile for the file in the clone fileset if the cloned bitfile does not
already exist in the clone fileset
2.
Modifying the clone filesets tag directory to reference the new file
3.
Allocating an extent in the new file for the portion being written
4.
5.
Fileset Clones
A clone fileset is a read-only copy of a fileset created to capture fileset data at a
particular time. The contents of the clone fileset can be backed up while the original
fileset remains available to users.
The following figure shows cloning actions including copy-on-write (COW).
Advanced File System Concepts 1-15
Cloning
Figure 1-5:
Fileset Clones
Application
Domain
write
read
COW
Backup tool
read
Cloning Issues
Consider these issues when working with cloned filesets:
Applications should not be writing to the master when the clone is created.
Fortunately cloning time is very fast (seconds) due to copy-on-write.
A clone is not a backup; it is a tool for minimizing down time for a fileset due
to backups:
Create clone of fileset
Back up from clone
Delete clone
Striping
Striping
Overview
AdvFS provides file striping to potentially enhance the performance of file I/O
intensive applications. This section introduces the concept of file striping.
File Striping
AdvFS provides file-level striping to help spread the disk I/O over several volumes.
The stripe utility directs a zero-length file (a file with no data written to it) to be
spread evenly across several volumes within a file domain.
As data is appended to the file, the data is spread across the volumes. AdvFS
determines the number of pages per stripe segment and alternates the segments
among the disks in a sequential pattern.
Existing, nonzero-length files cannot be striped using the stripe utility.
To stripe an existing file, create a new file, use the stripe utility to stripe the new
file, and copy the contents of the file you want to stripe into the new striped file.
After copying the file, delete the nonstriped file.
Once a file is striped, you cannot use the stripe utility to modify the number of disks
that a striped file crosses. To change the volume count of a striped file, you can
create a second file with a new volume count, and then copy the contents of the first
file into the second file. After copying the file, delete the first file.
The following figure depicts the blocks of a file (1,2,...) that is striped over three
volumes. Note that block one is on the first volume, block two is on the second
volume, and so forth.
Striping
Figure 1-6:
File Striping
File
1
2
3
4
5
..
Domain
Using Trashcans
Using Trashcans
Overview
An advanced file system should provide some user-level comforts as well as
administrator and application-level features. This section introduces the notion of a
trashcan directory from which deleted files can be retrieved.
Overview of Trashcans
The trashcan component within AdvFS allows administrators to prepare for the
inadvertent removal of files. The deleted files are moved to the trashcan directory
in case the user wants them back.You can configure your systems to retain a copy
of deleted files.
Trashcan directories can be attached to one or more directories within the same
fileset. Once attached, any file deleted from an attached directory is automatically
moved to the trashcan directory. The last version of a file deleted from a directory
with a trashcan attached can be returned to the original directory with the mv
command.
Root-user privilege is not required to retrieve files from a trashcan directory.
Restrictions include:
You can restore only the most recently deleted version of a file.
You can attach more than one directory to the same trashcan directory;
however, if you delete files with identical file names from the attached
directories, only the most recently deleted file remains in the trashcan directory.
Files deleted from the trashcan directory are unrecoverable.
The following table lists and defines the commands for setting up and managing
trashcans.
Table 1-1: Trashcan Commands
Command
Function
mktrashcan
shtrashcan
rmtrashcan
The following picture depicts a standard directory hierarchy on the left. If there is a
trashcan directory associated with the fileset, any removed files are placed in the
trashcan. If necessary, the files can be moved from the trashcan back to the
directory.
Using Trashcans
Figure 1-7:
Trashcans
Trashcan Dir
rm
mv
Fileset commands
File commands
Function
mkfdmn
addvol
rmvol
balance
defragment
Fileset Commands
Some fileset commands are shown here.
Command
Function
mkfset
Creates a fileset
chfsets
clonefset
File Commands
These are a few file commands.
Command
Function
migrate
stripe
mktrashcan
AdvFS architecture
AdvFS components
AdvFS Architecture
AdvFS includes two kernel subsystems:
The bitfile access subsystem manipulates bitfiles: create, open, read, write, add and
remove storage. It also interfaces with buffer cache, Volume Manager interface, and
I/O scheduling. BAS provides:
The following figure depicts the software components that may be involved with a
typical disk I/O. Note the AdvFS software component in the middle. The Virtual
File System (VFS) software directs the processing toward the appropriate file
system specific software.
Figure 1-8:
user mode
kernel mode
Disk Driver
Once VFS directs the I/O processing to the AdvFS software, the AdvFS processing
can be thought of as having two levels, FAS and BAS, as shown in the following
figure.
Figure 1-9:
VFS
File Access Subsystem (FAS)
VFS operations
vnode operations
Buffer cache operations (pin and unpin page, ref and deref
page,flushbitfile,flushcache,prefetchpages,I/Oqueuing)
The term bitfile refers to a generic file as is supported by the BAS. Files in the
FAS are simply bitfiles to which the FAS applies POSIX semantics. Therefore,
files are instantiated via bitfiles, and in general, file and bitfile are equivalent.
AdvFS in Tru64 UNIX V5
Many changes are included in the latest release of Tru64 UNIX (V5).
Version five of Tru64 UNIX has a new version of the on-disk structure of AdvFS.
The previous version of the AdvFS on-disk structure was V3. In Tru64 UNIX V5.0,
the AdvFS on-disk structure will be at version four.
Additional features include faster directory searches for directories larger than 8K.
AdvFS has added some additional support for very large directories. The
performance improvements include the creation of a B-tree index supporting
directories greater than 8K in size. This dramatically improves file creation and
deletion performance. Improvement becomes more noticeable when the directory
contains more than ~2500 files.
Quota limits are now held in 8-byte fields yielding higher limits.
Direct I/O allowing I/O direct to the applications address space (no UBC
buffering)
SMP improvements
Summary
Summary
Introducing AdvFS
A file domain is a named set of one or more volumes that provides a shared pool of
physical storage.
A fileset represents a portion of the directory hierarchy. Each fileset is a uniquely
named set of directories and files that form a subtree structure.
A volume is any mechanism that behaves like a UNIX block device.
Using Extent-Based Storage
The Advanced File System always attempts to write each file to disk as a set of
contiguous pages. The set of contiguous pages is called an extent. An extent map
translates the bitfile pages (8192 bytes each) to disk blocks (512 bytes each).
The AdvFS storage allocation policy adds pages to a file by preallocating one-fourth
of the file size up to 16 pages each time the file is appended. This fosters larger
extents. When the file is closed, excess preallocated space is truncated, so space is
not wasted.
When a file uses only part of the last page, a file fragment is created. Rather than
wasting the rest of the page in the extent, the space is allocated from a special file,
the fileset frag file. Each fileset has a frag file, containing seven groups of
fragments, from 1Kb to 7Kb in size. A fragment is allocated from the appropriately
sized group.
Logging
Fast crash recovery is achieved by using the transaction log to redo committed
transactions and undo uncommitted transactions. The log has a fixed size regardless
of the domain size, so this bounds the time for recovery.
This is in contrast to UFS which relies on fsck to repair the file system. The time
to run fsck is proportional to the number of files in a file system, so as disks get
bigger, fsck takes longer. On average AdvFS crash recovery takes about 10 to 15
seconds.
Transaction logging also improves performance for metadata-intensive operations.
Since all metadata modifications are first written to the log and can be recreated
using just the log, the file system can write the actual modifications to disk at a later
time. This allows the file system to wait until it can do bigger I/Os by collecting
many unrelated metadata modifications into fewer I/Os.
This is in contrast to UFS which relies on ordered synchronous writes to maintain
metadata consistency. The writes are ordered such that fsck can easily repair
inconsistencies.
Summary
Cloning
A clone fileset is a read-only copy of a fileset created to capture fileset data at a
particular time. The contents of the clone fileset can be backed up while the original
fileset remains available to users.
Striping
The stripe utility directs a zero-length file (a file with no data written to it) to be
spread evenly across several volumes within a file domain. As data is appended to
the file, the data is spread across the volumes. AdvFS determines the number of
pages per stripe segment and alternates the segments among the disks in a
sequential pattern.
Using Trashcans
You can configure your systems to retain a copy of deleted files. Trashcan
directories can be attached to one or more directories within the same fileset. Once
attached, any file deleted from an attached directory is automatically moved to the
trashcan directory. The last version of a file deleted from a directory with a trashcan
attached can be returned to the original directory with the mv command.
Reviewing AdvFS Commands
Some file domain commands are shown here.
Command
Function
mkfdmn
addvol
rmvol
balance
defragement
Summary
Exercises
Exercises
To successfully complete the following exercises, you must be able to perform the
following tasks:
Introducing AdvFS
If completely comfortable with AdvFS commands, skip this exercise set and move
forward to Exercise Set 2.
1.
Create a file domain using at least two volumes that contains at least two
filesets. If you have only one disk, you may have to repartition it to get the two
volumes.
2.
3.
Create some large files to take up some space in the filesets. How can a fileset
be prevented from taking up all of the available storage in the domain?
1.
Make a clone of one of your filesets. How long did it take to create?
2.
Check the contents of the clone. Does it match the contents of the original?
3.
Put a new file in the original fileset. Does it appear in the clone?
Cloning
Exercises
4.
Using Traschcans
1. Delete a file from one of your filesets. Can you get it back?
2.
3.
1.
Create an empty striped file. Use the showfile -x command to view the
extents of the empty file.
2.
3.
4.
Revisit the extents of the striped file. Is there any performance difference in
reading the two files?
5.
Striping
Solutions
Solutions
Introducing AdvFS
1. Create a file domain using at least two volumes that contains at least two
filesets. If you have only one disk, you may have to repartition it to get the two
volumes.
#
# disklabel -r /dev/rdisk/dsk0c
# /dev/rdisk/dsk0c:
type: SCSI
disk: RZ26F
label:
flags:
bytes/sector: 512
sectors/track: 57
tracks/cylinder: 14
sectors/cylinder: 798
cylinders: 2570
sectors/unit: 2050860
rpm: 5400
interleave: 1
trackskew: 40
cylinderskew: 43
headswitch: 0
# milliseconds
track-to-track seek: 0
# milliseconds
drivedata: 0
8 partitions:
#
size
offset
fstype
a:
131072
0
unused
b:
262144
131072
unused
c:
2050860
0
unused
d:
552548
393216
unused
1185*)
e:
552548
945764
unused
1877*)
f:
552548
1498312
unused
g:
819200
393216
unused
1519*)
h:
838444
1212416
unused
#
#
#
#
# mkfdmn /dev/disk/dsk0a bruden_dom
#
#
#
# addvol /dev/disk/dsk0b bruden_dom
#
# showfdmn bruden_dom
[fsize bsize
0
0
0
0
0
0
0
0
cpg]
exact
164*)
492*)
2569)
# (Cyl. 1185*-
0
0
0
0
Solutions
Id
Date Created LogPgs Version
37f12c39.000263ea Tue Sep 28 16:59:37 1999
512
4
showfdmn: unable to display volume info; domain not active
#
#
#
#
# mkfset bruden_dom bruce_fset
#
#
# showfdmn bruden_dom
Domain Name
bruden_dom
Id
Date Created LogPgs Version
37f12c39.000263ea Tue Sep 28 16:59:37 1999
512
4
showfdmn: unable to display volume info; domain not active
#
#
#
# mkdir /usr/bruce
# mkdir /usr/dennis
#
# mount bruden_dom#bruce_fset /usr/bruce
#
# showfdmn bruden_dom
Domain Name
bruden_dom
Id
37f12c39.000263ea
Domain Name
bruden_dom
Vol
1L
2
512-Blks
131072
262144
---------393216
2.
Date Created
Tue Sep 28 16:59:37 1999
Free
122432
261968
---------384400
% Used
7%
0%
-----2%
Cmode
on
on
LogPgs
512
Rblks
256
256
Version
4
Wblks
256
256
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
512-Blks
131072
262144
---------393216
Date Created
Tue Sep 28 16:59:37 1999
Free
122432
261968
---------384400
% Used
7%
0%
-----2%
Cmode
on
on
LogPgs
512
Rblks
256
256
Version
4
Wblks
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
Solutions
3.
# df -t advfs
Filesystem
usr_domain#usr
usr_domain#var
bruden_dom#bruce_fset
bruden_dom#dennis_fset
#
512-blocks
1426112
1426112
393216
393216
Used
1025604
75678
32
32
Available Capacity
294864
78%
294864
21%
384400
1%
384400
1%
Mounted on
/usr
/var
/usr/bruce
/usr/dennis
512-Blks
131072
262144
1858624
---------2251840
2.
Date Created
Tue Sep 28 16:59:37 1999
Free
122432
261968
1858496
---------2242896
% Used
7%
0%
0%
-----0%
Id
37f12c39.000263ea
512-Blks
131072
262144
1858624
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
Create some large files to take up some space in the filesets. How can a fileset
be prevented from taking up all of the available storage in the domain? Fileset
quotas can be used to limit the disk space of a fileset.
# cp /vmunix /usr/bruce/big1
#
#
# df -t advfs
Filesystem
512-blocks
usr_domain#usr
1426112
usr_domain#var
1426112
bruden_dom#bruce_fset
2251840
bruden_dom#dennis_fset
2251840
#
# showfdmn bruden_dom
Vol
1L
2
3
Cmode
on
on
on
LogPgs
512
Used
1025604
75680
22784
22784
Date Created
Tue Sep 28 16:59:37 1999
Free
99680
239216
1858496
% Used
24%
9%
0%
Cmode
on
on
on
Available Capacity
294864
78%
294864
21%
2197392
2%
2197392
2%
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Mounted on
/usr
/var
/usr/bruce
/usr/dennis
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
Solutions
---------2251840
---------2197392
-----2%
#
# cp /vmunix /usr/bruce/big2
#
# showfdmn bruden_dom
Id
37f12c39.000263ea
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
99680
239216
1835744
---------2174640
% Used
24%
9%
1%
-----3%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
#
#
# cp /vmunix /usr/dennis/big2
# showfdmn bruden_dom
Id
37f12c39.000263ea
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
76928
239216
1835744
---------2151888
% Used
41%
9%
1%
-----4%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
#
#
# cp /vmunix /usr/dennis/big3
# showfdmn bruden_dom
Id
37f12c39.000263ea
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
76928
216464
1835744
---------2129136
% Used
41%
17%
1%
-----5%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
#
#
# showfsets -q bruden_dom
Block (512) limits
Fileset
BF
used
soft
hard grace
bruce_fset
-45536
0
0
dennis_fset
-68288
0
0
#
#
# showfsets -q bruden_dom dennis_fset
used
4
5
File limits
soft hard
0
0
0
0
grace
Solutions
grace
grace
grace
Solutions
$ df -t /usr/bruce
Filesystem
512-blocks
Used
Available Capacity Mounted on
bruden_dom#bruce_fset
50000
50000
0
100%
/usr/bruce
$
$ showfdmn bruden_dom
Id
Date Created LogPgs Version Domain Name
37f12c39.000263ea Tue Sep 28 16:59:37 1999
512
4 bruden_dom
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Free
76928
216464
1812992
---------2106384
% Used
41%
17%
2%
-----6%
Cmode
on
on
on
Rblks
256
256
256
Wblks
256
256
256
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
$
$
$ showfsets -q bruden_dom
Block (512) limits
File limits
Fileset
BF
used
soft
hard grace
used soft hard grace
bruce_fset
*68288
50000
60000
none
6
0
0
dennis_fset
-68288
0
0
5
0
0
$
$
$
$ cp /vmunix /usr/dennis/big5
$
$ df -t advfs
Filesystem
512-blocks
Used
Available Capacity Mounted on
usr_domain#usr
1426112
1025636
294816
78%
/usr
usr_domain#var
1426112
75682
294816
21%
/var
bruden_dom#bruce_fset
50000
50000
0
100%
/usr/bruce
bruden_dom#dennis_fset
2251840
91040
2083632
5%
/usr/dennis
$
Cloning
1.
Make a clone of one of your filesets. How long did it take to create?
Clones take very little time to create since no data is copied. Some metadata is
created to represent the clone.
$
$ clonefset bruden_dom dennis_fset dennis_clone
Permission denied - user must be root to run clonefset.
usage: clonefset domain origSetName cloneSetName
$
$
$
$
#
# clonefset bruden_dom dennis_fset dennis_clone
#
Solutions
2.
Check the contents of the clone. Does it match the contents of the original?
3.
Put a new file in the original fileset. Does it appear in the clone?
4.
Contents of the clone match the original fileset. New files will not appear in the
clone since the clone is effectively a snapshot. A clone cannot be written to since
the clone is a read-only, pseudo copy of the original fileset.
# mkdir /usr/den_clone
#
#
# showfdmn bruden_dom
Id
37f12c39.000263ea
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
76928
193712
1812864
---------2083504
% Used
41%
26%
2%
-----7%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
#
# showfsets bruden_dom
bruce_fset
Id
: 37f12c39.000263ea.1.8001
Files
:
6, SLim=
0,
Blocks (512) :
68288, SLim=
50000,
Quota Status : user=off group=off
dennis_fset
Id
Clone is
Files
Blocks (512)
Quota Status
: 37f12c39.000263ea.2.8001
: dennis_clone
:
6, SLim=
0,
:
91040, SLim=
0,
: user=off group=off
dennis_clone
Id
Clone of
Revision
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
HLim=
HLim=
0
60000
HLim=
HLim=
0
0
grc=
none
: 37f12c39.000263ea.3.8001
: dennis_fset
: 1
#
#
# mount bruden_dom#dennis_clone /usr/den_clone
#
#
# df -t advfs
Filesystem
512-blocks
Used
usr_domain#usr
1426112
1025638
usr_domain#var
1426112
75686
bruden_dom#bruce_fset
50000
50000
Available Capacity
294816
78%
294816
21%
0
100%
Mounted on
/usr
/var
/usr/bruce
Solutions
bruden_dom#dennis_fset
2251840
91040
2083504
5%
/usr/dennis
bruden_dom#dennis_clone
2251840
91040
2083504
5%
/usr/den_clone
#
#
#
# ls -li /usr/dennis
total 45528
3 drwx-----2 root
system
8192 Sep 28 17:04 .tags
6 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:09 big1
7 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:11 big2
8 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:12 big3
9 -rwxr-xr-x
1 obrien
system
11646960 Sep 28 17:26 big5
5 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.group
4 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.user
#
#
# ls -li /usr/den_clone
total 45528
3 drwx-----2 root
system
8192 Sep 28 17:04 .tags
6 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:09 big1
7 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:11 big2
8 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:12 big3
9 -rwxr-xr-x
1 obrien
system
11646960 Sep 28 17:26 big5
5 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.group
4 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.user
#
#
#
# cat /etc/disktab > /usr/dennis/sm1
#
# ls -li /usr/dennis/sm1
10 -rw-r--r-1 root
system
31114 Sep 28 17:32 /usr/dennis/sm1
#
# ls -li /usr/den_clone/sm1
ls: /usr/den_clone/sm1 not found
#
#
# cat /etc/disktab > /usr/den_clone/sm1
sh: /usr/den_clone/sm1: cannot create
#
#
#
# ls -li /usr/dennis
total 45559
3 drwx-----2 root
system
8192 Sep 28 17:04 .tags
6 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:09 big1
7 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:11 big2
8 -rwxr-xr-x
1 root
system
11646960 Sep 28 17:12 big3
9 -rwxr-xr-x
1 obrien
system
11646960 Sep 28 17:26 big5
5 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.group
4 -rw-r----1 root
operator
8192 Sep 28 17:04 quota.user
10 -rw-r--r-1 root
system
31114 Sep 28 17:32 sm1
Solutions
Using Trashcans
1. Delete a file from one of your filesets. Can you get it back?
2.
3.
You can retrieve deleted files only if you have a trashcan associated with the
directory.
#
#
#
#
#
#
#
#
#
rm /usr/dennis/big5
mkdir /usr/dennis/den_trash
chmod a+w /usr/dennis/den_trash
mktrashcan /usr/dennis/den_trash /usr/dennis
/usr/dennis/den_trash attached to /usr/dennis
#
#
# rm /usr/dennis/big3
#
# ls -li /usr/dennis
total 22815
3 drwx-----2 root
system
8192
6 -rwxr-xr-x
1 root
system
11646960
7 -rwxr-xr-x
1 root
system
11646960
11 drwxrwxrwx
2 root
system
8192
5 -rw-r----1 root
operator
8192
4 -rw-r----1 root
operator
8192
10 -rw-r--r-1 root
system
31114
#
#
# ls -li /usr/dennis/den_trash
total 11376
8 -rwxr-xr-x
1 root
system
11646960
#
# mv /usr/dennis/den_trash/big3 /usr/dennis
#
# ls -li /usr/dennis/den_trash
total 0
# ls -li /usr/dennis
total 34191
3 drwx-----2 root
system
8192
6 -rwxr-xr-x
1 root
system
11646960
7 -rwxr-xr-x
1 root
system
11646960
8 -rwxr-xr-x
1 root
system
11646960
11 drwxrwxrwx
2 root
system
8192
5 -rw-r----1 root
operator
8192
4 -rw-r----1 root
operator
8192
10 -rw-r--r-1 root
system
31114
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
28
28
28
28
28
28
17:04
17:09
17:11
17:38
17:04
17:04
17:32
.tags
big1
big2
den_trash
quota.group
quota.user
sm1
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
28
28
28
28
28
28
28
17:04
17:09
17:11
17:12
17:38
17:04
17:04
17:32
.tags
big1
big2
big3
den_trash
quota.group
quota.user
sm1
Solutions
Striping
1.
Create an empty striped file. Use the showfile -x command to view the
extents of the empty file.
2.
3.
4.
Revisit the extents of the striped file. Is there any performance difference in
reading the two files?
5.
Vol
2
PgSz
16
Pages
0
XtntType
stripe
Segs
2
SegSz
8
I/O
Perf
async 100%
extentMap: 1
pageOff
pageCnt
extentCnt: 0
volIndex
volBlock
blockCnt
extentMap: 2
pageOff
pageCnt
extentCnt: 0
volIndex
volBlock
File
stripe1
blockCnt
#
#
# cd /usr/dennis
#
# ls -li
total 34191
3 drwx-----6 -rwxr-xr-x
7 -rwxr-xr-x
8 -rwxr-xr-x
11 drwxrwxrwx
5 -rw-r----4 -rw-r----10 -rw-r--r-12 -rw-r--r-#
# showfile -x big3
Id
8.8001
Vol
2
2
1
1
1
2
1
1
1
1
root
root
root
root
root
root
root
root
root
PgSz
16
system
8192 Sep 28 17:04 .tags
system
11646960 Sep 28 17:09 big1
system
11646960 Sep 28 17:11 big2
system
11646960 Sep 28 17:12 big3
system
8192 Sep 28 17:38 den_trash
operator
8192 Sep 28 17:04 quota.group
operator
8192 Sep 28 17:04 quota.user
system
31114 Sep 28 17:32 sm1
system
0 Sep 28 17:39 stripe1
Pages
1422
XtntType
simple
Segs
**
SegSz
**
I/O
Perf
async 100%
File
big3
Solutions
extentMap: 1
pageOff
pageCnt
0
1422
extentCnt: 1
#showfile -x big2
Id
7.8001
Vol
1
PgSz
16
Pages
1422
extentMap: 1
pageOff
pageCnt
0
1422
extentCnt: 1
vol
2
volBlock
75504
XtntType
simple
vol
1
Segs
**
blockCnt
22752
SegSz
**
volBlock
57760
I/O
Perf
async 100%
File
big2
blockCnt
22752
#
# showfile -x big1
Id
6.8001
Vol
2
PgSz
16
Pages
1422
extentMap: 1
pageOff
pageCnt
0
1422
extentCnt: 1
XtntType
simple
vol
2
Segs
**
SegSz
**
volBlock
52592
I/O
Perf
async 100%
File
big1
blockCnt
22752
#
#
# cp big3 stripe1
#
# showfile -x stripe1
Id
c.8001
Vol
2
PgSz
16
extentMap: 1
pageOff
0
16
32
48
64
Pages
1422
pageCnt
8
8
8
8
8
XtntType
stripe
Segs
2
SegSz
8
I/O
Perf
async 100%
volIndex
3
volBlock
1093536
blockCnt
11392
volIndex
1
volBlock
80704
File
stripe1
blockCnt
11360
(...)
1392
1408
extentCnt: 1
extentMap: 2
pageOff
8
24
40
56
8
8
pageCnt
8
8
8
8
(...)
1416
1400
6
Solutions
extentCnt: 1
#
#
#
# time cat big3 > /dev/null
real
user
sys
# time
0m1.61s
0m0.00s
0m0.36s
cat stripe1 > /dev/null
real
user
sys
0m1.03s
0m0.01s
0m0.36s
2
AdvFS On-Disk Structures
Bitfiles
Mcells
Extent maps
Tags
Fragments
Resources
For more information on topics in this chapter as well as related topics, see the
following:
Header Files
Bitfiles
Mcells
Reusing tags
Think of this as the standard file system components such as directories, support for
quotas, mount points, and so forth.
The following figure depicts the FAS as conceptually connected to the BAS
through the .tags directory.
Figure 2-1:
On Disk Structures
.tags directory
(connects the
FAS with the
BAS)
.tags Directory
Consider the .tags directory as a way to access the BAS from the context of the
FAS. All files and metadata are accessible through .tags by using the files tag
number or a special metadata file name.
The tag number is conceptually similar to a UFS inode number. Use the ls -li or
showfile commands to discover a files tag. Tag numbers are associated with a
sequence number that indicates the number of times this tag has been used.
The .tags directory provides access to files within a mounted fileset using tag
numbers. The .tags directory also provides access to the lower-level, special
metadata files through predefined names (M-10 is the BMT, M-6 is the RBMT).
The new AdvFS on-disk viewing utilities (nvtagpg, nvbmtpg, nvfragpg,
nvlogpg) bury most of the details of accessing metadata files through the .tags
directory.
Each AdvFS file system has a .tags directory which allows files to be accessed
by tag and sequence number.
/Advfs_mount_point/.tags/15374
/Advfs_mount_point/.tags/0x3c0e.8001
The following example shows an inode number (tag number) being used to access
a file through the .tags directory.
Example 2-1:
# ls -li
total 31
22894 -rwxr-xr-x
1 root
system
31114 Jun 24 15:20 ob_1
#
# tail -3 ob_1
:of#169728:pf#35135:bf#8192:ff#1024:\
:og#99458:pg#149368:bg#8192:fg#1024:\
:oh#0:ph#0:bh#8192:fh#1024:
#
# tail -3 /usr/.tags/22894
:of#169728:pf#35135:bf#8192:ff#1024:\
:og#99458:pg#149368:bg#8192:fg#1024:\
:oh#0:ph#0:bh#8192:fh#1024:
#
Example 2-2:
# /sbin/advfs/tag2name /usr/.tags/22894
/usr/bruden/ob_1
#
# echo $PATH
/sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local
#
# PATH=$PATH:/sbin/advfs
#
# tag2name usr_domain -S usr 22894
open_vol: open for volume "/dev/disk/dsk2g" failed: Device busy
#
# tag2name -r usr_domain -S usr 22894<== Uses raw device (-r)
bruden/ob_1
#
The following figure depicts the AdvFS metadata being used to access the bitfiles
by referencing a file system directory.
Figure 2-2:
tag 623
tag 51
tag 893
AdvFS
Metadata
File3 on disk
LBN
80334
(AdvFS sees this
as a bitfile.)
The following figure shows the logical file as a series of 8K blocks and being
represented at the lower level by one or more mcell data structures found in the
BAS.
Figure 2-3:
Logical File
On Disk
owner
group
size
mod bits
....
8K Pages
(Primary) mcell
Additional mcell(s)
292 bytes
optional
Contains variable
can contain more extent
sized records such as;
map records if needed
POSIX attributes
extent map records
extent 1
extent 2
Bitfiles
Bitfile characteristics include an array of 8K pages and are stored as extents:
All sectors are free or in a bitfile and are managed by mcell chains.
Use the showfile command to find the tag and sequence number.
Mcells
Several metadata bitfiles (RBMT, BMT) have an internal page organization
consisting of a page header and a series of mcell data structures. Each mcell can
contain a series of variable-length records describing various bitfile attributes and
characteristics.
AdvFS locates extents by finding the files primary metadata cell (mcell) and
stepping through the mcells to find the extent information.
The tag number is like an inode number, but an mcell functions like an inode.
Each mcell is 292 bytes and can fit 28 on an 8K page (plus a 16-byte header).
The following figure shows how a files tag number can locate the files primary
mcell in the BMT. The primary mcell provides access to the actual data blocks of
the file.
Figure 2-4:
Massaged tag #
.
.
.
Bitfile-Set
Bitfile-sets have the following characteristics:
Identified by numbers
Domain IDs can be found using the showfdmn command. Fileset IDs can be
found using the showfsets command.
Reusing Tags
Each time a file is created, a tag is allocated to represent that file. When the file is
deleted, the tag is recycled. If the tag is selected for reuse, AdvFS can distinguish
between the incarnations of the tag by referencing the tags sequence number. The
sequence number is 16 bits, with the leftmost bit used as the in use indicator.
Therefore sequence number 8003 means the tag is in use (0x8 = 1000 binary), and
it is the third use of the tag. Of the remaining 15 bits, only 12 are used for
sequencing. Therefore a tag can be reused 4096 times before it becomes a dead
tag.
Tag numbers can be reused:
Leftmost bit indicates tag in use; remaining 15 bits are used for sequencing.
Storage bitmap
Miscellaneous bitfile
In addition to the per-volume structures, each domain also has the following
structures. For these structures there is only one per domain and they can reside on
any volume in the domain:
Transaction log
Figure 2-5:
Reserved Bitfile
Metadata Table
Reserved Bitfile
Metadata Table
Storage Bitmap
Per Volume
Storage Bitmap
MISC Bit File
Per Domain
Per Fileset
fileset A
The following example uses the nvtagpg command to display the root tag file of
the usr_domain. The -r specifies that the raw device be used for access instead
of the block device eliminating a device busy error.
Example 2-3: Displaying the Root Tag File
# nvtagpg -r usr_domain
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk2g) lbn 96
root TAG page 0
-------------------------------------------------------------------------currPage 0
numAllocTMaps 3 numDeadTMaps 0 nextFreePage 0 nextFreeMap 5
tMapA[1]
tMapA[2]
tMapA[3]
#
tag 1
tag 2
tag 3
seqNo 1
seqNo 1
seqNo 1
1 0 1
1 0 13
2 2 4
usr
var
ob_fset
The following example displays summary information about the BMT for volume
one in the usr_domain.
Example 2-5: Displaying BMT for Volume 1 of usr_domain
# nvbmtpg -r usr_domain 1
Miscellaneous bitfile
Contains bootblocks and is four pages in size
Tag file consists of 8K pages with 1022 tagmap entries (8 bytes each) preceded
by a 16-byte header:
Tagmap entry contains the sequence number, volume index, and primary
mcell ID (BMT page number and cell number within page)
The following figure shows information from the fileset tag file locating the
primary mcell for a file. There may be a chain of mcells describing the file.
Figure 2-6:
BMT
.
.
.
tag 893
Sequence # 3,
Volume # 1,
BMT page 811,
mcell 7
.
.
.
.
.
.
The following example uses the tag number of a file to locate the tag directory file
entry for the file. The volume, page, and cell information found in the tag directory
file is used to access the primary mcell of the file.
Example 2-6: Finding Primary Mcell through Tag Directory
# ls -li big1
22896 -rwxr-xr-x
1 root
system
#
#
# nvtagpg -r usr_domain -T 1 -t 22896
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk2g) lbn 2055136
"usr" FRAG page 22
-------------------------------------------------------------------------currPage 22
numAllocTMaps 1022 numDeadTMaps 0 nextFreePage 0 nextFreeMap 0
tMapA[412]
#
#
#
#
tag 22896
seqNo 1
1 951 15
#
# nvbmtpg -r usr_domain 1 951 15
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk2g) lbn 23552
BMT page 951
-------------------------------------------------------------------------CELL 15
next mcell volume page cell 2 2 9
bfSetTag,tag 1,22896
RECORD 0
bCnt 92
type BSRA_VALID
BSR_ATTR
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 1 951 16
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
573376 (0x8bfc0)
bsXA[ 1]
bsPage
21 vdBlk
-1
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100755 (S_IFREG)
st_uid 0
st_gid 0
st_size 13729520
st_nlink 1
dir_tag 22893 st_mtime Thu Jun 24 16:53:06 1999
A fragment bitfile:
Function
M2
M3
One Per
(...)
Mn
1
2
3
4
5
6
7
(...)
n
Fileset
Metadata BitfileTags
Nonreserved bitfiles (user files) are assigned tags from their tag file. Reserved
bitfiles (metadata bitfiles) do not have tags assigned from a tag file because they
exist before a tag file exists (such as the root tag file) and because their mcell
locations must always be in a known place. Therefore, reserved tags are calculated
as follows:
tag = - (reserved-bitfile-primary-mcell-number + (volume-index * 6))
Since tags are used to locate the bitfiles primary mcell, the BAS translates a
reserved tag to the primary mcell by reversing the above calculation (translating the
tag to a volume number and an mcell address):
volume-index = tag / 6
reserved-bitfile-primary-mcell-number = -tag % 6
So, for RBMT tags -6 and -12:
-6:
-6/6 == volume-index:1
-6:
-6%6 == mcell:0
-12:
-12/6 == volume-index:2
-12:
12%6 == mcell:0
Formula
Disk 1
Disk 2
RBMT
- (0 + (vol * 6))
-6
-12
SBM
- (1 + (vol * 6))
-7
-13
- (2 + (vol * 6))
-8
-14
Log
- (3 + (vol * 6))
-9
-15
BMT
- (4 + (vol * 6))
-10
-16
Misc Bitfile
- (5 + (vol * 6))
-11
-17
Metadata bitfile tags can be printed in unusual tags, which effectively translate to
negative numbers.
fffffffa.0 RBMT for disk 1, fffffff3.0 SBM for disk 2
.tags for Directory Entries for Metadata Bitfiles
The special file names in the .tags directory can take several forms. M-6 is more
readable than -6, which would also work. Start with an M:
For example, if /usr is an AdvFS fileset, use the values in the table.
Table 2-2: .tags for Metadata Bitfiles
File
Description
/usr/.tags/1
Fragment bitfile
/usr/.tags/M-6
RBMT of disk 1
/usr/.tags/-6
/usr/.tags/M-15
Log of disk 2
/usr/.tags/M2
BMT is represented by a file found under the .tags directory. The special file
name is M-10. It contains a series of 8K pages just like any other AdvFS file,
however, its pages contain mcells (292 bytes each) and header information.
Each mcell contains one or more variable-length records describing various file
attributes, extents, permissions, fragment info, and so forth.
The bitfile metadata table can grow just as any file can grow; it just adds another
extent. It starts with slightly more than 1M (can be tailored).
BMT is created when the mkfdmn command is issued. There is one BMT for each
volume in the domain.
The BMT stores bitfile metadata, including:
Bitfile attributes
The BMT is an array of 8KB pages where each page consists of a header and an
array of fixed-size metadata cells (mcells), where each mcell contains one or more
variable-length records. The records are typed (for example, bitfile attributes, or
extent map).
BAS record types are defined in src/kernel/msfs/msfs/bs_ods.h and
ms_public.h.
The BMT contains all mcells for all files other than the reserved bitfiles:
User files
User directories
RBMT reserves the last mcell on each page to chain to other pages of mcells.
The following figure shows the on-disk layout for most of the reserved bitfiles.
Figure 2-7:
Mcell Records
These characteristics describe mcells and the records within them.
Inodes of AdvFS are 28 fixed-size (292 byte) mcells packed into 8K pages
Each mcell contains variably sized records describing attributes of the bitfile
Domain attributes
Fragment attributes
Page
page header
mcell
mcell header
record
record
record
mcell
28 mcells
per page
mcell header
record
record
record
mcell
mcell header
record
record
record
variable sized
records
RBMT Page 0
RBMT page 0 starts at sector 32 (LBN 32) and contains these primary mcells:
RBMT also contains all secondary mcells (extent maps) for the BMT.
BMT Page 0
The BMT page 0 includes the head of the BMT page free list. Any BMT page that
contains at least one free mcell is on this free list. The free list head is maintained
in the first mcell in BMT page 0. Note that BMT page 0 is not included in this free
list.
BMT page 0 starts at Sector 48. Mcell 0 is the head of the BMT page free list. It
contains mcells for nonreserved bitfiles (that is user files and directories). All other
BMT pages are found via the RBMT.
BMT Page Format
Each 8192-byte page is comprised of a 16-byte header followed by twenty-eight
292-byte mcells.
The BMT header consists of:
/*
/*
/*
/*
/*
/*
Mcell Addresses
Mcells can be located in several ways. The mcell is most often found through the
tag file; the BMT page number and mcell number (within page) are all that is
needed. Mcells are addressed by a 32-bit mcell ID, bfMCIdT.
RBMT itself
Transaction log
BMT
Miscellaneous bitfile
Mcell Format
Each mcell begins with a 24-byte header:
32-bit ID of the next mcell in the chain and virtual disk containing next mcell
/*
/*
/*
/*
/*
/*
Mcell Records
Mcell contents are arranged in variable-length records. They vary in size and type
and begin with a 4-byte header.
{
: 16;
: 8;
: 8;
nvfragpg
nvlogpg
nvtagpg
vsbmpg
vfilepg
savemeta
Encoding of extents
For striped files, extent map records use a shadow extent map and may point to
more than one disk.
Extent Maps for Reserved Files
Extent maps for reserved files have these characteristics:
Extra extent map (usually only needed for the BMT itself)
This format can be confusing. You will often see that an extent count displayed by
the showfile -x command is one less than seen when visiting the files mcells.
The above sequence indicates a file with three extents:
Extent Structure
Using Tags
Using Tags
Overview
This section discusses the function of the fileset tag files. Do not confuse these files
with the .tags directory.
Tagmap entries
UNIX directories
POSIX files
Volume index
Tag files are used to translate a bitfile tag to the location of its primary mcell. The
file is indexed by tag number and the entry contains the logical address of the
primary mcell, which is a tuple of the following format:
<volume index, BMT page number, mcell's index within the BMT page>
Using Tags
A bitfile tag consists of a tag number and a sequence number. Whenever a bitfile is
deleted, its tag is placed back on the free list. However, for various consistency
reasons (like crash recovery) AdvFS cannot reuse the tag unless it is made unique
from previous uses of that tag. Therefore, each time a tag is reused, its sequence
number is incremented to differentiate it from the previous use of the same tag. The
sequence number has a limited number of bits, so a tag can be used 4096 times and
then it becomes a dead tag, never to be reused again.
Tag files introduce an extra level of overhead in accessing file data.
The following figure depicts an FAS file access request directed to the tag file to get
the location of the primary mcell. The files mcells will point to the logical blocks
of the file.
Figure 2-9:
BMT
...
File on disk
LBN 80334
The following figure shows the files data moving physically with no changes in the
FAS level structure information.
Using Tags
BM T
...
File on disk
LBN 88526
/*
/*
/*
/*
/*
Using Tags
Tagmap Entries
Three different formats for entries in a tag file:
Using Tags
uint32T nextMap;
} tm_s2;
/*
* In use tagmap struct.
*/
struct {
uint16T seqNo;
/* must overlay seqNo in tm_s2 */
uint16T vdIndex;
/* virtual disk index */
bfMCIdT bfMCId;
/* bitfile mcell id */
} tm_s3;
} tm_u;
} bsTMapT;
Since you can have many filesets within a domain, there must be a way to locate the
tag file that is pertinent to each fileset. This is accomplished using the root tag file.
Fileset Tag File
Each fileset has its own fileset tag file.
Using Tags
A clone fileset is a read-only, virtual copy of the data as it existed at the time the
clone was created.
As original data changes while the clone exists, a:
The appropriate entry in the new copy of the fileset tag file must be updated to point
to the cloned pages new mcell in the BMT.
The figure shows the fileset tag file without a clone (on the left) and then shows how
the structures change when a clone is created.
Figure 2-11: Fileset Tag File Before and After Cloning
No Clone
original data
(LBN 919)
No data is copied unless a change is made to the original data. Only thedata about
to be changed is copied. A clone is effectively a snapshot of the data at a known
time.
The following figure depicts the fileset tag file after a change has been made to the
original data.
Using Tags
No Clone
original data
(LBN 919)
including
changes
original data
(LBN 1214)
copied before
changes were
made in LBN
919
tag 1
tag 2
tag 3
seqNo 1
seqNo 1
seqNo 1
1 0 1
1 0 13
2 2 4
usr
var
ob_fset
Using Tags
tag
tag
tag
tag
tag
(...)
1
2
3
4
5
seqNo
seqNo
seqNo
seqNo
seqNo
1
1
1
1
1
primary
primary
primary
primary
primary
mcell
mcell
mcell
mcell
mcell
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
1
1
1
1
1
0
0
0
0
0
3
4
6
7
8
The example shows how to use the individual files tag file entry.
Example 2-13: Displaying Individual Files Tag File Entry
# ls -li big1
22896 -rwxr-xr-x
1 root
system
#
# nvtagpg -r usr_domain -T 1 -t 22896
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk2g) lbn 2055136
"usr" FRAG page 22
-------------------------------------------------------------------------currPage 22
numAllocTMaps 1022 numDeadTMaps 0 nextFreePage 0 nextFreeMap 0
tMapA[412]
#
# bc
22896/1022
22
22896%1022
412
^D
#
tag 22896
seqNo 1
1 951 15
Using Tags
UNIX Directories
UNIX directories are contained in standard bitfiles.
AdvFS format is similar to UFS format except the:
Tag+sequence#: 64 bits
POSIX Files
The following figure shows how a directory file points to a fileset tag file, to an
entry in the BMT and ultimately to a POSIX file.
Using Tags
Directory File
File Data
Fileset Tag File
BMT
The ability to move a bitfiles data transparently; this is supported by the buffer
cache and I/O scheduling algorithms.
The ability to move a bitfiles metadata to another volume; tag files enable this.
When migration moves a bitfiles metadata to another volume, it simply updates the
bitfiles tag directory entry to point to the new metadata location. This makes
migration a purely BAS issue or feature since tag directories are part of the BAS
layer and the FAS layers structures are left unchanged.
Assigning Fragments
Assigning Fragments
Overview
A file that is not an exact multiple of 8K in size will most likely have a fragment
assigned to it. This fragment will hold the excess data in a piece of disk storage
represented in a fragment bitfile.
Fragment bitfile
Fragment groups
Fragment header
Fragment utilities
Fragment Bitfile
These are characteristics of fragment bitfiles:
In 1Kpages.
Assigning Fragments
The figure shows the fragment bitfile locating various fragment groups.
Figure 2-14: Fragment Bitfile Locating Fragment Groups
1k Listhead
2k Listhead
List of 2k frags
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
3k Listhead
4k Listhead
5k Listhead
List of 4k frags
| | | | |
6k Listhead
7k Listhead
Fragment Header
Fields in the fragment header (1024 bytes) include:
Fileset ID
Version
Assigning Fragments
/*
/*
/*
/*
/*
/*
/*
/*
* the following fields were added in ADVFS v3.0
* they were all zeros in pre-ADVFS v3.0
*/
unsigned int version;
== 1 */
uint32T firstFrag;
/*
* the following is used as a map of the free frags in the group.
* it is a linked list where element zero (0) is used as the head
* of the list (since frag 0 is always the group header it can
* never be allocated so element zero would otherwise be unused)
*/
unsigned short freeList[ BF_FRAG_GRP_SLOTS ];
} grpHdrT;
Fragment Utilities
The nvfragpg utility displays statistics about fragment use.
This example shows summary statistics.
Example 2-15: Fragment Group Statistics Display Using nvfragpg
# nvfragpg -r usr_domain usr
==========================================================================
DOMAIN "usr_domain"
-------------------------------------------------------------------------reading 438 frag group headers, 400 headers read
frag type
free
1K
2K
3K
4K
5K
6K
7K
totals
groups
2
44
67
80
76
63
52
54
438
frags
5588
4254
3386
2413
1600
1100
979
19320
frags used
5469
4245
3364
2405
1581
1093
973
19130
disk space
256K 5632K 8576K 10.0M 9728K 8064K 6656K 6912K
54.8M
space used
- 5469K 8490K
9.9M 9620K 7905K 6558K 6811K
53.7M
space free
254K
119K
18K
66K
32K
95K
42K
42K
668K
overhead
2K
44K
67K
80K
76K
63K
52K
54K
438K
wasted
0K
67K
80K
228K
126K
52K
54K
607K
% used
97%
98%
98%
98%
98%
98%
84%
98%
Assigning Fragments
any
free 1K
full 1K
free 2K
full 2K
free 7K
full 7K
6976
6960
0
1616
3936
5344
6880
64
1040
3088
3952
4496
4976
6144
(...)
6864
80
1328
3168
3712
6992
6912
112
1840
3968
5456
6928
128
2928
4192
5536
560
176
3184
4544
5600
224
3280
4816
5760
320
3424
4864
6240
400
3568
4912
6528
496
3808
4928
6608
944
3856
4944
6640
1184
3904
5120
6848
208
1168
3104
4032
4528
5168
6320
256
1264
3120
4080
4560
5360
6480
272
1520
3200
4144
4592
5488
6560
288
1664
3360
4160
4608
5552
6624
336
2480
3504
4288
4624
5584
6656
480
2736
3792
4304
4656
5616
624
3024
3824
4352
4688
5664
784
3056
3872
4400
4704
5824
928
3072
3888
4448
4896
5984
384
1440
3296
4048
512
1568
3408
4224
544
1680
3488
4432
656
1792
3536
4784
704
2528
3584
5072
768
2608
3600
5184
832
2688
3632
5200
912
2800
3664
5232
1024
2944
3680
5264
Assigning Fragments
5472
6448
5680
6672
5792
6816
5888
6000
6080
6128
6224
6336
6400
After you have found a fragment location, you can copy it using dd, with a
command similar to:
dd if=/users/.tags/1 of=/tmp/frag.cpy bs=1024 iseek=717 count=2
The following example hunts down a fragment of a file. The test file ob_1 is a copy
of the /etc/disktab file.
Example 2-17: Tracking Down a Fragment
# ls -li ob_1
22894 -rwxr-xr-x
1 root
system
#
#
# nvbmtpg -r usr_domain usr 22894 -c
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk2g) lbn 23552
BMT page 951
-------------------------------------------------------------------------CELL 4
next mcell volume page cell 0 0 0
bfSetTag,tag 1,22894
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
572976 (0x8be30)
bsXA[ 1]
bsPage
3 vdBlk
-1
BSR_ATTR
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100755 (S_IFREG)
st_uid 0
st_gid 0
st_size 31114
st_nlink 1
dir_tag 22893 st_mtime Thu Jun 24 15:20:45 1999
fragId.type BF_FRAG_7K fragId.frag 54990
#
Assigning Fragments
The FAS layer uses fragments in the following way. When a write exceeds the
fragment size, a page is allocated to the file and the fragment is copied to the new
page and the fragment is deallocated.
SBM format
Miscellaneous bitfile
Represents each 8K of on-disk storage within a volume with 1 bit (1K per bit in
DIGITAL UNIX V4.0)
Is .tags/M-7
On-disk SBM is little more than an array of bits (1 bit per page)
Each AdvFS volume contains a storage bitmap which keeps track of allocated disk
space. In AdvFS terminology, a block is a 512-byte sector, a cluster is one more
contiguous block, and a page is 16 blocks. Each bit in the storage bitmap represents
a page. If the bit is set, the page is allocated to a bitfile; if the bit is clear, the page
is free (available for allocation). The cluster size is definable on a volume basis,
however AdvFS currently uses a cluster size of two blocks (1K byte) for all
volumes. The bigger the page size, the smaller the bitmap.
The storage bitmap is structured as an array of 8KB pages where each page consists
of an array of 32-bit integers (each bit represents a page). Each page also contains
a header containing an XOR checksum of the integer array.
SBM Format
SBM page format consists of:
Bitmap
65472 bits
Enough for 8184 pages (8K each)
/var/.tags/M-7
ffff 00ff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff
0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000
0000 ffff ffff ffff ffff ffff
ffff 00ff ffff ffff ffff ffff<== Big bitmap.
ffff ffff ffff ffff ffff ffff
ffff ffff 0000 ff00 ffff ffff
ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff
/var/.tags/M-7
vol
1
volBlock
112
blockCnt
64
#
# ls -li /var/.tags/M-7
4294967289 ---------0 root
#
system
24576 Dec 31
1969 /var/.tags/M-7
2.
Byte offset into SBM for page 40000 is 4 * 8192 + 7264 + 8 or 40040 ( 40000
+ (4+1)*8, is easier).
3.
Miscellaneous Bitfile
Characteristics of the miscellaneous bitfile include:
Summary
Summary
Introducing AdvFS On-Disk Structures
AdvFS is built using a two-layer strategy separating file access support from file
storage support. The two layers are:
Consider the .tags directory as a way to access the BAS from the context of the
FAS. All files and metadata are accessible through .tags by using the files tag
number or a special metadata file name.
All AdvFS on-disk structures can be accessed as bitfiles. This includes user files and
directories as well as the AdvFS metadata structures.
Bitfiles are arrays of 8K disk pages holding user data or metadata. A series of
contiguous 8K pages in a bitfile is stored as an extent
Each bitfile is identified by its tag, which consists of a tag number or sequence
number pair. Use the tag number to locate the extents of a file.
Several metadata bitfiles (RBMT, BMT) have an internal page organization
consisting of a page header and a series of mcell data structures. Each mcell can
contain a series of variable-length records describing various bitfile attributes and
characteristics.
AdvFS files have means of identification: a tag
Identified by numbers
Summary
Storage bitmap
Miscellaneous bitfile
Bitfile metadata table (BMT) holds the support data for user files and directories.
It contains location information, permissions and other stats, extent information,
fragment location, and other descriptive data.
The BMT stores bitfile metadata, including:
Bitfile attributes
Inodes of AdvFS are 28 fixed-size (292 byte) mcells packed into 8K pages
Each mcell contains variably sized records describing attributes of the bitfile
Summary
Using Tags
Tag files translate a bitfile tag to the location of its primary mcell. The file is
indexed by tag number and the file entry contains the logical address of the primary
mcell which is a tuple of the following format:
<volume index, BMT page number, mcells index within the BMT page>
A bitfile tag consists of a tag number and a sequence number. Whenever a bitfile is
deleted, its tag is placed back on the free list. However, for various consistency
reasons (like crash recovery) AdvFS cannot reuse the tag unless it is made unique
from previous uses of that tag. So, each time a tag is reused, its sequence number
is incremented to differentiate it from the previous use of the same tag. The
sequence number has a limited number of bits, so a tag can be used 4096 times and
then it becomes a dead tag, never to be reused again.
Assigning Fragments
Storage allocation in AdvFS is done in 8KB page units. For small files this can
cause internal fragmentation. To solve this problem, AdvFS uses storage fragments
that are 1KB to 7KB in size to store small files and the ends of files less than 100KB
in size.
Fragments are allocated from the fragment bitfile, which is a metadata bitfile
associated with each bitfile-set (it is always assigned tag 1). The basic structure of
the fragment bitfile is a collection of fragment groups where each group contains a
header and an array of fragments of a uniform size.
Defining the Storage Bitmap Bitfile and Miscellaneous Bitfile
Each AdvFS volume contains a storage bitmap that keeps track of and allocates disk
space. In AdvFS terminology, a block is a 512-byte sector, a cluster is one more
contiguous block, and a page is 16 blocks. Each bit in the storage bitmap represents
a page. If the bit is set, the page is allocated to a bitfile; if it is clear, the page is free
(available for allocation). The cluster size is definable on a volume basis, however
AdvFS currently uses a cluster size of two blocks (1K byte) for all volumes.
The storage bitmap is structured as an array of 8KB pages where each page consists
of an array of 32-bit integers.
Exercises
Exercises
The exercises in this chapter are preceded by a refresher or primer section. Please
read the information carefully. It serves not only as a reminder of lecture
information, it sometimes introduces new points.
Bitfiles and Tags Lab Refresher
The lowest level of the AdvFS is the bitfile access system. Here every file is a
bitfile, a collection of 8192-byte pages. The higher level of AdvFS, or file access
system, transforms bitfiles into normal UNIX files.
When tags are used for the first time, they are given a sequence number of 8001
hexadecimal or 19647 decimal. You will notice from the output of showfile that
sequence numbers rarely get much greater than the initial 8001 value.
AdvFS file systems are also identified by tags. If you use the showfsets
command on a file domain, you will see that the ID of a fileset is a sequence of four
hexadecimal numbers, such as 319b7053.00092e01.2.8002.
The first two hexadecimal numbers, in this case, 319b7053.00092e01, identify the
file domain. The last two hexadecimal numbers, here 2.8002, are tags that identify
the fileset.
Every AdvFS file system has a .tags subdirectory that allows direct access, for the
superuser, to bitfiles by tag number. A file in the /users file system with tag
1bb88.803a can be addressed using .tags through a wide variety of names
including:
/users/.tags/0x1bb88
/users/.tags/113544
/users/.tags/0x1bb88.0x803a
Exercise
1.
Use the showfile and the ls -i commands to list the tag numbers of a few
AdvFS files and then access the files through the appropriate .tags directory.
2.
Exercises
One important use of the BMT is the storage of extent records that describe the
pages used by all bitfiles of the disk.
Each 8192-byte page of the BMT is comprised of a 16-byte header followed by an
array of twenty eight 292-byte mcells.
The BMT header starts with three fields used to track free mcells. It then contains
a field giving the pages number within the BMT bitfile and the version number of
the advanced file system being used in this file domain. The present version number
is 4.
Mcell Format Lab Refresher
Every bitfile has a primary mcell. The primary mcell is the beginning of a chain of
mcells which describe the bitfile. Mcells are addressed by a 32-bit mcell ID,
bfMCIdT, in which the first 27 bits give the mcells BMT page number and the
remaining 5 bits give the mcells position within its BMT page. Tag files, described
in another section, translate a bitfiles tag number into a 16-bit disk index and a 32bit mcell ID which points to the bitfiles primary mcell.
The 292-byte mcell begins with three fields used to link the chain of mcells
associated with a particular bitfile. The first field is the 32-bit ID of the next mcell
in the chain and the second field is the disk containing that mcell. Some bitfiles, in
particular striped files, will have mcells located on several disks. The third field
gives the position of this mcell within the chain. A disk and mcell ID of zero,
indicates the end of the mcell chain.
The remaining two header fields are a pair of tags that uniquely identify the bitfile.
The second tag of the page names the bitfile set, or file system, in which the bitfile
is contained. The first tag is the tag of the bitfile itself.
After these five header fields, 268 bytes remain within the mcell. These 268 bytes
contain mcell records.
Reserved Mcells Lab Refresher
The primary mcells of certain important bitfiles must be located at fixed positions
within the RBMT. Within RBMT page 0, there are seven reserved positions.
0
Exercises
BMT page 0 has a reserved mcell at slot 0. This mcell is the head of the BMTs list
of free mcells. Every disk must contain a BMT, a storage bitmap, and a
miscellaneous bitfile; however, only one disk of the file domain needs a root tag file
and a transaction log bitfile.
The reserved bitfiles do have special tags. Take the index of the virtual disk on
which the reserved bitfile is located, multiply that number by -6, and then subtract
the mcell position found in the above table. For example, the storage bitmap of disk
two has tag -13, 2*(-6)-1, and a transaction log on disk seven has tag -51, 7*(-6)-9.
You can use these tags to access reserved bitfiles via the .tags directory. /usr/
.tags/-22 (or M-22) would be the BMT of the second virtual disk of the file
domain that contains /usr.
Mcell Records Lab Refresher
Mcell records vary in size and type. Every mcell record begins with a 4-byte header
which gives the records size and type. Records are simply stored sequentially in
the mcell. Some records are so large that they fill the entire mcell. Others are only
8 bytes long, including header.
The lower-numbered record types are associated with the BAS layer of AdvFS.
These describe bitfile information such as extents and fileset names. The highernumbered record types are associated with the FAS layer of AdvFS. This is where
information such as file modification times and symbolic link names are stored.
Exercise
Within the /sbin/advfs directory is the nvbmtpg program which prints out
BMT records. Read the reference pages for nvbmtpg.
1.
2.
Use the nvbmtpg command to look at the first two pages of the RBMT on your
virtual disk. Save this information in a file. If a printer is available, you may
want to print out this information.
3.
Use the nvbmtpg -c command to look at the mcell chains for the BMT and
storage bitmap. Write down the extent map of the BMT. You will find it useful.
4.
Use the showfile -x command with the BMTs .tags directory entry as
an argument to verify that you successfully completed the last exercise.
5.
Try using nvbmtpg with the BMT's .tags directory entry as an argument.
You must have a fileset of the file domain successfully mounted to do this.
6.
Verify that the data of your chosen files really is stored in the pages shown in
the extent map by reading the data through the raw device that AdvFS uses to
store the data. Here is one example of someone doing this exercise:
Exercises
$ showfdmn -k play_dmn
Id
3269046b.000bc403
Vol
1
2L
1K-Blks
1067152
1055509
---------2122661
Date Created
Sat Oct 19 12:40:11 1996
Free
402864
387696
---------790560
% Used
62%
63%
-----63%
Cmode
on
on
Wblks
128
128
Vol Name
/dev/rz3c
/dev/rz2c
$ showfile -x bmtmisc.c
Id
bf48.8002
Vol
1
PgSz
16
Pages
1
extentMap: 1
pageOff
pageCnt
0
1
extentCnt: 1
XtntType
simple
vol
1
Segs
**
volBlock
1601392
SegSz
**
Log
off
Perf
100%
File
bmtmisc.c
blockCnt
16
Now create a striped file, at least 1 megabyte in size, and use nvbmtpg -c,
and showfile to find its extent map. You must look into the BMTs of at least
two virtual disks to obtain this information.
8.
Create a file with a few large holes and then look up its extent map. An easy
way to create a file with holes is:
Create a clone fileset. Use ls -i to verify that the tag numbers of the files in
both the original and clone filesets are the same. Use nvbmtpg to verify that
even the mcell IDs are unchanged.
10.
Modify a large file in the original fileset by appending some blocks to the end
of the file. (#cat some_file >> large_file) (or use dd with the
oseek and count options). Now use ls -i and nvbmtpg to see that, while
the tags are unchanged, the mcell IDs are now changed. Use showfile -x
and nvbmtpg -c to look at the extent maps of both original and clone.
11.
Use nvbmtpg -c to look at mcell number 0 on page 0 of the BMT for the first
volume of a domain. Note that the mcell free list is minimal. This is part of the
dynamics built into AdvFS for Tru64 UNIX V5.
12.
Look at bitfile attributes and bitfile inheritable attributes for reserved files,
nonreserved regular files, and finally nonreserved directories.
Exercises
13.
Look at bitfile attributes for a clone file with a modified original and then look
at the bitfile attributes for the original.
14.
Print out the mcell records for an original and a cloned fileset.
15.
This exercise is difficult. Try deleting a fileset with lots of large files. While the
deletion is in progress, examine the fileset mcell record to look at the progress
of the deletion through the delete pending change.
16.
Convince yourself that executing the chfsets command really does result in
modification of the appropriate fileset attributes record.
17.
Examine the domain attribute and virtual disk records for your AdvFS disks.
};
Exercises
If an mcell corresponds to a symbolic link, the mode field of the POSIX file stat
record is marked. If the name of the symbolic link target will fit into a BMT record,
a special BMT record is created which contains the target name as its data value.
Longer symbolic link names, which are very rare, are stored as file data.
1.
Examine the BMT POSIX file stat records for a few of your files. See how the
information stored in this record is reflected in the output of ls -l.
2.
Now create some symbolic links and examine the corresponding BMT fast
symbolic link records.
Use mktrashcan to create a trashcan directory and then examine the BMT
record that points to the trash.
Exercises
The 16 bytes of the header give the logical address of the page within the tag file,
pointers to free tagmap entries and to pages with free entries, a count of allocated
tagmap entries, and a count of dead tagmap entries.
There are actually three record formats for the 8-byte tagmap entries. The first entry
on page 0 of the tag file isnt really used to map tags to mcell IDs. Instead it contains
the page addresses of the first tag file page with a free entry and the first tag file
page that has not yet been initialized.
The second format for tagmap entries links the free entries of a page.Note that even
though the entry is free, the sequence number is still maintained. The final format
contains a real tag to mcell ID mapping:
Because tags can be reused when files are deleted and have their tags reclaimed,
sequence numbers distinguish reincarnations of the tag. If a tag is in use, the first
bit of the 16-bit sequence number is on. This is why the sequence numbers printed
by showfile usually start with the hexadecimal digits 80. This leaves 15 bits for
recording the real sequence number.
Given a tag number, it is not hard to find the appropriate tagmap entry. Divide the
tag number by 1022 to find the appropriate tag file page. Use the remainder of that
division to find the tagmap entry within the page. Just multiply that remainder by
eight and add in 16 for the page header.
Two Types of Tag Files Lab Refresher
Every AdvFS file domain has a single root tag file that gives the location of the
mcells associated with the filesets of the domain. The primary mcell of the root tag
file is located in position 2 of page 0 of the RBMT. Only one virtual disk of the
domain contains the true root tag file. The domain mutable attributes record of the
RBMT fingers the real one. The root tag file is usually found at block 96 on the
virtual disk, but an aggressive use of addvol and rmvol may cause it to move to
another location.
Every AdvFS fileset has its own tag file. The fileset ID, found in the bitfile-set
attributes record, is the tag for the fileset. Use this number as an index into the root
tag file to find the mcell ID for the fileset itself. The extent map found in the filesets
mcell chain gives the pages of the filesets own tag file. In general, the search goes
in the other direction; the root tag file is searched to locate a particular fileset.
For convenience, the .tags directory has its own special naming convention for
fileset tag files. Putting the letter M before the fileset ID gives the name of the tag
file as found in the .tags directory. For example, if the mounted file system
/playpen has fileset ID 5, /playpen/.tags/M5 is the name of /playpens
tagfile.
Exercises
Exercise
1.
Start by running showfsets on your AdvFS file domains so that you will
know a few fileset IDs to use in the remaining exercises.
2.
Use the nvtagpg program, located in /sbin/advfs, to list the root tag files
of an AdvFS file domain.
3.
Select a target file and use both showfile and ls -i to obtain its tag
number. The reason for using two programs is that one prints the tag number in
decimal and other prints the sequence number.
4.
Divide the tag number by 1022 and write down both the quotient and remainder.
The quotient determines the page number containing the appropriate tagmap
entry while the remainder determines the position within the page. (The
previous calculation was more useful in V4 than in V5 of Tru64 UNIX.) Now
use nvtagpg to get the tagfile page entry.
If the sequence numbers of nvtagpg and showfile do not match, you do
not have the right tagmap entry. You may need to convert from hexadecimal to
decimal to verify the match.
5.
Exercises
Every file within a directory has its own directory entry. The AdvFS directory entry
has five fields and two places where padding may be inserted. The first three fields
are considered the directory header. The first field, 4 bytes in size, gives the tag
number of the file. In a UFS directory entry, this is where the inode number is
stored. The next two fields, each 2 bytes long, give the size of the directory entry
and the size of the file name.
The fourth field of the directory entry is the file name.
In AdvFS there is a fifth field, an 8-byte tag consisting of tag number and sequence.
Up to 4 bytes of padding may precede the tag to ensure that the tag is stored on a 4byte boundary. More padding may follow the tag to fill out the entire directory
entry.
The reason why there may be up to 4 bytes of padding before the tag is that the file
name field is always followed by at least one null character.
Directory entries should never cross sector, 512-byte, boundaries. For this reason,
you often see that directory entries near the end of a sector will have a generous
allotment of padding. This enables them to fill the sector.
A directory entry with zero in its first 4 bytes, the location of the tag number in
AdvFS and the inode number in UFS, is considered empty. When a directory is
created, it is given two directory entries for . and .. which are placed at the
beginning of the directory file. The remainder of the directory file is filled with
empty sector-sized directory entries.
Exercise
1.
Create a directory and connect into it. Now look at the directory file by typing
the following commands:
Notice the entries for . and .. along with all the empty directory entries.
2.
Use the touch command to create five files, i, ii, iii, iv, and v, within
your new directory. Use od and vfilepg to examine the directory file.
3.
Remove the file iii. Use od to determine what happens to the directory entry
for iii.
4.
Now remove ii. Notice how the old directory entries for ii and iii have
been merged.
5.
You may have noticed that the tags for ii and iii continue to reside in the
directory file and may be wondering about the possibilities for file undeletion.
Return to reality by remembering what happens to free tagmap entries.
Exercises
6.
Create, via touch, a file vii and notice where its directory entry is placed.
7.
Create several files with very, very long names and see how the creation of
directory entries avoids crossing the sector boundaries.
8.
You have already encountered mention of fragments in two BMT records: the
bitfile-set attributes record contained an array of eight fragment group headers, and
the POSIX file stats record contained a fragment ID and page offset.
If you were paying careful attention to the output of nvtagpg, you may have
noticed something else unusual; every fileset has a bitfile with tag number 1. The
number one bitfile of a fileset is the fragment bitfile. If an FAS-level or POSIXlevel file has its final bytes stored in a fragment, those bytes are stored inside the
fragment bitfile.
Finding a Files Fragment
The fragID field of the POSIX file stats record is used to record the position of a
files fragment. This field is actually a two-part record: fragId.frag is the
offset, in 1024-byte blocks, of the files fragment within the filesets fragment bitfile,
and fragId.type is the number of 1024-byte blocks allocated to this fragment.
Two other fields of the file stats records are also involved with fragment
management. The fragPageOffset field records the logical page address of the
fragment within the fragment bitfile. Unless the file has holes, this will equal the
number of full pages allocated to the file. One other field, st_size, is needed to
determine just exactly how many bytes of the fragment are used by the file. Take
the remainder of dividing this field by 8192, and you have the number of bytes of
the fragment that contain real file data.
If the fragId.type field is zero, the file has no fragments.
Exercises
Exercise
1.
2.
Copy some randomly sized file, say /etc/disktab, onto your AdvFS file
system. Now use nvbmtpg to find out where your files fragment resides
within the fragment bitfile.
3.
Now use dd to copy that fragment directly out of the fragment bitfile. Youll
use a command similar to:
Exercises
Heres the definition of the group header taken from the kernel source file msfs/
msfs/bs_bitfile_sets.h:
typedef struct grpHdr {
uint32T nextFreeFrag;
uint32T lastFreeFrag;
uint32T nextFreeGrp;
uint32T self;
bfFragT fragType;
int freeFrags;
bfSetIdT setId;
/*
* the following fields were added in ADVFS v3.0
* they were all zeros in pre-ADVFS v3.0
*/
unsigned int version;
/* metadata version pre-ADVFS
v1.0 == 0, ADVFS v3.0 == 1 */
uint32T firstFrag;
/* frag index */
/*
* the following is used a map of the free frags in the group.
* it a linked list where element zero (0) is used as the head
* of the list (since frag 0 is always the group header it can
* never be allocated so element zero would otherwise be unused)
*/
unsigned short freeList[ BF_FRAG_GRP_SLOTS ];
} grpHdrT;
2.
Use the nvtagpg command to find the mcell IDs of some AdvFS bitfile-sets.
Now use nvfragpg to print out the addresses of the fragment group headers
for these filesets.
3.
The nvfragpg program, also located in /sbin/advfs, will print out a list
of the free fragments found within a fragment group along with the address of
the next group of that type.
Exercises
Start out by running od -x on one of your storage bitmap files. The command
syntax will be something like:
# od -x -N 1024 /usr/.tags/-7
2.
Repeat the previous exercise, but this time use the virtual disk interface. You
must use showfile -x to find the extent map for the storage bitmap. It will
look similar to:
Tru64 UNIX V5 supplies a much more convenient command, vsbmpg. See the
reference page for this command. Accomplish the same result as the previous
exercise without all the arithmetic. Find out if page 50000 of one of your virtual
disks is free.
Exercises
Solutions
Solutions
1.
Use the showfile and the ls -i commands to list the tag numbers of a few
AdvFS files and then access the files through the appropriate .tags directory.
#
# df -t advfs
Filesystem
512-blocks
usr_domain#usr
1426112
usr_domain#var
1426112
bruden_dom#bruce_fset
50000
bruden_dom#dennis_fset
2251840
#
# cd /usr/dennis
#
# ls -li
total 45567
3 drwx-----2 root
system
6 -rwxr-xr-x
1 root
system
7 -rwxr-xr-x
1 root
system
8 -rwxr-xr-x
1 root
system
11 drwxrwxrwx
2 root
system
5 -rw-r----1 root
operator
4 -rw-r----1 root
operator
10 -rw-r--r-1 root
system
12 -rw-r--r-1 root
system
#
# ls -li big3
8 -rwxr-xr-x
1 root
Used
1025668
75822
50000
91118
8192
11646960
11646960
11646960
8192
8192
8192
31114
11646960
Available Capacity
294688
78%
294688
21%
0
100%
2082800
5%
system
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
28
28
28
28
28
28
28
28
17:04
17:09
17:11
17:12
17:38
17:04
17:04
17:32
17:41
Mounted on
/usr
/var
/usr/bruce
/usr/dennis
.tags
big1
big2
big3
den_trash
quota.group
quota.user
sm1
stripe1
#
# showfile -x big3
Id
8.8001
Vol
2
PgSz
16
Pages
1422
extentMap: 1
pageOff
pageCnt
0
1422
extentCnt: 1
#
#
# ls -li ./.tags/8
8 -rwxr-xr-x
1 root
XtntType
simple
vol
2
Segs
**
volBlock
75504
system
SegSz
**
I/O
Perf
async 100%
File
big3
blockCnt
22752
#
#
# showfile -x .tags/8
Id
Vol
PgSz
Pages
XtntType
Segs
SegSz
I/O
Perf
File
Solutions
8.8001
16
1422
extentMap: 1
pageOff
pageCnt
0
1422
extentCnt: 1
simple
vol
2
**
volBlock
75504
**
async 100%
blockCnt
22752
2.
#
# tag2name .tags/8
/usr/dennis/big3
#
#
#
# tag2name -r bruden_dom dennis_fset 8
big3
#
3.
4.
# man nvbmtpg
(...)
# ls -lR /etc/fdmns
total 4
-r-------1 root
-r-------1 root
-r-------1 root
-r-------1 root
-r-------1 root
drwxr-xr-x
2 root
drwxr-xr-x
2 root
drwxr-xr-x
2 root
drwxr-xr-x
2 root
system
system
system
system
system
system
system
system
system
/etc/fdmns/bruden_dom:
total 0
lrwxr-xr-x
1 root
lrwxr-xr-x
1 root
lrwxr-xr-x
1 root
system
system
system
/etc/fdmns/domain_dsk0g:
total 0
lrwxr-xr-x
1 root
system
/etc/fdmns/domain_dsk2g:
0
0
0
0
0
512
512
512
512
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
15
14
11
11
28
14
14
11
16:59
00:38
16:29
11:08
11:08
17:08
16:30
16:37
11:08
.advfslock_bruden_dom
.advfslock_domain_dsk0g
.advfslock_domain_dsk2g
.advfslock_fdmns
.advfslock_usr_domain
bruden_dom
domain_dsk0g
domain_dsk2g
usr_domain
Solutions
total 0
lrwxrwxrwx
lrwxr-xr-x
1 root
1 root
system
system
/etc/fdmns/usr_domain:
total 0
lrwxr-xr-x
1 root
5.
system
Use the nvbmtpg command to look at the first two pages of the RBMT on your
virtual disk. Save this information in a file. If a printer is available, you may
want to print out this information.
# showfdmn bruden_dom
Id
37f12c39.000263ea
Vol
1L
2
3
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
65568
215648
1801584
---------2082800
% Used
50%
18%
3%
-----8%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
#
# nvbmtpg -rR bruden_dom 1 0
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 32
RBMT page 0
-------------------------------------------------------------------------CELL 0
next mcell volume page cell 1 0 6
bfSetTag,tag -2,-6(RBMT)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
32 (0x20)
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 1
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-7 (SBM)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
112 (0x70)
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR
BSR_XTNTS
Solutions
-------------------------------------------------------------------------CELL 2
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-8 (TAG)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
96 (0x60)
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 3
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-9 (LOG)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
128 (0x80)
bsXA[ 1]
bsPage
512 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 4
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-10 (BMT)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
48 (0x30)
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 5
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-11 (Misc)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 160
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 0 xCnt 3
bsXA[ 0]
bsPage
0 vdBlk
0 (0x0)
bsXA[ 1]
bsPage
2 vdBlk
64 (0x40)
bsXA[ 2]
bsPage
4 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 6
next mcell volume page cell 1 0 27
bfSetTag,tag -2,-6(RBMT)
RECORD 0
bCnt 40
BSR_VD_ATTR
Solutions
vdMntId 37f2025a.0008c86b
vdIndex 1 vdBlkCnt 131072
RECORD 1
bCnt 24
bfDomainId 37f12c39.000263ea
BSR_DMN_ATTR
(Tue Sep 28 16:59:37 1999)
RECORD 2
bCnt 52
uid 0 gid 1 mode 0744
vdCnt 3
RECORD 3
BSR_DMN_MATTR
bCnt 20
6.
BSR_DMN_TRANS_ATTR
Use the nvbmtpg -c command to look at the mcell chains for the BMT and
storage bitmap. Write down the extent map of the BMT. Youll find it useful.
BSR_ATTR
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
48 (0x30)
bsXA[ 1]
bsPage
1 vdBlk
-1
7.
BSR_XTNTS
Use the showfile -x command with the BMTs .tags directory entry as
an argument to verify that you successfully completed the last exercise.
# showfile -x /usr/dennis/.tags/M-10
Id Vol PgSz Pages XtntType Segs SegSz I/O
Perf File
fffffff6.0000
1
16
1
simple
**
** ftx
100% M-10
extentMap: 1
pageOff
pageCnt
0
1
extentCnt:
8.
vol
1
volBlock
48
blockCnt
16
Try using nvbmtpg with the BMTs .tags directory entry as an argument.
You must have a fileset of the file domain successfully mounted to do this.
# nvbmtpg -r /usr/dennis/.tags/M-10
==========================================================================
FILE "/usr/dennis/.tags/M-10"
RBMT page 0
-------------------------------------------------------------------------There is 1 page in the BMT in this file.
The BMT uses 1 extents (out of 1) in 1 mcell.
#
Solutions
9.
Verify that the data of your chosen files really is stored in the pages shown in
the extent map by reading the data through the raw device that AdvFS uses to
store the data. Here is one example of someone performing this exercise:
$ showfdmn -k play_dmn
Id
3269046b.000bc403
Vol
1
2L
1K-Blks
1067152
1055509
---------2122661
Date Created
Sat Oct 19 12:40:11 1996
Free
402864
387696
---------790560
% Used
62%
63%
-----63%
Cmode
on
on
Rblks
128
128
Wblks
128
128
Vol Name
/dev/rz3c
/dev/rz2c
$ showfile -x bmtmisc.c
Id
bf48.8002
Vol
1
PgSz
16
Pages
1
extentMap: 1
pageOff
pageCnt
0
1
extentCnt: 1
XtntType
simple
vol
1
Segs
**
volBlock
1601392
SegSz
**
Log
off
Perf
100%
File
bmtmisc.c
blockCnt
16
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
65568
215648
1801584
---------2082800
% Used
50%
18%
3%
-----8%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
Version
4
Wblks
256
256
256
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
#
#
# showfile -x sm1
Id
a.8001
Vol
2
PgSz
16
Pages
3
extentMap: 1
pageOff
pageCnt
0
3
extentCnt: 1
#
XtntType
simple
vol
2
Segs
**
volBlock
121328
SegSz
**
I/O
Perf
async 100%
blockCnt
48
File
sm1
Solutions
cat /tmp/chunk1
*****************************************************************
*
*
*
Copyright (c) Digital Equipment Corporation, 1991, 1999
*
*
*
*
All Rights Reserved. Unpublished rights reserved under
*
*
the copyright laws of the United States.
*
*
*
*
The software contained on t#
#
pg sm1
*****************************************************************
*
*
*
Copyright (c) Digital Equipment Corporation, 1991, 1999
*
*
*
*
All Rights Reserved. Unpublished rights reserved under
*
*
the copyright laws of the United States.
*
*
*
*
The software contained on this media is proprietary to
*
*
and embodies the confidential technology of Digital
*
*
Equipment Corporation. Possession, use, duplication or
*
*
dissemination of the software and media is authorized only *
*
pursuant to a valid written license from Digital Equipment *
*
Corporation.
*
*
*
*
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure *
*
by the U.S. Government is subject to restrictions as set *
*
forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
*
or in FAR 52.227-19, as applicable.
*
*
*
*****************************************************************
HISTORY
10.
Now create a striped file, at least 1 megabyte in size, and use nvbmtpg -c,
and showfile to find its extent map. You must look into the BMTs of at least
two virtual disks to obtain this information.
# showfile -x stripe1
Id
c.8001
Vol
2
extentMap: 1
pageOff
0
16
32
PgSz
16
Pages
1422
pageCnt
8
8
8
XtntType
stripe
volIndex
3
Segs
2
SegSz
8
volBlock
1093536
I/O
Perf
async 100%
File
stripe1
blockCnt
11392
Solutions
1392
()
8
1408
extentCnt: 1
extentMap: 2
pageOff
pageCnt
8
8
24
8
40
8
()
1400
8
1416
6
extentCnt: 1
#
# ls -li stripe1
12 -rw-r--r--
1 root
volIndex
1
system
volBlock
80704
blockCnt
11360
#
#
# nvbmtpg -r bruden_dom dennis_fset -t 12 -c
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 12
next mcell volume page cell 0 0 0
bfSetTag,tag 2,12
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_STRIPE chain mcell volume page cell 3 0 8
BSR_ATTR
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 11646960
st_nlink 1
dir_tag 2 st_mtime Tue Sep 28 17:41:55 1999
BSR_SHADOW_XTNTS
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
--------------------------------------------------------------------------
Solutions
CELL 18
RECORD 0
bCnt 260
allocVdIndex 1 mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
bsXA[ 1]
bsPage
710 vdBlk
bfSetTag,tag 2,12
BSR_SHADOW_XTNTS
80704 (0x13b40)
-1
11.
Create a file with a few large holes and then look up its extent map. An easy
way to create a file with holes is:
Vol
1
PgSz
16
Pages
14
extentMap: 1
pageOff
pageCnt
31
7
62
1
63
6
extentCnt: 3
XtntType
simple
vol
1
1
1
Segs
**
volBlock
57600
57744
80512
SegSz
**
I/O
Perf
async 33%
File
holesome.dat
blockCnt
112
16
96
#
#
# nvbmtpg -r bruden_dom dennis_fset -t 9 -c
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 17
next mcell volume page cell 0 0 0
bfSetTag,tag 2,9
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 1 0 16
firstXtnt mcellCnt 2 xCnt 1
bsXA[ 0]
bsPage
0 vdBlk
-1
BSR_ATTR
BSR_XTNTS
Solutions
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 563200
st_nlink 1
dir_tag 2 st_mtime Wed Sep 29 09:17:19 1999
bCnt 264
BSR_XTRA_XTNTS
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
12.
0
31
38
62
63
69
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
-1
57600 (0xe100)
-1
57744 (0xe190)
80512 (0x13a80)
-1
Create a clone fileset. Use ls -i to verify that the tag numbers of the files in
both the original and clone filesets are the same. Use nvbmtpg to verify that
even the mcell IDs are unchanged.
512-Blks
131072
262144
1858624
---------2251840
Date Created
Tue Sep 28 16:59:37 1999
Free
64000
215584
1801584
---------2081168
% Used
51%
18%
3%
-----8%
Cmode
on
on
on
LogPgs
512
Rblks
256
256
256
#
#
# showfsets bruden_dom
bruce_fset
Id
: 37f12c39.000263ea.1.8001
Files
:
6, SLim=
0,
Blocks (512) :
68288, SLim=
50000,
Quota Status : user=off group=off
dennis_fset
Id
: 37f12c39.000263ea.2.8001
Version
4
Wblks
256
256
256
HLim=
HLim=
Domain Name
bruden_dom
Vol Name
/dev/disk/dsk0a
/dev/disk/dsk0b
/dev/disk/dsk2h
0
60000
grc=
none
Solutions
Clone is
Files
Blocks (512)
Quota Status
den_clone
Id
Clone of
Revision
: den_clone
:
10, SLim=
:
92618, SLim=
: user=off group=off
0,
0,
HLim=
HLim=
0
0
: 37f12c39.000263ea.3.8003
: dennis_fset
: 3
#
# mount bruden_dom#den_clone /usr/den_clone
#
# df -t advfs
Filesystem
usr_domain#usr
usr_domain#var
bruden_dom#bruce_fset
bruden_dom#dennis_fset
bruden_dom#den_clone
#
# ls -li /usr/dennis
total 45709
3 drwx-----2
6 -rwxr-xr-x
1
7 -rwxr-xr-x
1
8 -rwxr-xr-x
1
11 drwxrwxrwx
2
9 -rw-r--r-1
5 -rw-r----1
4 -rw-r----1
10 -rw-r--r-1
12 -rw-r--r-1
512-blocks
1426112
1426112
50000
2251840
2251840
Used
1025780
76026
50000
92618
92618
Available Capacity
294384
78%
294384
21%
0
100%
2081168
5%
2081168
5%
Mounted on
/usr
/var
/usr/bruce
/usr/dennis
/usr/den_clone
root
root
root
root
root
root
root
root
root
root
system
system
system
system
system
system
operator
operator
system
system
8192
11646960
11646960
11646960
8192
563200
8192
8192
62228
11646960
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
28
28
28
29
29
28
28
29
28
17:04
17:09
17:11
17:12
09:30
09:17
17:04
17:04
09:35
17:41
.tags
big1
big2
big3
den_trash
holesome.dat
quota.group
quota.user
sm1
stripe1
#
# ls -li /usr/den_clone
total 45709
3 drwx-----2 root
6 -rwxr-xr-x
1 root
7 -rwxr-xr-x
1 root
8 -rwxr-xr-x
1 root
11 drwxrwxrwx
2 root
9 -rw-r--r-1 root
5 -rw-r----1 root
4 -rw-r----1 root
10 -rw-r--r-1 root
12 -rw-r--r-1 root
system
system
system
system
system
system
operator
operator
system
system
8192
11646960
11646960
11646960
8192
563200
8192
8192
62228
11646960
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
Sep
28
28
28
28
29
29
28
28
29
28
17:04
17:09
17:11
17:12
09:30
09:17
17:04
17:04
09:35
17:41
.tags
big1
big2
big3
den_trash
holesome.dat
quota.group
quota.user
sm1
stripe1
#
# nvbmtpg -r bruden_dom dennis_fset -t 10 -c
Solutions
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 10
next mcell volume page cell 0 0 0
bfSetTag,tag 2,10
RECORD 0
bCnt 92
type BSRA_VALID
BSR_ATTR
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 2 0 15
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
121328 (0x1d9f0)
bsXA[ 1]
bsPage
3 vdBlk
-1
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 62228
st_nlink 1
dir_tag 2 st_mtime Wed Sep 29 09:35:34 1999
fragId.type BF_FRAG_5K fragId.frag 129
bCnt 264
bsPage
bsPage
bsPage
BSR_XTRA_XTNTS
3
4
7
vdBlk
vdBlk
vdBlk
75488 (0x126e0)
98256 (0x17fd0)
-1
#
#
#
# nvbmtpg -r bruden_dom den_clone -t 10 -c
This clone file has no metadata.
13.
Modify a large file in the original fileset by appending some blocks to the end
of the file. (#cat some_file >> large_file) (or use dd instead with
the oseek and count options). Now use ls -i and nvbmtpg to see that,
while the tags are unchanged, the mcell IDs are now changed. Use showfile
-x and nvbmtpg -c to look at the extent maps of both original and clone.
system
Solutions
10 -rw-r--r--
1 root
system
#
# showfile -x /usr/dennis/sm1
Id
a.8001
Vol
2
PgSz
16
Pages
11
extentMap: 1
pageOff
pageCnt
0
3
3
1
4
3
7
4
extentCnt: 4
XtntType
simple
vol
2
2
2
2
Segs
**
volBlock
121328
75488
98256
75360
SegSz
**
I/O
Perf
async 25%
File
sm1
blockCnt
48
16
48
64
#
# showfile -x /usr/den_clone/sm1
Id
a.8001
Vol
3
PgSz
16
Pages
0
extentMap: 1
pageOff
pageCnt
extentCnt: 0
XtntType
simple
vol
Segs
**
volBlock
SegSz
**
I/O
Perf
async 100%
File
sm1
blockCnt
#
# nvbmtpg -r bruden_dom den_clone -t 10 -c
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 5
next mcell volume page cell 0 0 0
bfSetTag,tag 3,10
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 1
bsXA[ 0]
bsPage
0 vdBlk
-1
BSR_ATTR
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 62228
st_nlink 1
dir_tag 2 st_mtime Wed Sep 29 09:35:34 1999
fragId.type BF_FRAG_5K fragId.frag 129
#
# nvbmtpg -r bruden_dom dennis_fset -t 10 -c
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
Solutions
-------------------------------------------------------------------------CELL 10
next mcell volume page cell 0 0 0
bfSetTag,tag 2,10
RECORD 0
bCnt 92
type BSRA_VALID
BSR_ATTR
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 2 0 15
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
121328 (0x1d9f0)
bsXA[ 1]
bsPage
3 vdBlk
-1
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 93342
st_nlink 1
dir_tag 2 st_mtime Wed Sep 29 10:39:23 1999
fragId.type BF_FRAG_4K fragId.frag 260
bCnt 264
bsPage
bsPage
bsPage
bsPage
14.
BSR_XTRA_XTNTS
3
4
7
11
vdBlk
vdBlk
vdBlk
vdBlk
75488 (0x126e0)
98256 (0x17fd0)
75360 (0x12660)
-1
Use nvbmtpg -c to look at mcell number 0 on page 0 of the BMT for the first
volume of a domain. Note that the mcell free list is minimal. This is part of the
dynamics built into AdvFS for Tru64 UNIX V5.
# nvbmtpg -r bruden_dom 3 0 0 -c
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 0
next mcell volume page cell 0 0 0
bfSetTag,tag 0,0
RECORD 0
headPg 0
bCnt 8
RECORD 1
bCnt 12
nextMCId page,cell 0,0
15.
BSR_MCELL_FREE_LIST
BSR_DEF_DEL_MCELL_LIST
prevMCId page,cell 0,0
Look at bitfile attributes and bitfile inheritable attributes for reserved files,
nonreserved regular files, and finally nonreserved directories.
Solutions
#
# nvbmtpg -rv bruden_dom dennis_fset -t 1
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 10
nextFreePg -1
nextfreeMCId page,cell 0,18
-------------------------------------------------------------------------CELL 4 linkSegment 0
bfSetTag 2 (2.8001) tag 1 (1.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 2
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 2 0 17
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
121392 (0x1da30)
bsXA[ 1]
bsPage
48 vdBlk
-1
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
#
# nvbmtpg -rv bruden_dom dennis_fset -t 10
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 10
nextFreePg -1
nextfreeMCId page,cell 0,18
-------------------------------------------------------------------------CELL 10 linkSegment 0
bfSetTag 2 (2.8001) tag 10 (a.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 940
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_NIL (0)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
BSR_ATTR (2)
BSR_XTNTS (1)
AdvFS On-Disk Structures 2-79
Solutions
blocks 0
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 10
st_mode 100644 (S_IFREG)
st_nlink 1
st_size 124456
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 11:13:22 1999
st_umtime 538485000
st_atime Wed Sep 29 11:09:47 1999
st_uatime 126376000
st_ctime Wed Sep 29 11:13:22 1999
st_uctime 538485000
fragId.frag 386
fragId.type 2 BF_FRAG_2K
fragPageOffset 15
dir_tag 2 (2.8001) st_flags 0
st_unused_1 983040
st_unused_2 0
#
# nvbmtpg -rv bruden_dom dennis_fset -t 14
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 4
nextFreePg -1
nextfreeMCId page,cell 0,24
-------------------------------------------------------------------------CELL 22 linkSegment 0
bfSetTag 2 (2.8001) tag 14 (e.8001)
next mcell volume page cell 1 0 23
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 269
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
92080 (0x167b0)
bsXA[ 1]
bsPage
1 vdBlk
-1
RECORD 2
bCnt 64
dataSafety BFD_NIL
reqServices 1
optServices 0
version 0
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
BSR_BF_INHERIT_ATTR (16)
Solutions
extendSize 0
clientArea 0 0 0 0
rsvd1 0
rsvd2 0
rsvd_sec1 0
rsvd_sec2 0
rsvd_sec3 0
16.
Look at bitfile attributes for a clone file with a modified original and then look
at the bitfile attributes for the original.
# ls -li /usr/dennis/sm1
10 -rw-r--r-1 root
system
#
# ls -li /usr/den_clone/sm1
10 -rw-r--r-1 root
system
#
# nvbmtpg -rv bruden_dom den_clone -t 10
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 19
nextFreePg -1
nextfreeMCId page,cell 0,10
-------------------------------------------------------------------------CELL 5 linkSegment 0
bfSetTag 3 (3.8003) tag 10 (a.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 234
cloneId 3 cloneCnt 0 maxClonePgs 7
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_NIL (0)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 1
bsXA[ 0]
bsPage
0 vdBlk
-1
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 10
st_mode 100644 (S_IFREG)
st_nlink 1
st_size 62228
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 09:35:34 1999
st_umtime 250400000
st_atime Wed Sep 29 09:02:24 1999
st_uatime 451571000
Solutions
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 10
st_mode 100644 (S_IFREG)
st_nlink 1
st_size 124456
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 11:13:22 1999
st_umtime 538485000
st_atime Wed Sep 29 11:09:47 1999
st_uatime 126376000
st_ctime Wed Sep 29 11:13:22 1999
st_uctime 538485000
fragId.frag 386
fragId.type 2 BF_FRAG_2K
fragPageOffset 15
dir_tag 2 (2.8001) st_flags 0
st_unused_1 983040
st_unused_2 0
17.
Print out the mcell records for an original and a cloned fileset.
Solutions
-------------------------------------------------------------------------CELL 6 linkSegment 0
bfSetTag -2 (fffffffe.0) tag 2 (2.8001)
next mcell volume page cell 1 0 7
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 2
cloneId 0 cloneCnt 0 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
34688 (0x8780)
bsXA[ 1]
bsPage
8 vdBlk
-1
RECORD 2
bCnt 64
version 0
blkHLimitHi,blkHLimitLo 0,30d40 (200000)
blkSLimitHi,blkSLimitLo 0,0 (0)
fileHLimitHi,fileHLimitLo 0,0 (0)
fileSLimitHi,fileSLimitLo 0,0 (0)
blkTLimit 0, fileTLimit 0, quotaStatus 1420
unused1 0, unused2 0, unused3 0, unused4 0
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
BSR_BFS_QUOTA_ATTR (18)
--------------------------------------------------------------------------------------------------------------------------------------------------CELL 7 linkSegment 1
bfSetTag -2 (fffffffe.0) tag 2 (2.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 220 version 0
BSR_BFS_ATTR (8)
bfSetId.domainId 37f12c39.263ea (Tue Sep 28 16:59:37 1999)
bfSetId.dirTag 2 (2.8001)
fragBfTag 1 (1.8001)
nextCloneSetTag 3 (3.8003)
origSetTag 0 (0.0)
nxtDelPendingBfSet 0 (0.0)
state BFS_READY
flags 0x0
cloneId 0
cloneCnt 3
numClones 1
fsDev 0xaf0db242
freeFragGrps 2
oldQuotaStatus 0
uid 0
gid 1
mode 0744
setName "dennis_fset"
fsContext[0], fsContext[1] 2.8001 (rootTag)
fsContext[2], fsContext[3] 3.8001 (tagsTag)
fsContext[4], fsContext[5] 4.8001 (userQuotaTag)
fsContext[6], fsContext[7] 5.8001 (groupQuotaTag)
fragGrps[0] firstFreeGrp
64 lastFreeGrp
32
fragGrps[1] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[2] firstFreeGrp
48 lastFreeGrp
48
fragGrps[3] firstFreeGrp
-1 lastFreeGrp
-1
AdvFS On-Disk Structures 2-83
Solutions
fragGrps[4]
fragGrps[5]
fragGrps[6]
fragGrps[7]
firstFreeGrp
firstFreeGrp
firstFreeGrp
firstFreeGrp
32
16
-1
0
lastFreeGrp
lastFreeGrp
lastFreeGrp
lastFreeGrp
RECORD 1
bCnt 36
version 0
flags MSS_NO_SHELVE (0x4)
smallFile 5
readAhead 0
readAheadIncr 5
readAheadMax 50
autoShelveThresh 100
userId 0
shelf 0
32
16
-1
0
BSR_SET_SHELVE_ATTR (17)
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
BSR_BFS_QUOTA_ATTR (18)
--------------------------------------------------------------------------
Solutions
-------------------------------------------------------------------------CELL 14 linkSegment 1
bfSetTag -2 (fffffffe.0) tag 3 (3.8003)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 220 version 0
BSR_BFS_ATTR (8)
bfSetId.domainId 37f12c39.263ea (Tue Sep 28 16:59:37 1999)
bfSetId.dirTag 3 (3.8003)
fragBfTag 1 (1.8001)
nextCloneSetTag 0 (0.0)
origSetTag 2 (2.8001)
nxtDelPendingBfSet 0 (0.0)
state BFS_READY
flags 0x0
cloneId 3
cloneCnt 0
numClones 0
fsDev 0xdc8e9f23
freeFragGrps 0
oldQuotaStatus 0
uid 0
gid 1
mode 0744
setName "den_clone"
fsContext[0], fsContext[1] 2.8001 (rootTag)
fsContext[2], fsContext[3] 3.8001 (tagsTag)
fsContext[4], fsContext[5] 4.8001 (userQuotaTag)
fsContext[6], fsContext[7] 5.8001 (groupQuotaTag)
fragGrps[0] firstFreeGrp
32 lastFreeGrp
32
fragGrps[1] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[2] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[3] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[4] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[5] firstFreeGrp
16 lastFreeGrp
16
fragGrps[6] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[7] firstFreeGrp
0 lastFreeGrp
0
RECORD 1
bCnt 36
version 0
flags MSS_NO_SHELVE (0x4)
smallFile 5
readAhead 0
readAheadIncr 5
readAheadMax 50
autoShelveThresh 100
userId 0
shelf 0
BSR_SET_SHELVE_ATTR (17)
version 0
2
8
0
vdBlk
vdBlk
vdBlk
BSR_XTRA_XTNTS (5)
80608 (0x13ae0)
-1
0 (0x0)
AdvFS On-Disk Structures 2-85
Solutions
bsXA[ 3]
bsXA[ 4]
bsXA[ 5]
bsXA[ 6]
bsXA[ 7]
bsXA[ 8]
bsXA[ 9]
bsXA[10]
bsXA[11]
bsXA[12]
bsXA[13]
bsXA[14]
bsXA[15]
bsXA[16]
bsXA[17]
bsXA[18]
bsXA[19]
bsXA[20]
bsXA[21]
bsXA[22]
bsXA[23]
bsXA[24]
bsXA[25]
bsXA[26]
bsXA[27]
bsXA[28]
bsXA[29]
bsXA[30]
bsXA[31]
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
bsPage
18.
0
0
0
0
0
0
0
0
2
19
0
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
vdBlk
0
0
0
0
0
0
0
65616
1
0
16
0
0
-1
0
0
0
4
0
0
0
0
0
0
0
0
0
0
0
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x10050)
(0x1)
(0x0)
(0x10)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x4)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
(0x0)
This exercise is difficult. Try deleting a fileset with lots of large files. While
the deletion is in progress, examine the fileset mcell record to look at the
progress of the deletion through the delete pending change.
Use nvbmtpg to try to catch the action.
19.
Convince yourself that executing the chfsets command really does result in
modification of the appropriate fileset attributes record.
BSR_ATTR (2)
Solutions
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
34688 (0x8780)
bsXA[ 1]
bsPage
8 vdBlk
-1
RECORD 2
bCnt 64
version 0
blkHLimitHi,blkHLimitLo 0,30d40 (200000)
blkSLimitHi,blkSLimitLo 0,0 (0)
fileHLimitHi,fileHLimitLo 0,0 (0)
fileSLimitHi,fileSLimitLo 0,0 (0)
blkTLimit 0, fileTLimit 0, quotaStatus 1420
unused1 0, unused2 0, unused3 0, unused4 0
BSR_XTNTS (1)
blocks 0
BSR_BFS_QUOTA_ATTR (18)
--------------------------------------------------------------------------------------------------------------------------------------------------CELL 7 linkSegment 1
bfSetTag -2 (fffffffe.0) tag 2 (2.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 220 version 0
BSR_BFS_ATTR (8)
bfSetId.domainId 37f12c39.263ea (Tue Sep 28 16:59:37 1999)
bfSetId.dirTag 2 (2.8001)
fragBfTag 1 (1.8001)
nextCloneSetTag 3 (3.8003)
origSetTag 0 (0.0)
nxtDelPendingBfSet 0 (0.0)
state BFS_READY
flags 0x0
cloneId 0
cloneCnt 3
numClones 1
fsDev 0xaf0db242
freeFragGrps 2
oldQuotaStatus 0
uid 0
gid 1
mode 0744
setName "dennis_fset"
fsContext[0], fsContext[1] 2.8001 (rootTag)
fsContext[2], fsContext[3] 3.8001 (tagsTag)
fsContext[4], fsContext[5] 4.8001 (userQuotaTag)
fsContext[6], fsContext[7] 5.8001 (groupQuotaTag)
fragGrps[0] firstFreeGrp
64 lastFreeGrp
32
fragGrps[1] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[2] firstFreeGrp
48 lastFreeGrp
48
fragGrps[3] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[4] firstFreeGrp
32 lastFreeGrp
32
fragGrps[5] firstFreeGrp
16 lastFreeGrp
16
fragGrps[6] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[7] firstFreeGrp
0 lastFreeGrp
0
RECORD 1
bCnt 36
version 0
flags MSS_NO_SHELVE (0x4)
smallFile 5
BSR_SET_SHELVE_ATTR (17)
Solutions
readAhead 0
readAheadIncr 5
readAheadMax 50
autoShelveThresh 100
userId 0
shelf 0
#
#
# chfsets -b 200000 bruden_dom dennis_fset
chfsets: At least one fileset in this domain must be mounted.
#
# mount bruden_dom#dennis_fset /usr/dennis
#
#
# mount bruden_dom#bruce_fset /usr/bruce
#
# mount bruden_dom#den_clone /usr/den_clone
#
#
# df -t advfs
Filesystem
usr_domain#usr
usr_domain#var
bruden_dom#dennis_fset
bruden_dom#bruce_fset
bruden_dom#den_clone
512-blocks
1426112
1426112
200000
50000
2251840
Used
1025888
134972
92940
50000
92618
Available Capacity
235376
82%
235376
37%
107060
47%
0
100%
2079520
5%
Mounted on
/usr
/var
/usr/dennis
/usr/bruce
/usr/den_clone
#
#
# chfsets -b 200000 bruden_dom dennis_fset
dennis_fset
Id
: 37f12c39.000263ea.2.8001
Block H Limit: 100000 --> 200000
#
# nvbmtpg -rv bruden_dom dennis_fset -c
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 4
nextFreePg -1
nextfreeMCId page,cell 0,24
-------------------------------------------------------------------------CELL 6 linkSegment 0
bfSetTag -2 (fffffffe.0) tag 2 (2.8001)
next mcell volume page cell 1 0 7
RECORD 0
bCnt 92
type BSRA_VALID (3)
version 0
BSR_ATTR (2)
Solutions
bfPgSz 16 transitionId 2
cloneId 0 cloneCnt 0 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
34688 (0x8780)
bsXA[ 1]
bsPage
8 vdBlk
-1
RECORD 2
bCnt 64
version 0
blkHLimitHi,blkHLimitLo 0,30d40 (200000)
blkSLimitHi,blkSLimitLo 0,0 (0)
fileHLimitHi,fileHLimitLo 0,0 (0)
fileSLimitHi,fileSLimitLo 0,0 (0)
blkTLimit 0, fileTLimit 0, quotaStatus 1420
unused1 0, unused2 0, unused3 0, unused4 0
BSR_XTNTS (1)
blocks 0
BSR_BFS_QUOTA_ATTR (18)
--------------------------------------------------------------------------------------------------------------------------------------------------CELL 7 linkSegment 1
bfSetTag -2 (fffffffe.0) tag 2 (2.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 220 version 0
BSR_BFS_ATTR (8)
bfSetId.domainId 37f12c39.263ea (Tue Sep 28 16:59:37 1999)
bfSetId.dirTag 2 (2.8001)
fragBfTag 1 (1.8001)
nextCloneSetTag 3 (3.8003)
origSetTag 0 (0.0)
nxtDelPendingBfSet 0 (0.0)
state BFS_READY
flags 0x0
cloneId 0
cloneCnt 3
numClones 1
fsDev 0xaf0db242
freeFragGrps 2
oldQuotaStatus 0
uid 0
gid 1
mode 0744
setName "dennis_fset"
fsContext[0], fsContext[1] 2.8001 (rootTag)
fsContext[2], fsContext[3] 3.8001 (tagsTag)
fsContext[4], fsContext[5] 4.8001 (userQuotaTag)
fsContext[6], fsContext[7] 5.8001 (groupQuotaTag)
fragGrps[0] firstFreeGrp
64 lastFreeGrp
32
fragGrps[1] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[2] firstFreeGrp
48 lastFreeGrp
48
fragGrps[3] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[4] firstFreeGrp
32 lastFreeGrp
32
fragGrps[5] firstFreeGrp
16 lastFreeGrp
16
fragGrps[6] firstFreeGrp
-1 lastFreeGrp
-1
fragGrps[7] firstFreeGrp
0 lastFreeGrp
0
RECORD 1
bCnt 36
version 0
BSR_SET_SHELVE_ATTR (17)
AdvFS On-Disk Structures 2-89
Solutions
20.
Examine the domain attribute and virtual disk records for your AdvFS disks.
# nvbmtpg -r bruden_dom -f
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------There is 1 page in the BMT on this volume.
The BMT uses 1 extents (out of 1) in 1 mcell.
There are 1
pages on the free list with a total of 4 free mcells.
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------There is 1 page in the BMT on this volume.
The BMT uses 1 extents (out of 1) in 1 mcell.
There are 1
pages on the free list with a total of 10 free mcells.
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 48
BMT page 0
-------------------------------------------------------------------------There is 1 page in the BMT on this volume.
The BMT uses 1 extents (out of 1) in 1 mcell.
There are 1
pages on the free list with a total of 19 free mcells.
#
#
# nvbmtpg -rRv bruden_dom 1 0 6
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 32
RBMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 20
nextFreePg 0
nextfreeMCId page,cell 0,7
-------------------------------------------------------------------------CELL 6 linkSegment 1 bfSetTag -2 (fffffffe.0) tag -6 (fffffffa.0)(RBMT)
next mcell volume page cell 1 0 27
RECORD 0
bCnt 40
version 0
vdMntId 37f2795f.000c98fb
(Wed Sep 29 16:41:03 1999)
state 1
vdIndex 1
jays_new_field 0
vdBlkCnt 131072
BSR_VD_ATTR (3)
Solutions
stgCluster 16
maxPgSz 16
bmtXtntPgs 128
serviceClass 1
RECORD 1
bCnt 24
version 0
BSR_DMN_ATTR (4)
bfDomainId 37f12c39.000263ea
(Tue Sep 28 16:59:37 1999)
maxVds 256
bfSetDirTag -2 (fffffffe.0)
RECORD 2
bCnt 52
version 0
seqNum 1
delPendingBfSet 0 (0.0)
uid 0
gid 1
mode 0744
vdCnt 3
recoveryFailed 0
bfSetDirTag -8
ftxLogTag -9
ftxLogPgs 512
BSR_DMN_MATTR (15)
RECORD 3
bCnt 20
version 0
chainVdIndex -1
chainMCId page,cell 0,0
op 0
dev 0x0
BSR_DMN_TRANS_ATTR (21)
#
# nvbmtpg -rRv bruden_dom 2 0 6
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 32
RBMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 20
nextFreePg 0
nextfreeMCId page,cell 0,7
-------------------------------------------------------------------------CELL 6 linkSegment 1 bfSetTag -2 (fffffffe.0) tag -12 (fffffff4.0)(RBMT)
next mcell volume page cell 2 0 27
RECORD 0
bCnt 40
version 0
vdMntId 37f2795f.000c98fb
(Wed Sep 29 16:41:03 1999)
state 1
vdIndex 2
jays_new_field 0
vdBlkCnt 262144
stgCluster 16
maxPgSz 16
bmtXtntPgs 128
serviceClass 1
RECORD 1
bCnt 24
version 0
BSR_VD_ATTR (3)
BSR_DMN_ATTR (4)
Solutions
bfDomainId 37f12c39.000263ea
maxVds 256
bfSetDirTag -2 (fffffffe.0)
#
# nvbmtpg -rRv bruden_dom 3 0 6
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 32
RBMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 20
nextFreePg 0
nextfreeMCId page,cell 0,7
-------------------------------------------------------------------------CELL 6 linkSegment 1 bfSetTag -2 (fffffffe.0) tag -18 (ffffffee.0)(RBMT)
next mcell volume page cell 3 0 27
RECORD 0
bCnt 40
version 0
vdMntId 37f2795f.000c98fb
(Wed Sep 29 16:41:03 1999)
state 1
vdIndex 3
jays_new_field 0
vdBlkCnt 1858632
stgCluster 16
maxPgSz 16
bmtXtntPgs 128
serviceClass 1
BSR_VD_ATTR (3)
RECORD 1
bCnt 24
version 0
BSR_DMN_ATTR (4)
bfDomainId 37f12c39.000263ea
(Tue Sep 28 16:59:37 1999)
maxVds 256
bfSetDirTag -2 (fffffffe.0)
21.
Examine the BMT POSIX file stat records for a few of your files. See how the
information stored in this record is reflected in the output of ls -l.
BSR_ATTR (2)
rsvd1 0
Solutions
rsvd2 0
acl 0
rsvd_sec1 0
rsvd_sec2 0
rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 2 0 15
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
121328 (0x1d9f0)
bsXA[ 1]
bsPage
3 vdBlk
-1
BSR_XTNTS (1)
blocks 0
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 10
st_mode 100644 (S_IFREG)
st_nlink 1
st_size 124456
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 11:13:22 1999
st_umtime 538485000
st_atime Wed Sep 29 11:09:47 1999
st_uatime 126376000
st_ctime Wed Sep 29 11:13:22 1999
st_uctime 538485000
fragId.frag 386
fragId.type 2 BF_FRAG_2K
fragPageOffset 15
dir_tag 2 (2.8001) st_flags 0
st_unused_1 983040
st_unused_2 0
#
# pwd
/usr/bruden/advfs
#
# cd /usr/dennis
#
# ls -li sm1
10 -rw-r--r--
1 root
system
#
#
#
#
(0644 is rw-r--r--)
22.
Now create some symbolic links and examine the corresponding BMT fast
symbolic link records.
# pwd
/usr/dennis
#
# ln -s /etc/passwd pw
#
# ls -li pw
16 lrwxrwxrwx
1 root
system
#
# nvbmtpg -rv bruden_dom dennis_fset -t 16 -c
Solutions
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 2
nextFreePg -1
nextfreeMCId page,cell 0,26
-------------------------------------------------------------------------CELL 24 linkSegment 0
bfSetTag 2 (2.8001) tag 16 (10.8001)
next mcell volume page cell 1 0 25
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 113
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_NIL (0)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 1
bsXA[ 0]
bsPage
0 vdBlk
-1
bsXA[ 1]
bsPage
0 vdBlk
0 (0x0)
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 16
st_mode 120777 (S_IFLNK)
st_nlink 1
st_size 11
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 17:24:25 1999
st_umtime 167392000
st_atime Wed Sep 29 17:24:31 1999
st_uatime 363681000
st_ctime Wed Sep 29 17:24:25 1999
st_uctime 167392000
fragId.frag 0
fragId.type 0 BF_FRAG_ANY
fragPageOffset 0
dir_tag 2 (2.8001) st_flags 0
st_unused_1 0
st_unused_2 0
--------------------------------------------------------------------------------------------------------------------------------------------------CELL 25 linkSegment 1
bfSetTag 2 (2.8001) tag 16 (10.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 15
/etc/passwd
23.
version 0
BMTR_FS_DATA (254)
Use mktrashcan to create a trashcan directory and then examine the BMT
record that points to the trash.
# shtrashcan /usr/dennis
/usr/dennis/den_trash attached to /usr/dennis
#
#
Solutions
# ls -lid /usr/dennis
2 drwxrwxrwx
5 root
system
#
# nvbmtpg -rv bruden_dom dennis_fset -t 2 -c
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 2
nextFreePg -1
nextfreeMCId page,cell 0,26
-------------------------------------------------------------------------CELL 8 linkSegment 0
bfSetTag 2 (2.8001) tag 2 (2.8001)
next mcell volume page cell 1 0 9
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 2
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
34816 (0x8800)
bsXA[ 1]
bsPage
1 vdBlk
-1
RECORD 2
bCnt 64
dataSafety BFD_NIL
reqServices 1
optServices 0
extendSize 0
clientArea 0 0 0 0
rsvd1 0
rsvd2 0
rsvd_sec1 0
rsvd_sec2 0
rsvd_sec3 0
version 0
RECORD 3
bCnt 8
version 0
last sync Wed Sep 29 16:41:04 1999
RECORD 4
bCnt 12
dir_tag 11 (b.8001)
version 0
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
BSR_BF_INHERIT_ATTR (16)
BMTR_FS_TIME (251)
BMTR_FS_UNDEL_DIR (252)
--------------------------------------------------------------------------
Solutions
-------------------------------------------------------------------------CELL 9 linkSegment 1
bfSetTag 2 (2.8001) tag 2 (2.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 2
st_mode 40777 (S_IFDIR)
st_nlink 5
st_size 8192
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 17:24:25 1999
st_umtime 167392000
st_atime Wed Sep 29 16:00:36 1999
st_uatime 968173000
st_ctime Wed Sep 29 17:24:25 1999
st_uctime 167392000
fragId.frag 0
fragId.type 0 BF_FRAG_ANY
fragPageOffset 0
dir_tag 2 (2.8001) st_flags 0
st_unused_1 0
st_unused_2 0
24.
Find the mcell ID of a file system root and examine its BMT file system time
records.
# ls -lid /usr/bruce
2 drwxrwxrwx
3 root
system
#
# nvbmtpg -rv bruden_dom bruce_fset -t 2 -c
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 48
BMT page 0
-------------------------------------------------------------------------pageId 0 megaVersion 4
freeMcellCnt 2
nextFreePg -1
nextfreeMCId page,cell 0,26
-------------------------------------------------------------------------CELL 3 linkSegment 0
bfSetTag 1 (1.8001) tag 2 (2.8001)
next mcell volume page cell 1 0 4
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 2
cloneId 0 cloneCnt 0 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_FTX_AGENT (2)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
RECORD 1
bCnt 80
version 0
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize 0
delLink next page,cell 0,0 prev page,cell 0,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
34656 (0x8760)
bsXA[ 1]
bsPage
1 vdBlk
-1
RECORD 2
bCnt 64
dataSafety BFD_NIL
reqServices 1
optServices 0
version 0
BSR_ATTR (2)
BSR_XTNTS (1)
blocks 0
BSR_BF_INHERIT_ATTR (16)
Solutions
extendSize 0
clientArea 0 0 0 0
rsvd1 0
rsvd2 0
rsvd_sec1 0
rsvd_sec2 0
rsvd_sec3 0
RECORD 3
bCnt 8
version 0
last sync Wed Sep 29 16:41:26 1999
BMTR_FS_TIME (251)
--------------------------------------------------------------------------------------------------------------------------------------------------CELL 4 linkSegment 1
bfSetTag 1 (1.8001) tag 2 (2.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 2
st_mode 40777 (S_IFDIR)
st_nlink 3
st_size 8192
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Tue Sep 28 17:24:53 1999
st_umtime 191806000
st_atime Tue Sep 28 17:04:01 1999
st_uatime 0
st_ctime Tue Sep 28 17:24:53 1999
st_uctime 191806000
fragId.frag 0
fragId.type 0 BF_FRAG_ANY
fragPageOffset 0
dir_tag 2 (2.8001) st_flags 0
st_unused_1 0
st_unused_2 0
25.
Start by running showfsets on your AdvFS file domains so that you will
know a few fileset IDs to use in the remaining exercises.
# showfsets bruden_dom
bruce_fset
Id
: 37f12c39.000263ea.1.8001
Files
:
6, SLim=
0,
Blocks (512) :
68288, SLim=
50000,
Quota Status : user=off group=off
dennis_fset
Id
Clone is
Files
Blocks (512)
Quota Status
: 37f12c39.000263ea.2.8001
: den_clone
:
13, SLim=
0,
:
92940, SLim=
0,
: user=off group=off
den_clone
Id
Clone of
Revision
HLim=
HLim=
0
200000
HLim=
HLim=
0
400000
grc=
none
: 37f12c39.000263ea.3.8003
: dennis_fset
: 3
Solutions
26.
Use the nvtagpg program, located in /sbin/advfs, to list the root tag files
of an AdvFS file domain.
# nvtagpg -r bruden_dom
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 96
root TAG page 0
-------------------------------------------------------------------------currPage 0
numAllocTMaps 3 numDeadTMaps 0 nextFreePage 0 nextFreeMap 5
tMapA[1]
tMapA[2]
tMapA[3]
tag 1
tag 2
tag 3
27.
seqNo 1
seqNo 1
seqNo 3
1 0 1
1 0 6
1 0 19
bruce_fset
dennis_fset
den_clone
Select a target file and use both showfile and ls -i to obtain its tag
number. The reason for using two programs is that one prints the tag number in
decimal and other prints the sequence number.
Divide the tag number by 1022 and write down both the quotient and remainder.
The quotient determines the page number containing the appropriate tagmap
entry while the remainder determines the position within the page.
If the sequence numbers of nvtagpg and showfile dont match, you dont
have the right tagmap entry. You may need to convert from hexadecimal to
decimal to verify the match.
# showfile -x sm1
Id
a.8001
Vol
2
PgSz
16
Pages
15
extentMap: 1
pageOff
pageCnt
0
3
3
1
4
3
7
4
11
4
extentCnt: 5
#
# ls -li sm1
10 -rw-r--r--
1 root
XtntType
simple
vol
2
2
2
2
2
system
Segs
**
volBlock
121328
75488
98256
75360
98480
SegSz
**
I/O
Perf
async 20%
File
sm1
blockCnt
48
16
48
64
64
#
# nvtagpg -r bruden_dom -T 2 -t 10
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 34688
"dennis_fset" TAG page 0
-------------------------------------------------------------------------currPage 0
numAllocTMaps 16 numDeadTMaps 0 nextFreePage 0 nextFreeMap 18
Solutions
tMapA[10]
tag 10
seqNo 1
2 0 10
#
#
# nvbmtpg -r bruden_dom 2 0 10
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 48
BMT page 0
-------------------------------------------------------------------------CELL 10
next mcell volume page cell 0 0 0
bfSetTag,tag 2,10
RECORD 0
bCnt 92
type BSRA_VALID
BSR_ATTR
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 2 0 15
firstXtnt mcellCnt 2 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
121328 (0x1d9f0)
bsXA[ 1]
bsPage
3 vdBlk
-1
BSR_XTNTS
RECORD 2
bCnt 92
BMTR_FS_STAT
st_mode 100644 (S_IFREG)
st_uid 0
st_gid 0
st_size 124456
st_nlink 1
dir_tag 2 st_mtime Wed Sep 29 11:13:22 1999
fragId.type BF_FRAG_2K fragId.frag 386
#
# ls -li sm1
10 -rw-r--r--
1 root
28.
system
# showfile -x /usr/dennis/.tags/M1
Id
1.8001
Vol
1
PgSz
16
Pages
8
extentMap: 1
pageOff
pageCnt
0
8
extentCnt: 1
XtntType
simple
vol
1
Segs
**
volBlock
34528
SegSz
**
I/O
ftx
Perf
100%
File
M1
Perf
100%
File
M2
blockCnt
128
#
#
# showfile -x /usr/dennis/.tags/M2
Id
2.8001
Vol
1
extentMap: 1
pageOff
0
PgSz
16
Pages
8
pageCnt
8
XtntType
simple
vol
1
Segs
**
volBlock
34688
SegSz
**
I/O
ftx
blockCnt
128
Solutions
extentCnt: 1
#
# showfile -x /usr/dennis/.tags/M3
Id
3.8003
Vol
1
PgSz
16
Pages
8
extentMap: 1
pageOff
pageCnt
0
2
2
6
extentCnt: 2
XtntType
simple
vol
1
1
Segs
**
SegSz
**
volBlock
57712
80608
I/O
ftx
Perf
50%
File
M3
blockCnt
32
96
#
# showfile -x /usr/dennis/.tags/M4
Id Vol PgSz Pages XtntType Segs SegSz I/O
Perf File
showfile: lstat failed for file /usr/dennis/.tags/M4; No such file or directory
29.
Create a directory and connect into it. Now look at the directory file by typing
the following commands:
Notice the entries for . and .. along with all the empty directory entries.
# ls -l | grep
drwx-----2
drwxrwxrwx
2
drwxr-xr-x
2
^d
root
root
root
system
system
system
#
# cd testdir
# vfilepg -r bruden_dom dennis_fset testdir -f d
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 92080
page 0
-------------------------------------------------------------------------tag name
14 .
2 ..
15 smsub
#
#
# od -A x -a -h -H .
0000000
so nul nul nul dc4 nul soh nul
. nul nul nul
000e
0000
0014
0001
002e
0000
0000000e
00010014
0000002e
0000010 soh nul nul nul stx nul nul nul dc4 nul stx nul
Solutions
8001
0000
00008001
()
0002
0000
00000002
0014
0002
00020014
2e2e
0000
00002e2e
#
#
# pwd
/usr/dennis/testdir
30.
#
#
#
#
#
touch
touch
touch
touch
touch
Use the touch command to create five files, i, ii, iii, iv, and v within your
new directory. Use od and vfilepg to examine the directory file.
i
ii
iii
iv
v
#
#
# vfilepg -r bruden_dom dennis_fset testdir -f d
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 92080
page 0
-------------------------------------------------------------------------tag name
14 .
2 ..
15 smsub
17 i
18 ii
19 iii
20 iv
21 v
#
# od -A x -a -h -H .
0000000
so nul nul nul
000e
0000
0000000e
0000010 soh nul nul nul
8001
0000
00008001
0000020 stx nul nul nul
0002
0000
00000002
0000030
s
m
s
u
6d73
7573
75736d73
0000040 dc1 nul nul nul
0011
0000
00000011
0000050 soh nul nul nul
8001
0000
00008001
Solutions
0000060
0000070
0000080
0000090
dc2 nul nul nul soh nul nul nul dc3 nul nul nul
0012
0000
8001
0000
0013
0000
00000012
00008001
00000013
i
i
i nul dc3 nul nul nul soh nul nul nul
6969
0069
0013
0000
8001
0000
00696969
00000013
00008001
dc4 nul stx nul
i
v nul nul dc4 nul nul nul
0014
0002
7669
0000
0014
0000
00020014
00007669
00000014
nak nul nul nul dc4 nul soh nul
v nul nul nul
0015
0000
0014
0001
0076
0000
00000015
00010014
00000076
()
#
#
# vfilepg -r bruden_dom
dennis_fset -t 14
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 92080
page 0
-------------------------------------------------------------------------000000
0e 00 00 00 14 00 01 00 2e 00 00 00 0e 00 00 00
................
000010
01 80 00 00 02 00 00 00 14 00 02 00 2e 2e 00 00
................
000020
02 00 00 00 01 80 00 00 0f 00 00 00 18 00 05 00
................
000030
73 6d 73 75 62 00 00 00 0f 00 00 00 01 80 00 00
smsub...........
000040
11 00 00 00 14 00 01 00 69 00 00 00 11 00 00 00
........i.......
000050
01 80 00 00 12 00 00 00 14 00 02 00 69 69 00 00
............ii..
000060
12 00 00 00 01 80 00 00 13 00 00 00 14 00 03 00
................
000070
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
iii.............
000080
14 00 02 00 69 76 00 00 14 00 00 00 01 80 00 00
....iv..........
000090
15 00 00 00 14 00 01 00 76 00 00 00 15 00 00 00
........v.......
()
#
#
#
# vfilepg -r bruden_dom dennis_fset -t 14 | grep iii
000070
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
#
#
# vfilepg -r bruden_dom
000070
000700
001070
000070
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
#
# vfilepg -r bruden_dom
iii.............
iii.............
................
................
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
iii.............
Solutions
31.
Remove the file iii. Use od to determine what happens to the directory entry
for iii.
# rm iii
#
# vfilepg -r bruden_dom
000070
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
iii.............
32.
Now remove ii. Notice how the old directory entries for ii and iii have
been merged.
See solution for #31.
33.
You may have noticed that the tags for ii and iii continue to reside in the
directory file and may be wondering about the possibilities for file undeletion.
Remember what happens to free tagmap entries. They are placed on a free list
for recycling.
34.
Create, via touch, a file vii and notice where its directory entry is placed.
# touch vii
#
# vfilepg -r bruden_dom
dennis_fset -t 14
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 92080
page 0
-------------------------------------------------------------------------000000
0e 00 00 00 14 00 01 00 2e 00 00 00 0e 00 00 00
................
000010
01 80 00 00 02 00 00 00 14 00 02 00 2e 2e 00 00
................
000020
02 00 00 00 01 80 00 00 0f 00 00 00 18 00 05 00
................
000030
73 6d 73 75 62 00 00 00 0f 00 00 00 01 80 00 00
smsub...........
000040
11 00 00 00 14 00 01 00 69 00 00 00 11 00 00 00
........i.......
000050
01 80 00 00 12 00 00 00 14 00 03 00 76 69 69 00
............vii.
000060
12 00 00 00 02 80 00 00 00 00 00 00 14 00 00 00
................
000070
69 69 69 00 13 00 00 00 01 80 00 00 14 00 00 00
iii.............
000080
14 00 02 00 69 76 00 00 14 00 00 00 01 80 00 00
....iv..........
000090
15 00 00 00 14 00 01 00 76 00 00 00 15 00 00 00
........v.......
0000a0
01 80 00 00 00 00 00 00 5c 01 00 00 00 00 00 00
........\.......
()
#
#
# vfilepg -r bruden_dom dennis_fset testdir -f d
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 92080
page 0
-------------------------------------------------------------------------tag name
14 .
2 ..
15 smsub
17 i
18 vii
AdvFS On-Disk Structures 2-103
Solutions
20
21
iv
v
35.
Create several files with very, very long names and see how the creation of
directory entries avoids crossing the sector boundaries.
#
# touch Not_so_long_but_still_pretty_longggggggggggggggggggggggggggggggggg
nggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggggggggggggggggggggggg
#
# ls -li
total 92
19 -rw-r--r-1 root
system
0 Sep 29 18:30
Not_so_long_but_still_pretty_longgggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
17 -rw-r--r-1 root
system
0 Sep 29 17:57 i
20 -rw-r--r-1 root
system
0 Sep 29 17:57 iv
15 -rw-r--r-1 root
system
93342 Sep 29 11:09 smsub
21 -rw-r--r-1 root
system
0 Sep 29 17:57 v
18 -rw-r--r-1 root
system
0 Sep 29 18:25 vii
# ls -lid
14 drwxr-xr-x
2 root
system
8192 Sep 29 18:30 .
#
#
#
# ls -li
total 92
19 -rw-r--r-1 root
system
0 Sep 29 18:31
Not_so_long_but_still_pretty_longgggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
22 -rw-r--r-1 root
system
0 Sep 29 18:31
Not_so_long_but_still_pretty_longgggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg1
23 -rw-r--r-1 root
system
0 Sep 29 18:31
Not_so_long_but_still_pretty_longgggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg2
24 -rw-r--r-1 root
system
0 Sep 29 18:31
Not_so_long_but_still_pretty_longgggggggggggggggggggggggggggggggggggggggggggggggggggggg
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg3
17 -rw-r--r-1 root
system
0 Sep 29 17:57 i
20 -rw-r--r-1 root
system
0 Sep 29 17:57 iv
15 -rw-r--r-1 root
system
93342 Sep 29 11:09 smsub
21 -rw-r--r-1 root
system
0 Sep 29 17:57 v
18 -rw-r--r-1 root
system
0 Sep 29 18:25 vii
#
# ls -lid
14 drwxr-xr-x
2 root
system
Solutions
36.
# showfile -i /usr/dennis/testdir
Id Vol PgSz Pages XtntType Segs SegSz
/usr/dennis/testdir: does not have an index file
I/O
Perf
File
#
#
# cat make_100
#! /usr/bin/ksh
integer x=0
integer end=0
read x?"Start number? "
end=$x+100
while (( $x < $end ))
do
touch file$x
x=$x+1
done
#
# ls -lid
14 drwxr-xr-x
2 root
system
2 root
system
2 root
system
#
#
# ./make_100
Start number? 0
#
# ls -lid
14 drwxr-xr-x
#
# ./make_100
Start number? 100
#
# ls -lid
14 drwxr-xr-x
#
# ./make_100
Start number? 200
#
# ls -lid
AdvFS On-Disk Structures 2-105
Solutions
14 drwxr-xr-x
2 root
system
#
#
# showfile -i .
Id
146.8001
Vol
1
PgSz
16
Pages
2
XtntType
simple
Segs
**
SegSz
**
I/O
ftx
Perf
100%
File
index (.)
#
#
#
# pwd
/usr/dennis/testdir
37.
$ dd if=/etc/disktab of=frag.file
$ ls -l frag.file
$ showfile -x frag.file
# dd if=/etc/disktab of=frag.file
60+1 records in
60+1 records out
#
#
# ls -li frag.file
327 -rw-r--r-1 root
system
#
#
# showfile -x frag.file
Id
147.8001
Vol
2
PgSz
16
Pages
3
extentMap: 1
pageOff
pageCnt
0
2
2
1
extentCnt: 2
XtntType
simple
vol
2
2
Segs
**
volBlock
75424
98464
SegSz
**
I/O
Perf
async 50%
File
frag.file
blockCnt
32
16
38.
# ls -li /usr/dennis/.tags/1
1 ---------0 root
#
#
system
786432 Dec 31
1969 /usr/dennis/.tags/1
Solutions
# ls -li /usr/bruce/.tags/1
1 ---------0 root
system
0 Dec 31
1969 /usr/bruce/.tags/1
39.
Copy some randomly sized file, such as /etc/disktab, onto your AdvFS
file system. Now use nvbmtpg to find out where your files fragment resides
within the fragment bitfile.
# cp /etc/disktab /usr/dennis
#
# ls -li di*
328 -rwxr-xr-x
1 root
system
#
#
# nvbmtpg -rv bruden_dom dennis_fset -t 328
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 176
BMT page 4
-------------------------------------------------------------------------pageId 4 megaVersion 4
freeMcellCnt 27
nextFreePg 5
nextfreeMCId page,cell 4,1
-------------------------------------------------------------------------CELL 0 linkSegment 0
bfSetTag 2 (2.8001) tag 328 (148.8001)
next mcell volume page cell 0 0 0
RECORD 0
bCnt 92
version 0
type BSRA_VALID (3)
bfPgSz 16 transitionId 852
cloneId 0 cloneCnt 3 maxClonePgs 0
deleteWithClone 0 outOfSyncClone 0
cl.dataSafety BFD_NIL (0)
cl reqServices 1 optServices 0 extendSize 0 rsvd1 0
rsvd2 0 acl 0 rsvd_sec1 0 rsvd_sec2 0 rsvd_sec3 0
BSR_ATTR (2)
RECORD 1
bCnt 80
version 0
BSR_XTNTS (1)
type BSXMT_APPEND (0)
chain mcell volume page cell 0 0 0
blksPerPage 16 segmentSize -1484947200
delLink next page,cell 56286197,22 prev page,cell 20828416,0
delRst volume,page,cell 0,0,0 xtntIndex 0 offset 0 blocks 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
1105264 (0x10dd70)
bsXA[ 1]
bsPage
3 vdBlk
-1
RECORD 2
bCnt 92
version 0
BMTR_FS_STAT (255)
st_ino 328
st_mode 100755 (S_IFREG)
st_nlink 1
st_size 31114
st_uid 0
st_gid 0
st_rdev 0 major 0 minor 0
st_mtime Wed Sep 29 18:52:20 1999
st_umtime 360751000
st_atime Wed Sep 29 18:52:20 1999
st_uatime 355868000
st_ctime Wed Sep 29 18:52:20 1999
st_uctime 360751000
fragId.frag 8
fragId.type 7 BF_FRAG_7K
fragPageOffset 3
dir_tag 2 (2.8001) st_flags 0
st_unused_1 196608
st_unused_2 0
Solutions
40.
Now use dd to copy that fragment directly out of the fragment bitfile. You will
use a command similar to:
41.
0
16
32
48
64
80
lbn 121392
lbn 121648
lbn 121904
lbn 98560
lbn 98816
lbn 99072
BF_FRAG_7K
BF_FRAG_5K
BF_FRAG_4K
BF_FRAG_2K
BF_FRAG_1K
BF_FRAG_ANY
version
version
version
version
version
version
1
1
1
1
1
1
freeFrags 16
freeFrags 25
freeFrags 30
freeFrags 62
freeFrags 126
freeFrags
0
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
-1
-1
-1
-1
-1
-1
Solutions
#
#
# nvfragpg -rvf bruden_dom dennis_fset
==========================================================================
DOMAIN "bruden_dom"
-------------------------------------------------------------------------frag type
free
1K
2K
3K
4K
5K
6K
7K
totals
groups
1
1
1
0
1
1
0
1
6
frags
127
63
0
31
25
0
18
264
frags used
1
1
0
1
0
0
2
5
disk space
128K
128K
128K
0K
128K
128K
0K
128K
768K
space used
1K
2K
0K
4K
0K
0K
14K
21K
space free
127K
126K
124K
0K
120K
125K
0K
112K
734K
overhead
1K
1K
1K
0K
1K
1K
0K
1K
6K
wasted
0K
1K
0K
3K
2K
0K
1K
7K
% used
<1%
1%
0%
3%
<1%
0%
9%
2%
head
frag
frag
frag
frag
frag
frag
frag
frag
BF_FRAG_ANY groups on
PAGE
80 lbn 99072
BF_FRAG_1K groups on
PAGE
64 lbn 98816
BF_FRAG_2K groups on
PAGE
48 lbn 98560
BF_FRAG_4K groups on
PAGE
32 lbn 121904
BF_FRAG_5K groups on
PAGE
16 lbn 121648
BF_FRAG_7K groups on
PAGE
0 lbn 121392
42.
32
64
48
-1
32
16
-1
0
freeFrags
nextFreeGrp -1
freeFrags 126
nextFreeGrp -1
freeFrags
62
nextFreeGrp -1
freeFrags
30
nextFreeGrp -1
freeFrags
25
nextFreeGrp -1
freeFrags
16
nextFreeGrp -1
Use the nvtagpg command to find the mcell IDs of some AdvFS bitfile-sets.
Now use nvfragpg to print out the addresses of the fragment group headers
for these filesets.
tag 0
primary (vol,page,cell)
0 0 1
Solutions
tMapA[1]
tMapA[2]
tMapA[3]
tMapA[4]
tMapA[5]
tMapA[6]
tMapA[7]
tMapA[8]
tMapA[9]
tMapA[10]
tMapA[11]
tMapA[12]
tMapA[13]
tMapA[14]
tMapA[15]
tMapA[16]
tag 1
tag 2
tag 3
tag 4
tag 5
tag 6
tag 7
tag 8
tag 9
tag 10
tag 11
tag 12
tag 13
tag 14
tag 15
tag 16
()
tMapA[328] tag 328
tMapA[329] tag 329
tMapA[330] tag 330
tMapA[331] tag 331
()
tMapA[1021] tag 1021
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
seqNo
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
primary
seqNo
seqNo
seqNo
seqNo
1
primary
1 (NOT USED)
1 (NOT USED)
1 (NOT USED)
2
1
2
1
2
2
1
2
1
2
3
2
1
1
2
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8
5
10
6
7
12
8
17
10
6
12
15
22
13
24
mcell (vol,page,cell) 3
primary (vol,page,cell)
primary (vol,page,cell)
primary (vol,page,cell)
4
0
0
0
0
10 11
10 12
10 13
primary (vol,page,cell)
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
mcell
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
(vol,page,cell)
0 0 0
#
#
# nvfragpg -rv bruden_dom dennis_fset
==========================================================================
DOMAIN "bruden_dom"
-------------------------------------------------------------------------frag type
free
1K
2K
3K
4K
5K
6K
7K
totals
groups
1
1
1
0
1
1
0
1
6
frags
127
63
0
31
25
0
18
264
frags used
1
1
0
1
0
0
2
5
disk space
128K
128K
128K
0K
128K
128K
0K
128K
768K
space used
1K
2K
0K
4K
0K
0K
14K
21K
space free
127K
126K
124K
0K
120K
125K
0K
112K
734K
overhead
1K
1K
1K
0K
1K
1K
0K
1K
6K
wasted
0K
1K
0K
3K
2K
0K
1K
7K
% used
<1%
1%
0%
3%
<1%
0%
9%
2%
PAGE
PAGE
PAGE
PAGE
PAGE
PAGE
0
16
32
48
64
80
lbn 121392
lbn 121648
lbn 121904
lbn 98560
lbn 98816
lbn 99072
BF_FRAG_7K
BF_FRAG_5K
BF_FRAG_4K
BF_FRAG_2K
BF_FRAG_1K
BF_FRAG_ANY
version
version
version
version
version
version
1
1
1
1
1
1
freeFrags 16
freeFrags 25
freeFrags 30
freeFrags 62
freeFrags 126
freeFrags
0
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
nextFreeGrp
-1
-1
-1
-1
-1
-1
Solutions
43.
The nvfragpg program, also located in /sbin/advfs, will print out a list
of the free fragments found within a fragment group along with the address of
the next group of that type.
BF_FRAG_ANY groups on
PAGE
80 lbn 99072
BF_FRAG_1K groups on
PAGE
64 lbn 98816
BF_FRAG_2K groups on
PAGE
48 lbn 98560
BF_FRAG_4K groups on
PAGE
32 lbn 121904
BF_FRAG_5K groups on
PAGE
16 lbn 121648
BF_FRAG_7K groups on
PAGE
0 lbn 121392
44.
32
64
48
-1
32
16
-1
0
freeFrags
nextFreeGrp -1
freeFrags 126
nextFreeGrp -1
freeFrags
62
nextFreeGrp -1
freeFrags
30
nextFreeGrp -1
freeFrags
25
nextFreeGrp -1
freeFrags
16
nextFreeGrp -1
Start out by running od -x on one of your storage bitmap files. The command
syntax will be something like:
# od -x -N 1024 /usr/.tags/-7
# od -x -N 1024 /usr/dennis/.tags/M-7
0000000 0000 0000 c700 ffff ffff ffff ffff ffff
0000020 ffff ffff ffff ffff ffff ffff ffff ffff
*
Solutions
0000120
0000140
*
0000420
0000440
*
0001340
0001360
*
0020000
45.
Repeat the previous exercise, but this time use the virtual disk interface. You
must use showfile -x to find the extent map for the storage bitmap. It will
look similar to:
# od -x -j 112b -N
0000000 0000 0000
0000016 ffff ffff
*
0000080 ffff ffff
0000096 0000 0000
*
0000272 0000 0000
0000288 ffff ffff
*
0000736 07ff 0000
0000752 0000 0000
*
0008192 0002 0000
0008208 0001 0000
(...)
46.
1024 /dev/rdisk/dsk0a
c700 ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff
ffff ffff 00ff 0000 0000 0000
0000 0000 0000 0000 0000 0000
c000 ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff
0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000
0003 0000 2c39 37f1 63ea 0002
0000 ffff 0000 0000 0002 0000
47.
DOMAIN "bruden_dom"
VDI 1 (/dev/rdisk/dsk0a)
lbn 112
SBM page 0
Solutions
-------------------------------------------------------------------------blocks 50000 - 50015 (0xc350 - 0xc35f) are mapped by SBM map entry 97, bit 21
mapInt[97] 11111111 11111111 11111111 11111111
block 50000
^
48.
Use showfile to see the extents of your miscellaneous bitfile. Find them at
.tags/-11, and so forth.
# showfile -x /usr/dennis/.tags/M-11
Id Vol PgSz Pages XtntType Segs SegSz I/O
Perf File
fffffff5.0000
1
16
4
simple
**
** ftx
50% M-11
extentMap: 1
pageOff
pageCnt
0
2
2
2
extentCnt: 2
vol
1
1
volBlock
0
64
blockCnt
32
32
#
#
# showfile -x /usr/dennis/.tags/M-17
Id Vol PgSz Pages XtntType Segs SegSz I/O
Perf File
ffffffef.0000
2
16
4
simple
**
** ftx
50% M-17
extentMap: 1
pageOff
pageCnt
0
2
2
2
extentCnt: 2
vol
2
2
volBlock
0
64
blockCnt
32
32
#
#
# showfile -x /usr/dennis/.tags/M-23
Id Vol PgSz Pages XtntType Segs SegSz I/O
Perf File
ffffffe9.0000
3
16
4
simple
**
** ftx
50% M-23
extentMap: 1
pageOff
0
2
pageCnt
2
2
vol
3
3
volBlock
0
64
blockCnt
32
32
extentCnt: 2
Solutions
3
AdvFS In-Memory Structures
Resources
For more information on topics in this chapter as well as related topics, see the
following:
Header Files
Big picture
FAS layer
BAS layer
Figure 3-1:
Big Picture
thread
rootfs
mount
mount
task
proc
domain
file table
(system
wide)
utask
bfSet
vnode
vd
bfAccess
bfNode
fsContext
Extents
fileSetNode
VFS-specific structures
vnode structure
mount structure
The following example shows an open(2) system call returning a file descriptor to
the caller.
Example 3-1: Open System Call Returning a File Descriptor
int main(void)
{
int fd, uid, pid, bytesread;
fd = open("/usr/bruden/ob_1", O_RDWR | O_CREAT, 0777);
if (fd == -1)
{
perror("open failed ");
exit(EXIT_FAILURE);
}
printf("file opened -- file descriptor is %d.\n",fd);
}
File structure:
Points to vnode
The following example shows a path to the utask structure which contains open
file information.
Example 3-3: Using utask to Get Open File Information
(dbx) set $pid=953
(dbx) p (*(struct super_task *)thread.task).utask
struct {
uu_comm = "openone"
uu_maxuprc = 64
uu_logname = 0xfffffc0002fcc4a0 = "root"
(...)
uu_file_state = struct {
(...)
uf_entry = {
[0] 0xfffffc00017bd700 <== Indirectly points to file structure
[1] (nil)
[2] (nil)
[3] (nil)
[4] (nil)
[5] (nil)
[6] (nil)
[7] (nil)
}
Here is a route to the vnode using the file descriptor (number 3) to get to the file
structure and from there to the vnode. This can be crafted into a dbx macro which
expects to be given the PID of the process and the file descriptor number.
Example 3-4: Getting to the vnode
(dbx) p *(struct vnode *)(*(struct super_task *)thread.task)
.utask.uu_file_state.uf_entry[0][3].ufe_ofile.f_data
struct {
v_lock = 0
(...)
v_type = VREG
<== Regular file
v_tag = VT_MSFS
<== AdvFS
v_mount = 0xfffffc0005ab2a80
<== To mount structure
v_mountedhere = (nil)
v_op = 0xfffffc00006b01d0
v_freef = (nil)
v_freeb = (nil)
v_mountf = 0xfffffc000367bb00
v_mountb = 0xfffffc0001c3a958
(...)
v_data = ""
<== Begins file system specific information
vnode Structure
Every open file is represented by a vnode. If the file is within an AdvFS file system,
the vnode will have a file system-specific extension called a bfNode structure.
Characteristics of the vnode structure include:
Points to VM object
mount Structure
Each mounted file system is represented by a mount structure. All mount structures
are located from a singly linked listhead named rootfs.
Characteristics of the mount structure include:
The following example uses rootfs to locate a mount structure. Note that we are
examining the third mount structure. The structures are linked through the m_nxt
field.
Example 3-5: Viewing a mount Structure Using rootfs
(dbx) p *rootfs.m_nxt.m_nxt
struct {
m_lock = 18446739675758144512
m_flag = 20480
m_funnel = 0
m_nxt = 0xfffffc0005ab2d80
<== To next mount structure
m_prev = 0xfffffc0005ab3380
m_op = 0xfffffc00006af990
m_vnodecovered = 0xfffffc0001a8f200
m_mounth = 0xfffffc0004d5a240
m_vlist_lock = 0
m_exroot = 0
m_uid = 0
m_stat = struct {
f_type = 10
f_flags = 20480
f_fsize = 512
f_bsize = 8192
f_blocks = 1426112
f_bfree = 400688
f_bavail = 324960
f_files = 582215
f_ffree = 558528
(...)
f_mntonname = 0xfffffc0000d34c20 = "/usr"
f_mntfromname = 0xfffffc0000d34940 = "usr_domain#usr"
(...)
msfs_args = struct {
id = struct {
id1 = 937059922
id2 = 653520
tag = 1
}
}
(...)
bfNode structure
fsContext structure
fileSetNode structure
AdvFS vnode
Fileset context:
fsContext structure
Fileset node:
fileSetNode structure
bfNode Structure
The first private area (FAS level) of an AdvFS file is the bfNode structure. This
structure has changed in V5. Most notably, the first field is now a pointer rather than
an AdvFS handle.
The following is an excerpt from ms_osf.h.
Example 3-6:
/*
* bfNode is the msfs structure at the end of a vnode
*/
typedef struct bfNode {
struct bfAccess *accessp;
struct fsContext *fsContextp;
bfTagT tag;
bfSetIdT bfSetId;
} bfNodeT;
Source location: msfs/ms_osf.h
The following example uses an alias to get at the bfNode structure for an open file.
Example 3-7: Accessing bfNode Structure Using an Alias
(dbx) alias v5_get_ofile_bfNode_struct(pidd,fd)
"set $pid=pidd; p *(struct bfNode *)&((struct vnode *)(*(struct super_task
*)thread.task).utask.uu_file_state.uf_entry[0][fd].ufe_ofile.f_data).v_data"
(dbx)v5_get_ofile_bfNode_struct(953,3)
struct {
accessp = 0xfffffc0004d94d88
fsContextp = 0xfffffc0004d5ae70
tag = struct {
num = 23704
seq = 32770
}
bfSetId = struct {
domainId = struct {
tv_sec = 937059922
tv_usec = 653520
}
dirTag = struct {
num = 1
seq = 32769
}
}
}
(dbx) set $bfaccess=0xfffffc0004d94d88
(dbx) set $fscontext=0xfffffc0004d5ae70
fsContext Structure
Each file will have basic ownership and permission information available in a
memory-based structure. There is also reference to the directory and fileset
available through the fsContext structure.
Characteristics of the fsContext structure include:
Contains:
Quota information
Tag of fileset
Tag of files parent directory
File statistics
The following example contains excerpts from fs_dir.h. It shows the fields of
the fsContext data structure. Note the pointer to the fileSetNode structure.
Example 3-8: Fields of the fsContext Structure
struct fsContext {
short initialized;
short quotaInitialized;
bfTagT undel_dir_tag;
long fs_flag;
int dirty_stats;
int dirty_alloc;
lock_data_t file_lock;
/*
/*
/*
/*
/*
long dirstamp;
/* stamp to determine directory changes */
mutexT fsContext_mutex;
/* mutex to take out locks on this structure */
#ifdef ADVFS_DEBUG
char file_name[30];
/* first 29 chars of file name */
#endif
bfTagT bf_tag;
/* the tag for the file */
long last_offset;
/* the offset of the last found entry */
struct fs_stat dir_stats;
/* stats */
struct fileSetNode *fileSetNode; /* pointer to per-fileset info */
struct dQuot *diskQuot[MAXQUOTAS]; /* pointers to quota structs */
};
Example 3-9:
Figure 3-2:
Per File
vnode
mount
bfNode
fileSetNode
fsContext
bfSet
bfAccess
domain
Extent Map
Disk
Block
The mount structure for this file system is linked to the mount structure of the
root file system (m_nxt) which is found through the global symbol rootfs.
The mounted file systems mount structure (m_data) points to the file systemspecific mount structure, in this case the AdvFS fileSetNode structure.
Attached to the vnodes of the active files of the mounted file system are
bfNode data structures, which represent the files.
fileSetNode Structure
An AdvFS fileset is represented within the FAS layer by the fileSetNode
structure. Characteristics of the fileSetNode structure include the AdvFS
specific mount structure, which has pointers to:
domain structure
mount structure
Figure 3-3:
PBQ[W
PBLQIR
YQRGHV
0RXQW
6WUXFWXUH
YBPRXQW
YBPRXQW
YBPRXQW
YBPRXQWHGKHUH
YBGDWD
LQRGH
YBGDWD
LQRGH
PBLQIR
YQRGHV
YBPRXQW
YBPRXQW
YBPRXQW
YBGDWD
EI1RGH
YBGDWD
EI1RGH
YBGDWD
EI1RGH
YBGDWD
LQRGH
XIVPRXQW
ILOH6HW1RGH
Source locations:
bfAccess structure
bfSet structures
domain structures
vd structures
bfAccess structure
bitfile structure
bfSet
bitfile-set structure
domainT
File domain
vd structure
Virtual disks
Pointer to a vnode
Pointer to a vm object
Domain pointer
Vol
1
PgSz
16
Pages
3
extentMap: 1
pageOff
pageCnt
0
3
extentCnt: 1
XtntType
simple
vol
1
Segs
**
volBlock
222416
SegSz
**
I/O
Perf
async 100%
File
ob_1
blockCnt
48
bfSet Structure
Characteristics of the bfSet structure include the lower-level BAS structure for a
fileset. This includes:
Cloned/master state
}
bfDmnMntId = struct {
tv_sec = 937392621
tv_usec = 874423
}
dmnAccCnt = 4
dmnRefWaiters = 0
activateCnt = 2
mountCnt = 2
bfSetDirp = 0xfffffc0005b7c788
bfSetDirTag = struct {
num = 4294967288
seq = 0
}
(...)
bfSetHead = struct {
bfsQfwd = 0xfffffc0005b7cce8
bfsQbck = 0xfffffc0005b7c7e8
}
bfSetDirAccp = 0xfffffc0005af8488
ftxLogTag = struct {
num = 4294967287
seq = 0
}
ftxLogP = 0xfffffc0005baec48
ftxLogPgs = 512
logAccessp = 0xfffffc0005af8908
(...)
domainName = "usr_domain"
majorNum = 2055
flag = BFD_NORMAL
lsnLock = struct {
mutex = 0
}
lsnList = struct {
lsnFwd = 0xfffffe04075c0e68
lsnBwd = 0xfffffe04075c0e68
(...)
vdCnt = 1
vdpTbl = {
[0] 0xfffffc0000f2b508
[1] (nil)
[2] (nil)
(...)
bcStat = struct {
pinHit = 14402
pinHitWait = 784
pinRead = 0
refHit = 24821
refHitWait = 69
raBuf = 2458
ubcHit = 1418
unpinCnt = struct {
lazy = 14162
blocking = 66
clean = 11
log = 2172
}
derefCnt = 28516
devRead = 3025
devWrite = 3229
(...)
bmtStat = struct {
fStatRead = 0
fStatWrite = 5316
resv1 = 0
resv2 = 0
bmtRecRead = {
[0] 0
[1] 0
(...)
[21] 0
}
bmtRecWrite = {
[0] 0
[1] 0
[2] 97
[3] 0
(...)
[21] 0
}
}
logStat = struct {
logWrites = 313
transactions = 9860
segmentedRecs = 3
logTrims = 0
wastedWords = 27558
maxLogPgs = 102
minLogPgs = 0
maxFtxWords = 2127
maxFtxAgent = 91
maxFtxTblSlots = 15
oldFtxTblAgent = 34
excSlotWaits = 0
fullSlotWaits = 0
rsv1 = 0
rsv2 = 0
rsv3 = 0
rsv4 = 0
}
totalBlks = 1426112
freeBlks = 324480
dmn_panic = 0
(...)
smsync_policy = 0
metaPagep = 0xfffffe0400299008
fs_full_time = 0
}
vd Structure
Characteristics of the vd structure include per-virtual disk structure. This includes:
The following is an excerpt from bs_vd.h showing descriptions of some of the fields
in the data structure.
Example 3-15: Fields in the vd Structure
/*
* vd - this structure describes a virtual disk, including accessed
* bitfile references, its size, i/o queues, name, id, and an
* access handle for the metadata bitfile.
*/
typedef struct vd {
/*
** Static fields (ie - they are set once and never changed).
*/
uint32T stgCluster;
/* num blks each stg bitmap bit */
struct vnode *devVp;
/* device access (temp vnode *) */
uint_t vdMagic;
/* magic number: structure validation */
bfAccessT *rbmtp;
/* access structure pointer for RBMT */
bfAccessT *bmtp;
/* access structure pointer for BMT */
bfAccessT *sbmp;
/* access structure pointer for SBM */
domainT *dmnP;
/* domain pointer for ds */
uint32T vdIndex;
/* 1-based virtual disk index */
uint32T maxPgSz;
/* max possible page size on vd */
uint32T bmtXtntPgs;
/* number of pages per BMT extent */
char vdName[BS_VD_NAME_SZ]; /* temp - should be global name */
/* The following fields are
bsVdStatesT vdState;
struct thread *vdSetupThd;
uint32T
vdRefCnt;
uint32T
vdRefWaiters;
mutexT
vdStateLock;
/*
* The following fields are protected by the vdScLock semaphore
* in the domain structure. This lock is protected by the
* domain mutex. Use the macros VD_SC_LOCK and VD_SC_UNLOCK.
*/
uint32T vdSize;
/* count of vdSectorSize blocks in vd */
int vdSectorSize;
/* Sector size, in bytes, normally 512 */
uint32T vdClusters;
/* num clusters in vd */
serviceClassT serviceClass; /* service class provided */
ftxLkT mcell_lk;
int nextMcellPg;
ftxLkT rbmt_mcell_lk;
int lastRbmtPg;
int rbmtFlags;
ftxLkT stgMap_lk;
/* used with domain mutex */
stgDescT *freeStgLst;
/* ptr to list of free storage descriptors */
uint32T numFreeDesc;
/* number of free storage descriptors in list */
uint32T freeClust;
/* total number free clusters */
uint32T scanStartClust; /* cluster where next bitmap scan will start */
uint32T bitMapPgs;
/* number of pages in bitmap */
uint32T spaceReturned; /* space has been returned */
stgDescT *fill1;
/* ptr to list of reserved storage descriptors */
stgDescT *fill3;
/* ptr to list of free, reserved stg descriptors */
uint32T fill4;
/* # of free, reserved stg descriptors in list */
ftxLkT del_list_lk;
lock_data_t ddlActiveLk;
entries */
/*
* I/O queues; these fields protected by vdIoLock
*/
mutexT vdIoLock;
/* simple lock for guarding I/O fields. */
ioDescHdrT blockingQ;
/* For blocking I/O */
ioDescHdrT waitLazyQ;
/* Transactional buffers w/ too high lsn */
ioDescHdrT smSyncQ[SMSYNC_NQS]; /* smooth sync queues */
ioDescHdrT readyLazyQ;
/* Sorted, ready for consolidation */
ioDescHdrT consolQ;
/* Consolidated, ready to be written */
ioDescHdrT devQ;
/* Tracks device */
int blockingCnt;
/* keep track of how many times we can take */
#define BLOCKFACT 4
int blockingFact;
/* from blocking q before taking from consol q */
int rdmaxio;
/* max blocks that can be read/written */
int wrmaxio;
/* in a consolidated I/O */
int vdIoOut;
/* There are outstanding I/Os on this vd */
int start_active;
/* Recursion preventer */
int gen_active;
/* I/O generation loop active */
stateLkT active;
/* indicates when disk (or lazy thread) is busy */
short advfs_start_more_posted; /* 0 = no message yet posted */
/* 1 = message posted but not processed */
/* 2 = vd_free in progress */
#ifdef ADVFS_DEBUG
enum deFlags errorFlag;
int errorCount;
int errorRepeat;
#endif /* ADVFS_DEBUG */
u_long blkQ_cnt;
/* count of bufs placed onto blockingQ */
u_long lazyQ_cnt;
/* count of bufs placed onto lazyQ */
u_long smsyncQ_cnt;
/* count of bufs placed onto smsyncQ */
u_long readyQ_cnt;
/* count of bufs placed onto readyQ */
u_long consolQ_cnt;
/* count of bufs placed onto consQ */
u_long devQ_cnt;
/* count of bufs placed onto devQ */
u_long rmioq_cnt;
/* count of bufs rm_ioqed */
u_long rmormvq_cnt;
/* count of bufs rm_or_moveqed */
u_int syncQIndx;
/* next smsync queue to be processed */
/* end of fields protected by vdIoLock */
int
int
int
int
int
int
consolidate;
max_iosize_rd;
max_iosize_wr;
preferred_iosize_rd;
preferred_iosize_wr;
qtodev;
/*
/*
/*
/*
/*
/*
stgDescT freeRsvdStg;
/* desc for free rsvd stg for rsvd files */
#ifdef ADVFS_VD_TRACE
uint32T trace_ptr;
vdTraceElmtT trace_buf[VD_TRACE_HISTORY];
#endif
} vdT;
Each entry gives the starting block and size of each free area
To avoid costly I/Os and bitmap scanning when searching for free space on a
volume, AdvFS uses an in-memory free space cache to keep track of free space on
a volume. The cache is a linked list of free space extents. It is a cache because it
has a limited number of entries so it does not represent all the free space on a
volume. The entries in the cache are sorted by cluster number.
The free space cache is filled whenever it becomes empty (or when it is explicitly
invalidated). It is filled by scanning the bitmap and creating cache entries for free
space extents in the bitmap.
The following example describes the storage descriptor structure found in msfs/
msfs/bs_vd.h. This structure uses data drawn from the SBM.
Example 3-16: Fields in the stgDesc Structure
/*
* stgDescT - Describes a contiguous set of available (free) vd blocks.
* These structures are used to maintain a list of free disk space. There
* is a free list in each vd structure. The list is ordered by virtual
* disk block (it could also be ordered by the size of each contiguous
* set of blocks in the future). Refer to the "sbm_" routines in
* bs_sbm.c.
*/
typedef struct stgDesc {
uint32T start_clust;
uint32T num_clust;
struct stgDesc *prevp;
struct stgDesc *nextp;
} stgDescT;
Structure bsBuf
Lots of fields for doubly linked lists
Log record addresses
AdvFS In-Memory Structures 3-27
Page address
Domain, bitfile-set, fileset, page
Physical location
bfAccess structure
I/O descriptor information and queues
Migrating pages may have more than one I/O descriptor.
This structure gives information about the in-core information of an AdvFS page
stored in the primary cache. Pinned pages may be found here.
Source location: msfs/msfs/bs_buf.h
I/O Descriptor
Characteristics of the I/O descriptor include:
Block descriptor
Virtual disk
Block
Address of buffer
Summary
Summary
Examining AdvFS In-Memory Structures
Recall that all I/O will flow through the VFS software which directs the flow to the
appropriate file system-specific software. The following file system layers are
supported by in-memory structures.
VFS layer
FAS layer
BAS layer
fsContext
fileSetNode
dQuot
bfSet
Bitfile-set structure
domainT
File domain
vd
Virtual disks
Summary
Exercises
Exercises
Start a process that opens an AdvFS file but does not close it. If you are a C or Korn
shell user, start a cat process and press ^Z to suspend it (or use the more
command).
% cd some-advfs-directory
% cat > testy.file
Here is one line.
^Z
Note the inode number of the file you have created and the ID of the process writing
the file.
1.
Determine the address of the file structure associated with the file. Use the
ofile command of kdbx or use the dbx techniques shown in class. If you
followed the suggestion above when creating the file, the address of the file
structure will be found in file descriptor 1, standard output.
# kdbx -k /vmunix
....
(kdbx) ofile -pid 19279
Proc=0xfffffc0002590ca0
pid=19279
ofile[ 0]=0xfffffc0003269680
ofile[ 1]=0xfffffc0003269400
ofile[ 2]=0xfffffc0003269680
2.
Now print the file structure. Examine its values to make sure they seem
reasonable. You may continue to use kdbx, however, if you encounter
problems, try dbx. It does not crash as frequently.
# dbx -k /vmunix
.......
(dbx) set $f = (struct file *)0xfffffc0003269400
(dbx) print *(struct file *)$f
3.
The f_data field of the file structure points to the files vnode. Save and print
the address of the vnode. Its useful to print the address so youll have it handy
in case dbx crashes. Now print the vnode structure.
You should not have to type the (struct vnode *) type case.
Feel free to use a supplied alias, or create your own.
AdvFS In-Memory Structures 3-31
Exercises
4.
The bfNode and fileset context structures are in the private area of the vnode.
Set a pointer to the bfNode and print its contents. The bfNode is an extension
to the vnode and contains a pointer to the fsContext structure.
Note the access and fileset context pointer for your file.
5.
Verify that you are looking at the right file by matching the tag number, as
shown by showfile, with the tag you see with dbx.
6.
Note how information contained in several BMT records related to the file has been
placed into one in-memory structure. Verify that the POSIX file statistics
information seems reasonable.
7.
At this point you have looked at the in-core, FAS-level structures for the file. Now
look at the FAS-level structure for the file system or fileset. You could go directly
from the fileset context structure, but lets take the scenic tour through the mount
structure.
Exercises
8.
There is a pointer to the mount structure inside the vnode. Print the structure.
Wake up when you see the few MSFS-specific fields.
The m_info field of the mount structure contains a pointer to AdvFS private
file system information. This information is the fileSetNode. Print it.
You will see all sorts of interesting information: domain ID, bitfile-set handle,
pointer to the file systems root directory, and lots of statistics.
10.
Print the access structure and see if its tag number matches your target.
Exercises
12.
Examine the back pointers to the vnode and VM object. Use these fields for
additional confirmation that you have the right target. You will also see pointers
to extent map information and the bitfile-set and domain structures.
For most bitfiles this will not be a very exciting structure; however, for bitfiles with
many extents, this is the beginning of a mass of pointers. Note that the
subXtntMap field is an array with validCnt elements. Each subXtntMap
structure has an array of extents (bsXA) with cnt elements.
We can now proceed to the bitfile-set, domain, and virtual disk data structures of
AdvFS. Use the pointers of the bitfile access structure to find them.
14.
Move from the bitfile access structure into the bitfile-set structure. Print it.
There is a lot to see. Be sure to use the bitfile-set ID field to verify and match
the values returned by showfsets.
15.
Now print the domain structure. (Do not use struct domain unless you
want the structure for socket domains.) In the middle of this structure, you will
see an array for pointers to virtual disk structures. There are also many fields
used to control file domain I/O.
Exercises
16.
The last major structure to print is used for virtual disks. You will see even
more I/O control substructures here.
Solutions
Solutions
Start a process that opens an AdvFS file but does not close it. If you are a C or Korn
shell user, start a cat process and press ^Z to suspend it (or just use more).
% cd some-advfs-directory
% cat > testy.file
Here is one line.
^Z
Note the inode number of the file you have created and the ID of the process writing
the file.
#
# cat openone.c
/*
openone.c
I
*/
/*
SAMPLE PROGRAM FOR FILE OPEN TESTING
*/
/*
Opens or creates a file named ob_1 in the current directory. */
#include <sys/file.h>
#include <stdlib.h>
int main(void)
{
int fd, uid, pid, bytesread;
fd = open("ob_1", O_RDWR | O_CREAT, 0777);
if (fd == -1)
{
perror("open failed ");
exit(EXIT_FAILURE);
}
printf("file opened -- file descriptor is %d.\n",fd);
uid = getuid();
printf("uid is %d.\n",uid);
pid = getpid();
printf("pid is %d.\n",pid);
printf("Hit any key to close file and terminate program.\n");
getchar();
close(fd);
printf("done\n");
}
#
# cc -o openone openone.c
#
# ./openone&
[1]
816
Solutions
1.
0:00.02 ./openone
0:00.01 grep open
1 root
system
Determine the address of the file structure associated with the file. Use the
ofile command of kdbx or use the dbx techniques shown in class. If you
followed the suggestion above when creating the file, the address of the file
structure will be found in file descriptor 1, standard output.
# kdbx -k /vmunix
....
(kdbx) ofile -pid 19279
Proc=0xfffffc0002590ca0
pid=19279
ofile[ 0]=0xfffffc0003269680
ofile[ 1]=0xfffffc0003269400
ofile[ 2]=0xfffffc0003269680
# kdbx -k /vmunix
dbx version 5.0
Type help for help.
stopped at [thread_block:2709 ,0xfffffc00002c8084]
Source not available
warning: Files compiled -g3: parameter values probably wrong
(kdbx)
(kdbx)
(kdbx)
(kdbx) ofile -pid 816
Proc=0xfffffc00059b2c80
ofile[
ofile[
ofile[
ofile[
pid=
816
0]=0xfffffc000248e040
1]=0xfffffc000248e040
2]=0xfffffc000248e040
3]=0xfffffc0002eef500
(kdbx)
(kdbx)
(kdbx) q
dbx (pid 832) died.
#
Through dbx
Exiting...
Solutions
#
# dbx -k /vmunix
dbx version 5.0
Type help for help.
stopped at [thread_block:2709 ,0xfffffc00002c8084]
Source not available
warning: Files compiled -g3: parameter values probably wrong
(dbx)
(dbx)
(dbx)
(dbx) set $pid=816
(dbx)
(dbx) p (*(struct super_task
*)thread.task).utask.uu_file_state.uf_entry[0][3].ufe_ofile
0xfffffc0002eef500
2.
Now print the file structure. Examine its values to make sure they seem
reasonable. You can continue to use kdbx, however, if it starts giving you
trouble, remember that dbx does not crash as frequently.
# dbx -k /vmunix
.......
(dbx) set $f = (struct file *)0xfffffc0003269400
(dbx) print *(struct file *)$f
(dbx) set $f = 0xfffffc0002eef500
(dbx)
(dbx) px $f
0xfffffc0002eef500
(dbx)
(dbx)
(dbx) p *(struct file *)$f
struct {
f_incore_lock = 0
f_flag = 3
f_count = 1
f_type = 1
f_msgcount = 0
f_cred = 0xfffffc000346c3c0
f_ops = 0xfffffc00006c5990
f_data = 0xfffffc00020ec000 = ""
f_u = union {
fu_offset = 0
fu_freef = (nil)
}
f_io_lock = 0
f_io_waiters = 0
}
3.
The f_data field of the file structure points to the files vnode. Save and print
the address of the vnode. It is useful to print the address so you will have it
handy in case dbx crashes. Now print the vnode structure.
Solutions
0xfffffc0002964e00
(dbx) print *(struct vnode *)$p
You should not have to type the (struct vnode *) type case. Feel free to use
a supplied macro or create your own.
(dbx) set $v = 0xfffffc00020ec000
(dbx)
(dbx) p *(struct vnode *)$v
struct {
v_lock = 0
v_flag = 0
v_usecount = 1
v_aux_lockers = 0
v_shlockc = 0
v_exlockc = 0
v_lastr = 0
v_id = 29695
v_type = VREG
v_tag = VT_MSFS
v_mount = 0xfffffc0005ab2a80
v_mountedhere = (nil)
v_op = 0xfffffc00006b01d0
v_freef = (nil)
v_freeb = (nil)
v_mountf = 0xfffffc0002218900
v_mountb = 0xfffffc0004ad4058
v_buflists_lock = 0
v_cleanblkhd = (nil)
v_dirtyblkhd = (nil)
v_ncache_time = 1765
v_free_time = 1286
v_output_lock = 0
v_numoutput = 0
v_outflag = 0
v_cache_lookup_refs = 0
v_rdcnt = 1
v_wrcnt = 1
v_dirtyblkcnt = 0
v_dirtyblkpush = 0
v_un = union {
vu_socket = (nil)
vu_specinfo = (nil)
vu_fifonode = (nil)
}
v_object = 0xfffffc00027f9380
v_secattr = (nil)
v_data = "
}
(dbx)
(dbx)
(dbx) alias v5_get_ofile_vnode_struct(pidd,fd) "set $pid=pidd;p *(struct vnode
*)(*(struct super_task
*)thread.task).utask.uu_file_state.uf_entry[0][fd].ufe_ofile.f_data"
Solutions
(dbx)
(dbx)
(dbx) v5_get_ofile_vnode_struct(816,3)
struct {
v_lock = 0
v_flag = 0
v_usecount = 1
v_aux_lockers = 0
v_shlockc = 0
v_exlockc = 0
v_lastr = 0
v_id = 29695
v_type = VREG
v_tag = VT_MSFS
v_mount = 0xfffffc0005ab2a80
v_mountedhere = (nil)
v_op = 0xfffffc00006b01d0
v_freef = (nil)
v_freeb = (nil)
v_mountf = 0xfffffc0002218900
v_mountb = 0xfffffc0004ad4058
v_buflists_lock = 0
v_cleanblkhd = (nil)
v_dirtyblkhd = (nil)
v_ncache_time = 1765
v_free_time = 1286
v_output_lock = 0
v_numoutput = 0
v_outflag = 0
v_cache_lookup_refs = 0
v_rdcnt = 1
v_wrcnt = 1
v_dirtyblkcnt = 0
v_dirtyblkpush = 0
v_un = union {
vu_socket = (nil)
vu_specinfo = (nil)
vu_fifonode = (nil)
}
v_object = 0xfffffc00027f9380
v_secattr = (nil)
v_data = "
}
4.
The bfNode and fileset context structures are in the private area of the vnode.
Set a pointer to the bfNode and print its contents. The bfNode is an extension
to the vnode and contains a pointer to the fsContext structure.
Note the access and fileset context pointer for your file.
Solutions
(dbx) px $v
0xfffffc00020ec000
(dbx)
(dbx)
(dbx) p &(*(struct vnode *)$v).v_data
0xfffffc00020ec0c8 = "^H^;\256^E"
(dbx)
(dbx)
(dbx) set $bf=0xfffffc00020ec0c8
(dbx)
(dbx)
(dbx) p *(struct bfNode *)$bf
struct {
accessp = 0xfffffc0005aefb08
fsContextp = 0xfffffc00020ec0f0
tag = struct {
num = 23723
seq = 32771
}
bfSetId = struct {
domainId = struct {
tv_sec = 937059922
tv_usec = 653520
}
dirTag = struct {
num = 1
seq = 32769
}
}
}
(dbx)
(dbx)
(dbx) whatis struct bfNode
struct bfNode {
struct bfAccess * accessp;
struct fsContext * fsContextp;
bfTagT tag;
bfSetIdT bfSetId;
};
(dbx)
(dbx)
(dbx) set $fsc = 0xfffffc00020ec0f0
(dbx)
(dbx)
(dbx) p *(struct fsContext *)$fsc
struct {
initialized = 1
quotaInitialized = 1
undel_dir_tag = struct {
num = 0
seq = 0
}
fs_flag = 0
dirty_stats = 0
Solutions
dirty_alloc = 0
file_lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc00020ec118
prev = 0xfffffc00020ec118
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
dirstamp = 0
fsContext_mutex = struct {
mutex = 0
}
bf_tag = struct {
num = 23723
seq = 32771
}
last_offset = 0
dir_stats = struct {
st_ino = struct {
num = 23723
seq = 32771
}
st_mode = 33261
st_uid = 0
st_gid = 0
st_rdev = 0
st_size = 0
st_atime = 938696472
st_uatime = 976962000
st_mtime = 938696472
st_umtime = 976962000
st_ctime = 938696472
st_uctime = 976962000
st_flags = 0
dir_tag = struct {
num = 23707
seq = 32769
}
fragId = struct {
frag = 0
type = BF_FRAG_ANY
}
st_nlink = 1
st_unused_1 = 0
fragPageOffset = 0
st_unused_2 = 0
}
Solutions
fileSetNode = 0xfffffc0005ab5088
diskQuot = {
[0] 0xfffffc0005ac7088
[1] 0xfffffc0005ac7148
}
}
5.
Verify that you are looking at the right file by matching the tag number, as
shown by showfile, with the tag you see with dbx.
Vol
1
PgSz
16
Pages
0
extentMap: 1
pageOff
pageCnt
extentCnt: 0
(dbx)
(dbx)
(dbx) sh ls -li ob_1
23723 -rwxr-xr-x
1 root
(dbx)
6.
XtntType
simple
vol
system
Segs
**
SegSz
**
volBlock
I/O
Perf
async 100%
File
ob_1
blockCnt
Note how information contained in several BMT records related to the file has been
placed into one in-memory structure. Verify that the POSIX file statistics
information seems reasonable. (Extracted from the solution for #4.)
(dbx) dir_stats = struct {
st_ino = struct {
num = 23723
seq = 32771
}
Solutions
st_mode = 33261
st_uid = 0
st_gid = 0
st_rdev = 0
st_size = 0
st_atime = 938696472
st_uatime = 976962000
st_mtime = 938696472
st_umtime = 976962000
st_ctime = 938696472
st_uctime = 976962000
st_flags = 0
dir_tag = struct {
num = 23707
(dbx)
(dbx)
(dbx) po 33261
0100755
(dbx)
(dbx)
(dbx)
(dbx) sh ls -li ob_1
23723 -rwxr-xr-x
1 root
system
(dbx)
(dbx)
(dbx) sh ls -lid /usr/bruden/advfs
23707 drwxr-xr-x
2 root
system
(dbx)
7.
Solutions
gid_t st_gid;
dev_t st_rdev;
off_t st_size;
time_t st_atime;
int st_uatime;
time_t st_mtime;
int st_umtime;
time_t st_ctime;
int st_uctime;
uint_t st_flags;
bfTagT dir_tag;
bfFragIdT fragId;
u_short st_nlink;
short st_unused_1;
uint32T fragPageOffset;
uint32T st_unused_2;
} dir_stats;
struct fileSetNode * fileSetNode;
diskQuot[2] of struct dQuot *;
};
(dbx)
(dbx)
(dbx) whatis struct dQuot
struct dQuot {
dyn_hashlinks_w_keyT dq_links;
int dq_flags;
int dq_type;
int dq_cnt;
uint_t dq_id;
union {
struct dQBlk32 {
u_int dqb_bhardlimit;
u_int dqb_bsoftlimit;
u_int dqb_curblocks;
u_int dqb_ihardlimit;
u_int dqb_isoftlimit;
u_int dqb_curinodes;
time_t dqb_btime;
time_t dqb_itime;
} dq_dqb32;
struct dQBlk64 {
u_long dqb_bhardlimit;
u_long dqb_bsoftlimit;
u_long dqb_curblocks;
u_int dqb_ihardlimit;
u_int dqb_isoftlimit;
u_int dqb_curinodes;
u_int dqb_unused1;
time_t dqb_btime;
u_int dqb_unused2;
time_t dqb_itime;
u_int dqb_unused3;
u_long dqb_unused4;
} dq_dqb64;
Solutions
} dQ;
struct fileSetNode * fileSetNode;
lock_data_t dqLock;
};
(dbx)
(dbx)
(dbx) p *(*(struct fsContext *)$fsc).diskQuot[0]
struct {
dq_links = struct {
dh_links = struct {
dh_next = 0xfffffc0005ac7088
dh_prev = 0xfffffc0005ac7088
}
dh_key = 36028788429215309
}
dq_flags = 8
dq_type = 0
dq_cnt = 203
dq_id = 0
dQ = union {
dq_dqb32 = struct {
dqb_bhardlimit = 0
dqb_bsoftlimit = 0
dqb_curblocks = 0
dqb_ihardlimit = 0
dqb_isoftlimit = 203192
dqb_curinodes = 0
dqb_btime = 0
dqb_itime = 0
}
dq_dqb64 = struct {
dqb_bhardlimit = 0
dqb_bsoftlimit = 0
dqb_curblocks = 203192
dqb_ihardlimit = 0
dqb_isoftlimit = 0
dqb_curinodes = 7477
dqb_unused1 = 0
dqb_btime = 0
dqb_unused2 = 0
dqb_itime = 0
dqb_unused3 = 0
dqb_unused4 = 0
}
}
fileSetNode = 0xfffffc0005ab5088
dqLock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005ac7100
prev = 0xfffffc0005ac7100
}
l_caller = 3682780
l_wait_writers = 0
Solutions
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c93500
}
}
At this point we have seen the in-core, FAS-level structures for the file. Now look
at the FAS-level structure for the file system or fileset. You could go directly from
the fileset context structure, but take the scenic tour through the mount structure.
8.
There is a pointer to the mount structure inside the vnode. Print the structure.
Wake up when you see the few MSFS-specific fields.
Solutions
[0] 0
[1] 0
[2] 0
}
f_mntonname = 0xfffffc0000d34c90 = "/usr"
f_mntfromname = 0xfffffc0000d34940 = "usr_domain#usr"
mount_info = union {
ufs_args = struct {
fspec = 0x9f8d037da6652
exflags = 1
exroot = 0
}
nfs_args = struct {
addr = 0x9f8d037da6652
fh = 0x1
flags = 0
wsize = 0
rsize = 0
timeo = 0
retrans = 0
maxtimo = 0
hostname = (nil)
acregmin = 0
acregmax = 0
acdirmin = 0
acdirmax = 0
netname = (nil)
pathconf = (nil)
}
mfs_args = struct {
name = 0x9f8d037da6652
base = 0x1
size = 0
}
cdfs_args = struct {
fspec = 0x9f8d037da6652
exflags = 1
exroot = 0
flags = 0
version = 0
default_uid = 0
default_gid = 0
default_fmode = 0
default_dmode = 0
map_uid_ct = 0
map_uid = (nil)
map_gid_ct = 0
map_gid = (nil)
}
procfs_args = struct {
fspec = 0x9f8d037da6652
exflags = 1
exroot = 0
}
Solutions
msfs_args = struct {
id = struct {
id1 = 937059922
id2 = 653520
tag = 1
}
}
ffm_args = struct {
ffm_flags = 937059922
f_un = union {
ffm_pname = 0x1
ffm_fdesc = 1
}
}
}
}
m_info = 0xfffffc0005ab5088
m_nfs_errmsginfo = struct {
n_noexport = 0
last_noexport = 0
n_stalefh = 0
last_stalefh = 0
}
m_unmount_lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005ab2ba8
prev = 0xfffffc0005ab2ba8
}
l_caller = 4783020
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc00025ac900
}
}
9.
The m_info field of the mount structure contains a pointer to AdvFS private
file system information. This information is the fileSetNode. Print it.
Solutions
dmnH = 2
}
root_vp = 0xfffffc0001451200
.......
fileSetStats = struct {
msfs_lookup = 8721216
.......
You will see different types interesting information: domain ID, bitfile-set handle,
pointer to the file systems root directory, and lots of statistics.
(dbx) p (*(struct mount *)$m).m_info
0xfffffc0005ab5088
(dbx)
(dbx)
(dbx) set $fsn = 0xfffffc0005ab5088
(dbx)
(dbx)
(dbx) p *(struct fileSetNode *)$fsn
struct {
fsNext = (nil)
fsPrev = 0xfffffc0005ab5348
rootTag = struct {
num = 2
seq = 32769
}
tagsTag = struct {
num = 3
seq = 32769
}
filesetMagic = 2918187013
dmnP = 0xfffffc0000f24008
rootAccessp = 0xfffffc0005af7688
bfSetId = struct {
domainId = struct {
tv_sec = 937059922
tv_usec = 653520
}
dirTag = struct {
num = 1
seq = 32769
}
}
bfSetp = 0xfffffc0005b7ca08
root_vp = 0xfffffc0005ac98c0
fsFlags = 0
mountp = 0xfffffc0005ab2a80
quotaStatus = 1421
blkHLimit = 0
blkSLimit = 0
fileHLimit = 0
fileSLimit = 0
blksUsed = 1026404
filesUsed = 23704
Solutions
blkTLimit = 0
fileTLimit = 0
filesetMutex = struct {
mutex = 0
}
qi = {
[0] struct {
qiAccessp = 0xfffffc0005af7208
qiContext = 0xfffffc0005ac9bf0
qiTag = struct {
num = 4
seq = 32769
}
qiBlkTime = 604800
qiFileTime = 604800
qiFlags = ^@
qiPgSz = 8192
qiFilePgs = 2
qiCred = 0xfffffc0005ac6e40
qiLock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005ab5178
prev = 0xfffffc0005ab5178
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
}
[1] struct {
qiAccessp = 0xfffffc0005af6d88
qiContext = 0xfffffc0005ac9e30
qiTag = struct {
num = 5
seq = 32769
}
qiBlkTime = 604800
qiFileTime = 604800
qiFlags = ^@
qiPgSz = 8192
qiFilePgs = 1
qiCred = 0xfffffc0005ac6fc0
qiLock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005ab51e0
prev = 0xfffffc0005ab51e0
}
l_caller = 0
Solutions
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
}
}
fileSetStats = struct {
msfs_lookup = 99608
lookup = struct {
hit = 31366
hit_not_found = 1087
miss = 67149
}
msfs_create = 7
msfs_mknod = 0
msfs_open = 0
msfs_close = 5543
msfs_access = 113974
msfs_getattr = 182729
msfs_setattr = 13
msfs_read = 9986
msfs_write = 161
msfs_mmap = 1456
msfs_fsync = 1
msfs_seek = 2981
msfs_remove = 3
msfs_link = 0
msfs_rename = 0
msfs_mkdir = 0
msfs_rmdir = 0
msfs_symlink = 0
msfs_readdir = 4282
msfs_readlink = 2389
msfs_inactive = 86090
msfs_reclaim = 57420
msfs_page_read = 0
msfs_page_write = 0
msfs_getpage = 6706
msfs_putpage = 12
msfs_bread = 0
msfs_brelse = 0
msfs_lockctl = 29
msfs_setvlocks = 8
msfs_syncdata = 0
}
}
10.
Use showfdmn to verify you have a domain ID match. The significant FASlevel structures have now been studied.
(dbx) sh pwd
/usr/bruden/advfs
Solutions
(dbx)
(dbx)
(dbx) sh showfdmn usr_domain
Id
37da6652.0009f8d0
Vol
1L
512-Blks
1426112
11.
Date Created
Sat Sep 11 10:25:22 1999
Free
204960
% Used
86%
Cmode
on
LogPgs
512
Rblks
256
Version
4
Wblks
256
Domain Name
usr_domain
Vol Name
/dev/disk/dsk1g
Print the access structure and see if its tag number matches your target.
Solutions
dh_key = 2222450857
}
freeFwd = (nil)
freeBwd = (nil)
onFreeList = 0
accMagic = 2918187009
setFwd = 0xfffffc0003659688
setBwd = 0xfffffc00016a5b08
bfaLock = struct {
mutex = 0
}
accessCnt = 1
refCnt = 1
mmapCnt = 0
stateLk = struct {
hdr = struct {
lkType = LKT_STATE
nxtFtxLk = (nil)
mutex = 0xfffffc0005aefb48
lkUsage = LKU_BF_STATE
}
state = ACC_VALID
pendingState = LKW_NONE
waiters = 0
cv = 0
}
saved_stats = (nil)
bfVp = 0xfffffc00020ec000
bfObj = 0xfffffc00027f9380
bfIoLock = struct {
mutex = 0
}
dkResult = 0
miDkResult = 0
dirtyBufList = struct {
lsnFwd = (nil)
lsnBwd = (nil)
accFwd = 0xfffffc0005aefbb8
accBwd = 0xfffffc0005aefbb8
freeFwd = (nil)
freeBwd = (nil)
hashFwd = (nil)
hashBwd = (nil)
length = 0
touched = 0
ioOut = 0
lenLimit = 0
indexBuf = (nil)
}
cleanBufList = struct {
lsnFwd = (nil)
lsnBwd = (nil)
accFwd = 0xfffffc0005aefc10
accBwd = 0xfffffc0005aefc10
Solutions
freeFwd = (nil)
freeBwd = (nil)
hashFwd = (nil)
hashBwd = (nil)
length = 0
touched = 0
ioOut = 0
lenLimit = 0
indexBuf = (nil)
}
flushWait = 0
maxFlushWaiters = 0
hiFlushLsn = struct {
num = 0
}
hiWaitLsn = struct {
num = 0
}
nextFlushSeq = struct {
num = 2
}
flushWaiterQ = struct {
head = 0xfffffc0005aefc78
tail = 0xfffffc0005aefc78
cnt = 0
}
msyncWait = 0
msyncNum = 0
raHitPage = 0
raStartPage = 0
logWrite = (nil)
trunc_xfer_lk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefcb8
prev = 0xfffffc0005aefcb8
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
cow_lk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefce8
prev = 0xfffffc0005aefce8
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
Solutions
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
nextCloneAccp = (nil)
origAccp = (nil)
cowPgCount = 0
cloneId = 0
cloneCnt = 0
maxClonePgs = 0
dataSafety = BFD_NIL
noClone = 0
deleteWithClone = 0
outOfSyncClone = 0
trunc = 0
cloneAccHRefd = 0
fragState = FS_FRAG_NONE
fragId = struct {
frag = 0
type = BF_FRAG_ANY
}
fragPageOffset = 0
bfPageSz = 16
reqServices = 1
optServices = 0
tag = struct {
num = 23723
seq = 32771
}
bfState = BSRA_VALID
transitionId = 30271
file_size = 0
bfSetp = 0xfffffc0005b7ca08
dmnP = 0xfffffc0000f24008
mcellList_lk = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0005aefb48
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefdb8
prev = 0xfffffc0005aefdb8
}
l_caller = 3296636
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
Solutions
l_lastlocker = 0xfffffc0001f83800
}
cv = 0
}
xtntMap_lk = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0005aefb48
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefe10
prev = 0xfffffc0005aefe10
}
l_caller = 3415076
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001f83800
}
cv = 0
}
mapped = 1
nextPage = 0
extendSize = 0
primMCId = struct {
cell = 1
page = 985
}
primVdIndex = 1
xtnts = struct {
validFlag = 1
xtntMap = 0xfffffc0005a8f0e8
shadowXtntMap = (nil)
stripeXtntMap = (nil)
copyXtntMap = (nil)
migTruncLk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefe88
prev = 0xfffffc0005aefe88
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
Solutions
}
type = BSXMT_APPEND
allocPageCnt = 0
}
dirTruncp = (nil)
putpage_lk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005aefec8
prev = 0xfffffc0005aefec8
}
l_caller = 3347236
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c92f00
}
real_bfap = (nil)
idx_params = (nil)
idxQuotaBlks = 0
largest_pl_num = 0
actRangeLock = struct {
mutex = 0
}
actRangeList = struct {
arFwd = 0xfffffc0005aeff10
arBwd = 0xfffffc0005aeff10
arCount = 0
arMaxLen = 0
arDioCount = 0
arDioWaiters = 0
}
}
(dbx)
12.
Examine the back pointers to the vnode and VM object. Use these fields for
additional confirmation that you have the right target. You will also see pointers
to extent map information and the bitfile-set and domain structures.
Solutions
xtntMap = 0xfffffc0003b328a8
shadowXtntMap = (nil)
stripeXtntMap = (nil)
13.
For most bitfiles, this is not a very exciting structure; however, for bitfiles with
many extents, this is the beginning of a mass of pointers. Note that the
subXtntMap field is an array with validCnt elements. Each subXtntMap
structure has an array of extents (bsXA) with cnt elements.
(dbx) p *(*(struct bfAccess *)$bfa).xtnts.xtntMap
struct {
nextXtntMap = (nil)
domain = 0xfffffc0000f24008
hdrType = 1
hdrVdIndex = 1
hdrMcellId = struct {
cell = 1
page = 985
}
blksPerPage = 16
nextValidPage = 0
allocDeallocPageCnt = 0
allocVdIndex = 65535
origStart = 0
origEnd = 0
updateStart = 1
updateEnd = 0
validCnt = 1
cnt = 1
maxCnt = 1
subXtntMap = 0xfffffc0001346f88
}
Now proceed to the bitfile-set, domain, and virtual disk data structures of AdvFS.
Use the pointers of the bitfile access structure to find them.
14.
Move from the bitfile access structure into the bitfile-set structure. Print it.
There is a lot to see. Be sure to use the bitfile-set ID field to verify and match
the values returned by showfsets.
Solutions
}
.......
dmnp = 0xfffffc000123e008
(dbx) p (*(struct bfAccess *)$bfa).bfSetp
0xfffffc0005b7ca08
(dbx)
(dbx)
(dbx) set $bfs = 0xfffffc0005b7ca08
(dbx)
(dbx)
(dbx)
(dbx) whatis bfSetT
typedef struct bfSet {
dyn_hashlinks_w_keyT hashlinks;
bfSetName[32] of char ;
bfSetIdT bfSetId;
uint_t bfSetMagic;
int refCnt;
int logicalRefCnt;
domainT * dmnP;
bfsQueueT bfSetList;
mutexT accessChainLock;
bfAccessT * accessFwd;
bfAccessT * accessBwd;
dev_t dev;
bfTagT dirTag;
bfAccessT * dirBfAp;
bfSetT * cloneSetp;
bfSetT * origSetp;
uint32T cloneId;
uint32T cloneCnt;
uint32T numClones;
uint32T outOfSync;
mutexT cloneDelStateMutex;
stateLkT cloneDelState;
int xferThreads;
uint32T infoLoaded;
uint32T cachepolicy;
mutexT dirMutex;
ftxLkT dirLock;
bfsStateT state;
int bfCnt;
unsigned long tagFrLst;
unsigned long tagUnInPg;
unsigned long tagUnMpPg;
ftxLkT fragLock;
bfTagT fragBfTag;
bfAccessT * fragBfAp;
uint32T freeFragGrps;
uint32T truncating;
fragGrps[8] of fragGrpT ;
void * fsnp;
} bfSetT;
(dbx)
Solutions
(dbx)
(dbx) p *(bfSetT *)$bfs
struct {
hashlinks = struct {
dh_links = struct {
dh_next = 0xfffffc0005b7ca08
dh_prev = 0xfffffc0005b7ca08
}
dh_key = 937059923
}
bfSetName = "usr"
bfSetId = struct {
domainId = struct {
tv_sec = 937059922
tv_usec = 653520
}
dirTag = struct {
num = 1
seq = 32769
}
}
bfSetMagic = 2918187010
refCnt = 1
logicalRefCnt = 1
dmnP = 0xfffffc0000f24008
bfSetList = struct {
bfsQfwd = 0xfffffc0005b7c7e8
bfsQbck = 0xfffffc0005b7cce8
}
accessChainLock = struct {
mutex = 0
}
accessFwd = 0xfffffc0005ae4d88
accessBwd = 0xfffffc0005af7b08
dev = -518913147
dirTag = struct {
num = 1
seq = 32769
}
dirBfAp = 0xfffffc0005af8008
cloneSetp = (nil)
origSetp = (nil)
cloneId = 0
cloneCnt = 0
numClones = 0
outOfSync = 0
cloneDelStateMutex = struct {
mutex = 0
}
cloneDelState = struct {
hdr = struct {
lkType = LKT_STATE
nxtFtxLk = (nil)
mutex = 0xfffffc0005b7cac8
Solutions
lkUsage = LKU_CLONE_DEL
}
state = CLONE_DEL_NORMAL
pendingState = LKW_NONE
waiters = 0
cv = 0
}
xferThreads = 0
infoLoaded = 1
cachepolicy = 0
dirMutex = struct {
mutex = 0
}
dirLock = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0005b7cb10
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005b7cb40
prev = 0xfffffc0005b7cb40
}
l_caller = 3630684
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c92f00
}
cv = 0
}
state = BFS_READY
bfCnt = 23723
tagFrLst = 24
tagUnInPg = 24
tagUnMpPg = 24
fragLock = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0005b7cb10
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0005b7cbb8
prev = 0xfffffc0005b7cbb8
}
Solutions
l_caller = 3630684
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c92600
}
cv = 0
}
fragBfTag = struct {
num = 1
seq = 32769
}
fragBfAp = 0xfffffc0005af7b08
freeFragGrps = 1
truncating = 0
fragGrps = {
[0] struct {
firstFreeGrp = 7280
lastFreeGrp = 32
}
[1] struct {
firstFreeGrp = 7216
lastFreeGrp = 5024
}
[2] struct {
firstFreeGrp = 7168
lastFreeGrp = 7168
}
[3] struct {
firstFreeGrp = 7248
lastFreeGrp = 7248
}
[4] struct {
firstFreeGrp = 7232
lastFreeGrp = 7232
}
[5] struct {
firstFreeGrp = 7120
lastFreeGrp = 7120
}
[6] struct {
firstFreeGrp = 7056
lastFreeGrp = 7056
}
[7] struct {
firstFreeGrp = 7264
lastFreeGrp = 7264
}
}
fsnp = 0xfffffc0005ab5088
}
(dbx)
Solutions
(dbx)
(dbx) sh showfsets usr_domain
usr
Id
: 37da6652.0009f8d0.1.8001
Files
:
23704, SLim=
0,
Blocks (512) : 1026436, SLim=
0,
Quota Status : user=off group=off
HLim=
HLim=
0
0
HLim=
HLim=
0
0
var
Id
Files
Blocks (512)
Quota Status
15.
: 37da6652.0009f8d0.2.8001
:
970, SLim=
0,
:
165004, SLim=
0,
: user=off group=off
Now print the domain structure. (Do not use struct domain unless you
want the structure for socket domains.) In the middle of this structure, you will
see an array for pointers to virtual disk structures. There are also many fields
used to control file domain I/O.
Solutions
domainId = struct {
tv_sec = 937059922
tv_usec = 653520
}
dualMountId = struct {
tv_sec = 0
tv_usec = 0
}
bfDmnMntId = struct {
tv_sec = 938694756
tv_usec = 891025
}
dmnAccCnt = 4
dmnRefWaiters = 0
activateCnt = 2
mountCnt = 2
bfSetDirp = 0xfffffc0005b7c788
bfSetDirTag = struct {
num = 4294967288
seq = 0
}
BfSetTblLock = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0000f24008
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f240a8
prev = 0xfffffc0000f240a8
}
l_caller = 3271972
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc000320bb00
}
cv = 0
}
bfSetHead = struct {
bfsQfwd = 0xfffffc0005b7cce8
bfsQbck = 0xfffffc0005b7c7e8
}
bfSetDirAccp = 0xfffffc0005af8488
ftxLogTag = struct {
num = 4294967287
seq = 0
}
ftxLogP = 0xfffffc0005baec48
Solutions
ftxLogPgs = 512
logAccessp = 0xfffffc0005af8908
ftxTbld = struct {
rrNextSlot = 13
rrSlots = 30
ftxWaiters = 0
trimWaiters = 0
excWaiters = 0
slotCv = 0
trimCv = 0
excCv = 0
logTrimLsn = struct {
num = 0
}
nextNewSlot = 30
oldestFtxLa = struct {
read = 782
update = 783
lgra = {
[0] struct {
page = 184
offset = 1790
lsn = struct {
num = 2821672
}
}
[1] struct {
page = 185
offset = 656
lsn = struct {
num = 0
}
}
}
}
lastFtxId = 68203
slotUseCnt = 0
noTrimCnt = 0
tablep = 0xfffffc0001360808
oldestSlot = 13
totRoots = 68203
}
pinBlockBuf = (nil)
domainName = "usr_domain"
majorNum = 2055
flag = BFD_NORMAL
lsnLock = struct {
mutex = 0
}
lsnList = struct {
lsnFwd = 0xfffffe0407605e70
lsnBwd = 0xfffffe0407605e70
accFwd = (nil)
accBwd = (nil)
Solutions
freeFwd = (nil)
freeBwd = (nil)
hashFwd = (nil)
hashBwd = (nil)
length = 1
touched = 0
ioOut = 0
lenLimit = 0
indexBuf = (nil)
}
writeToLsn = struct {
num = 0
}
pinBlockWait = 0
pinBlockCv = 0
pinBlockRunning = 0
contBits = 0
dirtyBufLa = struct {
read = 266
update = 266
lgra = {
[0] struct {
page = 185
offset = 656
lsn = struct {
num = 2821708
}
}
[1] struct {
page = 185
offset = 603
lsn = struct {
num = 2821706
}
}
}
}
scLock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f24308
prev = 0xfffffc0000f24308
}
l_caller = 3557160
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c93500
}
scTbl = 0xfffffc00035fe008
vdpTblLock = struct {
mutex = 0
Solutions
}
vdCnt = 1
vdpTbl = {
[0] 0xfffffc0000f2b508
[1] (nil)
[2] (nil)
()
[255] (nil)
}
rmvolTruncLk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f24b50
prev = 0xfffffc0000f24b50
}
l_caller = 3777480
l_wait_writers = 0
l_readers = 0
l_flags = '^@'
l_lifms = '\200'
l_info = 0
l_lastlocker = 0xfffffc00022f4300
}
bcStat = struct {
pinHit = 13744
pinHitWait = 207
pinRead = 0
refHit = 319958
refHitWait = 128
raBuf = 3376
ubcHit = 2107
unpinCnt = struct {
lazy = 13391
blocking = 56
clean = 10
log = 908
}
derefCnt = 330259
devRead = 9034
devWrite = 1790
unconsolidate = 0
consolAbort = 0
unpinFileType = struct {
meta = 10673
ftx = 12051
}
derefFileType = struct {
meta = 137070
ftx = 318466
}
}
bmtStat = struct {
fStatRead = 0
fStatWrite = 67009
Solutions
resv1 = 0
resv2 = 0
bmtRecRead = {
[0] 0
[1] 0
[2] 0
[3] 0
[4] 0
[5] 0
[6] 0
[7] 0
[8] 0
[9] 0
[10] 0
[11] 0
[12] 0
[13] 0
[14] 0
[15] 0
[16] 0
[17] 0
[18] 0
[19] 0
[20] 0
[21] 0
}
bmtRecWrite = {
[0] 0
[1] 0
[2] 81
[3] 0
[4] 0
[5] 0
[6] 0
[7] 0
[8] 33
[9] 0
[10] 0
[11] 0
[12] 0
[13] 0
[14] 0
[15] 1
[16] 84
[17] 2
[18] 23
[19] 0
[20] 0
[21] 0
}
}
logStat = struct {
logWrites = 382
transactions = 12731
Solutions
segmentedRecs = 2
logTrims = 0
wastedWords = 35019
maxLogPgs = 59
minLogPgs = 0
maxFtxWords = 317
maxFtxAgent = 65
maxFtxTblSlots = 29
oldFtxTblAgent = 0
excSlotWaits = 0
fullSlotWaits = 2
rsv1 = 0
rsv2 = 0
rsv3 = 0
rsv4 = 0
}
totalBlks = 1426112
freeBlks = 204928
dmn_panic = 0
xidRecovery = struct {
head = (nil)
tail = (nil)
current_free_slot = 0
timestamp = struct {
tv_sec = 0
tv_usec = 0
}
}
xidRecoveryLk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f24e08
prev = 0xfffffc0000f24e08
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
smsync_policy = 0
metaPagep = 0xfffffe0400299008
fs_full_time = 0
}
(dbx)
16.
The last major structure to print is used for virtual disks. You will see even more
I/O control substructures here.
Solutions
struct {
.......
vdName = "/dev/disk/dsk2g"
........
freeStgLst = 0xfffffc0003fcf188
Solutions
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc00022f4600
}
cv = 0
}
nextMcellPg = 985
rbmt_mcell_lk = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0000f24008
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f2ba00
prev = 0xfffffc0000f2ba00
}
l_caller = 0
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = (nil)
}
cv = 0
}
lastRbmtPg = 0
rbmtFlags = 0
stgMap_lk = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0000f24008
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f2ba60
prev = 0xfffffc0000f2ba60
}
l_caller = 3575624
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc0001c93500
}
Solutions
cv = 0
}
freeStgLst = 0xfffffc0001a8e928
numFreeDesc = 50
freeClust = 12807
scanStartClust = 34044
bitMapPgs = 2
spaceReturned = 1
fill1 = (nil)
fill3 = (nil)
fill4 = 0
del_list_lk = struct {
hdr = struct {
lkType = LKT_FTX
nxtFtxLk = (nil)
mutex = 0xfffffc0000f24008
lkUsage = LKU_UNKNOWN
}
lock = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f2baf0
prev = 0xfffffc0000f2baf0
}
l_caller = 3630684
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc00022f4600
}
cv = 0
}
ddlActiveLk = struct {
l_lock = 0
l_head = struct {
next = 0xfffffc0000f2bb28
prev = 0xfffffc0000f2bb28
}
l_caller = 3365256
l_wait_writers = 0
l_readers = 0
l_flags = ^@
l_lifms = \200
l_info = 0
l_lastlocker = 0xfffffc00022f4600
}
ddlActiveWaitMCId = struct {
cell = 0
page = 0
}
ddlActiveWaitCv = 0
dStat = struct {
Solutions
nread = 9034
nwrite = 1806
readblk = 194256
writeblk = 43648
seekCnt = 0
rglobBuf = 3543
rglobBlk = 56688
rglob = 436
wglobBuf = 1292
wglobBlk = 20672
wglob = 370
blockingQ = 0
waitLazyQ = 3
readyLazyQ = 0
consolQ = 0
devQ = 0
}
vdIoLock = struct {
mutex = 0
}
blockingQ = struct {
fwd = 0xfffffc0000f2bbe0
bwd = 0xfffffc0000f2bbe0
length = 0
lenLimit = 0
}
waitLazyQ = struct {
fwd = 0xfffffe0407605fa0
bwd = 0xfffffe0407605fa0
length = 1
lenLimit = 0
}
smSyncQ = {
[0] struct {
fwd = 0xfffffc0000f2bc10
bwd = 0xfffffc0000f2bc10
length = 0
lenLimit = 0
}
[1] struct {
fwd = 0xfffffc0000f2bc28
bwd = 0xfffffc0000f2bc28
length = 0
lenLimit = 0
}
()
[15] struct {
fwd = 0xfffffc0000f2bd78
bwd = 0xfffffc0000f2bd78
length = 0
lenLimit = 0
}
}
readyLazyQ = struct {
Solutions
fwd = 0xfffffc0000f2bd90
bwd = 0xfffffc0000f2bd90
length = 0
lenLimit = 1024
}
consolQ = struct {
fwd = 0xfffffc0000f2bda8
bwd = 0xfffffc0000f2bda8
length = 0
lenLimit = 0
}
devQ = struct {
fwd = 0xfffffc0000f2bdc0
bwd = 0xfffffc0000f2bdc0
length = 0
lenLimit = 0
}
blockingCnt = 0
blockingFact = 4
rdmaxio = 256
wrmaxio = 256
vdIoOut = 0
start_active = 0
gen_active = 0
active = struct {
hdr = struct {
lkType = LKT_STATE
nxtFtxLk = (nil)
mutex = 0xfffffc0000f2bbd8
lkUsage = LKU_VD_ACTIVE
}
state = INACTIVE_DISK
pendingState = LKW_NONE
waiters = 0
cv = 0
}
advfs_start_more_posted = 0
blkQ_cnt = 12899
lazyQ_cnt = 13413
smsyncQ_cnt = 3706
readyQ_cnt = 2027
consolQ_cnt = 1976
devQ_cnt = 1970
rmioq_cnt = 11441
rmormvq_cnt = 1
syncQIndx = 12
consolidate = 1
max_iosize_rd = 1048576
max_iosize_wr = 1048576
preferred_iosize_rd = 131072
preferred_iosize_wr = 131072
qtodev = 3
freeRsvdStg = struct {
start_clust = 1545
Solutions
num_clust = 4370
prevp = 0xfffffc0000f2be90
nextp = 0xfffffc0000f2be90
}
}
17.
For the finale, print the data structure of the free storage cache.
4
AdvFS System Calls and Kernel Interfaces
Filesets
Miscellaneous operations
Cloning algorithms
Objectives
To describe the entries into AdvFS, you should be able to:
Resources
For more information on topics in this chapter, see the following sources:
/usr/include/sys/mount.h
/usr/include/sys/vnode.h
msfs/osf/msfs_vfsops.c
msfs/osf/msfs_vnops.c
msfs/osf/msfs_misc.c
msfs/osf/msfs_io.c
msfs/bs/bs_qio.c
msfs/bs/bs_misc.c
kernel/msfs/msfs/msfs_syscalls.h
The following excerpt from msfs_vfsops.c shows the 13 VFS switch table
routine names for AdvFS (MSFS) activities.
Example 4-1: VFS Switch Table Routine List
/*
* msfs_vfsops
*
* Defines function pointers to AdvFS specific VFS fs operations.
*/
struct vfsops msfs_vfsops = {
msfs_mount,
msfs_start,
msfs_unmount,
msfs_root,
advfs_quotactl,
msfs_statfs,
msfs_sync,
msfs_fhtovp,
msfs_vptofh,
msfs_init,
msfs_mountroot,
msfs_noop,
msfs_smoothsync,
};
The example lists the 42 entry points for vnode operations involving AdvFS.
Example 4-2: File (vnode) Operations
/*
* msfs_vnodeops
*
* Defines function pointers to AdvFS specific VFS vnode operations.
*/
struct vnodeops msfs_vnodeops = {
msfs_lookup,
/* lookup */
msfs_create,
/* create */
msfs_mknod,
/* mknod */
msfs_open,
/* open */
msfs_close,
/* close */
msfs_access,
/* access */
msfs_getattr,
/* getattr */
msfs_setattr,
/* setattr */
msfs_read,
/* read */
msfs_write,
/* write */
msfs_ioctl,
/* ioctl */
seltrue,
/* select */
msfs_mmap,
/* mmap */
msfs_fsync,
/* fsync */
msfs_seek,
/* seek */
msfs_remove,
/* remove */
msfs_link,
/* link */
msfs_rename,
/* rename */
msfs_mkdir,
/* mkdir */
msfs_rmdir,
/* rmdir */
msfs_symlink,
/* symlink */
msfs_readdir,
/* readdir */
msfs_readlink,
/* readlink */
msfs_abortop,
/* abortop */
AdvFS System Calls and Kernel Interfaces 4-5
msfs_inactive,
msfs_reclaim,
msfs_bmap,
msfs_strategy,
msfs_print,
msfs_page_read,
msfs_page_write,
msfs_swap,
msfs_bread,
msfs_brelse,
msfs_lockctl,
msfs_syncdata,
msfs_noop,
msfs_noop,
msfs_getproplist,
msfs_setproplist,
msfs_delproplist,
msfs_pathconf,
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
inactive */
reclaim */
bmap */
strategy */
print */
page_read */
page_write */
swap handler */
buffer read */
buffer release */
file locking */
fsync byte range */
Lock a node */
Unlock a node */
Get extended attributes */
Set extended attributes */
Delete extended attributes */
pathconf */
};
UBC Interface
Ultimately, data read from an AdvFS file system ends up in a memory location that
is associated with the unified buffer cache (UBC). The UBC interface consists of:
msfs_iodone()
Temporarily raises system priority level.
Places buffer on MsfsIodoneBuf queue (holds completed I/O operations
for AdvFS) found within the processor structure.
Posts LWC_PRI_MSFS_UBC.
Priority: LWC_PRI_MSFS_UBC
Entry: msfs_async_iodone_lwc()
msfs_async_iodone_lwc()
Removes buffer from MsfsIodoneBuf
Calls bs_osf_complete()
msfs_real_syscall()
Single call, many flavors
Called through MsfsSyscallp (filled in when AdvFS is started) with the
lower 32 bits of the KSEG address of msfs_real_syscall()
MsfsSyscallp + 0xfffffc0000000000 =
&msfs_real_syscall()
First argument is operation type (used in large case statement to determine the
action)
parmBufLen
typedef enum {
OP_NONE,
OP_GET_BF_PARAMS,
OP_SET_BF_ATTRIBUTES,
OP_GET_BF_XTNT_MAP,
OP_ADD_STG,
OP_ADD_OVER_STG,
OP_MIGRATE,
OP_DMN_INIT,
OP_GET_DMNNAME_PARAMS,
OP_GET_DMN_PARAMS,
OP_SET_DMN_PARAMS,
OP_GET_DMN_VOL_LIST,
OP_GET_VOL_PARAMS,
OP_SET_VOL_IOQ_PARAMS,
OP_DUMP_LOCKS,
OP_TRACE,
OP_FSET_CREATE,
OP_FSET_DELETE,
OP_FSET_CLONE,
OP_FSET_GET_INFO,
OP_FSET_GET_ID,
OP_GET_BFSET_PARAMS,
OP_SET_BFSET_PARAMS,
OP_ADD_VOLUME,
OP_CRASH,
OP_MSS_RESV1,
(...)
OP_MSS_RESV17,
OP_UNDEL_ATTACH,
OP_UNDEL_DETACH,
OP_UNDEL_GET,
OP_GET_NAME,
OP_REM_STG,
OP_EVENT,
OP_TAG_STAT,
OP_SWITCH_LOG,
OP_GET_BF_IATTRIBUTES,
OP_SET_BF_IATTRIBUTES,
OP_MOVE_BF_METADATA,
OP_GET_VOL_BF_DESCS,
OP_REM_VOLUME,
OP_ADD_REM_VOL_SVC_CLASS,
OP_SWITCH_ROOT_TAGDIR,
OP_SET_BF_NEXT_ALLOC_VOL,
OP_DISK_ERROR,
OP_FTX_PROF,
OP_REWRITE_XTNT_MAP,
OP_RESET_FREE_SPACE_CACHE,
OP_SET_NEXT_TAG,
OP_REM_NAME,
OP_REM_BF,
OP_FSET_RENAME,
OP_GET_LOCK_STATS,
OP_FSET_GET_STATS,
OP_GET_BKUP_XTNT_MAP,
OP_GET_VOL_PARAMS2,
OP_GET_GLOBAL_STATS,
OP_GET_SMSYNC_STATS,
OP_GET_IDX_BF_PARAMS,
OP_ADD_REM_VOL_DONE
} opIndexT;
msfs_dmn_init()
mkfdmn
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
in
in
in
in
in
in
in
in
in
in
- bf domain name */
- maximum number of virtual disks */
- number of pages in log */
- log service attributes */
- tag directory service attributes */
- block special device name */
- service class */
- size of the virtual disk */
- number of pages per BMT extent */
- number of pages to be preallocated for
msfs_add_volume()
addvol
advfs_remove_volume() rmvol
Example 4-7:
mlStatusT
advfs_remove_volume(
mlBfDomainIdT bfDomainId,
/* in */
u32T volIndex, /* in */
u32T forceFlag /* in */
);
msfs_syscall_op_get_dmn_params()
showfdmn
mlStatusT
msfs_syscall_op_get_dmn_params(
libParamsT *libBufp
);
msfs_syscall_op_get_dmn_vol_list()
Filesets
This section specifies some of the routines associated with some common filesetoriented commands. Calls related to filesets consist of:
System call
Utility
Routines include:
msfs_fset_create()
mkfset
mlStatusT
msfs_fset_create(
char *domain,
char *setName,
mlServiceClassT reqServ,
mlServiceClassT optServ,
u32T userId,
gid_t quotaId,
mlBfSetIdT *bfSetId
);
/*
/*
/*
/*
/*
/*
/*
in - domain name */
in - sets name */
in - required service class */
in - optional service class */
in - user id */
in - group ID for quota files */
out - bitfile set id */
msfs_fset_clone()
clonefset
msfs_fset_delete()
rmfset
msfs_set_bfset_params() chfsets
msfs_syscall_op_set_bf_attributes()
Stripes a file
msfs_undel_attach()
Attaches a trashcan directory
Recovering a domain
2.
3.
Call get_domain_disks().
This searches the /etc/fdmns/domain for a list of virtual disks.
4.
2.
3.
4.
5.
2.
3.
4.
2.
3.
4.
Read a record.
2.
Put in slot for this FTX ID (and allocate new one if needed).
a.
b.
c.
3.
4.
5.
6.
Source locations:
msfs/bs/bs_stg.c
msfs/bs/bs_sbm.c
MAX_PREALLOC_PAGES is presently 16
If this fails, data space is allocated as needed. BAS level will combine adjacent
allocations.
Source location of fs_read_write_stg() is
msfs/fs/fs_read_write.c.
Truncating Bitfiles
AdvFS preallocates disk space to prevent multiple trips to the SBM information and
to promote large extents. If the file write does not demand all preallocated disk
pages, file truncation and possibly fragmentation will take place upon file close:
When bitfile closes, AdvFS determines if last page should be allocated in the
fragment file.
If necessary:
A fragment is allocated.
Last page is now unused.
Source locations:
Cloning
Cloning
Overview
Cloning a fileset creates a read-only, pseudo copy (snapshot) of a file system usually
for the purpose of online backups. This section discusses some routines used in
cloning.
Creating a clone
Creating a Clone
This section introduces several routines involved in clone creation. The
fs_fset_clone() routine performs various access checks.
The following example shows the fs_fset_clone() argument list.
Example 4-10: Prototype for fs_fset_clone()
/*
* fs_fset_clone
*
* Creates a clone file set of an original file set.
*/
statusT
fs_fset_clone(
char *domain,
char *origSetName,
char *cloneSetName,
bfSetIdT *retCloneBfSetId,
long xid
)
/*
/*
/*
/*
/*
fs_fset_clone() in msfs/fs/fs_file_sets.c.
bs_bfs_clone()in msfs/bs/bs_bitfile_sets.c.
Cloning
2.
If not:
a.
b.
3.
If a page is written into a hole of the original, the clone must be given a
permanent hole extent.
Note that AdvFS optimizes I/O to the original bitfile-set, not to the clone.
Cloning
Ensure data is available for clone after deletion from original fileset.
2.
2.
3.
4.
2.
b.
c.
Update the delRst field of bitfiles extent map to point to next extent to
delete.
Cloning
3.
b.
c.
Migrating a bitfile
Deleting a fileset
Migrating a Bitfile
Use the following sequence to migrate a file:
1.
2.
3.
4.
5.
Flush blocks.
6.
2.
3.
4.
5.
Delete tagfile.
Documenting Threads
Documenting Threads
Overview
This section documents several kernel threads which are active behind the scenes
to keep AdvFS in sync. Kernel threads are found under PID 0.
AdvFS threads
I/O thread
AdvFS Threads
The following are some common characteristics of the AdvFS threads:
Documenting Threads
I/O Thread
This thread monitors its message queue for requests to trigger I/O:
Source locations:
Summary
Summary
Describing Entries to AdvFS
The VFS switch table defines a series of pointers to functions implementing many
of the file system level activities.
The vnode switch table defines a series of pointers to functions implementing most
of the file-oriented AdvFS activities.
Data read from an AdvFS file system ultimately ends up in a memory location that
is associated with the unified buffer cache.
AdvFS I/O must eventually cause device activity to begin. The device activity is
triggered by device driver routines.
Starting Up and Recovering in AdvFS
Use bs_bfset_activate_int() to activate or find a domain structure.
Use bs_bfdmn_tbl_activate()to search for virtual disks.
Use bs_bfdmn_activate() to activate the domain.
Use ftx_bfdmn_recovery() to recover a domain with one of three recovery
passes:
Providing Storage Management
Some SBM information is cached in memory data structures:
MAX_PREALLOC_PAGES is presently 16
Summary
Cloning
Cloning a fileset creates a read-only, pseudo copy (snapshot) of a file system usually
for the purpose of online backups.
The fs_fset_clone() routine performs various access checks. The
bs_bfs_clone ():
2.
3.
4.
5.
Flush blocks.
6.
To delete a fileset:
1.
2.
3.
4.
5.
Delete tagfile.
Documenting Threads
AdvFS threads are created by the kernel thread routine.
Fragment bitfile thread: One per system; deallocates frag groups of type 0
Exercises
Exercises
Labs for this section involve reading any of the source code specified in the
student materials (if it is available). The instructor will suggest several routines.
Solutions
Solutions
If you are not confident using the C programming language, this code reading
can be done as a group. Routine fs_fset_clone() found in
fs_file_sets.c may be a good starting point.
5
Troubleshooting AdvFS
Resources
For more information on topics in this chapter as well as related topics, see the
following:
Problem statement
Configuration
Problem description
Analysis
Things attempted
Final solution/summary
Function
addvol
advfsstat
advscan
Locates AdvFS volumes (disk partitions or LSM disk groups) that are in AdvFS domains.
balance
chfile
chfsets
Changes fileset quotas (file usage limits and block usage limits).
chvol
defragment
migrate
mkfdmn
mkfset
mountlist
ncheck
Lists i-number or tag and path for all files in a file system.
nvbmtpg
Displays pages of AdvFS bitfile metadata table (BMT) file; new command in Tru64 UNIX V5.0.
nvfragpg
Displays the pages of an AdvFS fragment file; new command in Tru64 UNIX V 5.0.
nvlogpg
Displays the log file of an AdvFS file domain; new command in Tru64 UNIX V 5.0.
nvsbmpg
Displays a page of the storage bitmap (SBM) file; new command in Tru64 UNIX V 5.0.
nvtagpg
Displays a page formatted as a tag file page; new command in Tru64 UNIX V 5.0.
rmfdmn
rmfset
rmvol
salvage
Recovers file data from damaged AdvFS file domains; new command in Tru64 UNIX Version
5.0 release. Versions are available for previous releases of Tru64 UNIX.
shblk
shfragbf
Function
showfdmn
Displays the attributes of a file domain and detailed information about each volume in the file
domain.
showfile
showfsets
stripe
switchlog
tag2name
vbmtchain
Displays metadata for a file including the time-stamp, extent map, and whether the file is a user
directory or data file.
vbmtpg
Displays a complete, formatted page of the BMT for a mounted or unmounted domain.
vdf
Displays disk information for AdvFS domains and filesets; new command in the Tru64 UNIX
Version 5.0 release.
vdump,
rvdump
verify
Checks on-disk structures such as the BMT, storage bitmaps, tag directory, and the fragment file
for each fileset; included in Tru64 UNIX Version 4.0 and higher.
vfile
vfilepg
vfragpg
vlogpg
Translates a 16-block part of a volume of an unmounted file system and formats it as a log page.
vlsnpg
vrestore,
rvrestore
vsbmpg
vtagpg
Is there anything else that is not behaving normally (whether related or not)?
What (if any) parts of the system that might be relevant are working as
expected?
Was anything happening physically close to the system at the time the problem
appeared? For example, was a cable unintentionally disconnected?
If any changes have taken place, can the configuration be restored to its original
state to determine whether the problem is still present? (Note: changes should
be made sparingly and in as logical a sequence as possible to reduce the number
of possible factors influencing or potentially masking the problem.)
Any obvious problems with cables, connectors or terminators. For example, are
the cables too long? Are there any bent pins? Is the hardware seated properly?
binary.errlog
/var/adm/syslog.dated/datekern.log
/var/adm/syslog.dated/datedaemon.log
/var/adm/messages
If you think it might be a bug in the software, research the reported bugs and
patches for potential similarities.
Use the following sources to look for any existing information:
The Atlanta CSC UNIX Web page has links to many useful sources.
COMET search for past cases: Integrated Problem Management Tool
(IPMT)/QAR entries, blitzes and notes conferences.
COMET is an intelligent web-based storage and retrieval tool which allows
users to search large collections of documents. It differs from STARS in its
search algorithms and available information. A prime feature, Smart Query
decides which subset of COMET's 500 databases is most likely to contain
the information you want. An account is not required to access COMET.
Search of blitzes database:
Notes conferences:
Patch READMEs
AdvFS/LSM Focals
AdvFS/LSM Manuals
SPD
iostat
Performance Manager
Use AdvFS tools and utilities to check for and fix problems.
System panic
Domain panic
Corrupted data
Hardware problem
Hardware problems are the most common sources of AdvFS-related system
panics. The most frequent cause of corruption in any file system is bad blocks
on the physical disk. Another common cause is outdated firmware revisions.
Software bug
Check the binary errorlog for bad block replacements or other I/O errors. If
excessive, ensure the hardware problem is resolved before taking any other
action.
Run sys_check.
Repair domain structures using the verify utility for DIGITAL UNIX
Version 4.x systems. (Use the msfsck and the vchkdir command for
DIGITAL UNIX Version 3.x systems.)
If the verify utility does not solve the problem, attempt to recover the
fileset data from backup media.
Only if both methods are unsatisfactory should you employ the salvage
utility. salvage is a new utility available in Tru64 UNIX Version 5.0. (A
field test version of salvage is available in DIGITAL UNIX Version
4.0D.)
File an IPMT.
Software bug
Analyze the system crash dump for insight towards determining the next
troubleshooting step. Search CANASTA.
Run sys_check.
Check the binary errorlog for bad block replacements or other I/O errors. If
excessive, ensure the hardware problem is resolved before taking any other
action.
This technique has been useful because it allows you to get a backup of the file
system. The specialist should use caution when using either flag. The -d flag
disables transaction logging. The -r flag mounts the file system with read-only
access.
Localized Corruption
Localized corruption is often a situation that is tolerable. The verify utility may
be useful in cases of local corruption.
Symptoms of localized corruption include:
Normal file manipulations for a few files on the file system that do not work
properly.
Software bug.
Check the binary errorlog for bad block replacements or other hardware
events.
If excessive, ensure the hardware problem is resolved before taking any other
action.
If the corruption is not increasing and remains localized, add a new volume to
replace the volume experiencing the errors.
File an IPMT.
Generalized Corruption
Generalized corruption is often a more serious situation than localized corruption.
The verify utility is not generally useful in fixing generalized corruption. Time
spent using verify on generalized corruption problems may be better spent
running salvage or restoring from backup.
Symptoms of generalized corruption include:
Normal file manipulations for many or all the files on a file system.
Software bug.
Check the binary errorlog for bad block replacements or other hardware
events. If excessive, ensure the hardware problem is resolved before taking any
other action.
You can try adding volumes and removing the volumes having problems. In the
case of general corruption, this will probably not solve the problem. This
process is time consuming with a large number of bad files.
Repair domain structures using the verify utility. However, since verify
will attempt to mount the filesets, a system panic will most likely occur. (Use
the msfsck and the vchkdir commands for DIGITAL UNIX Version 3.x
systems.)
If the verify utility does not solve the problem, attempt to recover the fileset
data from backup media.
Only if both methods are unsatisfactory should you employ the salvage
utility. salvage is a new utility available in Tru64 UNIX Version 5.0.
File an IPMT.
Domain Panic
A domain panic has occurred when the domain goes offline and data is inaccessible
to users of the system.
Possible causes include:
Software bug.
Check the binary errorlog for bad block replacements or other I/O errors. If
excessive, ensure the hardware problem is resolved before any other action.
Use the mount -d command to try to get data off when restoring any volumes
that have I/O errors.
Repair domain structures using the verify utility for DIGITAL UNIX
Version 4.x systems. However, since verify will attempt to mount the
filesets, a system panic will most likely occur and verify will be unsuccessful
in fixing the problem. (Use the msfsck and the vchkdir commands for
DIGITAL UNIX Version 3.x systems.)
If the verify utility does not solve the problem, attempt to recover the fileset
data from backup media.
Only if both methods are unsatisfactory should you employ the salvage
utility. salvage is a new utility available in Tru64 UNIX Version 5.0.
File an IPMT.
When a very large file truncate is performed (this can occur when a file is
overwritten by another file or by an explicit truncate system call), and the
fileset containing the file has a clone fileset.
When very large, highly fragmented files are migrated. Files with greater than
40000 extents are at risk. A migrate operation is performed when running the
defragment, balance, rmvol, or migrate AdvFS utilities.
Regardless of the cause, the problem can be addressed by either reducing file
fragmentation or by increasing the size of the log.
Fixing Log Half-Full Problems: Reducing Fragmentation
File fragmentation can be reduced by following these steps:
1.
2.
40000
768
60000
1024
80000
1280
Fixing Log Half Full Problems: Increasing Log Size Using switchlog
If you have a spare partition, you can:
1.
2.
3.
4.
If you have a spare partition, follow these steps to increase the log size:
1.
Enter the addvol command specifying the block device special file name of
the disk that you are adding to the file domain and the domain name.
2.
<== V4.x
<== V5.x
# showfdmn domain
3.
Enter the switchlog command specifying the name of the domain and the
number of the new volume to use for the log.
# switchlog domain 3
4.
Enter the switchlog command specifying a larger log size with the -l option
and the number of the volume to use for the log. (The -l option is
undocumented.) This command essentially moves the log back with a larger log
size.
Fixing Log Half Full Problems: Increasing Log Size Using mkfdmn
Alternatively, you can set the log page size using the mkfdmn command as follows:
mkfdmn -l pages
Regularly create and delete very large numbers (many hundreds) of these small
files
can run out of metadata space (inode tables), causing misleading out of disk
space errors. Internet news servers and mail servers are particularly prone to this
problem.
In DIGITAL UNIX Version 4.0d, use space reservation to work around the BMT
exhaustion problem. This problem is fixed in Tru64 UNIX Version 5.0.
Avoiding BMT Exhaustion
BMT exhaustion is a problem only in DIGITAL UNIX Version 4.0C and earlier.
The problem can still occur in DIGITAL UNIX Version 4.0D, but it is less likely to
be due to space reservation. Preallocating the metadata immediately after the file
domain is created and/or additional volumes are added avoids BMT exhaustion.
For DIGITAL UNIX Version 3.x, this preallocation can be accomplished by writing
a script that creates and then deletes the estimated number of files that are expected
to exist in the AdvFS domain. The files created by the script are empty.
For example, the following ksh script preallocates metadata for 1000 files:
integer f=1000
while ((f > 0))
do
touch prealloc_$f
f=f-1
done
rm prealloc_*
For DIGITAL UNIX Version 4.x, this preallocation can be accomplished by using
the -x and -p switches to the mkfdmn and addvol commands. This increases
the number of file systems blocks (8K) to extend or preallocate the bitfile metadata
table (BMT) respectively.
For example, the following steps show how the -x switch can create a new AdvFS
file system containing two volumes in which both will extend their BMT by 2048
pages at a time.
1.
2.
Enter the mkfset command to create a new fileset in the specified domain.
3.
Enter the addvol command to add a volume to the specified domain. Using
the -x option, you can set the number of pages (extent size) by which the bitfile
metadata table grows. The default is 128 pages.
For example, the following steps show how to use the -p switch to create a new
AdvFS file system containing one volume in which the volumes BMT is
preallocated by 10240 pages.
1.
Enter the mkfdmn command. Specifying the -p option lets you set the number
of pages by which the bitfile metadata table is preallocated. There is no default.
2.
Enter the mkfset command to create a new fileset in the specified domain.
For example, the following steps show how the -x and -p switches can be used
together to create a new AdvFS file system containing one volume in which the
volumes BMT is preallocated by 4096 pages and will extend by 1024 pages.
1.
2.
Enter the mkfset command to create a new fileset in the specified domain.
Default
-x 1024
-p 20000
-x 2048 -p30000
128
1024
20000
30000
128
1024
128
2048
128
1024
128
2048
...
...
...
...
...
...
...
...
...
...
683
128
1024
128
2048
If the domain becomes fragmented before filling out the BMT extent map, the size
of the extents (at some point between three and 683 extents) will diminish and be
smaller than the default (or the value specified using the -x switch). It is not
possible to predict those sizes because the file system will attempt to find the largest
available hole to hold the extent. The size of this hole depends on the file system
fragmentation at the time the system attempts to find the extent.
BMT Exhaustion: Fixing the Problem
Two common task or command sequences for fixing a BMT exhaustion problem
include:
1.
You could use the DIGITAL UNIX Version 3.x method of preallocating files before
restoring. In DIGITAL UNIX Version 4.x, you could use the -x and -p flags.
2.
addvol, rmvol
The addvol command adds another new volume to the domain with a fresh
BMT that files will be migrated to.
The addvol command also allows you to use the -x and -p options to alter
the defaults for BMT. Using the -x flag, you can set the number of pages by
which the BMT extent size grows. Using the -p flag, you can set the number
of pages to preallocate for the BMT.
The rmvol command automatically migrates files and metadata to other
volumes in the domain.
The result is similar to restoring from backups in that the metadata is written in
a contiguous fashion, and is therefore defragmented. Defragmented metadata
generally will not become exhausted as quickly.
These commands can be executed while the domain is online, minimizing the
impact on the users of the domain.
Additional disk space is needed for the new volume. In an existing multivolume
domain, you must add a volume equivalent in size to the largest volume in that
domain.
Since other domains were functioning normally, the specialist deduced that the
problem was localized to the bruden_dom volumes. The error log showed no
recent bad block replacements.
2.
# ls -l /etc/fdmns/bruden_dom
total 0
lrwxr-xr-x
1 root
system
lrwxr-xr-x
1 root
system
lrwxr-xr-x
1 root
system
# showfsets bruden_dom
bruce_fset
Id
: 37f12c39.000263ea.1.8001
Files
:
6, SLim=
Blocks (512) :
68288, SLim=
Quota Status : user=off group=off
0,
50000,
dennis_fset
Id
Clone is
Files
Blocks (512)
Quota Status
: 37f12c39.000263ea.2.8001
: den_clone
:
324, SLim=
0,
:
93114, SLim=
0,
: user=off group=off
den_clone
Id
Clone of
Revision
HLim=
HLim=
0
200000
HLim=
HLim=
0
400000
grc=
none
: 37f12c39.000263ea.3.8003
: dennis_fset
: 3
3.
4.
# verify -f bruden_dom
verify: cant get set info for domain bruden_dom
verify: error = E_BAD_BMT (-1171)
verify: cant allocate memory for fileset mount_point array
Unable to malloc an additional 0 bytes, currently using 0
exiting...
5.
verify indicates a problem in the BMT. Lets see if salvage can give us
some help or insight. salvage (ultimately) causes further domain panics.
# salvage bruden_dom
salvage: Domain to be recovered bruden_dom
salvage: Volumes to be used /dev/disk/dsk0a /dev/disk/dsk0b /dev/disk/
dsk2h
salvage: Files will be restored to .
salvage: Logfile will be placed in ./salvage.log
salvage: Starting search of all filesets: 13-Oct-1999 10:38:26
salvage: Starting search of all volumes: 13-Oct-1999 10:38:26
salvage: Loading file names for all filesets: 13-Oct-1999 10:38:26
salvage: Starting recovery of all filesets: 13-Oct-1999 10:38:27
you have mail in /usr/spool/mail/root
#
# mail
From root Wed Oct 13 10:36:06 1999
Received: by den255 id KAA01133; Wed, 13 Oct 1999 10:36:05 -0400 (EDT)
Date: Wed, 13 Oct 1999 10:36:05 -0400 (EDT)
From: system PRIVILEGED account <root>
Message-Id: <199910131436.KAA01133@den255>
Subject: EVM ALERT [600]: AdvFS: An AdvFS domain panic has occurred on bruden_dom
============================ EVM Log event ===========================
EVM event name: sys.unix.fs.advfs.fdmn.panic
:
:
:
:
:
:
:
:
:
:
:
sys.unix.fs.advfs.fdmn.panic
True
600
1131
664
171
0
13-Oct-1999 10:35:04
192.206.126.27
den255
AdvFS: An AdvFS domain panic has occurred on
$domain
: cat:evmexp.cat:450
Variable Items:
domain = "bruden_dom"
6.
# showfdmn bruden_dom
showfdmn: unable to get info for domain bruden_dom
showfdmn: error = E_BAD_BMT (-1171)
#
# showfsets bruden_dom
showfsets: cant show set info for domain bruden_dom
showfsets: error = E_BAD_BMT (-1171)
7.
8.
Elevate the problem to engineering. However, keep trying to solve the problem
for the customer. See if the on-disk viewing tools can help.
9.
Block 32 of the volume should contain the RBMT (see the on-disk module).
Since we cant seem to get anywhere, lets look at the beginning of the RBMT.
The first mcell should map the RBMT itself.
# vfilepg /dev/disk/dsk0a -b 32
Bad
mcell record 0: bCnt too large 63265
get_stripe_parms: Bad mcell RBMT vol 1 page 0 cell 4: No BSR_XTNTS record in
primary mcell.
==========================================================================
VOLUME "/dev/disk/dsk0a" (VDI 1) lbn 32
-------------------------------------------------------------------------004000
08 00 00 00 00 00 00 00 13 00 00 00 00 00 00 20
...............
004010
06 00 00 00 01 00 00 00 fa ff ff ff 00 00 00 00
................
004020
fe ff ff ff 00 00 00 00 5c 00 02 00 03 00 00 00
........\.......
004030
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004040
00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
................
004050
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004060
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004070
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004080
00 00 00 00 50 00 01 00 00 00 00 00 00 00 00 00
....P...........
004090
00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00
................
0040a0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040b0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040c0
01 00 02 00 00 00 00 00 00 00 00 00 01 00 00 00
................
0040d0
ff ff ff ff 04 00 00 00 00 00 00 00 00 00 00 00
................
0040e0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040f0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004100
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004110
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004120
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004130
00 00 00 00 00 00 00 00 00 00 00 00 f9 ff ff ff
................
004140
00 00 00 00 fe ff ff ff 00 00 00 00 5c 00 02 00
............\...
004150
03 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
................
004160
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
................
004170
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004180
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004190
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0041a0
00 00 00 00 00 00 00 00 50 00 01 00 00 00 00 00
........P.......
0041b0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0041c0
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0041d0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0041e0
00 00 00 00 01 00 02 00 00 00 00 00 70 00 00 00
............p...
0041f0
01 00 00 00 ff ff ff ff 04 00 00 00 00 00 00 00
................
10.
The event manager log shows many AdvFS domain panic messages.
# evmget | evmshow
System startup
ASCII msg: Test for EVM connection of binlogd
System timestamp
System shutdown msg: System halted by root:
System startup
ASCII msg: Test for EVM connection of binlogd
System timestamp
System startup
ASCII msg: Test for EVM connection of binlogd
System timestamp
AdvFS domain panic
AdvFS domain panic
AdvFS domain panic
AdvFS domain panic
...
11.
This page can be interpreted if we remember that each BMT (and RBMT) page
starts with a 16-byte header followed by a series of mcells containing a variable
number of records. Each mcell is 292 bytes and contains within it a 24-byte
header. Try to determine what is wrong by looking at a good domains RBMT.
# showfdmn usr_domain
Id
37da6652.0009f8d0
Vol
1L
Date Created
Sat Sep 11 10:25:22 1999
512-Blks
1426112
Free
201120
% Used
86%
Cmode
on
LogPgs
512
Rblks
256
Version
4
Wblks
256
Domain Name
usr_domain
Vol Name
/dev/disk/dsk1g
#
#
# vfilepg /dev/rdisk/dsk1g -b 32
==========================================================================
VOLUME "/dev/rdisk/dsk1g" (VDI 1) lbn 32
-------------------------------------------------------------------------004000
08 00 00 00 00 00 00 00 13 00 00 00 00 00 00 20
...............
004010
06 00 00 00 01 00 00 00 fa ff ff ff 00 00 00 00
................
004020
fe ff ff ff 00 00 00 00 5c 00 02 00 03 00 00 00
........\.......
004030
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004040
00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
................
004050
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004060
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004070
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004080
00 00 00 00 50 00 01 00 00 00 00 00 00 00 00 00
....P...........
004090
00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00
................
0040a0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040b0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040c0
01 00 02 00 00 00 00 00 20 00 00 00 01 00 00 00
........ .......
0040d0
ff ff ff ff 04 00 00 00 00 00 00 00 00 00 00 00
................
0040e0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0040f0
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004100
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004110
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004120
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004130
00 00 00 00 00 00 00 00 00 00 00 00 f9 ff ff ff
................
004140
00 00 00 00 fe ff ff ff 00 00 00 00 5c 00 02 00
............\...
004150
03 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
................
004160
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
................
004170
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004180
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
004190
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
0041a0
00 00 00 00 00 00 00 00 50 00 01 00 00 00 00 00
........P.......
0041b0
00 00 00 00 00 00
0041c0
10 00 00 00 00 00
0041d0
00 00 00 00 00 00
0041e0
00 00 00 00 01 00
0041f0
02 00 00 00 ff ff
#
# nvbmtpg -rR usr_domain 1
00
00
00
02
ff
00
00
00
00
ff
00
00
00
00
04
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
70
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
................
................
................
............p...
................
==========================================================================
DOMAIN "usr_domain" VDI 1 (/dev/rdisk/dsk1g) lbn 32
RBMT page 0
-------------------------------------------------------------------------CELL 0
next mcell volume page cell 1 0 6
bfSetTag,tag -2,-6(RBMT)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
32 (0x20)
bsXA[ 1]
bsPage
1 vdBlk
-1
BSR_ATTR
BSR_XTNTS
-------------------------------------------------------------------------CELL 1
next mcell volume page cell 0 0 0
bfSetTag,tag -2,-7 (SBM)
RECORD 0
bCnt 92
type BSRA_VALID
RECORD 1
bCnt 80
type BSXMT_APPEND chain mcell volume page cell 0 0 0
firstXtnt mcellCnt 1 xCnt 2
bsXA[ 0]
bsPage
0 vdBlk
112 (0x70)
bsXA[ 1]
bsPage
2 vdBlk
-1
(...)
12.
BSR_ATTR
BSR_XTNTS
................
........ .......
< 0041f0
--> 0041f0
#
01 00 00 00 ff ff ff ff 04 00 00 00 00 00 00 00
................
02 00 00 00 ff ff ff ff 04 00 00 00 00 00 00 00
................
13.
The byte containing the hex 00 (bolded) should contain a hex 20. The customer
agreed to try a fix to the suspected corrupted byte. The specialist wrote a
program to insert a hex 20 (decimal 32) in the raw volume file at the correct
location. This turned out to be the LBN field of the RBMTs extent field. It was
supposed to contain a 32 indicating block 32 is where to find the RBMT file.
The corrupted RBMT had a 00 where it should have had a 20 (hex). The fix was
tried and worked. Disk corruption was ultimately determined to be the problem.
# cat putbyte.c
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#define READ_COUNT 512
int main(void)
{
int fd, ret, count = READ_COUNT, i = 0;
int offset = 32*512;
long off = 0;
long targ = 0;
char buf[READ_COUNT];
ssize_t size;
fd = open("/dev/rdisk/dsk0a",O_RDWR);
if(fd == -1)
{
perror("open problem");
exit(EXIT_FAILURE);
}
{
perror("read trouble");
exit(EXIT_FAILURE);
}
*(buf+200) = (char)0x20;
printf("Changed byte is %04x.\n",*(buf+200));
off = lseek(fd,offset, SEEK_SET);
ret = write(fd, buf, READ_COUNT);
if(ret == -1)
{
perror("read trouble");
exit(EXIT_FAILURE);
}
}
#
#
# cc -o putbyte putbyte.c
#
#
# ./putbyte
offset (off) is 16384, 4000
08 00 00 00 00 00 00 00 13 00 00 00 00 00 00 20
06 00 00 00 01 00 00 00 fffffffa ffffffff ffffffff ffffffff 00
fffffffe ffffffff ffffffff ffffffff 00 00 00 00 5c 00 02 00 03
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 50 00 01 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
01 00 02 00 00 00 00 00 00 00 00 00 01 00 00 00
ffffffff ffffffff ffffffff ffffffff 04 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 fffffff9 ffffffff ffffffff
00 00 00 00 fffffffe ffffffff ffffffff ffffffff 00 00 00 00 5c
00 00 00
00 00 00
00 00 00
ffffffff
00 02 00
03 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 50 00 01 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 01 00 02 00 00 00 00 00 70 00 00 00
01 00 00 00 ffffffff ffffffff ffffffff ffffffff 04 00 00 00 00 00 00 00
byte to change in hex is 0000.
Changed byte is 0020.
#
#
# vfilepg /dev/rdisk/dsk1g -b 32 > /tmp/dsk1g
#
# vfilepg /dev/rdisk/dsk0a -b 32 > /tmp/dsk0a
#
#
# diff dsk0a dsk1g
2c2
< VOLUME "/dev/rdisk/dsk0a" (VDI 1) lbn 32
--> VOLUME "/dev/rdisk/dsk1g" (VDI 1) lbn 32
35c35
< 0041f0
01 00 00 00 ff ff ff ff 04 00 00 00 00 00 00 00
................
--> 0041f0
02 00 00 00 ff ff ff ff 04 00 00 00 00 00 00 00
................
#
#
# mount bruden_dom#bruce_fset /usr/bruce
#
#
# df
Filesystem
512-blocks
Used
Available Capacity Mounted on
/dev/disk/dsk1a
644808
268766
311560
47%
/
/proc
0
0
0
100%
/proc
usr_domain#usr
1426112
1026492
200464
84%
/usr
usr_domain#var
1426112
169516
200464
46%
/var
bruden_dom#bruce_fset
50000
22788
27212
46%
/usr/bruce
#
#
# cd /usr/bruce
#
#
# ls
.tags
big5
quota.user
sm2
big4
quota.group sm1
#
#
# ls -l
total 11402
drwx-----2 root
system
8192 Sep 28 17:04 .tags
-rwxr-xr-x
1 root
system
11646960 Sep 28 17:21 big4
-rwxr-xr-x
1 obrien
system
-rw-r----1 root
operator
-rw-r----1 root
operator
-rw-r--r-1 root
system
-rw-r--r-1 root
system
#
#
# nvbmtpg -rR bruden_dom
0
8192
8192
5
10
Sep
Sep
Sep
Oct
Oct
28
28
28
13
13
17:24
17:04
17:04
10:26
10:27
big5
quota.group
quota.user
sm1
sm2
==========================================================================
DOMAIN "bruden_dom" VDI 1 (/dev/rdisk/dsk0a) lbn 32
RBMT page 0
-------------------------------------------------------------------------There is 1 page in the RBMT on this volume.
There are 19 free mcells in the RBMT on this volume.
==========================================================================
DOMAIN "bruden_dom" VDI 2 (/dev/rdisk/dsk0b) lbn 32
RBMT page 0
-------------------------------------------------------------------------There is 1 page in the RBMT on this volume.
There are 19 free mcells in the RBMT on this volume.
==========================================================================
DOMAIN "bruden_dom" VDI 3 (/dev/rdisk/dsk2h) lbn 32
RBMT page 0
-------------------------------------------------------------------------There is 1 page in the RBMT on this volume.
There are 19 free mcells in the RBMT on this volume.
#
The syslog and binlog files were checked for any hardware or system
problems that may have lead to the corruption. None were found.
2.
The specialist created different files of various sizes and checked to see whether the
data for those files was equivalent to some number of other files on the domain.
For example, the file sal already existed in the domain (file sal was small and
recently created). The specialist created a new file called jim in the same domain
and entered the data JUNK1234 in the file. Listing the contents of the file sal
showed it now contained the same data that had been entered for file jim.
eagles [207] #
JUNK1234
eagles [208] #
JUNK1234
Entering the ls -li command for both files lists these characteristics:
i-number
Access rights
Owner
Group
File name
The modification of the contents of file sal to be identical to the contents of the
newly created file jim was not recorded as the last file modification.
eagles [209] # ls -li jim sal
623 -rw-r--r-1 root
dba
567 -rw-r--r-1 sal
dba
The testing indicated that the problem manifested itself only for new, small files
(<1K) created on the domain. In addition, there were multiple filesets in the domain,
all of which exhibited the same behavior.
Since only new files were manifesting the problem, this pointed to a recent
corruption. The size of the files being affected pointed to a problem with the
allocation of small (1K) fragments from the fragment-free list for this domain.
3.
Enter the AdvFS showfile command with the -x qualifier specifying both
files.
The showfile command displays the attributes of one or more AdvFS files. The
-x qualifier displays the full storage allocation map (extent map) for the specified
files. See the AdvFS Commands Appendix for more information on this command.
eagles [212] # showfile -x jim sal
Id Vol PgSz Pages XtntType Segs SegSz Log
26f.8002
2
16
0
simple
**
** off
extentMap: 1
pageOff
pageCnt
vol
volBlock
blockCnt
extentCnt: 0
Id Vol PgSz Pages XtntType Segs SegSz Log
237.8017
3
16
0
simple
**
** off
extentMap: 1
pageOff
pageCnt
vol
volBlock
blockCnt
extentCnt: 0
Perf
100%
File
jim
Perf
100%
File
sal
A value of 0 for the number of extents (extentCnt) for both files indicates that
neither small file has any extents. AdvFS writes files to disk in sets of 8KB pages.
When a file uses only part of the last page, less than 8KB, a file fragment is created.
Troubleshooting AdvFS 5-31
The fragment, which is from 1KB to 7KB in size, is allocated from the fragment file.
Using fragments reduces the amount of unused, wasted disk space. The fragment
file is a special file not visible in the directory hierarchy.
Given the size of these files, we expect that AdvFS allocated space for them from
the 1K fragment-free list.
4.
The shfragbf command displays how much space is used on the fragment file.
See the AdvFS Commands Appendix for more information on this command.
eagles [235] # /usr/field/shfragbf -t 1 -v /decsave/.tags/1 |more
-group pg =
0, next pg =
-1, type = 1
nextFree =
43, numFree =
18
frag on free list :
43, nextFree =
43
frag on free list :
43, nextFree =
43
frag on free list :
43, nextFree =
43
frag on free list :
43, nextFree =
43
...
The output of the shfragbf command repeated the same values from this point
onward. Therefore, any new fragment allocated from the 1K fragment-free list is
receiving the same block (43) every time. Files that have already been allocated
block 43 will all be pointing to the same fragment in the same block. Changing the
data located at block 43 therefore causes an update of the file content for all the files
pointing to that block.
Issuing the shfragbf command displays output similar to:
# /usr/field/shfragbf -t 1 -v /.tags/1
-group pg =
64, next pg =
112, type = 1
nextFree =
66, numFree =
34
frag on free list :
578, nextFree =
601
frag on free list :
601, nextFree =
602
frag on free list :
602, nextFree =
603
frag on free list :
603, nextFree =
604
[snip]
frag on free list :
624, nextFree =
623
frag on free list :
623, nextFree =
-1
5.
The msfsck and vchkdir tools were run against the domain and reported no
other domain corruption.
The latest patches were applied to the system. Patches do not generally clean up
corruption problems, but will hopefully prevent future occurrences of known
issues.
Analysis
1.
2.
# ls -l /usr10/vogar/cs2005/poly2
/usr10/vogar/cs2005/poly2 not found
Enter the mount | grep command for /usr10 to find the domain name.
# ls -l /etc/fdmns/disk7
total 0
lrwxrwxrwx
1 root
wheel
The results provide additional information about the problem domain. At this We
found that this was not a Compaq device (Seagate drive) and therefore possibly a
device driver issue. Bad blocks on the disk are the most common cause for
corruption, so look for those on this disk.
3.
4.
The vdump command was used to perform a full backup. The vrestore
command was used to restore the files from the savesets produced by vdump.
The full vdump and vrestore was performed to ensure data integrity after
the corruption.
5.
Run the verify command specifying the -d flag (to remove the corrupted
files) on the domain.
The verify command checks on-disk structures such as the bitfile metadata
table (BMT), the storage bitmaps, the tag directory and the fragment file for
each fileset. In this case, using the -d option, also temporarily cleared the
corruption.
The corrupted files that were originally present were deleted by verify.
However, additional files subsequently became corrupted on several different
domains within a few hours after running at DIGITAL UNIX Version 4.0a with
the Prestoserve option enabled.
At one point, the domains became so corrupted that attempting to mount them
or repair the corruption resulted in a system panic.
6.
#
# Crash Data Collection (Version 1.4)
#
_crash_data_collection_time: Sat Nov 9 12:34:16 EST 1996
_current_directory: /
_crash_kernel: /var/adm/crash/vmunix.12
_crash_core: /var/adm/crash/vmcore.12
_crash_arch: alpha
_crash_os: Digital UNIX
_host_version: Digital UNIX V4.0A (Rev. 464); Fri Oct 25 18:54:14 EDT 1996
_crash_version: Digital UNIX V4.0A (Rev. 464); Fri Oct 25 18:54:14 EDT 1996
thread 0xfffffc0000e0a840 stopped at [boot:2412 ,0xfffffc000047a850] Source no
_crashtime:
struct {
tv_sec = 847560441
tv_usec = 435137
}
_boottime: struct {
tv_sec = 847559468
tv_usec = 118564
}
_config: struct {
sysname = "OSF1"
nodename = "res.WPI.EDU"
release = "V4.0"
version = "464"
machine = "alpha"
}
_cpu: 35
_system_string: 0xffffffffff8010b8 = "AlphaServer 2100 4/200"
_ncpus: 3
_avail_cpus: 3
_partial_dump: 1
_physmem(MBytes): 319
_panic_string: 0xffffffff94ccb328 = "bad v1 frag free list"
_paniccpu: 0
_panic_thread: 0xfffffc0000e0a840
_preserved_message_buffer_begin:
struct {
msg_magic = 0x63061
msg_bufx = 0xb84
msg_bufr = 0xa3e
msg_bufc = "Alpha boot: available memory from 0xc88000 to 0x13ffe000
Digital UNIX V4.0A (Rev. 464); Fri Oct 25 18:54:14 EDT 1996
physical memory = 320.00 megabytes.
available memory = 307.56 megabytes.
using 1221 buffers containing 9.53 megabytes of memory
Master cpu at slot 0.
Firmware revision: 4.6
PALcode: OSF version 1.45
ibus0 at nexus
AlphaServer 2100 4/200
cpu 0 EV-4s 1mb b-cache
cpu 1 EV-4s 1mb b-cache
cpu 2 EV-4s 1mb b-cache
gpc0 at ibus0
pci0 at ibus0 slot 0
tu0: DECchip 21040-AA: Revision: 2.2
tu0 at pci0 slot 0
tu0: DEC TULIP Ethernet Interface, hardware address: 08-00-2B-E2-65-1C
tu0: console mode: selecting 10BaseT (UTP) port: half duplex: no link
psiop0 at pci0 slot 1
Loading SIOP: script 1000000, reg 81000000, data 100df38
scsi0 at psiop0 slot 0
rz0 at scsi0 target 0 lun 0 (LID=0) (DEC
RZ28
(C) DEC D41C)
rz1 at scsi0 target 1 lun 0 (LID=1) (SEAGATE ST32550N
0012)
rz2 at scsi0 target 2 lun 0 (LID=2) (SEAGATE ST15150N
0017)
rz3 at scsi0 target 3 lun 0 (LID=3) (SEAGATE ST15150N
0017)
eisa0 at pci0
ace0 at eisa0
ace1 at eisa0
lp0 at eisa0
fdi0 at eisa0
fd0 at fdi0 unit 0
fd1 at fdi0 unit 1
qvision0 at eisa0
qvision0: CMPQ Qvision 1024/E SVGA
tu1: DECchip 21140-AA: Revision: 1.2
tu1 at pci0 slot 6
tu1: DEC Fast Ethernet Interface, hardware address: 00-00-F8-02-8B-0E
tu1: console mode: selecting 100BaseTX (UTP) port: full duplex
pnvram0: Module Revision 16, Cache size: 8387584
pnvram0 at pci0 slot 7
pnvram_ssn: NO System Serial Number
presto: NVRAM tested readonly ok
presto: using 8387584 bytes of NVRAM at 0xc0000400
presto: primary battery ok
00544 cron
00570 lpd
00579 lpd
00580 rlogind
00581 tcsh
00583 smbd
00587 nmbd
00622 pwd_server
00627 httpsd
00637 httpsd
00639 httpsd
00640 httpsd
00641 httpsd
00642 httpsd
00643 httpsd
00658 erpcd
00670 rarpd
00684 asplmd.exe
00705 dtlogin
00718 getty
00721 Xdec
00726 dtlogin
00780 dxconsole
00781 dtgreet
00808 rlogind
00809 tcsh
00842 httpsd
00881 tcsh
00883 lynx
00887 httpsd
00892 httpsd
00898 telnetd
00899 tcsh
00918 pine
00999 rpc.ttdbserverd
01053 httpsd
01057 httpsd
01188 httpsd
01201 httpsd
01207 httpsd
01236 httpsd
01264 httpsd
01342 httpsd
01343 httpsd
01344 httpsd
01354 vi
_kernel_process_status_end:
_current_pid: 0
_current_tid: 0xfffffc0000e0a840
_proc_thread_list_begin:
thread 0xfffffc0000e0a840 stopped at [boot:2412 ,0xfffffc000047a850] Source no
thread 0xfffffc0000e0ab00 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b080 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b340 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b600 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
thread
0xfffffc0000e0b8c0
0xfffffc0000e0bb80
0xfffffc000412a000
0xfffffc000412a2c0
0xfffffc0000e0a580
0xfffffc0000e0a2c0
0xfffffc0000e0a000
0xfffffc0012d1bb80
0xfffffc0012d1b8c0
0xfffffc0012d1b600
0xfffffc0012d1b340
0xfffffc0012d1b080
0xfffffc0012d1adc0
0xfffffc0012d1ab00
0xfffffc0012d1a840
0xfffffc0012d1a580
0xfffffc0012d1a2c0
0xfffffc0012d1a000
0xfffffc0012529b80
0xfffffc00125298c0
0xfffffc0012529600
0xfffffc0012529340
0xfffffc0012529080
0xfffffc0012528dc0
0xfffffc0012528b00
0xfffffc0012528840
0xfffffc0012528580
0xfffffc00125282c0
0xfffffc0012528000
0xfffffc0004641b80
0xfffffc00046418c0
0xfffffc0004641600
0xfffffc0004641340
0xfffffc0004641080
0xfffffc0000c99080
0xfffffc0000c98dc0
0xfffffc0000c98b00
0xfffffc0000c98840
0xfffffc0000c98580
0xfffffc0000c982c0
0xfffffc0000c98000
0xfffffc0012107b80
0xfffffc0012107600
0xfffffc0012107340
0xfffffc0012107080
0xfffffc0012106dc0
0xfffffc0012106b00
0xfffffc0012106840
0xfffffc0012106580
0xfffffc00121062c0
0xfffffc0012106000
0xfffffc0013ecfb80
0xfffffc0013ecf8c0
0xfffffc0013ecf600
0xfffffc0013ecf340
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
stopped
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[stop_secondary_cpu:499,0xfffffc00004719
[stop_secondary_cpu:499,0xfffffc00004719
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
dmnh = 9
}
prevState = ACC_VALID
delVdp = 0xfffffc00040ed008
delList = 0xfffffc000031d884
delCnt = 0
delMCId = struct {
cell = 12
page = 12
}
dmnp = 0xfffffc00040ed008
cp = (nil)
fragFlag = 1
deleteIt = 0
ftxFlag = 0
vp = 0xfffffc00040ed008
6 close_int() ["../../../../src/kernel/msfs/bs/
bs_access.c":3179,0xfffffc000
bfap = 0xffffffff804dc528
7 bs_vfs_close(bfAccessH = 4716512) ["../../../../src/kernel/msfs/bs/
bs_acces
8 msfs_inactive(0xfffffc0000357308, 0x12, 0xfffffc000042db44,
0xfffffc00110cf
9 vrele(vp = 0xfffffc00110cf200) ["../../../../src/kernel/vfs/
vfs_subr.c":230
10 rfs3_writeg() ["../../../../src/kernel/nfs/nfs3_server.c":2827,0xfffffc000
error = 0
bverror = 59160000
resp2 = 0xfffffc00110cf200
piov = 0xfffffc000f555a48
piovlen = 286061056
psv = 0xffffffff80476db0
minoffset = 8192
maxoffset = 18446739675949101568
first = 286061056
imgathering = 0
dupwrite = 60579840
estale = 0
prestohere = 0
dummy = 0
didmyreply = 0
prevwr = 0x40000000000
mywritelist = (nil)
dev = 4716512
pbp = 0xffffffff80476de8
11 rfs3_write(args = 0xfffffc00036a8e60, resp = 0xfffffc000f555a40, nreq = 0xf
psv = 0xffffffff80476db0
vp = 0xfffffc000047f7e0
12 rfs_dispatch(req = (nil), xprt = 0xfffffc00015a5700) ["../../../../src/kern
disp = 0xfffffc00005a5d20
error = 0
nreq = 0xfffffc000f65a180
args = 0xfffffc00036a8e60 = " "
res = 0xfffffc000f555a40 = ""
ep = 0xfffffc00044ee680
fh = 0xfffffc00015a5700
which = 7
ret = 0
dupstat = 2
args_translated = 1
psv = 0xffffffff80476db0
count = 0
buff = ""
13 nfs_rpc_recv(0xa305dc1600000007, 0xfffffc0000000001, 0xfffffc0013631a40,0x
14 nfs_rpc_input(0xfffffc0013631a40, 0xfffffc0000000024, 0x0,0xfffffc0013631b
15 nfs_input(m = 0xfffffc00034b5300) ["../../../../src/kernel/nfs/
nfs_server.c
psv = 0xffffffff80476db0
xprt = 0xfffffc00015a5700
savecr = 0xfffffc0013ecc100
save_nd = 0xfffffc0013ecb158
ip = 0xfffffc00015a5700
uh = 0xfffffc0013ecc100
ui = 0xffffffff80476db0
len = 2
n = 0x28000
udp_in = struct {
sin_len = ^P
sin_family = ^B
sin_port = 65027
sin_addr = struct {
s_addr = 102291330
}
sin_zero = ""
}
16 nfs_thread() ["../../../../src/kernel/nfs/nfs_server.c":5714,0xfffffc00003
m = 0xfffffc000254eb00
thread = 0xfffffc0000e0a840
psv = 0xffffffff80476db0
_dump_end:
_kernel_thread_list_begin:
thread 0xfffffc0000e0a840 stopped at [boot:2412 ,0xfffffc000047a850] Source no
thread 0xfffffc0000e0ab00 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b080 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b340 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b600 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0b8c0 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0bb80 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc000412a000 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc000412a2c0 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0a580 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0a2c0 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0000e0a000 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1bb80 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1b8c0 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1b600 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1b340 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1b080 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1adc0 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
thread 0xfffffc0012d1ab00 stopped at
[thread_block:2066 ,0xfffffc00002a80d0]
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
at
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[stop_secondary_cpu:499,0xfffffc00004719
[stop_secondary_cpu:499,0xfffffc00004719
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_block:2066 ,0xfffffc00002a80d0]
[thread_run:2438 ,0xfffffc00002a8898]
fault_sp = 0x0
access = 0x0
status = 0x0
cpunum = 0x0
count = 0x0
pcb = (nil)
thread = (nil)
task = (nil)
proc = (nil)
}
_kernel_memory_fault_data_end:
_uptime: .27 hours
thread 0xfffffc0000e0a840 stopped at [boot:2412 ,0xfffffc000047a850] Source no
paniccpu: 0x0
machine_slot[paniccpu]: struct {
is_cpu = 0x1
cpu_type = 0xf
cpu_subtype = 0x9
running = 0x1
cpu_ticks = {
[0] 0x4708
[1] 0x0
[2] 0x1998d
[3] 0xd55ad
[4] 0x273a
}
clock_freq = 0x400
error_restart = 0x0
cpu_panicstr = 0xffffffff94ccb328 = "bad v1 frag free list"
cpu_panic_thread = 0xfffffc0000e0a840
}
tset machine_slot[paniccpu].cpu_panic_thread:
Begin Trace for machine_slot[paniccpu].cpu_panic_thread:
thread 0xfffffc0000e0a840 stopped at [boot:2412 ,0xfffffc000047a850] Source no
> 0 boot(0x0, 0xfffffc0000e0a840, 0x2c0000002c, 0x31, 0xfffffc0000000001) ["../
1 panic(s = 0xffffffff94ccb328 = "bad v1 frag free list") ["../../../../src/k
2 advfs_sad(0x76, 0x9000005, 0xfffffc0008260000, 0x13af6, 0xfffffc00005839d8)
3 bs_frag_alloc(setp = 0xfffffc00041e8c08, ftxH = struct {
hndl = 0x5
level = 0x0
dmnh = 0x9
}, fragId = 0xffffffff94ccb640) ["../../../../src/kernel/msfs/bs/
bs_bitfile_sets
4 fs_create_frag(0xffffffff804dc528, 0xfffffc0012c1fc00, 0x9000005,0xfffffc0
5 close_one_int(bfap = 0xffffffff804dc528, parentFtxH = struct {
hndl = 0xc558
level = 0x4d
dmnh = 0x80
}) ["../../../../src/kernel/msfs/bs/bs_access.c":3422, 0xfffffc00002ed6ec]
6 close_int() ["../../../../src/kernel/msfs/bs/bs_access.c":3179,0xfffffc000
7 bs_vfs_close(bfAccessH = 0x47f7e0) ["../../../../src/kernel/msfs/bs/
bs_acce
8 msfs_inactive(0xfffffc0000357308, 0x12,
0xfffffc000042db44,0xfffffc00110cf
The stack trace fell through the NFS, VFS, and AdvFS code. The panic therefore
did not isolate one of these subsystems as the cause of the problem.
7.
Since the problem was not present before any upgrade was performed,
revert to a known working configuration (DIGITAL UNIX Version 3.2g).
The customer was able to continue to run booted from a DIGITAL UNIX
Version 3.2g system disk without the AdvFS file corruption.
Since the problem appeared after an upgrade from DIGITAL UNIX Version
3.2g to DIGITAL UNIX Version 4.0a, the problem was likely related to
changes in source code between the two versions. At this point it was still
unknown whether it was a DIGITAL UNIX, AdvFS, Presto, or NFS bug.
b.
c.
A dd copy of the domain was copied from one of the corrupted domains to
help in reproducing the corruption and panic.
d.
8.
Time was spent with engineering to determine that the corruption and panics
were not hardware related nor related to changes in the CAM driver.
The system was tested for corruption when running DIGITAL UNIX
Version 4.0a with the Prestoserve option disabled to determine if the
corruption was related to the Prestoserve option.
Once the problem was isolated to Prestoserve, an existing Prestoserve patch was
available in the latest patch kit that fixed another problem.
It is always a good idea to install any related patches (in this case presto.mod)
even if the patch README does not specifically mention this problem for a couple
of reasons:
The patch README does not always list all the things fixed by the patch.
The patch may change the behavior of the problem and may provide additional
information that can assist in troubleshooting.
So, although the patch README did not mention this problem, we had the
customer install it to see if it might meet one of the two criteria above.
The engineer soon found that there was a locking problem in the Prestoserve module
and produced a patch. The first version of this patch was not successful because it
caused NFS to lock up. The second iteration of the patch proved to solve the
problem.
Things Attempted: Case Study 3
1. Installed available AdvFS, Prestoserve option, NFS and Tru64 UNIX kernel
patches.
2.
3.
Replaced the CPU due to some CPU exceptions reported in the binary
errorlog file.
The customer system after problem resolution was running DIGITAL UNIX
Version 4.0b with a new CPU, and a Prestoserve module kernel patch.
Turning off the Prestoserve option was actually one of the first things that the
specialist recommended to the customer. The customer refused to run this test
unless we could prove to him beforehand that Prestoserve was causing the problem.
He felt that the performance gained by using this option was a necessity on this
system which acted as the main NFS server for the entire campus. The customer
preferred to run at DIGITAL UNIX Version 3.2g, than to accept the performance
degradation of turning off the Prestoserve option.
One reason the customer wanted to upgrade from DIGITAL UNIX Version 3.2g to
DIGITAL UNIX Version 4.0a was to obtain the performance improvement from the
unfunneling of AdvFS in 4.0x. After approximately two months of ineffective
troubleshooting, the customer was willing to try running while disabling the
Prestoserve option. The file system corruption problem was resolved under this test
situation indicating that the source of the corruption was the Prestoserve option in
conjunction with AdvFS. The problem was subsequently isolated to the Prestoserve
driver for DIGITAL UNIX Version 4.0x.
As you will recall from the stack trace, the panic did not include Prestoserve.
Therefore, the panic was a symptom, not an indication that there was a problem in
any of the subsystems that showed up in the trace.
Disabling the Prestoserve option did cause a loss of performance that the customer
was displeased with. Once the Prestoserve patch was installed, they enabled the
option and regained the performance.
The domain command specifies the name of an existing AdvFS file domain from
which filesets are to be recovered. Use this parameter when you want the utility to
obtain volume information from the /etc/fdmns directory. The volume
information used by the utility consists of the device special file names of the
AdvFS volumes in the file domain. When the domain parameter is specified
without optional arguments, the utility attempts to recover the files in all filesets in
the domain. Do not use this parameter when you want to use the -V special flag
to specify device special file names of AdvFS volumes. If you do, the utility
displays an error message and exits with an exit value of 2.
The fileset [path] command specifies the name of a fileset to be recovered
from a domain or a volume. Specify path to indicate the path of a directory or file
in a fileset. When you specify a path that is a directory, the utility attempts to
recover only the files in that directory tree, starting at the specified directory. When
you specify a path that is a file, the utility attempts to recover only that file. Specify
path relative to the mount point of the fileset.
Table 5-4: salvage Options
Option
Function
-d time
-D directory
Specifies the path of the directory to which all recovered files are written. If you do not specify
a directory, the utility writes recovered files to the current working directory.
-f [archive]
Use the next argument as the name of an archive. If "-", salvage writes to standard output.
-F format
Specifies that salvage should recover files in an archive format. The only legitimate value
is tar (currently V5.0).
Specifies verbose mode for messages written to the log file for every file encountered during
the recovery. If you do not specify this flag, the utility writes a message to the log file only for
partially recovered and unrecovered files.
-L path
Specifies the path of the directory or the file name for the log file you choose to contain
messages logged by this utility. If you include a log file name in the path, the utility uses that
file name. If no log file name is specified, the utility places the log file in the specified directory
and names it salvage.log.pid (pid is the process ID of the user process). When you do
not specify this flag, the utility places the log file in the current working directory and names it
salvage.log.pid.
-o option
Specifies the action the utility takes when a file being recovered already exists in the directory
to which it is to be written. The values for option are:
yes: Overwrites the existing file without querying the user. This is the default action
when option is not specified.
Specifies that utility is to run in sequential search mode, checking each page on each volume in
domain; takes a long time on large AdvFS file domains. This flag can recover most files from
a domain damaged from an incorrect execution of the mkfdmn utility. In some cases, recovery
must generate names based on files tag number. These cases usually happen in root directory,
because mkfdmn usually overwrites this directory.
-S
When you specify this flag, there may be a security issue because the utility could recover old
filesets and deleted files.
-v number
Specifies the type of messages directed to stdout. If you do not specify this flag, the default
is to direct only error messages to stdout. If you specify number to be 1, both errors and the
names of partially recovered files are directed to stdout. If you specify number to be 2,
error messages and the status of all files as they are recovered are directed to stdout.
-V special
[-V special]
Specifies the block device special file names of volumes in the domain, for example, /dev/
disk/dsk3c. The utility attempts to recover files only from the volumes you specify. If you
do not specify the -V flag, you must specify the domain parameter so that the utility can obtain
the special file names of the volumes in the domain from the /etc/fdmns directory. Do not
use this flag with the domain parameter. If you do, an error message is displayed and the utility
exits with an exit value of 2.
-x
Specifies that partially recoverable files are not to be recovered. If you do not use this flag,
partial files are recovered.
Do not use the -x flag with the -p flag. If you do, the utility displays an error message and
exits with an exit value of 2.
Operation
The salvage utility helps you recover file data after an AdvFS file domain has
become unmountable due to some type of data corruption. Errors that could cause
data corruption of a file domain include I/O errors in file system metadata or the
accidental removal of a volume.
As the utility recovers files, it saves relevant information in memory. It requires
enough disk space to save the recovered files plus the log file.
Running the salvage utility does not guarantee that you will recover all your
information. You may be missing files, directories, file names, or parts of files. The
utility generates a log file that contains the status of files that were recovered. Use
the -l flag to print the status of all files that are encountered. There is a
lost+found directory that lists files for which no parent directory can be found.
salvage places recovered files in directories named after the filesets. Recovered
information must be moved to new filesets before you can remount the files as a
fileset. You can specify the path name of the directory into which the files are
recovered. If you do not specify a directory, the utility writes recovered files to the
current working directory.
The results of using this utility can include some fully recovered files, partially
recovered files, and unrecovered files. A partially recovered file is one that
salvage could not obtain all of the files data due to corrupt metadata, I/O errors
reading the disk or missing volumes. If the partially recovered file is an ASCII file,
the user may be able to fill in the missing data. Compaq cannot provide any more
recovery assistance of these types of files at this point.
The salvage utility opens and reads block devices directly and could present a
security issue if it recovers data remaining from previous AdvFS file domains while
attempting to recover data from current AdvFS file domains.
The salvage utility can be run in single user mode, without mounting other file
systems. The salvage utility is available from the UNIX Shell option when you
are starting from the Tru64 UNIX operating system volume 1 CDROM.
You must have root user privilege to use the salvage utility.
salvage Examples
The following example shows a salvage command that uses all the defaults to
recover all files from the AdvFS file domain named user_domain. Other results
include:
The files recovered from the user_domain are also written to the fixit
directory.
Partially recoverable files are included in the recovered files. These files are
written to the fixit directory.
# cd /fixit
# /sbin/advfs/salvage user_domain
This example shows a salvage command that uses the -d option to recover all
files in the domain user_domain that have been changed after that date.
# cd /fixit
# /sbin/advfs/salvage -d 199611200000 user_domain
The following example shows a salvage command that recovers the file
data.file, whether or not it is only partially recoverable, from the fileset
user_fileset on the volume mounted as /dev/disk/dsk3c. The
data.file file is written to the recovery directory and is logged in the log file
(only if it was partially recovered).
# cd /fixit
# /sbin/advfs/salvage -V /dev/disk/dsk3c user_fileset/data.file
The following example shows a salvage command that recovers the file
data.file, only if it is fully recoverable, from the fileset user_fileset on
the domain user_domain. The data.file file, if it is not recovered, is logged
in the log file. Otherwise, it is written to the recovery directory.
# cd /fixit
# /sbin/advfs/salvage -x user_domain user_fileset/data.file
2.
Attempt to recover the fileset data from backup media if the verify utility
does not solve the problem.
Only if both methods are unsatisfactory should you use the salvage utility.
Remember that running the salvage utility does not guarantee that you will
recover all your information. You may be missing files, directories, file names, or
parts of files. The utility generates a log file that contains the status of files that were
recovered. Use the -l flag to print the status of all files that are encountered.
Since salvage may only be partially successful recovering the files, this should
not be construed as a replacement for backups. Compaq recommends that regular
backups be performed on any critical system data (as defined by the customer), and
any corruption issues be dealt with by restoring any corrupted files from backups.
Using salvage in Conjunction with Backup Media
In cases where the backup is not recent enough, salvage can be used in
conjunction with the most recent backup to obtain current copies of files. These
steps define how to perform this task:
1.
2.
3.
4.
Run the salvage utility with the -d (date) flag set to recover files that have
changed since the backup.
5.
2.
Summary
Summary
Describing AdvFS Troubleshooting Practices
These troubleshooting practices were described:
Describe the problem and any relevant circumstances surrounding the problem
as much as possible.
If you think it might be a bug in the software, research the reported bugs and
patches for potential similarities.
Use AdvFS tools and utilities to check for and to fix problems.
System panic
Domain panic
Corrupted data
BMT exhaustion
Summary
Using salvage
salvage is a new AdvFS utility available in the Tru64 UNIX Version 5.0 release.
(Versions of salvage for earlier versions of Tru64 UNIX can be obtained from
the File systems and Clusters Support Web page at sunny.alf.dec.com.)
salvage can recover information at the block level from disks containing
damaged AdvFS domains (that is, filesets cannot be mounted).
Use salvage as a last resort to recover file data from a damaged file domain.
Before using the salvage utility:
1.
2.
If the verify utility does not solve the problem, attempt to recover the fileset
data from backup media.
Summary
Only if both methods are unsatisfactory should you employ the salvage utility.
Remember that running the salvage utility does not guarantee that you will
recover all your information. You may be missing files, directories, file names, or
parts of files. The utility generates a log file that contains the status of files that were
recovered.
Since salvage may only be partially successful recovering the files, this should
not be construed as a replacement for backups. Compaq recommends that regular
backups be performed on any critical system data (as defined by the customer), and
any corruption issues be dealt with by restoring any corrupted files from backups.
Exercises
Exercises
Describing AdvFS Troubleshooting Practices
These questions provide a review of the material.
1.
Which database should you search if there is a system panic involved with the
problem?
2.
3.
4.
5.
In the case of generalized AdvFS corruption, what steps should you take to
troubleshoot the problem?
6.
Solutions
Solutions
Describing AdvFS Troubleshooting Practices
1. CANASTA is a Compaq internal crash dump analysis tool being used worldwide inside Compaq to store and evaluate crash footprint information for
OpenVMS Alpha, OpenVMS VAX and Tru64 UNIX system crashes.
CANASTA uses AI technology to provide solutions or additional
troubleshooting information for system crash problems. The CANASTA tool
is typically used in the CSCs, but access to the CANASTA knowledge database
is also available using the CANASTA Mail Server, TIMA STARS and
COMET.
By using the AutoCLUE tool, customer crash dump information can be
automatically sent to Compaq using DSNlink and will be analyzed using the
DSNlink CLUE post-processor. Solution information, if available, can be
automatically returned to the customer and/or included in the call handling
system. (See http://hanhwr.hao.dec.com/
CANASTA.HTML#CANASTA Overview for more information.)
2.
nvbmtpg
nvfragpg
nvlogpg
nvsbmpg
nvtagpg
salvage
vdf
3.
The sys_check tool is a ksh script that can be useful when debugging or
diagnosing system problems. The script generates an HTML file of a Tru64
UNIX configuration. This script has been tested on DIGITAL UNIX Version
3.2*, and Version 4.0 systems. (See http://www-unix.zk3.dec.com/
tuning/tools/sys_check/sys_check.html.)
4.
Solutions
6.
Use salvage as a last resort to recover file data from a damaged file domain.
Before using the salvage utility:
Repair domain structures using the verify utility.
If the verify utility does not solve the problem, attempt to recover the
fileset data from backup media.
Only if both methods are unsatisfactory should you use the salvage utility.
A
AdvFS Commands and Utilities
Resources
For more information on topics in this chapter as well as related topics, see the
following:
msfsck
verify
verify
vchkdir
verify
verify
vods
vbmtpg,
nvbmtpg
vbmtchain
no equivalent?
vfragpg
nvfragpg
logread
vlogpg,
nvlogpg
vlsnpg
no equivalent?
vtagpg
nvtagpg
no equivalent
salvage
no equivalent
no equivalent
savemeta
no equivalent
no equivalent
vdf
no equivalent
vfile
vfilepg
no equivalent
no equivalent
vsbmpg
addvol
Description
special specifies the block special device name of the disk that you are adding
to the file domain. domain specifies the name of the file domain.
Options
-F
-x numpages
Sets the number of pages by which the bitmap metadata table extent
size grows. The default is 128 pages.
-p numpages
A newly created file domain consists of one volume, which can be a disk or a logical
volume. The addvol utility enables you to increase the number of volumes within
an existing file domain. You can add volumes immediately after creating a file
domain, or you can wait until the filesets within the domain require additional space.
For optimum performance, each volume that you add should consist of the entire
disk (typically, partition c). Existing data on the volume you add is destroyed during
the addvol procedure. Do not add a volume containing data that you want to keep.
The addvol command checks for potential overlapping partitions before adding
the volume. If you try to add a volume that would cause partitions to overlap with
any other file systems, including Logical Storage Manager (LSM), UNIX file
system (UFS), and AdvFS, or that would overlap with blocks currently in use, the
following message is displayed and the volume is not added:
/dev/rdisk/dsk1g or an overlapping partition is open.
Quitting ....
addvol: Cant add volume /dev/rdisk/dsk1g to domain proj_x
If you try to add a volume that would cause partitions to overlap with other file
systems, but none of the partitions are currently in use, you can choose to continue
with the procedure or stop. Use the -F flag to disable testing for overlap. Disabling
the overlap check can result in extensive data loss and should be used with extreme
caution.
Adding volumes to a file domain does not affect the logical structure of the filesets
within the file domain. You can add a volume to an active file domain while its
filesets are mounted and in use. While up to 256 volumes per domain are allowed,
limiting the number of volumes to three decreases the risk of disk errors that can
cause the entire domain to become inaccessible.
Preallocating all of the space for the BMT when the volume is added
Increasing the number of pages that the system attempts to grow the metadata
table each time more space is needed.
To preallocate all the BMT space that you expect the file domain to need, use the
mkfdmn command with the -p flag set to specify the number of pages to
preallocate. Space that is preallocated to the BMT cannot be deallocated. Do not
preallocate excessive space for the BMT. The following table provides BMT page
number estimates for numbers of files.
To set the BMT to grow by more than 128 pages each time additional metadata
extents are needed, use the addvol command with the -x flag set to specify a
number of pages greater than 128. You can increase the number of pages to any
value; the following table shows suggested guidelines.
Number of Files
Default (128)
3,600
100,000
256
7,200
Number of Files
200,000
512
14,400
300,000
768
21,600
400,000
1024
28,800
800,000
2048
57,600
To get the maximum benefit from increasing the number of metadata table extent
pages, use the same number of pages when adding a volume with the addvol
command as was assigned when the domain was created with the mkfdmn
command.
advfsstat
Description
domain specifies the name of an existing domain. fileset specifies the name
of an existing fileset.
Option
Function
-i sec
-c count
-s
-R
Displays the percent ratio of the returned statistics. (Use only with -b, -p, or
-r flags.)
Stats-types
Function
-b
-f 0
-f 1
-f 2
-l 0
-l 1
-l 2
-n
-p
-r
-S
-v 0
-v 1
-v 2
-v 3
Displays volume I/O queue statistics for everything put on the queue during the
last interval (-i).
-B r
-B w
Operation
The advscan command locates AdvFS volumes (disk partitions or LSM disk
groups) that are in AdvFS domains.
/sbin/advfs/advsan [-g] [-a] [-r] [-f domain_name] devices...
disk_group...
devices specifies the device names of the disks to scan. disk_group specifies
the Logical Storage Manager (LSM) disk groups to scan for AdvFS volumes.
Use the advscan command when you have moved disks to a new system, have
moved disks around in a way that has changed device numbers or have lost track of
where the domains are. The command is also used for repair if you delete the
/etc/fdmns directory, delete a file domain directory in the /etc/fdmns
directory, or delete links from a file domain directory under the /etc/fdmns
directory.
Options
-g
-a
-r
-f domain_name
Fixes the domain count and the links for the named domain.
Operation
The advscan command locates AdvFS volumes (disk partitions or LSM volumes)
that are in AdvFS domains. Given the AdvFS volumes, you can recreate or fix the
/etc/fdmns directory of a named domain or LSM disk group. For example, if
you have moved disks to a new system, moved disks around in a way that has
changed device numbers, or have lost track of where the AdvFS domains are, you
can use this command to locate them.
Another use of the advscan command is to repair AdvFS domains when you have
broken them. For example, if you mistakenly delete the /etc/fdmns directory,
delete a domain directory in the /etc/fdmns directory, or delete links from a
domain directory under the /etc/fdmns directory, you can use the advscan
command to fix the problem.
The advscan command accepts a list of disk device names and/or LSM disk group
names and searches all the disk partitions to determine which partitions are part of
an AdvFS domain.
You can run the advscan command to rebuild all or part of your /etc/fdmns
directory or you can rebuild it manually by supplying all the names of the AdvFS
volumes in a domain.
If the -g flag is not set, the AdvFS volumes are listed as they are grouped in
domains. Set the flag to list the AdvFS volumes in the order they are found on each
disk.
Run the advscan command with the -r flag set to recreate missing domains from
the /etc/fdmns directory, missing links, or the entire /etc/fdmns directory.
Although the advscan command will rebuild the /etc/fdmns directory
automatically, Compaq recommends that you always keep a hardcopy record of the
current /etc/fdmns directory.
To determine if a partition is part of an AdvFS domain, the advscan command
performs the following functions:
Reads the disk label to sort out overlapping partitions. The size of overlapping
partitions are examined and compared to the file domain information to
determine which partitions are in the file domain. These partitions are reported
in the output.
Reads the boot block to determine if the partition is AdvFS root startable.
The advscan command displays the date the domain was created, the on-disk
structure version, and the last known or current state of the volume.
To mount an AdvFS file system into a domain, the domain must be consistent. An
AdvFS domain is consistent when the number of physical partitions or volumes
with the correct domain ID are equal to both the domain volume count (which is a
number stored in the domain) and the number of links to the partitions in the /etc/
fdmns directory.
Domain inconsistencies can occur in diverse ways. Use the -f flag to correct
domain inconsistencies. If you attempt to mount an inconsistent domain, a message
similar to the following will appear on the console:
# Volume count mismatch for domain dmnz.
dmnz expects 2 volumes, /etc/fdmns/dmnz has 1 links.
The balance utility balances the percentage of used space among volumes in a
domain.
/usr/sbin/balance [-v] domain
Displays information on which files are being moved to different volumes. Selecting
this flag slows down the balance procedure.
Operation
The balance utility evenly distributes the percentage of used space between
volumes in a multivolume domain. This improves performance and evens the
distribution of future file allocations.
Use the showfdmn command to determine the percentage of used space on each
volume. This information allows you to determine the need to balance the volumes.
The balance utility can be used at any time, but it is particularly useful after
adding or removing a volume (addvol, rmvol) because these procedures can
cause file distribution to become uneven.
When you plan to run both the defragment and balance utilities on the same
domain, run the defragment utility before running the balance utility. The
defragment utility often improves the balance of free space, this enabling the
balance utility to run more quickly.
Before you can balance volumes in a file domain, all filesets in the file domain must
be mounted. If you try to balance volumes in an active file domain that includes
unmounted filesets, the system displays an error message indicating that a fileset is
unmounted.You must have root privilege to access this utility. The AdvFS utilities
license must be present.
You cannot run the balance utility while the addvol, rmvol, defragment,
rmfset, or balance utility is running on the same file domain. If you attempt to
do this, a warning message is displayed.
The balance utility does not operate on striped files in the domain and does not
include them in its calculations on used space.
chfile
Description
-L on | off
Enables or disables (on | off) atomic write data logging on the specified
filename. By default, atomic write data logging is turned off.
Operation
The chfile command lets you view or change attributes of an AdvFS file. The
only file attribute that can be set with the chfile command is the I/O mode used
when write requests are made to the file. There are three settings for this I/O mode:
Asynchronous I/O
The default setting. Write requests are cached, the write system call returns to
the calling program, and later (asynchronously), the data is written to the disk.
The -l and -L options are mutually exclusive. You cannot simultaneously enable
both forced synchronous writes and atomic write data logging on a file. However,
you can override the current I/O mode for a file. For example, you can change a
files I/O mode setting from forced synchronous writes to atomic write data logging
by using the chfile -L on command.
If you do not use the options, the command displays the current state of the files
I/O attribute.
Use the chfile command on AdvFS files that have been remotely mounted across
NFS. You can run the chfile command on an NFS client to examine or change
the I/O mode of AdvFS files on the NFS server.
Enabling atomic write data logging for a file will retard performance because the
data is written to both the user file and the AdvFS log file. Enabling forced
synchronous writes to a file also can retard system performance.
To use the chfile command on AdvFS files that are mounted across NFS, the
NFS property list daemon, proplistd, must be running on the NFS client and the
fileset must have been mounted on the client using the proplist option.
Only writes of up to 8192 bytes are guaranteed to be atomic for files that use atomic
write data logging. When writing to an AdvFS file that has been mounted across
NFS, a further restriction applies: the offset into the file of the write must be on an
8K page boundary, because NFS performs I/O on 8K page boundaries.
The showfile command does not display the I/O mode for files that are mounted
across NFS. To display the I/O mode of these files, use the chfile command.
Usually AdvFS, when operating on small files that do not have a size that is a
multiple of 8K, puts the last part of the files (their frags) into a special metadata file
called the fileset frags file as a way to reduce disk fragmentation. For example, a file
that does not use atomic write data logging and has had 20K of data written to it
will occupy 20K of disk space (as displayed by the du command).
Files that use atomic write data logging are exempt from this behavior. As a result,
they always have a disk usage (as displayed by the du command) that is a multiple
of 8K. For example, a file that has atomic write data logging enabled and has had
20K of data written to it occupies 24K of disk space.
If a file has a frag, an attempt to activate atomic write data logging on it will fail.
Files that use atomic write data logging cannot be memory-mapped through the
mmap system call. The error ENOTSUP is returned if the attempt is made. If a file
has been memory-mapped through the mmap system call, an attempt to activate
atomic write data logging on it fails with the same error.
chfsets
Description
The chfsets command enables you to change fileset quotas (file usage limits and
block usage limits).
/sbin/chfsets [-F limit] [-f limit] [-B limit] [-b limit] domain
[fileset...]
domain specifies the name of the file domain. fileset specifies the name of one
or more filesets.
Options
- F limit
- f limit
- B limit
Specifies the block usage soft limit (quota) in 1K blocks of the fileset.
- b limit
Specifies the block usage hard limit (quota) in 1K blocks of the fileset.
Operation
Filesets can have both soft and hard disk storage and file limits. When a hard limit
is reached, no more disk space allocations or file creations which would exceed the
limit are allowed. The soft limit may be exceeded for a period of time (called the
grace period). The grace periods for the soft limits are set with the edquota
command.
The command also displays the changes made to the file and block usage limits.
Id is a unique number (in hexadecimal format) that identifies a file domain and
fileset.
File H limit is the files usage hard limit of the specified fileset before the
change followed by the new limit.
Block H limit is the block usage hard limit of the specified fileset.
File S limit is the file usage soft limit of the specified fileset before the
change followed by the new limit.
Block S limit is the block usage soft limit of the specified fileset before
the change followed by the new limit.
At least one fileset within the domain must be mounted for the chfsets command
to succeed. You must have root user privilege to access this command.
chvol
Description
The chvol command enables you to change the attributes of a volume in an active
domain.
/sbin/chvol [-r blocks] [-w blocks] [-t blocks] [-c on | off] [-A]
special domain
Specifies the maximum number of 512-byte blocks that the file system
reads from the disk at one time.
-w blocks
Specifies the maximum number of 512-byte blocks that the file system
writes to the disk at one time.
-t blocks
Specifies the maximum number of dirty, 512-byte blocks that the file
system will cache in-memory (per volume in a domain). Dirty means that
the data has been written by the application but the file system has cached
it in memory so it has not yet been written to disk.
Number of blocks must be in multiples of 16; valid range is 0-32768.
Default (when a volume is added to a domain) is 768 blocks. For optimal
performance, specify blocks in multiples of wblks (as specified by -w)
-c on | off
-A
-l
Operation
The file system can consolidate a number of I/O transfers into a single, large I/O
transfer. The larger the I/O transfer, the better the file-system performance. If you
attempt to change the attributes of a volume in a domain that is not active an error
message is produced.
The initial I/O transfer parameter for both reads and writes is 128 blocks. Once you
change the I/O transfer parameters with the -r flag or the -w flag, the parameters
remain fixed until you change them. The values for the I/O transfer parameters are
limited by the device driver. Every device has a minimum and maximum value for
the size of the reads and writes it can handle. If you set a value that is outside of the
range that the device driver allows, the device automatically resets the value to the
largest or smallest it can handle.
By default, the I/O consolidation mode (cmode) is on. The cmode must be on for
the I/O transfer parameters to take effect. You can use the -c flag to turn the
cmode off, which sets the I/O transfer parameter to one page.
For file system workloads that are heavily biased toward random writes, use the -t
flag to increase the file systems dirty threshold. This may improve write
performance.
Interrupting an rmvol operation can leave the volume in an inaccessible state. If a
volume does not allow new allocations after an rmvol operation, use the chvol
command with the -A flag to reactivate the volume.
Using the chvol command without any flags displays the current cmode and the
I/O transfer parameters.
The values for the wblks and rblks attributes are limited by the device driver.
You must have root user privilege to access this command.
defragment
Description
The defragment utility makes the files in a file domain more contiguous.
/usr/sbin/defragment [-e] [-n] [-N threads] [-t time] [-T time]
[-v] [-V] domain
Ignores errors and continues, if possible. Errors that are ignored are usually
related to a specific file.
-n
-N threads
Specifies the number of threads to run on the utility. The default number of
threads that will be run is the number of volumes in the domain. The maximum
number you can specify is 20.
-t time
Specifies a flexible time interval (in minutes) for the defragment utility to
run. If the utility is performing an operation when the specified time has
elapsed, the procedure continues until the operation is complete.
-T time
Specifies an exact time interval (in minutes) for the defragment utility to
run. When the specified time has elapsed, the defragmentation procedure stops,
even if it is performing an operation.
-v
-V
Displays the same information provided by the -v flag along with information
about each operation the defragment utility performs on each file. This flag
slows the defragment procedure.
Operation
When a file consists of many discontiguous file extents, the file is fragmented on
the disk. File fragmentation reduces the read/write performance because more I/O
operations are required to access a fragmented file.
The defragment utility attempts to reduce the number of file extents in a file
domain by making files more contiguous. Defragmenting a file domain often
makes the free space on a disk more contiguous, resulting in less fragmented file
allocations in the future.
Before you can defragment a file domain, all filesets in the file domain must be
mounted. If you try to defragment an active file domain that includes unmounted
filesets, the system displays an error message indicating that a fileset is unmounted.
To determine the amount of file fragmentation in a file domain before using the
defragment utility, issue the defragment command with the -v and -n flags.
This provides the fragmentation information without starting the defragment
utility.
Before running the defragment utility, delete any files in the domain that you do
not need. This gives the defragment utility more free space to use, which
produces better results. Deleting files afterwards creates more free-space fragments.
Additionally, run the balance utility on the domain before you run the
defragment utility in order to balance domain free space before defragmenting
the domain files.
To monitor the improvement made to the file domain by the defragment utility,
use the verbose mode flag, -v, which displays the following information:
The number of files that have extents. (Note that files do not have extents if the
files are so small that they are kept with the metadata.)
The average number of extents for each file that has one or more extents.
The migrate utility moves a file or file pages to another volume in an AdvFS
domain.
/usr/sbin/migrate [-p pageoffset] [-n pagecount] [-s volumeindex]
[-d volumeindex] filename
filename specifies the name of the file or file pages to be migrated from the
volume. The file can be simple or striped.
Options
-p pageoffset
Specifies the page offset of the first page to migrate. The first page
of the file is page 0. The default page offset is 0. If you do not
specify the -p flag, the migrate command migrates pages
starting at page 0 of the file.
-n pagecount
-s volumeindex
Specifies the volume index number of the volume from which the
pages are to be migrated. Use the showfile -x command to
determine the volume index number of the volumes in the AdvFS
file domain.
If you specify the -s flag and the volume that contains the file does
not contain any data extents of that file, the utility returns success
without taking any action.
You must use the -s flag when you are migrating striped files. You
can move pages of a striped file or a stripe file segment, which is
the entire portion of a striped file that resides on the specified
volume, to another volume.
-d volumeindex
Operation
The migrate utility moves the specified simple file to another volume in the same
file domain. The utility also moves pages of a simple file or pages of a striped file
segment to another volume (or volumes, if necessary) within the file domain.
Because there are no read/write restrictions when using this command, you can
migrate a file while users are reading it, writing to it, or both, without disrupting file
I/O. File migration is transparent to users.
When you run the migrate utility with only the -p and -n flags, the utility
attempts to allocate the destination pages contiguously on one destination volume
in the file domain. If there are not enough free, contiguous blocks to accomplish
the move, the utility then attempts to allocate the pages to the next available blocks
on the same volume. If there are not enough free blocks on the same volume, the
utility then attempts to move the file to the next available volume or volumes. The
utility returns an error diagnostic if it cannot accomplish the move.
You must use the -s, -n, and -p flags in order to move pages of a striped file from
one volume to another. Only those pages assigned to the source volume are moved
to the destination volume: all pages in the file are not moved.
You can use the migrate utility to move heavily accessed files or pages of files
to a different volume in the file domain. Use the -d flag to indicate a specific
volume. Also, you can use the utility to defragment a specific file, because the
migrate utility defragments a file whenever possible.
You can only perform one migrate operation on the same file at the same time.
When you migrate a striped file, you can only migrate from one source volume at a
time.
You must have root user privilege to access this command.
mkfdmn
Description
-l numpages
Sets the number of pages in the log file. AdvFS rounds this number
up to a multiple of four.
-o
-p numpages
Sets the number of pages to preallocate for the bitfile metadata table
(BMT). The default is 0 (zero) pages.
-r
Specifies the file domain as the root domain. This prevents multiple
volumes in the root domain. AdvFS supports only one volume in
the root domain.
-x numpages
Sets the number of pages by which the bitfile metadata table (BMT)
extent size grows. The default is128 pages.
-V3 | -V4
If you try to add a volume that would cause partitions to overlap with any other file
system, including LSM, UFS, and AdvFS, or that would overlap with blocks that
are in use, the system displays a message asking if you wish to continue. Using the
-F flag disables testing for overlap.
The mkfdmn command does not create a file system that you can mount. In order
to mount a file system, the file domain must contain one or more filesets. After you
run the mkfdmn command, you must run the mkfset command to create at least
one fileset within the new file domain. You can access the file domain as soon as
you mount one or more filesets. For more information about creating filesets, see
mkfset(8).
To remove a file domain, dismount all filesets in the domain you want to remove.
Then use the rmfdmn command to remove the file domain. You can also remove
the definition of the domain by removing the defining directory and all links under
it in the /etc/fdmns directory. To accomplish this, execute the following
command line:
# rm -rf /etc/fdmns/domain_name
Although you can use the advscan command to recreate the file domain links, it
is good practice to maintain a current hardcopy record of each volume you have.
You must have the names of all the volumes in the domain to recreate the /etc/
fdmns directory by hand.You must have root user privilege to use the mkfdmn
command.
You cannot have more than 100 active file domains at one time. A file domain is
active when at least one fileset is mounted.
Each file domain must have a unique name of up to 31 characters. All whitespace
characters (tab, line feed, space, and so on) and the / # : * ? characters are invalid
for file domain names.
DIGITAL UNIX V4.x Specific mkfdmn Information
Systems with file domains that contain very large numbers of files can use more
BMT extents (similar to inodes in UFS) than normal. By default, AdvFS attempts
to grow the BMT by 128 pages each time additional BMT extents are needed.
Frequent requests by the system to increase the BMT cause the metadata to become
very fragmented, which can result in an out of disk space error.
You can reduce the amount of metadata fragmentation in one of two ways:
increasing the number of pages the system attempts to grow the BMT each time
more space is needed or by preallocating all of the space for the BMT when the file
domain is created.
To preallocate all of the BMT space you expect the file domain to need, use the
mkfdmn command with the -p flag set to specify the number of pages to
preallocate. Space that is preallocated for the BMT cannot be deallocated, so do not
preallocate more space than you need for it. The following table provides BMT
page number estimates for numbers of files.
To set the BMT to grow by more than 128 pages each time additional metadata
extents are needed, use the mkfdmn command with the -x flag set to specify a
number of pages greater than 128. You can increase the number of pages to any
value; the following table shows suggested guidelines.
Number of Files
default (128)
3,600
100,000
256
7,200
200,000
512
14,400
300,000
768
21,600
400,000
1024
28,800
800,000
2048
57,600
If you make a file domain using the -p or -x flags to increase the BMT extent
allocations, you must use the same flag with the same number of pages when you
add a volume to the file domain with the addvol command. See addvol(8) for
information about adding a volume to a file domain.
Use a value in the -x num_pages argument that maintains the following ratio
between the BMT extent size (the number of pages for the -x parameter) and the
log file size (the number of pages for the -l parameter):
BMT extent size <= (log file size * 8184) / 4
It takes about one minute to process 5000 BMT extent size pages with the -x flag.
A process that initiates a BMT extent size operation must take into account that very
large values for -x will take a long time to complete.
mkfset
Description
domain specifies the name of an existing AdvFS file domain. fileset specifies
the name of the fileset to be created in the specified file domain.
Operation
You must create at least one fileset per file domain; however, you can create
multiple filesets within a file domain. You can mount and unmount each fileset
independently of the other filesets in the file domain. You can assign fileset quotas
(block and file usage limits) to filesets. You must have root user privilege to use this
utility.
Each fileset within a domain must have a unique name of up to 31 characters. All
whitespace characters (tab, new line, space and so on) and the / # : * ? characters
are invalid for fileset names.
Tru64 UNIX supports an unlimited number of filesets per system; only 512 filesets
can be mounted at one time.
mountlist
Description
Operation
The ncheck command lists i-number or tag and path name for all files in a file
system.
/usr/sbin/ncheck [-i numbers] [-asm] filesystem
filesystem specifies one or more file systems. Specify any file system by
entering its full path name. The full path name is the file systems mount point in
the /etc/fstab file. You can also specify a UFS file system by entering the
name of its device special file. You can specify an AdvFS fileset by entering the
name of the file domain, a pound sign (#) character, and the name of the fileset. For
example: root_domain#root.
Options
-a
Includes in the list the path names . (dot) and .. (dot dot), which are
ordinarily suppressed.
-i numbers
Lists only those files with the specified i-numbers (UFS) or tags (AdvFS).
-m
Includes in the list the mode, UID, and GID of the files. To use this flag
you must also specify the -i or the -s flag on the command line.
-s
Lists only the special files and files with set-user-ID mode.
Operation
The ncheck command with no flags generates a list of all files on every specified
file system. The list includes the path name and the corresponding i-number or tag
of each file. Each directory file name in the list is followed by a /. (slash dot). Use
the available flags to customize the list to include or exclude specific types of files.
The files are listed in order by i-number or tag. To sort the list in a more useful
format, pipe the output to the sort command.You must have root user privilege to
access this command.
The ncheck command checks the /etc/fstab file for the specified domain and
file system entry. If there is no entry in /etc/fstab for the specified file system,
an error message is displayed to indicate that the file does not exist.
nvbmtpg
Description
The nvbmtpg command displays pages of an AdvFS BMT file. This command is
new in Tru64 UNIX V5.0. This command should be used in place of the vbmtpg
and vbtmchain commands provided in earlier releases.
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
/sbin/advfs/nvbmtpg
[-R]
[-R]
[-R]
[-R]
[-R]
[-R]
[-R]
[-R]
[-R]
bmt_id specifies the BMT file on an AdvFS volume or a BMT file that has been
saved as a dump_file. Use the following format if you want to specify a dump
file:
volume_id | [-F] dump_file
Specify the -F flag to force the command to interpret the name you supply as a file
name.
domain_id specifies an AdvFS file domain using the following format:
[-r] [-D] domain
Specify the -r flag to operate on the raw device (character device special file) of
the domain instead of the block device. Specify the -D flag to indicate the domain
argument is to be used as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -S flag to indicate the fileset argument is to be used as the fileset
name. Specify the fileset by entering either the name of the fileset, fileset, or the
filesets tag number, -T fileset_tag.
file_id specifies a file name in the following format:
file
| [-t] file_tag
Specify the file by entering either the files pathname, file, or the files tag number,
-t file_tag.
dump_file specifies the name of a file that contains the output from this utility.
mcell specifies the number of a metadata cell (mcell) from a file. page specifies
the file page number of a file.
Options
-a
-b block
-c
-d dumpfile
Specifies the name of a file that will hold the contents of the
specified BMT file.
-F
-f
-l
-R
-s b block
-s f frag
Specifies the number of a file fragment in the frag file for a fileset.
When you use this flag, the utility searches all BMT files (there is
one on each AdvFS volume) for a mcell that:
-s t tag
Specifies the file tag number. The utility searches one or all of the
BMT files for a mcell with this tag.
-T fileset_tag
-t file_tag
-v
volume
volume_index
Operation
The nvbmtpg utility formats, dumps, and displays pages of the bitfile metadata
table (BMT) files. BMTs are composed of mcells. Each file in an AdvFS domain
is described by a collection of mcells. The mcells for each file are chained together.
The first mcell in a chain is called the primary mcell.
AdvFS creates one BMT file for each AdvFS volume in an AdvFS file domain.
AdvFS first creates a BMT file on the volume you specify when you run the
mkfdmn utility to create an AdvFS file domain. As you add volumes to the domain
with the addvol utility, a BMT file is created on each added volume.
The BMT file for a volume never migrates from the volume. When you remove a
volume from a domain, the BMT file on the removed volume is, like the volume
itself, no longer accessible.
A BMT file is an array of 8 Kbyte file pages, each page containing a header and an
array of metadata cells (mcells). The purpose of a BMT file is to contain all the
metadata for all files that are stored on an AdvFS volume.
You can use this command to:
Display a summary of the BMT on one AdvFS volume or a summary of all the
BMT files (there is one per volume) in a domain.
Display a page of mcells or one mcell or a chain of mcells. The page can be
specified by BMT page number or volume block number. An mcell can be
specified by a number or by specifying the primary mcell of a file.
Search for a mcell based on an extent that maps a volume block or a file that
uses a given frag ID.
The nvfragpg command displays the pages of an AdvFS frag file. This
command is new in Tru64 UNIX V5.0. This command should be used in place of
the vfragpg command provided in earlier releases.
/sbin/advfs/nvfragpg [-v] [-f] frag_id
/sbin/advfs/nvfragpg [-v] [-f] frag_id page
/sbin/advfs/nvfragpg volume_id -b block
/sbin/advfs/nvfragpg [-v] [-f] domain_id fileset_id -d dump_file
The dump_file is a previously-saved copy of a frag file. Use the -F flag to force
the utility to interpret the dump_file as a file name when it has the same name as
a domain name.
domain_id specifies an AdvFS file domain using the following format:
[-r] [-D] domain
Specify the -r flag to operate on the raw device (character device special file) of
the domain instead of the block device. Specify the -D flag to force the utility to
interpret the name you supply in the domain argument as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -V flag to force the utility to interpret the name you supply in the
volume argument as a volume name. The volume name argument also can be a
full or partial path name, for example /dev/disk/dsk12a or dsk12a.
Alternatively, specify the volume by using arguments for its domain,
domain_id, and its volume index number, volume_index.
fileset_id specifies an AdvFS fileset using the following format:
[-S] fileset | -T fileset_tag
Specify the -S flag to force the command to interpret the name you supply as a
fileset name. Specify the fileset by entering either the name of the fileset, or the
filesets tag number, -T fileset_tag.
file_id specifies a file name in the following format:
file
| [-t] file_tag
-d dumpfile
Specifies the name of a file that contains the output of this utility.
-f
-v
Operation
Use the nvfragpg utility to display information about frag file metadata.
Each fileset in an AdvFS domain has one frag file. Frag files are collections of file
fragments. The collections of file fragments in a frag file are called groups, because
the file fragments are grouped by file fragment size: file fragments of 1 Kbyte or
less are collected in one group; file fragments more than 1 Kbyte up to 2 Kbytes are
collected in another group; and so on, up to a group that contains file fragments that
are more than 7 Kbytes up to 8 Kbytes.
The first 1024 bytes of each group in a frag file contains the metadata for the file
fragments in the group. A group is never larger than 128 Kbytes, so a group that
collects 1 Kbyte fragments can hold at most 127 fragments, a group that collects 2
Kbyte fragments can hold at most 63 fragments, and so on. A group that collects 8
Kbyte fragments can hold at most 15 fragments.
You can use the nvfragpg command to:
Display a summary
The nvlogpg command displays the log file of an AdvFS file domain. This
command is new in Tru64 UNIX V5.0 and should be used in place of the vlogpg
and vlsnpg commands provided in DIGITAL UNIX Version 4.0x releases and in
place of the logread command in DIGITAL UNIX Version 3.2x releases.
/sbin/advfs/nvlogpg
/sbin/advfs/nvlogpg
/sbin/advfs/nvlogpg
/sbin/advfs/nvlogpg
/sbin/advfs/nvlogpg
/sbin/advfs/nvlogpg
log_id
[-v | -B]
[-v | -B]
[-v | -B]
domain_id
[-v | -B]
log_id specifies a log file in an AdvFS domain or a log file that has been saved
by the utility as a dump_file. Use the following format:
domain_id | volume_id [-F] dump_file
Specify the -F flag to force the utility to interpret the name you supply as a file
name.
domain_id specifies an AdvFS file domain using the following format:
[-r] [-D] domain
Specify the -r flag to operate on the raw device (character device special file) of
the domain instead of the block device. Specify the -D flag to force the utility to
interpret the name you supply in the domain argument as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -V flag to force the utility to interpret the name you supply in the
volume argument as a volume name. The volume name argument also can be a
full or partial path for the volume, for example /dev/disk/dsk12a or
dsk12a. Alternatively, specify the volume by using arguments for its domain,
domain_id, and its volume index number, volume_index.
dump_file specifies the name of a file that contains the output from this utility.
page specifies the file page number of a file. page_offset specifies the offset
in the log file. record_offset specifies a byte offset in a page of the log file.
Options
-a
-B
Specifies that only the transaction id for each log file entry be
displayed.
-b block
-d dump_file
Specifies the name of a file that will hold the contents of the
specified log file.
-e
Specifies that the last active record in the log file is to be displayed.
-f
-s
Specifies that the first active record in the log file (the start of the
log file) is to be displayed.
-v
Operation
The nvlogpg command locates the log file of an AdvFS file domain and displays
records from it in various ways.
The log file for a domain is a bitfile, organized as an array of 8KB disk pages. Each
page consists of a fixed-size header record, a number of variable-sized data records,
and a variable-sized trailer record. Each data record consists of a fixed-size header
and a variable amount of data.
The log file for a domain contains the metadata, the log, of each transaction. Before
a transaction is written to disk, its logged metadata is written to disk. Because the
log of a transaction contains the information necessary to redo the transaction, the
file system can maintain consistency on disk and recover from transaction failures
when they occur. These transactions and the metadata they include are used to
replay transactions that did not complete, for example if the system crashed, when
the domain is next activated.
Using this command you can:
Display a summary
It can be misleading to use this utility with the -r flag on a domain with mounted
filesets. The utility does not synchronize its read requests with AdvFS file domain
read and write requests. For example, the AdvFS can be writing to the disk as the
utility is reading from the disk. Therefore, metadata may not have been flushed in
time for the utility to read it and consecutive reads of the same file page may return
unpredictable or contradictory results. To avoid this problem, do not use the -r
flag on an active domain.
The utility can fail to open a block device, even when there are no filesets mounted
for the domain and the AdvFS daemon, advfsd, is running. The daemon, as it
runs, activates the domain for a brief time. If the nvlogpg utility fails in this
situation, run it again.
nvtagpg
Description
The nvtagpg command displays a page formatted as a tag file page. This
command is new in Tru64 UNIX V5.0. This command should be used in place of
the vtagpg command provided in earlier releases.
/sbin/advfs/nvtagpg
/sbin/advfs/nvtagpg
/sbin/advfs/nvtagpg
/sbin/advfs/nvtagpg
/sbin/advfs/nvtagpg
/sbin/advfs/nvtagpg
[-v] tag_id
[-v] tag_id | {page | -a}
[-v] fileset_id file_id
domain_id fileset_id -d dump_file
domain_id -d dump_file
volume_id -b block
The roottag_id parameter specifies the root tag file using the following format:
domain_id | [-F] dump_file
The dump_file parameter is a previously-saved copy of the filesets tag file. You
can use the -F flag to force the utility to interpret the dump_file parameter as a
file name if it has the same name as a domain name.
filesettag_id specifies a fileset tag file using the following format:
domain_id fileset_id | [-F] dump_file
Specify the -r flag to operate on the raw device (character device special file) of
the domain instead of the block device. Specify the -D flag to force the utility to
interpret the name you supply in the domain argument as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -V flag to force the utility to interpret the name you supply in the
volume argument as a volume name. The volume name argument also can be a full
or partial path for the volume, for example /dev/disk/dsk12a or dsk12a.
Alternatively, specify the volume by using arguments for its domain,
domain_id, and its volume index number, volume_index.
fileset_id specifies an AdvFS fileset using the following format:
[-S] fileset | -T fileset_tag
Specify the -S flag to force the command to interpret the name you supply as a
fileset name. Specify the fileset by entering either the name of the fileset, fileset, or
the fileset's tag number, -T fileset_tag.
file_id specifies a file name in the following format:
[-F] file
| [-t] file_tag
Specify the -F flag to force the command to interpret the name you supply as a file
name. Specify the file by entering either the files pathname, file, or the files tag
number, -t file_tag.
page specifies the file page number of a file.
Options
-a
-b block
-d dump_file
Specifies the name of a file that will hold the contents of the
specified tag file.
-v
Operation
The nvtagpg utility displays formatted pages of a root tag file or a fileset tag file.
The utility can also save a copy of a tag file.
Each AdvFS domain has a root tag file that lists all the filesets in the domain. Each
fileset has a tag file that lists all the files in the fileset.
Use the nvtagpg command to:
It can be misleading to use this utility with the -r flag on a domain with mounted
filesets. The utility does not synchronize its read requests with AdvFS file domain
read and write requests. For example, the AdvFS can be writing to the disk as the
utility is reading from the disk. Therefore, metadata may not have been flushed in
time for the utility to read it and consecutive reads of the same file page may return
unpredictable or contradictory results. To avoid this problem, do not use the -r
flag on an active domain.
The utility can fail to open a block device, even when there are no filesets mounted
for the domain and the AdvFS daemon, advfsd is running. The daemon, as it
runs, activates the domain for a brief time. If the nvtagpg utility fails in this
situation, run it again.
rmfdmn
Description
Operation
The rmfdmn utility enables you to remove an unused file domain. Before you can
remove a file domain, unmount all filesets and clone filesets from the domain using
the umount command. If you try to remove a file domain that has mounted
filesets, the system displays an error message indicating that a fileset is mounted.
AdvFS will not remove the file domain.
The -f flag is useful for scripts when you do not want to be queried for each file
domain. If you choose the -f flag, no message prompt will display. The rmfdmn
command will operate as if you responded yes to the prompt.
You must have root user privilege to use this command.
You must update the /etc/fdmns directory to delete the file domain entry for the
deleted file domain.
rmfset
Description
The rmfset command removes a fileset or a clone fileset from an AdvFS file
domain.
/sbin/rmfset [-f] domain fileset
domain specifies the name of an existing AdvFS file domain. fileset specifies
the name of the fileset to be removed from the specified file domain.
Options
-f
Operation
The rmfset command removes a fileset (and all of its files) from an existing
AdvFS file domain.
Unmount the fileset before removing it with the rmfset command. A fileset or
clone fileset cannot be removed with this command if it is mounted. A fileset that
has a clone fileset cannot be removed with this command until the clone fileset has
been removed.
The -f flag is useful for scripts or when you do not want to be queried about each
fileset. If you choose the -f flag, no prompts are displayed.
You must have root user privilege to use this command.
rmvol
Description
The rmvol command removes a volume from an existing AdvFS file domain.
/usr/sbin/rmvol [-f][-v] special domain
special specifies the block device special file name, such as /dev/disk/
dsk2c, of the volume that you are removing from the file domain. domain
specifies the name of an existing AdvFS file domain.
Options
-f
-v
Displays messages that describe which files are moved off the specified volume.
Using this flag slows the rmvol process.
Operation
The rmvol utility enables you to decrease the number of volumes within an
existing file domain. When you attempt to remove a volume, the file system
automatically migrates the contents of that volume to another volume in the file
domain.
The logical structure of the filesets in a file domain is unaffected when you remove
a volume. If you remove a volume that contains a stripe segment, the rmvol utility
moves the segment to another volume that does not already contain a stripe segment
of the same file. If a file is striped across all volumes in the file domain, the utility
requests confirmation before placing a second stripe segment on a volume that has
one.
Before you can remove a volume from a file domain, all filesets in the file domain
must be mounted. If you try to remove a volume from an active file domain that
includes unmounted filesets, the system displays an error message indicating that a
fileset is unmounted. This message is repeated until you mount all filesets in the file
domain.
If you attempt to remove a volume from an inactive file domain, the system returns
the ENO_SUCH_DOMAIN error message. A file domain is inactive when none of its
filesets is mounted. In this case, the rmvol command does not remove the volume.
If there is not enough free space on other volumes in the file domain to accept the
offloaded files from the departing volume, the rmvol utility moves as many files
as possible to free space on other volumes. Then a message is sent to the console
indicating that there is not enough space to complete the procedure. The files that
were not yet moved remain on the original volume.
You can interrupt the rmvol process without damaging your file domain. AdvFS
will stop removing files from the volume. Files already removed from the volume
will remain in their new location. Interrupting a rmvol operation with the kill
command can leave the volume in an inaccessible state. If a volume does not allow
new allocations after an rmvol operation, use the chvol command with the -A
flag to reactivate the volume.
You cannot run the rmvol utility while the defragment, balance, rmfset,
or rmvol utility is running on the same domain.
You must have root user privilege to use this utility.
salvage
Description
The salvage command recovers file data from damaged AdvFS file domains.
This is a new command in the Tru64 UNIX Version 5.0 release. (A field test version
of salvage is in the DIGITAL UNIX Version 4.0D release.)
/sbin/advfs/salvage [-x|-p] [-l] [-S] [-v number]
[-d time] [-D directory] [-L path] [-o option]
{ -V special [-V special]... | domain } [fileset[path]]
domain specifies the name of an existing AdvFS file domain from which filesets
are to be recovered. Use this parameter when you want the utility to obtain volume
information from the /etc/fdmns directory. The volume information used by
the utility consists of the device special file names of the AdvFS volumes in the file
domain. When the domain parameter is specified without optional arguments, the
utility attempts to recover the files in all filesets in the domain.
Do not use this parameter when you want to use the -V special flag to specify device
special file names of AdvFS volumes. If you do, the utility displays an error
message and exits with an exit value of 2.
fileset [path] specifies the name of a fileset to be recovered from a domain
or a volume.
Specify path to indicate the path of a directory or file in a fileset. When you
specify a path that is a directory, the utility attempts to recover only the files in that
directory tree, starting at the specified directory. When you specify a path that is a
file, the utility attempts to recover only that file. Specify path relative to the mount
point of the fileset.
Options
-d time
-D directory
Specifies the path of the directory to which all recovered files are written. If you do not
specify a directory, the utility writes recovered files to the current working directory.
-l
Specifies verbose mode for messages written to the log file for every file that is encountered
during the recovery. If you do not specify this flag, the utility writes a message to the log
file only for partially recovered and unrecovered files.
-L path
Specifies the path of the directory or the file name for the log file you choose to contain
messages logged by this utility. If you include a log file name in the path, the utility uses
that file name. If no log file name is specified, the utility places the log file in the specified
directory and names it salvage.log.pid (PID is the process ID of the user process).
When you do not specify this flag, the utility places the log file in the current working
directory and names it salvage.log.pid.
-o option
Specifies the action the utility takes when a file being recovered already exists in the
directory to which it is to be written. The values for option are:
yes, overwrite the existing file without querying the user. This is the default action
when option is not specified.
-p
Specifies that the utility identifies a partially covered file by appending a .partial to
its file name.
-S
Specifies that the utility is to run in sequential search mode, checking each page on each
volume in the domain. This mode of operation will take a long time on large AdvFS file
domains. This flag can be used to recover most files from a domain which has been
damaged from an incorrect execution of the mkfdmn utility. In some cases, the recovery
will need to generate names based on the file's tag number. These cases usually happen in
the root directory, because mkfdmn usually overwrites this directory.
When you specify this flag, there may be a security issue, because the utility could recover
old filesets and deleted files.
-F format
Specifies that salvage should recover files in an archive format. The only legitimate value
for format is tar.
-f [archive]
Salvage uses the next argument as the name of an archive. If the name is -, salvage writes
to standard output.
-v number
Specifies the type of messages directed to stdout. If you do not specify this flag, the
default is to direct only error messages to stdout. If you specify number to be 1, both
errors and the names of partially recovered files are directed to stdout. If you specify
number to be 2, error messages and the status of all files as they are recovered are directed
to stdout.
-V special
[-V special]
Specifies block device special file names of volumes in the domain, /dev/disk/dsk3c.
The utility attempts to recover files only from the volumes you specify. If you do not
specify the -V flag, you must specify the domain parameter so that the utility can obtain the
special file names of the volumes in the domain from the /etc/fdmns directory. Do not
use this flag with the domain parameter. If you do, an error message is displayed and the
utility exits with an exit value of 2.
-x
Specifies that partially recoverable files are not to be recovered. If you do not use this flag,
partially recoverable files are recovered. Do not use the -x flag with the -p flag. If you
do, the utility displays an error message and exits with an exit value of 2.
Operation
The salvage utility helps you recover file data after an AdvFS file domain has
become unmountable due to some type of data corruption. Errors that could cause
data corruption of a file domain include I/O errors in file system metadata, the
accidental removal of a volume, or any I/O error that produces a panic.
Use the salvage utility as a last resort. You should first repair domain structures
by using the verify utility. If that repair method is unsatisfactory, attempt to
recover fileset data from backup media. Only if both methods are unsatisfactory
should you employ the salvage utility.
The salvage utility opens and reads block devices directly and could present a
security issue if it recovers data remaining from previous AdvFS file domains while
attempting to recover data from current AdvFS file domains.
The salvage utility can be run in single user mode, without mounting other file
systems. The salvage utility is available from the UNIX Shell option when you are
booting from the Tru64 UNIX Operating System Volume 1 CDROM.
The salvage utility can find metadata on disk that appears valid but might not be:
in most cases, the utility can determine when this suspect metadata should be used
or ignored. One of these problems that the utility cannot detect is the situation when
the metadata contains a tag number that could be valid on a fileset with a very large
number of files, but is usually invalid for common filesets. In this case, the utility
creates a partial file in the lost+found directory.
The salvage utility has a built-in soft limit on the number of valid tags in a fileset:
10,000,000 tags. If an application should exceed this soft limit, the user is prompted
about increasing the limit.
You must have root user privilege to use the salvage utility.
Before using the salvage utility, all filesets in the domain you are trying to
recover probably have already been unmounted. However, use the umount(8)
command to ensure that the filesets are unmounted.
savemeta
Description
/tag_file
Options
-L
-S
-T
Does not save the domains root tag file to the savedir.
-t
-f
Saves the structure information from the frag file in each fileset to the savedir.
shblk
Description
-bc block_count
Operation
Use this command to display how much space is used on the frag file.
/sbin/advfs/shfragbf file_system /.tags/l
file_system specifies the fileset mount point of the file system to display.
Operation
The frag type is listed as 0K when the frag file is not in use. The type is listed
as 1K for 1K frags, and so forth.
The showfdmn command displays the attributes of a file domain and detailed
information about each volume in the file domain.
/sbin/showfdmn [-k] domain
Displays the total number of blocks and the number of free blocks in terms of
1K blocks instead of the default 512-byte blocks.
Operation
Id is a unique number (in hexadecimal format) that identifies the file domain.
Date Created is the day, month, and time that a file domain was created.
LogPgs is the number of 8-kilobyte pages in the transaction log of the specified
file domain.
Vol is the volume number within the file domain. An L next to the number
indicates that the volume contains the transaction log.
Free is the number of blocks in a volume that are available for use.
% Used is the percent of the volume space that is currently allocated to files or
metadata.
Rblks is the maximum number of 512-byte blocks read from the volume at one
time.
Wblks is the maximum number of 512-byte blocks written to the volume at one
time.
Vol Name is the name of the special device file for the volume.
For multivolume file domains, the showfdmn command also displays the total
volume size, total number of free blocks, and the total percent of volume space
currently allocated.
A file domain must be active before the showfdmn command can display volume
information. A file domain is active when at least one fileset in the file domain is
mounted.
showfile
Description
The showfile command displays the attributes of one or more AdvFS files.
/usr/sbin/showfile [-i] [-h | -x] filename...
-i
When a filename is a directory, displays the attributes for the directorys index file.
(V5.x only)
-x
Displays full storage allocation map (extent map) for files in an Advanced File System.
Operation
The showfile command also displays the extent map of each file. An extent is a
contiguous area of disk space that the file system allocates to a file. Simple files
have one extent map; striped files have an extent map for every stripe segment.
You can list AdvFS attributes for an individual file or the contents of a directory.
Although the showfile command lists both AdvFS and non-AdvFS files, the
command displays meaningful information for AdvFS files only.
The showfile command displays the following file attributes:
Id is the unique number (in hexadecimal format) that identifies the file. Digits
to the left of the dot (.) character are equivalent to a UFS inode.
Vol is the location of primary metadata for the file, expressed as a number. The
data extents of the file can reside on another volume.
XtntType is the extent type. The extent type can be simple, which is a
regular AdvFS file without special extents; stripe, which is a striped file;
symlink, which is a symbolic link to a file; usf, nfs, and so on. The
showfile command cannot display attributes for symbolic links or nonAdvFS files.
Segs is the number of stripe segments per striped file, which is the number of
volumes a striped file crosses. (Applies only to stripe type.)
SegSz is the number of pages per stripe segment. (Applies only to stripe type.)
File is the name of the directory or file. If the file is a directory that has an
index file associated with it and the -i flag has not been specified, the statistics
displayed are for the directory. The term index follows the directory name. If
the file is a directory that has an index file associated with it and the -i flag is
specified, the statistics displayed are for the index file associated with the
directory. The name of the directory follows the index.
Whereas a simple file has one extent map, a striped file has more than one extent
map. An extent map displays the following information:
showfsets
Description
The showfsets command displays the filesets (or clone filesets) and their
characteristics in a specified domain.
/sbin/showfsets [-b | -q] [-k] domain [fileset...]
domain specifies the full path name of the file domain. fileset... specifies
the name of one or more filesets.
Options
-b
-k
Displays the total number of blocks and the number of free blocks in terms of 1K blocks
instead of the default 512-byte blocks.
-q
Operation
Files specifies the number of files in the fileset and the current file usage
limits (quotas). SLim, the soft limit, is a quota that can be exceeded for a fixed
period of time and HLim, the hard limit, is a quota that cannot be exceeded.
Blocks specifies the number of blocks that are in use by a mounted fileset and
the current block soft and hard usage limits (quotas). For filesets that are not
mounted, zero blocks will display. For an accurate display, the fileset must be
mounted.
The showfsets command with the -q flag set displays block and file information
for a specified domain or for one or more named filesets in the domain. The
characteristics of a named fileset are:
BF (block flag) specifies block (B) and file (F) usage limits. A + in this
field means that the soft block usage is exceeded; a * means that the hard limit
is reached.
Block (512) Limits specifies the number of blocks used, the soft limit
(the number of blocks that can be exceeded for a period of time), the hard limit
(the number of blocks that cannot be exceeded), and the grace period (the
remaining time for which the soft limit may be exceeded).
File Limits specifies the number of files used, the soft and hard file limits
for the fileset, and the grace period remaining.
stripe
Description
The stripe utility enables you to improve the read/write performance of a file by
spreading it evenly across several volumes in a file domain.
/usr/sbin/stripe -n volume_count filename
The stripe utility directs a zero-length file (a file with no data written to it yet) to
be spread evenly across several volumes within a file domain. As data is appended
to the file, the data is spread across the volumes. AdvFS determines the number of
pages per stripe segment and alternates the segments among the disks in a sequential
pattern.
Existing, nonzero-length files cannot be striped using the stripe utility. To stripe an
existing file, create a new file, use the stripe utility to stripe the new file, and copy
the contents of the file you want to stripe into the new striped file. After copying the
file, delete the nonstriped file.
Once a file is striped, you cannot use the stripe utility to modify the number of disks
that a striped file crosses. To change the volume count of a striped file, you can
create a second file with a new volume count, and then copy the contents of the first
file into the second file. After copying the file, delete the first file.
switchlog
Description
vol_id
The switchlog command relocates the transaction log of the specified file
domain to a different volume in the same file domain. Moving the transaction log
within a multivolume file domain is typically done to place the log on either a faster,
less congested, or mirrored volume.
Use the showfdmn command to determine the current location of the transaction
log. In the showfdmn command display, the letter L displays next to the volume
that contains the log. The showfdmn command also displays all of the volumes
and their volume numbers.
You must have root user privilege to execute this command.
tag2name
Description
The tag2name command displays the path name of a file given the tag number.
/sbin/advfs/tag2name tags_directory/tag
/sbin/advfs/tag2name [-r] domain fileset tag
domain specifies the name of an AdvFS file domain. fileset specifies the
name of an AdvFS fileset. tags_directory specifies the relative path of the
AdvFS tags directory for the fileset. tag specifies the AdvFS file tag number.
Options
-r
Specifies this flag to operate on the raw device (character device special file) of the fileset
instead of the block device.
Operation
You must have root user privilege to access this command. The tag you specify
must be numeric and greater than 1.
vbmtchain
Description
The vbtmchain utility displays metadata for a file including the time stamp,
extent map, and whether the file is a user directory or data file. (Valid for V4.x only.
Use nvbmtpg for V5.0.)
/sbin/advfs/vbmtchain BMT_page cell special [special 2...]
BMT_page specifies the page within the bitfile metadata table (BMT) of the
volume that contains the files mcell. cell specifies the cell of the BMT page that
contains the files mcell. special specifies the volume on which the files
primary mcell is located. special 2... specifies the other volumes in this
domain that may be accessed to follow the files mcell chain.
Operation
The file is described by the location of its primary mcell. Each mcell location is
composed of three parts: volume, page within the BMT file located on that volume,
and cell within the BMT page.
The primary mcell for the root tag directory is found in the BMT of the volume
containing the log. To find this volume for a domain, use the showfdmn or the
advscan command. The volume marked "L" contains the log.
Certain metadata files are in fixed locations:
Page
Cell
Volume
Every volume
Storage bitmap
Every volume
The vbmtchain utility displays the attributes of the file including the time stamp,
the extent map, and whether the file is a user directory or a data file.
You must have root user privileges to access this command.
vbmtpg
Description
The vbmtpg utility displays a complete, formatted page of the BMT for a mounted
or unmounted domain. (Valid for V4.x only. Use nvbmtpg for V5.0.)
/sbin/advfs/vbmtpg special [page_LBN]
special specifies the volume on which the page is located. page_LBN specifies
the logical block number (LBN) of the requested page; the default is 32 which is
page zero of the bitfile metadata table (BMT).
Operation
The vbmtpg utility is useful for debugging when there has been some seemingly
random file corruption.
Note that the vbmtchain command displays all the mcells associated with a given
file whereas the vbmtpg command displays a page of information. This page may
contain information for more than one file and may not provide complete
information on any file.
vdf
Description
The vdf utility displays disk information for AdvFS domains and filesets. This
command is new in Tru64 UNIX V5.0
/sbin/advfs/vdf [-k][-l] domain | domain#fileset
domain is the full path name of an AdvFS file domain. When a domain argument
is specified, the default display contains information about: the number of disk
blocks allocated to the domain; the number of disk blocks in use by the domain; and
the number of disk blocks that are available to the domain.
domain#fileset is the name of an AdvFS fileset in an AdvFS file domain.
When a domain#fileset argument is specified, the default display contains
information about: the number of disk blocks allocated to the fileset; the number of
disk blocks in use by the fileset; and the number of disk blocks that are available to
the fileset. This information is in the same format as that displayed by the df
command.
Options
-k
Displays disk blocks as 1024-byte blocks instead of the default of 512-byte blocks.
-l
Specifies that the default information for both the domain and filesets is reformatted to
show the relationships between them. For example, any domain metadata displayed is the
total metadata shared by filesets in the domain.
Operation
The vdf utility is a script that reformats output from the showfdmn,
showfsets, shfragbf, and df utilities in order to display information about
the disk usage of AdvFS file domains and filesets. In addition, the utility computes
and displays the sizes of metadata files in a domain or fileset.
The disk space used by clone filesets is not calculated. If clone filesets are present
in the specified domain, the utility displays a warning message.
The vdump (rvdump) utility performs full and incremental backups on filesets.
/sbin/vdump -h
/sbin/vdump -V
/sbin/vdump -w
/sbin/vdump [-0..9] [-CDNUquv] [-F num_buffers] [-T tape_num]
[-b size] [-f device] [-x num_blocks] fileset
/sbin/rvdump -h
/sbin/rvdump -V
/sbin/rvdump -w
/sbin/rvdump [-0..9] [-CDNUquv] [-F num_buffers]
[-T tape_num] [-b size] [-f nodename:device]
[-x num_blocks] fileset
fileset specifies the full path name of a mounted AdvFS fileset to be backed up.
Alternatively, specifies a mounted NFS or UFS file system. When used with the D flag, specifies a subdirectory.
Options
-h
-V
-w
Displays the filesets that have not been backed up within one week.
-0..9
Specifies the backup level. The value 0 for this flag causes the entire fileset to be backed
up to the storage device. The default backup level is 9.
-C
Compresses the data as it is backed up, which minimizes the saveset size.
-D
Performs a level 0 backup on the specified subdirectory. This flag overrides any
backup level specification in the command. If this flag is specified, the AdvFS user and
group quota files and the fileset quotas are not backed up.
-N
-P
Produces backward compatible savesets that can be read by earlier versions of the
vrestore command.
-U
-q
-u
-v
-F num_buffers
Specifies the number of in-memory buffers to use. The valid range is 2 through 64
buffers; the default is 8 buffers. The size of the in-memory buffers is determined by the
value of the -b flag.
-T tape_num
Specifies the starting number for the first tape. The default number is 1. The tape number
is used only to prompt the operator to load another tape in the drive.
-b size
Specifies the number of 1024-byte blocks per record in the saveset. The valid range is
1 through 64 blocks; the default is 60 blocks per record. The value of this flag also
determines the size of the in-memory buffers.
-f device
Specifies the destination of the saveset. For vdump, the local destination can be a
device, a file, or, when the - (dash) character is specified, standard output. For rvdump,
the specification must be in the format nodename:device to specify the remote
machine name that holds the device, file, or standard output.
-f node:device
-x num_blocks
Operation
The vdump command backs up files and any associated extended attributes
(including ACLs, see the proplist(4) and acl(4) reference pages) from a single
mounted fileset or clone fileset to a local storage device.
The rvdump command backs up files and any associated extended attributes
(including ACLs, see the proplist(4) and acl(4) reference pages) from a single
mounted fileset or clone fileset to a remote storage device.
The vdump and rvdump commands are the backup facility for the AdvFS file
system. However, the commands are file-system independent, and you can use
them to back up other file systems, such as UFS and NFS.
The commands back up all files in the specified fileset that are new or changed since
a certain date and produce a saveset on the storage device. The date is determined
by comparing the specified backup level to previous backup levels recorded in the
/etc/vdumpdates file. The default storage device is /dev/tape/
tape0_d1. You can specify an alternate storage device by using the -f flag.
The commands perform either an incremental backup, level 9 to 1, or a full backup,
level 0, depending on the desired level of backup and the level of previous backups
recorded in the /etc/vdumpdates file. The commands back up all files that are
new or have changed since the latest backup date of all backup levels that are lower
than the backup level being performed. If a backup level that is lower than the
specified level does not exist, the commands initiate a level 0 backup. A level 0
backup backs up all the files in the fileset.
After the backup operation is complete, you can use the vrestore -t command
to verify that the backup contains the files you wanted to save. This command lists
the name and size of each file in the saveset without restoring them.
The vdump and rvdump commands do not back up filesets that are not mounted.
Filesets backed up by using the vdump or the rvdump command must be restored
by using the vrestore or the rvrestore command. The vdump and rvdump
commands are not interchangeable with the dump and rdump commands.
Similarly, the vrestore and the rvrestore commands are not interchangeable
with the restore and rrestore commands.
The vrestore command in DIGITAL UNIX versions earlier than Version 4.0
cannot be used to restore savesets produced by the vdump command in DIGITAL
UNIX Version 4.0 or higher systems.
The /etc/vdumpdates file is written in ASCII and consists of a single record
per line. You must be the root user to update this file or to change any record field.
If you edit the /etc/vdumpdates file, be certain that all records follow the
correct format. An incorrectly formatted record in this file may make the file
inaccessible for updates or reads.
See the manpage for more information.
verify
Description
The verify command checks on-disk structures such as the bitfile metadata table
(BMT), the storage bitmaps, the tag directory and the frag file for each fileset. The
verify command should be used in place of the msfsck and vchkdir commands
available in DIGITAL UNIX V3.2x.
/sbin/advfs/verify [-a | -f] [-l | -d] [-v | -q] [-t] [-r] [-F]
domain_name
-f
-d
-D
Checks a domain previously mounted with the -o dual option of the mount command.
-l
-v
Prints file status information. Selecting this flag slows down the verify procedure.
-q
-t
-r
-F
Mounts filesets of a file domain using mount -d option if there is a mount failure of the
file domain. Use this flag with caution.
Operation
This command verifies that the directory structure is correct and that all directory
entries reference a valid file (tag) and that all files (tags) have a directory entry.
The verify command checks the storage bitmap for double allocations and
missing storage. It checks that all mcells in use belong to a bitfile and that all
bitfiles have all of their mcells.
The verify command checks the consistency of free lists for mcells and tag
directories. It checks that the mcells pointed to by tags in the tag directory match
the corresponding mcells.
For each fileset in the specified file domain, the verify command checks the frag file
headers for consistency. For each file that has a fragment, the frag file is checked
to ensure that the frag is marked as in use.You must have root user privilege to
access this command.
Unless you are checking the root domain, all filesets in the file domain must be
unmounted. The verify command automatically mounts all of the filesets in a file
domain individually. If you choose the -r option when you run the verify
command on the root domain, all filesets in the root domain must be mounted.
Run verify on /root and /usr from a single user mode. To run verify in
single user mode, you must first run a mount update on the root (mount -u /).
To run the command from multiuser mode, dismount any file system that you have
mounted as /root or /usr and make sure there is no file activity.
If you run the verify command on a fileset that has any other file system (AdvFS
or otherwise) mounted on it, an error results. If you have a fileset erroneously
labeled as UFS and it overlaps a fileset labeled AdvFS, an error results. You can
recover from this error by changing the erroneously-labeled filesets fstype field
from ufs to unused with the disklabel -s command. After changing the disk
label, run the verify command.
If the -F option is specified and the verify command is unable to mount a fileset
due to a failure of the file domain, the fileset is mounted using the mount -d
option. Use this option with extreme caution and only as a last resort when you
cannot mount a fileset. The mount -d option mounts an AdvFS fileset without
running recovery on the file domain. Mounting without running recovery will
cause your file domain to be inconsistent.
If you use the -F option, the verify command starts some recovery on the file
domain before you mount it.
vfile
Description
The vfile utility outputs the contents of a file from an unmounted domain. In
Tru64 UNIX Version 5.0, the vfilepg command should be used in place of this
command.
/sbin/advfs/vfile BMT_page cell special [special 2 ...]
BMT_page specifies the page within the bitfile metadata table (BMT) of the
volume that contains the files mcell. cell specifies the cell of the BMT page that
contains the files mcell. special specifies the volume on which the files primary
mcell is located. special 2... specifies the other volumes in this domain that
may be accessed to follow the files mcell chain.
Operation
The file is identified by the location of its primary mcell. Each mcell location is
composed of three parts: volume, page within the BMT file located on that volume,
and cell within the BMT page.
The primary mcell for the root tag directory is found in the BMT of the volume
containing the log. To find this volume for a domain, use the showfdmn or the
advscan command. The volume marked "L" contains the log.
Certain metadata files are in fixed locations:
Page
Cell
Volume
Every volume
Storage bitmap
Every volume
The vfilepg command displays pages of an AdvFS file. This command is new
in Tru64 UNIX V5.0. The vfilepg command should be used in place of the
vfile command.
/sbin/advfs/vfilepg domain_id fileset_id file_id [ page | -a ]
[-f d ]
/sbin/advfs/vfilepg volume_id -b block
/sbin/advfs/vfilepg domain_id fileset_id file_id -d dump_file
/sbin/advfs/vfilepg [-F] dump_file [ page | -a ] [-f d ]
Specify the -r flag to operate on the raw device (character device special file) of
the domain instead of the block device. Specify the -D flag to force the utility to
interpret the name you supply in the domain argument as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -V flag to force the utility to interpret the name you supply in the
volume argument as a volume name. The volume name argument also can be a full
or partial path for the volume, for example /dev/disk/dsk12a or dsk12a.
Alternatively, specify the volume by using arguments for its domain,
domain_id, and its volume index number, volume_index.
fileset_id specifies an AdvFS fileset using the following format:
[-S] fileset | -T fileset_tag
Specify the -S flag to force the command to interpret the name you supply as a
fileset name. Specify the fileset by entering either the name of the fileset,
fileset, or the filesets tag number, -T fileset_tag.
file_id specifies a file name in the following format:
file
| [-t] file_tag
Specify the file by entering either the files pathname, file, or the files tag number,
-t file_tag.
dump_file specifies the name of a file that contains the output from this utility.
page specifies the file page number of a file.
Options
-a
-b block
-d dump_file
Specifies the name of a file that will contain the output of this
utility.
-f d
-T fileset_tag
-t fileset_tag
volume
volume_index
Operation
The vfilepg utility formats, dumps, and displays AdvFS file pages. A file page
is the unit of disk storage for AdvFS file: 8 Kbytes of contiguous disk space.
The utility has the following functions:
Format and display one file page or all the file pages of a file. The file can be
in a mounted or unmounted fileset.
Save the contents of a file in one fileset to a file in another fileset. The file
written is called a dump file. The source file can be in a mounted or unmounted
fileset; the output fileset must be mounted.
Format and display a dump file that has been dumped using the utility.
Format and display a disk block of a file. A disk block is always 512 bytes and
is located by specifying its logical block number.
You can specify which file page is to be displayed (page zero is the default), or you
can display all the file pages in a file. The default display of file page information
is in hexadecimal and ASCII formats. If you use the -f d flag, you can specify
that the data be formatted as a directory page as it is displayed.
The utility displays one 8 Kbyte file page unless you specify the -b or -a flags. In
those cases, the utility displays one 512-byte disk block.
It can be misleading to use this utility with the -r flag on a domain with mounted
filesets. The utility does not synchronize its read requests with AdvFS file domain
read and write requests. For example, the AdvFS can be writing to the disk as the
utility is reading from the disk. Therefore, metadata may not have been flushed in
time for the utility to read it and consecutive reads of the same file page may return
unpredictable or contradictory results. To avoid this problem, do not use the -r flag
on an active domain.
The utility can fail to open a block device, even when there are no filesets mounted
for the domain and the AdvFS daemon, advfsd, is running. The daemon, as it
runs, activates the domain for a brief time. If the vfilepg utility fails in this
situation, run it again.
vfragpg
Description
The vfragpg command displays a single header page of a frag file. In Tru64
UNIX Version 5.0, the nvfragpg command should be used in place of this
command.
/sbin/advfs/vfragpg special page_LBN
The vfragpg command allows you to see the structure of a single header page in
a frag file.
Use showfile -x /usr/.tags/1 to locate the logical block number of the
page.
You must have root user privileges to access this command.
vlogpg
Description
special specifies the volume on which the log is located. page_LBN specifies
the logical block number (LBN) of the volume; the default is zero.
Operation
Use this utility with other file utilities for debugging. If the volume is mounted, use
the showfdmn -x command to get the extent map before calling the vlogpg
command. If the volume is unmounted, use the vbmtchain command to identify
the extent information that locates the log.
The vlogpg utility displays the pages and records needed to redo transactions that
were in progress at the time of a crash.
You must have root user privileges to access this command.
vlsnpg
Description
The vlsnpg command displays the logical sequence number (LSN) of a page of
the log. In Tru64 UNIX Version 5.0, the nvlogpg command should be used in
place of this command.
/sbin/advfs/vlsnpg special [page_LBN]
special specifies the volume on which the page is located. page_LBN specifies
the logical block number (LBN) of the requested page; the default is zero.
Operation
Given the device and the LBN, the vlsnpg utility displays the logical sequence
number of the page of the log. The page takes on the logical sequence number (LSN)
of its first record. Use this command in a script to loop through logical sequence
numbers for several pages to find the end of the log.
You must have root user privileges to access this command.
vrestore
Description
The vrestore ( rvrestore) command restores files from savesets that are
produced by the vdump and rvdump commands.
/sbin/vrestore -h
/sbin/vrestore -V
/sbin/vrestore -t [-f device]
/sbin/vrestore -l [-f device]
/sbin/vrestore -i [-mqv] [-f device] [-D path]
/sbin/vrestore -x [-mqv] [-f device] [-D path]
/sbin/rvrestore -h
/sbin/rvrestore -V
/sbin/rvrestore -t [-f nodename:device]
/sbin/rvrestore -l [-f nodename:device]
/sbin/rvrestore -i [-mqv] [-f nodename:device]
/sbin/rvrestore -x [-mqv] [-f nodename:device]
[file ...]
[-o opt]
[-o opt] [file ...]
Options
-h
-V
-t
Lists the names and size (in bytes) of all f iles contained in a saveset.
Exception: the sizes of any AdvFS quota files are not shown.
-l
-i
-x
Extracts a specific file or files from the saveset. Use this command
as an alternate to using the add command in interactive mode. The
-x flag can precede any other options, but the file ... list must
be the last item on the command line.
-m
Does not preserve the owner, group, or modes of each file from the
device.
-q
-v
Writes the name of each file read from the storage device to the
standard output device. Without this flag the vrestore
command does not notify you about progress on reading from the
storage device.
-f device
-f node:device
-o opt
Specifies the action to take when a file already exists. The options
are:
file...
Specifies the file or files to restore when using the -x flag. All
other flags must precede any file names on the command line.
Operation
If the destination fileset is AdvFS, and the saveset contains AdvFS fileset quotas,
the fileset quotas are restored, even when they differ from the fileset quotas of the
destination fileset. By using the -o no or -o ask options, you can prevent this
behavior.
The vdump and rvdump commands can write many savesets to a tape. If you want
to use the vrestore or the rvrestore commands to restore a particular saveset,
you must first position the tape to the saveset by using the mt command with the
fsf option. For example, to position a tape that is rewound at the beginning of its
second saveset, you can enter the command mt fsf 1.
The vdump and vrestore commands maintain the sparseness of AdvFS sparse
files. However, sparse files that have been striped are still handled in the fashion of
releases earlier than DIGITAL UNIX Version 4.0D: they are allocated disk space
and filled with zeros.
You do not have to be the root user to use the vrestore command or the
rvrestore command, but you must have write access to the directory to which
you want to restore the files.
See rsh(8) for server and client access rules when using the rvdump or
rvrestore commands.
Filesets that have been archived by using the vdump or rvdump commands must
be restored by using the vrestore or rvrestore commands. The vdump and
rvdump commands are not interchangeable with the dump and rdump commands.
Similarly, the vrestore and rvrestore commands are not interchangeable
with the restore and rrestore commands.
Only the root user can restore AdvFS quota files and fileset quotas. A warning
message is displayed when a non-root user attempts to use the vrestore
command to restore AdvFS quota files or fileset quotas. The vrestore command
in DIGITAL UNIX versions earlier than Version 4.0 cannot be used to restore
savesets produced by the vdump command in DIGITAL UNIX Version 4.0 or
higher systems.
AdvFS quota files can be restored to either an AdvFS fileset or a UFS file system,
but UFS quota files cannot be restored to an AdvFS fileset. If AdvFS quota files are
to be restored to a UFS file system, quotas must be enabled on the UFS file system.
Otherwise, the operation fails.
AdvFS fileset quotas cannot be restored to an UFS file system because there is no
UFS analog to AdvFS fileset quotas. Attempting to do a vrestore or
rvrestore to a base directory that has a default ACL or a default access ACL
may cause unintended ACLs to be created on the restored files and directories. If
ACLs are enabled on the system, check all ACLs after the vrestore or
rvrestore.
vsbmpg
Description
The vsbmpg command displays a page from a storage bitmap (SBM) file. This
command is new in Tru64 UNIX V5.0.
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
/sbin/advfs/vsbmpg
By default, the utility opens all volumes using block device special files. Specify
the -r flag to operate on the raw device (character device special file) of the domain
instead of the block device. Specify the -D flag to force the utility to interpret the
name you supply in the domain argument as a domain name.
volume_id specifies an AdvFS volume using the following format:
[-V] volume | domain_id volume_index
Specify the -V flag to force the utility to interpret the name you supply in the
volume argument as a volume name. The volume name argument also can be a full
or partial path for the volume, for example /dev/disk/dsk12a or dsk12a.
Specifying a partial path name always opens the character device special file.
Alternatively, specify the volume by using arguments for its domain, domain_id,
and its volume index number, volume_index.
page specifies the file page number of the SBM file.
entry specifies the index of the SBM word on the page.
Options
-a
-B block
Displays the portion of the SBM that maps the specified block.
-b block
Specifies a starting block for the part of an AdvFS volume that you
want to format as an SBM page.
-d dump_file
Specifies the name of a file that contains the output of this utility.
-i index
-v
Operation
Storage bitmaps (SBMs) are used to track free and allocated disk space of AdvFS
volumes. Each volume in an AdvFS domain has one SBM file. The vsbmpg utility
displays pages of a SBM file.
Using the vsbmpg command you can:
The utility can fail to open a block device, even when there are no filesets mounted
for the domain and the AdvFS daemon, advfsd, is running. The daemon, as it
runs, activates the domain for a brief time. If the vsbmpg utility fails in this
situation, run it again.
You must have root user privilege to use this command.
vtagpg
Description
The vtagpg utility displays a formatted page of a tag file. In Tru64 UNIX Version
5.0, the nvtagpg command should be used in place of this command.
/sbin/advfs/vtagpg special [page_LBN]
The vtagpg utility formats a page of the disk as a tag file page. Use this utility with
other file utilities to locate file-structure anomalies for debugging.
If the volume is mounted, use the showfile -x command to get the extent map
before calling the vtagpg command. If the volume is unmounted, call the
vbmtchain command to identify the extent information.
Run the vtagpg utility to obtain the root tag file first because it has entries for
each fileset in the domain. Then, run the utility again to view the tag file for the
fileset under investigation. This tag information points to the fileset metadata.
The vtagpg utility displays tag entries that map a file tag number to a primary
mcell location.
You must be the root user to use this command.
Index
A
addvol A-3
AdvFS
architecture 1-22, 1-23
directories and migration 2-36
file addresses 2-8
in-memory structures overview 3-3
POSIX files 2-35
two-level implementation 2-3, 2-4
UNIX directories 2-35
AdvFS command
addvol A-3
advfsstat A-6
advscan A-7
balance A-9
chfile A-10
chfsets A-12
chvol A-13
defragment A-14
logread A-16
migrate A-16
mkfdmn A-18
mkfset A-20
mountlist A-21
msfsck A-21
ncheck A-21
nvbmtpg A-22
nvfragpg A-25
nvlogpg A-27
nvtagpg A-29
rmfdmn A-32
rmfset A-32
rmvol A-33
salvage 5-50, A-34
shblk A-37
shfragbf A-37
showfdmn A-38
showfile A-39
showfsets A-41
stripe A-42
switchlog A-42
tag2name A-43
vbmtchain A-44
vbmtpg A-44
vchkdir A-45
vdf A-45
vdump A-46
verify A-48
version comparison table A-3
vfile A-50
vfilepg A-50
vfragpg A-53
vlogpg A-53
vlsnpg A-53
vods A-54
vrestore A-54
vsbmpg A-57
vtagpg A-59
AdvFS corruption
causes 5-8
recognizing 5-8
AdvFS entry point
device driver callback 4-6
I/O completion function 4-7
lightweight context interface 4-7
UBC interface 4-6
VFS switch table 4-4
vnode switch table 4-5
AdvFS recovery pass 4-15
AdvFS startup
activating domain table entry 4-14
activating the bitfile-set 4-14
activating the domain 4-14
mounting the file system 4-13
recovering a domain 4-14
AdvFS system call
domains and volumes 4-10
example 4-25
filesets 4-11
true 4-8
types 4-8
AdvFS thread
fragment bitfile 4-23
FS cleanup 4-24
I/O 4-24
overview 4-23
AdvFS troubleshooting
BMT exhaustion 5-16
corruption and system panic case study
determining log size 5-14
domain corruption case study 5-20
domain panic 5-12
fragment free list corruption case study
generalized corruption 5-11
localized corruption 5-10
log half-full problem 5-14
mount file system crashes system 5-9
no valid file system error 5-9
tips and practices 5-4
AdvFS volume 1-6
advfsstat A-6
advscan A-7
5-34
5-30
Index-1
encoding 2-25
extent based storage 1-8
primary extent map record
extent maps
nonreserved files 2-25
reserved files 2-25
B
balance A-9
BAS
access to structures 3-19
in-memory structures 3-18
storage allocation 4-16
bfAccess structure
finding 3-19
managing 3-19
bfnode structure 3-9
bfSet structure
finding 3-20
bitfile
BAS on-disk metadata 2-10
buffer descriptor 3-27
definition 2-7
migrating 4-22
misc 2-47
page references 3-28
per bitfile-set 2-13
per volume 2-12
root tag directory 2-31
SBM (storage bitmap) 2-43
truncating 4-17
bitfile-set 2-9
tag directory 2-31
BMT
extents 2-21
page 1 2-21
page format 2-21
F
FAS
in-memory structures 3-9
storage allocation 4-16
file domain 1-3, 1-4, 1-5
file structures, in-memory 3-9
fileset
definition 1-3, 1-4, 1-5
deleting 4-22
in-memory structures 3-13
quota structures 3-16
fileSetNode structure 3-12
fragment
bitfile 2-37
groups 2-37
header 2-38
utilities 2-39
fragments and files 2-41
free space cache 3-27
fsContext structure 3-11
FTX state structure 3-28
I
I/O descriptor
C
chfile A-10
chfsets A-12
chvol A-13
clone
closing a deleted bitfile 4-20
creating 4-18
deleting a bitfile 4-20
deleting bitfile from cloned original
issues with 1-16
reading from 4-19
using clonefset command 1-15
writing to a cloned original 4-19
logging
a transaction 1-13
process definition 1-13
logread A-16
4-20
M
mcell
addresses 2-22
format 2-23
overview 2-20
page structure 2-20
records 2-19, 2-23
reserved addresses 2-22
migrate A-16
mkfdmn A-18
mkfset A-20
mount structure 3-7
mountlist A-21
msfsck A-21
defragment A-14
domain structure
finding 3-21
Index-2
3-28
extent
definition 1-8, 1-9, 1-10
displaying using showfile command
2-27
1-9
vfilepg A-50
vfragpg A-53
vlogpg A-53
vlsnpg A-53
vnode structure
vods A-54
vrestore A-54
vsbmpg A-57
vtagpg A-59
N
ncheck A-21
nvbmtpg A-22
nvfragpg A-25
nvlogpg A-27
nvtagpg A-29
R
rmfdmn A-32
rmfset A-32
rmvol A-33
3-7
S
salvage A-34
definition 5-50
example 5-52
massive metadata corruption 5-54
using with backup media 5-53
when to use 5-53
without backup media 5-54
SBM format 2-44
shblk A-37
shfragbf A-37
showfdmn A-38
showfile A-39
showfsets A-41
stripe A-42
striping
file 1-17
switchlog A-42
T
tag2name A-43
tags
directories 2-27
directory 2-10
directory page 2-29
metadata bitfile 2-16
reusing 2-9
tagmap entries 2-30
utility for viewing tag directory
trash cans 1-19
2-33
U
user/group quota structures
3-17
V
vbmtpg A-44
vchkdir A-45
vdf A-45
vdump A-46
verify A-48
vfile A-50
Index-3
Index-4