Escolar Documentos
Profissional Documentos
Cultura Documentos
Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A.
Part No: 817509314 November 2006
Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more U.S. patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. This distribution may include materials developed by third parties. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, the Solaris logo, the Java Coffee Cup logo, docs.sun.com, Java, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. FireWire and the FireWire logo are trademarks of Apple Computer, Inc, used under license. X/Open is a registered trademark of X/Open Company, Ltd. DLT is claimed as a trademark of Quantum Corporation in the United States and other countries. The OPEN LOOK and SunTM Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Suns licensees who implement OPEN LOOK GUIs and otherwise comply with Suns written license agreements. Products covered by and information contained in this publication are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical or biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identied on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited. DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2006 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits rservs.
Sun Microsystems, Inc. dtient les droits de proprit intellectuelle relatifs la technologie incorpore dans le produit qui est dcrit dans ce document. En particulier, et ce sans limitation, ces droits de proprit intellectuelle peuvent inclure un ou plusieurs brevets amricains ou des applications de brevet en attente aux Etats-Unis et dans dautres pays. Cette distribution peut comprendre des composants dvelopps par des tierces personnes. Certaines composants de ce produit peuvent tre drives du logiciel Berkeley BSD, licencis par lUniversit de Californie. UNIX est une marque dpose aux Etats-Unis et dans dautres pays; elle est licencie exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, Java et Solaris sont des marques de fabrique ou des marques dposes de Sun Microsystems, Inc. aux Etats-Unis et dans dautres pays. Toutes les marques SPARC sont utilises sous licence et sont des marques de fabrique ou des marques dposes de SPARC International, Inc. aux Etats-Unis et dans dautres pays. Les produits portant les marques SPARC sont bass sur une architecture dveloppe par Sun Microsystems, Inc. FireWire et le logo de FireWire sont des marques d?pos?es de Applex Computer, Inc., utilis? sous le permis. X/Open est une marque de fabrique ou une marque d?pos?e de X/Open Company, Ltd.Quantum Corporation riclame DLT comme sa marque de fabrique aux Etats-Unis et dans dautres pays. Linterface dutilisation graphique OPEN LOOK et Sun a t dveloppe par Sun Microsystems, Inc. pour ses utilisateurs et licencis. Sun reconnat les efforts de pionniers de Xerox pour la recherche et le dveloppement du concept des interfaces dutilisation visuelle ou graphique pour lindustrie de linformatique. Sun dtient une licence non exclusive de Xerox sur linterface dutilisation graphique Xerox, cette licence couvrant galement les licencis de Sun qui mettent en place linterface dutilisation graphique OPEN LOOK et qui, en outre, se conforment aux licences crites de Sun. Les produits qui font lobjet de cette publication et les informations quil contient sont rgis par la legislation amricaine en matire de contrle des exportations et peuvent tre soumis au droit dautres pays dans le domaine des exportations et importations. Les utilisations nales, ou utilisateurs naux, pour des armes nuclaires, des missiles, des armes chimiques ou biologiques ou pour le nuclaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou rexportations vers des pays sous embargo des Etats-Unis, ou vers des entits gurant sur les listes dexclusion dexportation amricaines, y compris, mais de manire non exclusive, la liste de personnes qui font objet dun ordre de ne pas participer, dune faon directe ou indirecte, aux exportations des produits ou des services qui sont rgis par la legislation amricaine en matire de contrle des exportations et la liste de ressortissants spciquement designs, sont rigoureusement interdites. LA DOCUMENTATION EST FOURNIE "EN LETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A LAPTITUDE A UNE UTILISATION PARTICULIERE OU A LABSENCE DE CONTREFACON.
061101@15490
Contents
Preface ...........................................................................................................................................................21
Managing Removable Media (Overview) ................................................................................................25 Whats New in Removable Media in the Solaris 10 1/06 Release? ..........................................................25 vold is Managed by the Service Management Facility (SMF) .........................................................25 Improvements to Volume Management (vold) ................................................................................26 Whats New in Removable Media in the Solaris 10 Release? ...................................................................27 DVD+RW and DVD-RW Support .....................................................................................................27 New cdrw Options ................................................................................................................................28 Listing Removable Media Devices ......................................................................................................28 Playing Musical CDs ............................................................................................................................28 Where to Find Managing Removable Media Tasks ..................................................................................29 Removable Media Features and Benets ...................................................................................................29 Comparison of Manual and Automatic Mounting ..................................................................................29 What You Can Do With Volume Management .........................................................................................30
Managing Removable Media (Tasks) ........................................................................................................33 Managing Removable Media (Task Map) ..................................................................................................33 Formatting Diskettes ....................................................................................................................................34 Removable Media Hardware Considerations ...................................................................................34 M How to Load Removable Media ..........................................................................................................35 M How to Format a Diskette (rmformat) ...............................................................................................36 M How to Create a File System on Removable Media ...........................................................................37 M How to Create a File System on a DVD-RAM ...................................................................................39 M How to Check a File System on Removable Media ...........................................................................39 M How to Repair Bad Blocks on Removable Media ..............................................................................40 Applying Read or Write Protection and Password Protection to Removable Media ...................41 M How to Enable or Disable Write Protection on Removable Media .................................................41
3
Contents
M How to Enable or Disable Read or Write Protection and Set a Password on Removable Media ......................................................................................................................................................41
Accessing Removable Media (Tasks) ........................................................................................................43 Accessing Removable Media (Task Map) ..................................................................................................43 Accessing Removable Media .......................................................................................................................44 Using Removable Media Names .........................................................................................................44 Guidelines for Accessing Removable Media Data ............................................................................45 M How to Add a New Removable Media Drive .....................................................................................45 M How to Stop and Start Volume Management (vold) ........................................................................46 M How to Access Information on Removable Media ...........................................................................46 M How to Copy Information From Removable Media ........................................................................47 M How to Determine If Removable Media Is Still in Use .....................................................................48 M How to Eject Removable Media ..........................................................................................................48 Accessing Removable Media on a Remote System (Task Map) ..............................................................49 M How to Make Local Media Available to Other Systems ....................................................................49 M How to Access Removable Media on Remote Systems ....................................................................53
Writing CDs and DVDs (Tasks) ....................................................................................................................55 Working With Audio CDs and Data CDs and DVDs ...............................................................................55 CD/DVD Media Commonly Used Terms .........................................................................................56 Writing CD and DVD Data and Audio CDs .............................................................................................57 Restricting User Access to Removable Media With RBAC ..............................................................58 M How to Restrict User Access to Removable Media With RBAC .....................................................58 M How to Identify a CD or DVD Writer ................................................................................................59 M How to Check the CD or DVD Media ................................................................................................60 Creating a Data CD or DVD ................................................................................................................60 M How to Create an ISO 9660 File System for a Data CD or DVD .....................................................61 M How to Create a Multi-Session Data CD ............................................................................................61 Creating an Audio CD ..........................................................................................................................63 M How to Create an Audio CD ................................................................................................................64 M How to Extract an Audio Track on a CD ............................................................................................65 M How to Copy a CD ................................................................................................................................66 M How to Erase CD-RW Media ..............................................................................................................66
Contents
Managing Devices (Overview/Tasks) ........................................................................................................69 Whats New in Device Management in the Solaris 10 11/06 Release? ....................................................69 Support for PCI Express (PCIe) ..........................................................................................................70 Improved Device In Use Error Checking ...........................................................................................70 Whats New in Device Management in the Solaris 10 6/06 Release? ......................................................71 USB and 1394 (FireWire) Support Enhancements ...........................................................................71 Whats New in Device Management in the Solaris 10 Release? ..............................................................72 USB Device Enhancements .................................................................................................................72 1394 (FireWire) and Mass Storage Support on x86 Systems ...........................................................72 Device File System (devfs) ..................................................................................................................73 Power Management of Fibre Channel Devices .................................................................................73 Where to Find Device Management Tasks ................................................................................................74 About Device Drivers ...................................................................................................................................74 Automatic Conguration of Devices .........................................................................................................75 Features and Benets of Autoconguration ......................................................................................76 What You Need for Unsupported Devices ........................................................................................76 Displaying Device Conguration Information .........................................................................................76 driver not attached Message ............................................................................................................77 M How to Display System Conguration Information ........................................................................77 Adding a Peripheral Device to a System ....................................................................................................81 M How to Add a Peripheral Device .........................................................................................................81 M How to Add a Device Driver ................................................................................................................82
Dynamically Conguring Devices (Tasks) ................................................................................................85 Dynamic Reconguration and Hot-Plugging ........................................................................................... 85 Attachment Points ................................................................................................................................86 Detaching PCI or PCIe Adapter Cards ...............................................................................................88 Attaching PCI or PCIe Adapter Cards ...............................................................................................88 SCSI Hot-Plugging With the cfgadm Command (Task Map) .................................................................88 SCSI Hot-Plugging With the cfgadm Command ......................................................................................89 M How to Display Information About SCSI Devices ............................................................................90 M How to Uncongure a SCSI Controller ..............................................................................................90 M How to Congure a SCSI Controller ..................................................................................................91 M How to Congure a SCSI Device ........................................................................................................91 M How to Disconnect a SCSI Controller ................................................................................................92 M SPARC: How to Connect a SCSI Controller ......................................................................................93
5
Contents
M SPARC: How to Add a SCSI Device to a SCSI Bus ............................................................................94 M SPARC: How to Replace an Identical Device on a SCSI Controller ................................................95 M SPARC: How to Remove a SCSI Device .............................................................................................96 Troubleshooting SCSI Conguration Problems ...............................................................................97 M How to Resolve a Failed SCSI Uncongure Operation ....................................................................98 PCI or PCIe Hot-Plugging With the cfgadm Command (Task Map) .....................................................99 PCI or PCIe Hot-Plugging With the cfgadm Command .........................................................................99 PCIe Led Indicator Behavior .............................................................................................................100 M How to Display PCI Slot Conguration Information ....................................................................100 M How to Remove a PCI Adapter Card ................................................................................................101 M How to Add a PCI Adapter Card .......................................................................................................103 Troubleshooting PCI Conguration Problems ...............................................................................105 Reconguration Coordination Manager (RCM) Script Overview .......................................................105 What Is an RCM Script? .....................................................................................................................106 What Can an RCM Script Do? ..........................................................................................................106 How Does the RCM Script Process Work? ......................................................................................106 RCM Script Tasks ........................................................................................................................................107 Application Developer RCM Script (Task Map) .............................................................................107 System Administrator RCM Script (Task Map) ..............................................................................108 Naming an RCM Script ......................................................................................................................108 Installing or Removing an RCM Script ............................................................................................109 M How to Install an RCM Script ...........................................................................................................109 M How to Remove an RCM Script ........................................................................................................ 110 M How to Test an RCM Script ............................................................................................................... 110 Tape Backup RCM Script Example ................................................................................................... 111
Using USB Devices (Overview) ................................................................................................................. 115 Whats New in USB Devices in the Solaris 10 6/06 Release? .................................................................. 115 Changed USB Device Hotpluggable Behavior ................................................................................ 116 USB Power Budgeting ........................................................................................................................ 116 ZFS Support on USB Devices ............................................................................................................ 116 Support for Prolic and Keyspan Serial Adapters ........................................................................... 117 Whats New in USB Devices in the Solaris 10 1/06 Release? .................................................................. 117 x86: Support for USB CDs and DVDs in GRUB-Based Booting .................................................. 117 USB Virtual Keyboard and Mouse Support ..................................................................................... 117 vold Provides Awareness of Hot-Plugged USB Devices ................................................................ 118
Contents
Whats New in USB Devices in the Solaris 10 Release? .......................................................................... 118 Solaris Support for USB Devices ....................................................................................................... 118 Overview of USB Devices ..........................................................................................................................120 Commonly Used USB Acronyms .....................................................................................................120 USB Bus Description ..........................................................................................................................120 About USB in the Solaris OS .....................................................................................................................125 USB 2.0 Features .................................................................................................................................125 USB Keyboards and Mouse Devices .................................................................................................127 USB Host Controller and Hubs .........................................................................................................127 Guidelines for USB Cables .................................................................................................................129
Using USB Devices (Tasks) ........................................................................................................................131 Managing USB Devices in the Solaris OS (Roadmap) ...........................................................................131 Using USB Mass Storage Devices (Task Map) .........................................................................................132 Using USB Mass Storage Devices .............................................................................................................133 Using USB Diskette Devices ..............................................................................................................134 Using Non-Compliant USB Mass Storage Devices ........................................................................135 M How to Use a Non-Complaint USB Mass Storage Device .....................................................135 Hot-Plugging USB Mass Storage Devices ........................................................................................136 M How to Add a USB Mass Storage Device Without vold Running .........................................137 M How to Add a USB Camera ........................................................................................................137 M How to Remove a USB Mass Storage Device Without vold Running ..................................139 Preparing to Use a USB Mass Storage Device With vold Running ..............................................139 M How to Prepare to Use USB Mass Storage Devices Without vold Running ................................139 M How to Display USB Device Information ........................................................................................140 M How to Create a File System on a USB Mass Storage Without vold Running .............................141 M How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device Without vold Running .......................................................................................................................143 M How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device Without vold Running ......................................................................................................................................147 M How to Mount or Unmount a USB Mass Storage Device Without vold Running .....................149 Troubleshooting Tips for USB Mass Storage Devices .....................................................................150 Disabling Specic USB Drivers .........................................................................................................150 M How to Disable Specic USB Drivers ...............................................................................................151 M How to Remove Unused USB Device Links ....................................................................................151 Using USB Audio Devices (Task Map) .....................................................................................................152 Using USB Audio Devices .........................................................................................................................152
7
Contents
Hot-Plugging Multiple USB Audio Devices ....................................................................................153 M How to Add USB Audio Devices .......................................................................................................154 M How to Identify Your Systems Primary Audio Device ..................................................................154 M How to Change the Primary USB Audio Device .............................................................................155 Troubleshooting USB Audio Device Problems ...............................................................................155 Hot-Plugging USB Devices With the cfgadm Command (Task Map) .................................................156 Hot-Plugging USB Devices With the cfgadm Command ..............................................................156 M How to Display USB Bus Information (cfgadm) .............................................................................157 M How to Uncongure a USB Device ...................................................................................................158 M How to Congure a USB Device .......................................................................................................159 M How to Logically Disconnect a USB Device ....................................................................................159 M How to Logically Connect a USB Device .........................................................................................160 M How to Logically Disconnect a USB Device Subtree ......................................................................160 M How to Reset a USB Device ...............................................................................................................160 M How to Change the Default Conguration of a Multi-Conguration USB Device ....................161
Using InniBand Devices (Overview/Tasks) ..........................................................................................163 Overview of InniBand Devices ...............................................................................................................163 Dynamically Reconguring IB Devices (Task Map) ..............................................................................164 Dynamically Reconguring IB Devices (cfgadm) ...................................................................................166 M How to Display IB Device Information ...........................................................................................167 M How to Uncongure an IOC Device ................................................................................................168 M How to Congure an IOC Device .....................................................................................................169 M How to Uncongure an IB Port, HCA_SVC, or a VPPA Device ...................................................169 M How to Congure a IB Port, HCA_SVC, or a VPPA Device ..........................................................170 M How to Uncongure an IB Pseudo Device ......................................................................................170 M How to Congure an IB Pseudo Device ...........................................................................................171 M How to Display Kernel IB Clients of an HCA .................................................................................171 M How to Uncongure IB Devices Connected to an HCA ................................................................172 Conguring an IB HCA .....................................................................................................................173 M How to Update the IB p_key Tables ..................................................................................................173 M How to Display IB Communication Services ..................................................................................173 M How to Add a VPPA Communication Service ................................................................................173 M How to Remove an Existing IB Port, HCA_SVC, or a VPPA Communication Service .............174 M How to Update an IOC Conguration .............................................................................................175 Using the uDAPL Application Interface With InniBand Devices ......................................................175
Contents
M How to Enable uDAPL .......................................................................................................................176 Updating the DAT Static Registry .....................................................................................................177 M How to Update the DAT Static Registry ...................................................................................177 M How to Register a Service Provider in the DAT Static Registry .............................................177 M How to Unregister a Service Provider from the DAT Static Registry ...................................177
10
Accessing Devices (Overview) .................................................................................................................179 Accessing Devices .......................................................................................................................................179 How Device Information Is Created ................................................................................................179 How Devices Are Managed ................................................................................................................179 Device Naming Conventions ............................................................................................................180 Logical Disk Device Names .......................................................................................................................180 Specifying the Disk Subdirectory ......................................................................................................181 Direct and Bus-Oriented Controllers ...............................................................................................182 x86: Disks With Direct Controllers ...................................................................................................182 Disks With Bus-Oriented Controllers ..............................................................................................182 Logical Tape Device Names .......................................................................................................................183 Logical Removable Media Device Names ................................................................................................184
11
Managing Disks (Overview) .....................................................................................................................185 Whats New in Disk Management in the Solaris 10 11/06 Release? ......................................................185 Support for iSCSI Target Devices ......................................................................................................185 Whats New in Disk Management in the Solaris 10 6/06 Release? ........................................................186 iSCSI Initiator Support Enhancements ............................................................................................186 Whats New in Disk Management in the Solaris 10 1/06 Release? ........................................................187 x86: Disk Management in the GRUB Boot Environment ..............................................................187 Solaris iSCSI Initiator Support ..........................................................................................................188 Support for SCSI Disks That are Larger Than 2 Tbytes ..................................................................188 Whats New in Disk Management in the Solaris 10 Release? ................................................................188 Multiterabyte Disk Support With EFI Disk Label ...........................................................................188 Common SCSI Drivers for SPARC and x86 Systems ......................................................................192 New fdisk Partition Identier ..........................................................................................................192 Where to Find Disk Management Tasks ..................................................................................................193 Overview of Disk Management ................................................................................................................193 Disk Terminology ...............................................................................................................................193 About Disk Slices ................................................................................................................................194
9
Contents
format Utility ......................................................................................................................................198 About Disk Labels .......................................................................................................................................201 Partition Table Terminology .............................................................................................................201 Displaying Partition Table Information ...........................................................................................201 Partitioning a Disk ......................................................................................................................................203 Using the Free Hog Slice ....................................................................................................................204
12
Administering Disks (Tasks) .....................................................................................................................205 Administering Disks (Task Map) ..............................................................................................................205 Identifying Disks on a System ...................................................................................................................206 M How to Identify the Disks on a System .............................................................................................206 Formatting a Disk .......................................................................................................................................208 M How to Determine if a Disk Is Formatted ........................................................................................208 M How to Format a Disk ........................................................................................................................209 Displaying Disk Slices ................................................................................................................................ 211 M How to Display Disk Slice Information ........................................................................................... 211 Creating and Examining a Disk Label ......................................................................................................213 M How to Label a Disk ............................................................................................................................213 M How to Examine a Disk Label ............................................................................................................215 Recovering a Corrupted Disk Label ..........................................................................................................217 M How to Recover a Corrupted Disk Label ..........................................................................................217 Adding a Third-Party Disk ........................................................................................................................219 Creating a format.dat Entry ............................................................................................................220 M How to Create a format.dat Entry ..................................................................................................220 Automatically Conguring SCSI Disk Drives .........................................................................................220 M How to Automatically Congure a SCSI Drive ...............................................................................221 Repairing a Defective Sector ......................................................................................................................222 M How to Identify a Defective Sector by Using Surface Analysis ......................................................223 M How to Repair a Defective Sector ......................................................................................................224 Tips and Tricks for Managing Disks .........................................................................................................225 Debugging format Sessions ...............................................................................................................225 Labeling Multiple Disks by Using the prtvtoc and fmthard Commands ...................................226
13
SPARC: Adding a Disk (Tasks) ...................................................................................................................227 SPARC: Adding a System Disk or a Secondary Disk (Task Map) ..........................................................227 SPARC: Adding a System Disk or a Secondary Disk .......................................................................228
10
Contents
M SPARC: How to Connect a System Disk and Boot ..........................................................................228 M SPARC: How to Connect a Secondary Disk and Boot ....................................................................229 M SPARC: How to Create Disk Slices and Label a Disk ......................................................................230 M SPARC: How to Create a UFS File System .......................................................................................235 M SPARC: How to Install a Boot Block on a System Disk ..................................................................236
14
x86: Adding a Disk (Tasks) ........................................................................................................................237 x86: Adding a System Disk or a Secondary Disk (Task Map) ................................................................237 x86: Adding a System Disk or a Secondary Disk .....................................................................................238 M x86: How to Connect a System Disk .................................................................................................239 M How to Change the Solaris fdisk Identier ....................................................................................239 M x86: How to Connect a Secondary Disk and Boot ...........................................................................241 x86: Guidelines for Creating an fdisk Partition .............................................................................242 M x86: How to Create a Solaris fdisk Partition ..................................................................................242 M x86: How to Create Disk Slices and Label a Disk .............................................................................248 M x86: How to Create File Systems .......................................................................................................250 M x86: How to Install a Boot Block on a System Disk .........................................................................250
15
Conguring Solaris iSCSI Initiators (Tasks) ...........................................................................................253 The iSCSI Technology (Overview) ...........................................................................................................253 iSCSI Software and Hardware Requirements ..................................................................................254 Setting Up Solaris iSCSI Initiators (Task Map) .......................................................................................254 Conguring Solaris iSCSI Initiators .................................................................................................255 M How to Prepare for a Solaris iSCSI Conguration ..........................................................................257 Conguring Authentication in Your iSCSI-Based Storage Network ............................................257 M How to Congure CHAP Authentication for Your iSCSI Conguration ............................258 Using a Third-Party Radius Server to Simplify CHAP Management in Your iSCSI Conguration ......................................................................................................................................259 M How to Congure RADIUS for Your iSCSI Conguration ...................................................259 M How to Congure iSCSI Target Discovery .......................................................................................260 M How to Remove Discovered iSCSI Targets ......................................................................................261 Accessing iSCSI Disks ........................................................................................................................262 M Monitoring Your iSCSI Conguration .............................................................................................263 Modifying iSCSI Initiator and Target Parameters ..........................................................................265 M How to Modify iSCSI Initiator and Target Parameters ..........................................................266 M How to Enable Multiple iSCSI Sessions for a Target .......................................................................269
11
Contents
Troubleshooting iSCSI Conguration Problems ....................................................................................270 No Connections to the iSCSI Target From the Local System .........................................................271 M How to Troubleshoot iSCSI Connection Problems ................................................................271 iSCSI Device or Disk Is Not Available on the Local System ...........................................................272 M How to Troubleshoot iSCSI Device or Disk Unavailability ...................................................272 Use LUN Masking When Using the iSNS Discovery Method .......................................................272 General iSCSI Error Messages ...........................................................................................................273
16
The format Utility (Reference) .................................................................................................................279 Recommendations and Requirements for Using the format Utility ....................................................279 format Menu and Command Descriptions ............................................................................................280 partition Menu .................................................................................................................................282 x86: fdisk Menu .................................................................................................................................282 analyze Menu .....................................................................................................................................283 defect Menu .......................................................................................................................................285 format.dat File ..........................................................................................................................................286 Contents of the format.dat File .......................................................................................................286 Syntax of the format.dat File ...........................................................................................................287 Keywords in the format.dat File .....................................................................................................287 Partition Tables (format.dat) ..........................................................................................................289 Specifying an Alternate Data File for the format Utility ................................................................290 Rules for Input to format Commands .....................................................................................................291 Specifying Numbers to format Commands ....................................................................................291 Specifying Block Numbers to format Commands .........................................................................291 Specifying format Command Names ..............................................................................................292 Specifying Disk Names to format Commands ...............................................................................292 Getting Help on the format Utility ...........................................................................................................293
17
Managing File Systems (Overview) ........................................................................................................295 Whats New in File Systems in the Solaris 10 11/06 Release? .................................................................295 File System Monitoring Tool (fsstat) .............................................................................................295 Whats New in File Systems in the Solaris 10 6/06 Release? ..................................................................296 ZFS File System ...................................................................................................................................296 Enhancements to UFS File System Utilities (fsck, mkfs, and newfs) ..........................................297 Whats New in File Systems in the Solaris 10 Release? ...........................................................................304 UFS Logging Is Enabled by Default ..................................................................................................304
12
Contents
NFS Version 4 ......................................................................................................................................305 64-bit: Support of Multiterabyte UFS File Systems .........................................................................305 libc_hwcap ..........................................................................................................................................308 Where to Find File System Management Tasks ......................................................................................308 Overview of File Systems ...........................................................................................................................309 Types of File Systems ..........................................................................................................................309 Commands for File System Administration ............................................................................................314 How File System Commands Determine the File System Type ....................................................315 Manual Pages for Generic and Specic File System Commands ..................................................315 Default Solaris File Systems .......................................................................................................................316 UFS File System ..........................................................................................................................................317 Planning UFS File Systems ................................................................................................................318 UFS Logging ........................................................................................................................................318 UFS Snapshots .....................................................................................................................................319 UFS Direct Input/Output (I/O) ........................................................................................................319 Mounting and Unmounting File Systems ...............................................................................................320 The Mounted File System Table ........................................................................................................321 The Virtual File System Table ............................................................................................................322 The NFS Environment .......................................................................................................................323 Automounting or AutoFS ..................................................................................................................324 Determining a File Systems Type .............................................................................................................324 How to Determine a File Systems Type ...........................................................................................324
18
Creating UFS, TMPFS, and LOFS File Systems (Tasks) ..........................................................................327 Creating a UFS File System ........................................................................................................................327 M How to Create a UFS File System ......................................................................................................328 M How to Create a Multiterabyte UFS File System .............................................................................329 M How to Expand a Multiterabyte UFS File System ...........................................................................331 M How to Expand a UFS File System to a Multiterabyte UFS File System .......................................332 Troubleshooting Multiterabyte UFS File System Problems ..........................................................333 Creating a Temporary File System (TMPFS) ...........................................................................................334 M How to Create and Mount a TMPFS File System ............................................................................334 Creating and Mounting a Loopback File System (LOFS) ......................................................................335 M How to Create and Mount an LOFS File System .............................................................................335
13
Contents
19
Mounting and Unmounting File Systems (Tasks) ................................................................................337 Overview of Mounting File Systems .........................................................................................................337 Commands for Mounting and Unmounting File Systems ............................................................338 Commonly Used Mount Options .....................................................................................................339 Field Descriptions for the /etc/vfstab File ...................................................................................340 Mounting File Systems ...............................................................................................................................342 How to Determine Which File Systems Are Mounted ...................................................................342 M How to Add an Entry to the /etc/vfstab File ................................................................................343 M How to Mount a File System (/etc/vfstab File) ...........................................................................344 M How to Mount a UFS File System (mount Command) ...................................................................345 M How to Mount a UFS File System Without Large Files (mount Command) ................................346 M How to Mount an NFS File System (mount Command) .................................................................347 M x86: How to Mount a PCFS (DOS) File System From a Hard Disk (mount Command) ............348 Unmounting File Systems .........................................................................................................................349 Prerequisites for Unmounting File Systems ....................................................................................349 How to Verify a File System is Unmounted .....................................................................................350 M How to Stop All Processes Accessing a File System ........................................................................350 M How to Unmount a File System ........................................................................................................351
20
Using The CacheFS File System (Tasks) ..................................................................................................353 High-Level View of Using the CacheFS File System (Task Map) ..........................................................353 Overview of the CacheFS File System ......................................................................................................354 How a CacheFS File System Works ...................................................................................................354 CacheFS File System Structure and Behavior ..................................................................................355 Creating and Mounting a CacheFS File System (Task Map) .................................................................356 M How to Create the Cache ....................................................................................................................357 Mounting a File System in the Cache ...............................................................................................357 M How to Mount a CacheFS File System (mount) ...............................................................................358 M How to Mount a CacheFS File System (/etc/vfstab) ..................................................................360 M How to Mount a CacheFS File System (AutoFS) ............................................................................360 Maintaining a CacheFS File System (Task Map) .....................................................................................361 Maintaining a CacheFS File System .........................................................................................................362 Modifying a CacheFS File System .....................................................................................................362 M How to Display Information About a CacheFS File System ..........................................................363 Consistency Checking of a CacheFS File System ............................................................................363 M How to Specify Cache Consistency Checking on Demand ...........................................................364
14
Contents
M How to Delete a CacheFS File System ..............................................................................................364 M How to Check the Integrity of a CacheFS File System ....................................................................366 Packing a Cached File System (Task Map) ...............................................................................................366 Packing a CacheFS File System .................................................................................................................367 M How to Pack Files in the Cache .........................................................................................................368 M How to Display Packed Files Information .......................................................................................368 Using Packing Lists .............................................................................................................................369 M How to Create a Packing List .............................................................................................................370 M How to Pack Files in the Cache With a Packing List .......................................................................370 Unpacking Files or Packing Lists From the Cache .........................................................................371 M How to Unpack Files or Packing Lists From the Cache .................................................................371 Troubleshooting cachefspack Errors ..............................................................................................372 Collecting CacheFS Statistics (Task Map) ...............................................................................................375 Collecting CacheFS Statistics ....................................................................................................................376 M How to Set Up CacheFS Logging ......................................................................................................377 M How to Locate the CacheFS Log File ................................................................................................377 How to Stop CacheFS Logging ..........................................................................................................378 M How to View the Working Set (Cache) Size .....................................................................................378 Viewing CacheFS Statistics ................................................................................................................379 M How to View CacheFS Statistics ........................................................................................................380
21
Conguring Additional Swap Space (Tasks) ..........................................................................................381 About Swap Space .......................................................................................................................................381 Swap Space and Virtual Memory ......................................................................................................381 Swap Space and the TMPFS File System ..........................................................................................382 Swap Space as a Dump Device ...........................................................................................................382 Swap Space and Dynamic Reconguration .....................................................................................383 How Do I Know If I Need More Swap Space? .........................................................................................383 Swap-Related Error Messages ...........................................................................................................384 TMPFS-Related Error Messages .......................................................................................................384 How Swap Space Is Allocated ....................................................................................................................384 Swap Areas and the /etc/vfstab File ..............................................................................................385 Planning for Swap Space ............................................................................................................................385 Monitoring Swap Resources ......................................................................................................................386 Adding More Swap Space ..........................................................................................................................387 Creating a Swap File ............................................................................................................................387
15
Contents
M How to Create a Swap File and Make It Available ...........................................................................388 Removing a Swap File From Use ..............................................................................................................389 M How to Remove Unneeded Swap Space ...........................................................................................389
22
Checking UFS File System Consistency (Tasks) .....................................................................................391 File System Consistency .............................................................................................................................392 How the File System State Is Recorded ....................................................................................................392 What the fsck Command Checks and Tries to Repair ..........................................................................393 Why UFS File System Inconsistencies Might Occur ......................................................................393 UFS Components That Are Checked for Consistency ...................................................................394 fsck Summary Message .....................................................................................................................398 Interactively Checking and Repairing a UFS File System ......................................................................399 M How to Check the root (/), /usr, or /var File Systems From an Alternate Boot Device ...........400 M How to Check Other File Systems (Not root (/), /usr, or /var) ...................................................402 Preening UFS File Systems ................................................................................................................404 M How to Preen a UFS File System .......................................................................................................404 Fixing a UFS File System That the fsck Command Cannot Repair .............................................404 Restoring a Bad Superblock .......................................................................................................................405 M How to Restore a Bad Superblock (Solaris 10 6/06 Release Only) ................................................406 M How to Restore a Bad Superblock (Solaris 8, 9, and 10 Releases) ..................................................409 Syntax and Options for the fsck Command ...........................................................................................410
23
UFS File System (Reference) ....................................................................................................................413 Structure of Cylinder Groups for UFS File Systems ...............................................................................413 Boot Block ............................................................................................................................................413 Superblock ...........................................................................................................................................414 Inodes ...................................................................................................................................................414 Data Blocks ..........................................................................................................................................415 Free Blocks ...........................................................................................................................................415 Customizing UFS File System Parameters ..............................................................................................416 Logical Block Size ................................................................................................................................416 Fragment Size ......................................................................................................................................417 Minimum Free Space .........................................................................................................................417 Rotational Delay .................................................................................................................................418 Optimization Type ..............................................................................................................................418 Number of Inodes (Files) ...................................................................................................................418
16
Contents
Maximum UFS File and File System Size .........................................................................................419 Maximum Number of UFS Subdirectories ......................................................................................419
24
Backing Up and Restoring File Systems (Overview) ............................................................................421 Where to Find Backup and Restore Tasks ................................................................................................421 Introduction to Backing Up and Restoring File Systems .......................................................................422 Why You Should Back Up File Systems ...........................................................................................422 Planning Which File Systems to Back Up ........................................................................................423 Choosing the Type of Backup ............................................................................................................424 Choosing a Tape Device .....................................................................................................................425 High-Level View of Backing Up and Restoring File Systems (Task Map) ...........................................426 Considerations for Scheduling Backups ..........................................................................................427 Guidelines for Scheduling Backups ..................................................................................................428 Using Dump Levels to Create Incremental Backups ......................................................................429 Sample Backup Schedules ..................................................................................................................430
25
Backing Up Files and File Systems (Tasks) .............................................................................................437 Backing Up Files and File System (Task Map) .........................................................................................437 Preparing for File System Backups ...........................................................................................................438 M How to Find File System Names .......................................................................................................438 M How to Determine the Number of Tapes Needed for a Full Backup ............................................439 Backing Up a File System ...........................................................................................................................439 M How to Back Up a File System to Tape .............................................................................................440
26
Using UFS Snapshots (Tasks) ...................................................................................................................447 Using UFS Snapshots (Task Map) ............................................................................................................447 UFS Snapshots Overview ...........................................................................................................................448 Why Use UFS Snapshots? ..................................................................................................................448 UFS Snapshots Performance Issues ..................................................................................................449 Creating and Deleting UFS Snapshots .....................................................................................................449 Creating a Multiterabyte UFS Snapshot ...........................................................................................450 M How to Create a UFS Snapshot .........................................................................................................451 M How to Display UFS Snapshot Information ....................................................................................452 Deleting a UFS Snapshot ....................................................................................................................453 M How to Delete a UFS Snapshot ..........................................................................................................453 Backing Up a UFS Snapshot ......................................................................................................................454
17
Contents
M How to Create a Full Backup of a UFS Snapshot (ufsdump) ..........................................................454 M How to Create an Incremental Backup of a UFS Snapshot (ufsdump) .........................................455 M How to Back Up a UFS Snapshot (tar) ............................................................................................455 Restoring Data From a UFS Snapshot Backup ................................................................................456
27
Restoring Files and File Systems (Tasks) ................................................................................................457 Restoring Files and File System Backups (Task Map) ............................................................................457 Preparing to Restore Files and File Systems ............................................................................................458 Determining the File System Name ..................................................................................................458 Determining the Type of Tape Device You Need ............................................................................458 Determining the Tape Device Name ................................................................................................459 Restoring Files and File Systems ...............................................................................................................459 M How to Determine Which Tapes to Use ...........................................................................................459 M How to Restore Files Interactively ....................................................................................................460 M How to Restore Specic Files Noninteractively ..............................................................................463 M How to Restore a Complete File System ...........................................................................................465 M How to Restore the root (/) and /usr File Systems .........................................................................468
28
UFS Backup and Restore Commands (Reference) ................................................................................473 How the ufsdump Command Works ........................................................................................................473 Determining Device Characteristics ................................................................................................473 Detecting the End of Media ...............................................................................................................473 Copying Data With the ufsdump Command ...................................................................................474 Purpose of the /etc/dumpdates File ................................................................................................474 Backup Device (dump-le) Argument .............................................................................................475 Specifying Files to Back Up ................................................................................................................476 Specifying Tape Characteristics ........................................................................................................477 Limitations of the ufsdump Command ............................................................................................477 Specifying ufsdump Command Options and Arguments ......................................................................477 Default ufsdump Options ...................................................................................................................477 The ufsdump Command and Security Issues ...........................................................................................478 Specifying ufsrestore Options and Arguments ....................................................................................478
29
Copying UFS Files and File Systems (Tasks) ..........................................................................................479 Commands for Copying File Systems ......................................................................................................479 Copying File Systems Between Disks .......................................................................................................481
System Administration Guide: Devices and File Systems November 2006
18
Contents
Making a Literal File System Copy ...................................................................................................482 M How to Copy a Disk (dd) ....................................................................................................................482 Copying Directories Between File Systems (cpio Command) .............................................................485 M How to Copy Directories Between File Systems (cpio) .................................................................486 Copying Files and File Systems to Tape ....................................................................................................487 Copying Files to Tape (tar Command) ...................................................................................................487 M How to Copy Files to a Tape (tar) ....................................................................................................487 M How to List the Files on a Tape (tar) ................................................................................................488 M How to Retrieve Files From a Tape (tar) .........................................................................................489 Copying Files to a Tape With the pax Command ...................................................................................490 M How to Copy Files to a Tape (pax) ....................................................................................................490 Copying Files to Tape With the cpio Command ....................................................................................491 M How to Copy All Files in a Directory to a Tape (cpio) ...................................................................491 M How to List the Files on a Tape (cpio) ..............................................................................................492 M How to Retrieve All Files From a Tape (cpio) .................................................................................492 M How to Retrieve Specic Files From a Tape (cpio) .........................................................................493 Copying Files to a Remote Tape Device ...................................................................................................494 M How to Copy Files to a Remote Tape Device (tar and dd) .............................................................494 M How to Extract Files From a Remote Tape Device ..........................................................................496 Copying Files and File Systems to Diskette .............................................................................................496 What You Should Know When Copying Files to Diskettes ...........................................................497 M How to Copy Files to a Single Formatted Diskette (tar) ...............................................................497 M How to List the Files on a Diskette (tar) ..........................................................................................498 M How to Retrieve Files From a Diskette (tar) ...................................................................................498 Archiving Files to Multiple Diskettes ...............................................................................................499
30
Managing Tape Drives (Tasks) .................................................................................................................501 Choosing Which Media to Use .................................................................................................................501 Backup Device Names ................................................................................................................................502 Specifying the Rewind Option for a Tape Drive ..............................................................................503 Specifying Different Densities for a Tape Drive ..............................................................................503 Displaying Tape Drive Status ....................................................................................................................504 M How to Display Tape Drive Status ....................................................................................................504 Handling Magnetic Tape Cartridges ........................................................................................................505 Retensioning a Magnetic Tape Cartridge .........................................................................................505 Rewinding a Magnetic Tape Cartridge .............................................................................................505
19
Contents
Index ............................................................................................................................................................507
20
Preface
System Administration Guide: Devices and File Systems is part of a set that includes a signicant part of the SolarisTM system administration information. This guide contains information for both SPARC based and x86 based systems. This book assumes you have completed the following tasks:
I I
Installed the SunOS 5.10 Operating System Set up all the networking software that you plan to use
The SunOS 5.10 release is part of the Solaris product family, which also includes many features, including the GNOME Desktop Environment. The SunOS 5.10 operating system is compliant with AT&Ts System V, Release 4 operating system. For the Solaris 10 releases, new features of interest to system administrators are covered in sections called Whats New in ... ? in the appropriate chapters.
Note This Solaris release supports systems that use the SPARC and x86 families of processor
architectures: UltraSPARC, SPARC64, AMD64, Pentium, and Xeon EM64T. The supported systems appear in the Solaris 10 Hardware Compatibility List at http://www.sun.com/bigadmin/hcl. This document cites any implementation differences between the platform types. In this document these x86 terms mean the following:
I I I
x86 refers to the larger family of 64-bit and 32-bit x86 compatible products. x64 points out specic 64-bit information about AMD64 or EM64T systems. 32-bit x86 points out specic 32-bit information about x86 based systems.
Note Sun is not responsible for the availability of third-party web sites mentioned in this document.
Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused by or in connection with the use of or reliance on any such content, goods, or services that are available on or through such sites or resources.
21
Preface
User accounts and groups, server and client support, shutting down and booting a system, managing services, and managing software (packages and patches) Printing services, terminals and modems, system resources (disk quotas, accounting, and crontabs), system processes, and troubleshooting Solaris software problems Removable media, disks and devices, le systems, and backing up and restoring data TCP/IP network administration, IPv4 and IPv6 address administration, DHCP, IPsec, IKE, IP lter, Mobile IP, IP network multipathing (IPMP), and IPQoS DNS, NIS, and LDAP naming and directory services, including transitioning from NIS to LDAP and transitioning from NIS+ to LDAP NIS+ naming and directory services Web cache servers, time-related services, network le systems (NFS and Autofs), mail, SLP, and PPP Auditing, device management, le security, BART, Kerberos services, PAM, Solaris cryptographic framework, privileges, RBAC, SASL, and Solaris Secure Shell Resource management topics projects and tasks, extended accounting, resource controls, fair share scheduler (FSS), physical memory control using the resource capping daemon (rcapd), and dynamic resource pools; virtualization using Solaris Zones software partitioning technology
System Administration Guide: Devices and File Systems System Administration Guide: IP Services
System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) System Administration Guide: Naming and Directory Services (NIS+) System Administration Guide: Network Services System Administration Guide: Security Services
22
Preface
Book Title
Topics
ZFS storage pool and le system creation and management, snapshots, clones, backups, using access control lists (ACLs) to protect ZFS les, using ZFS on a Solaris system with zones installed, emulated volumes, and troubleshooting and data recovery
AaBbCc123
Edit your .login le. Use ls -a to list all les. machine_name% you have mail.
What you type, contrasted with on screen computer output Command-line placeholder: replace with a real name or value Book titles, new words or terms, or words to be emphasized
machine_name% su Password: To delete a le, type rm lename. Read Chapter 6 in Users Guide. These are called class options. Do not save changes yet.
23
Preface
C shell prompt C shell superuser prompt Bourne shell and Korn shell prompt Bourne shell and Korn shell superuser prompt
machine_name% machine_name# $ #
General Conventions
Be aware of the following conventions used in this book:
I
When following steps or using examples, be sure to type double-quotes ("), left single-quotes (), and right single-quotes () exactly as shown. The key referred to as Return is labeled Enter on some keyboards. The root path usually includes the /sbin, /usr/sbin, /usr/bin, and /etc directories. So, the steps in this book show the commands in these directories without absolute path names. Steps that use commands in other, less common, directories show the absolute paths in the examples. The examples in this book are for a basic SunOS software installation without the Binary Compatibility Package installed and without /usr/ucb in the path.
Caution If /usr/ucb is included in a search path, it should always be at the end of the search path.
I I
Commands such as ps or df are duplicated in /usr/ucb with different formats and options from the SunOS commands.
24
1
I I I I I I
C H A P T E R
This chapter provides general guidelines for managing removable media in the Solaris OS. This is a list of the overview information in this chapter. Whats New in Removable Media in the Solaris 10 1/06 Release? on page 25 Whats New in Removable Media in the Solaris 10 Release? on page 27 Where to Find Managing Removable Media Tasks on page 29 Removable Media Features and Benets on page 29 Comparison of Manual and Automatic Mounting on page 29 What You Can Do With Volume Management on page 30
You can identify the status of the volfs service by using this command:
$ svcs volfs STATE online
STIME Sep_29
FMRI svc:/system/filesystem/volfs:default
25
For more information, see smf(5). You can use the svccfg command to display and to set additional vold properties. For example, you could temporarily enable vold logging to help troubleshooting a problem. For example:
# svccfg svc:> select system/filesystem/volfs svc:/system/filesystem/volfs> setprop vold/log_debuglevel=3 svc:/system/filesystem/volfs> exit # svcadm disable volfs # svcadm enable volfs
You can also use the svccfg command to display a listing of settable vold properties.
# svccfg svc:> select volfs svc:/system/filesystem/volfs> listprop vold/* vold/config_file astring vold/log_debuglevel count 3 vold/log_file astring vold/log_nfs_trace boolean false vold/log_verbose boolean false vold/root_dir astring vold/never_writeback_label boolean false svc:/system/filesystem/volfs> exit
Now, you can use the cdrw and rmformat commands to list devices that have no media when vold is running. You can revert back to the previous vold behavior by changing the following support nomedia entry in the /etc/vold.conf le as follows:
support media
In addition, vold is now hot-plug aware. This improvement means that if you insert removable media, the media is automatically detected and mounted by vold. There should be no need to restart vold manually to recognize and mount a le system from any removable media device. If you are using a legacy or non-USB diskette device, then you might need to issue the volcheck command before vold can recognize the media. If the media is detected, but for some reason, is unmounted, then youll need to run the following commands:
# volrmmount -i rmdisk0
Before you hot-remove a removable media device, eject the media rst. For example:
# eject rmdisk0
DVD+RW Digital video disk (recordable/rewritable) drives can write both DVD-R discs, which can play back on most DVD players, and computer drives and DVD-RW rewritable disks DVD-RW Digital video disk (rewritable) drives can be read only by DVD-RW drives
Both DVD+RW and DVD-RW devices are described generally as DVD devices in this guide unless specic information is required for DVD+RW devices or DVD-RW devices. The cdrw command uses Disk-At-Once (DAO) mode when writing DVDs, which does the following:
I I
Closes the media when writing is completed Prevents any further sessions from being added
Keep the following key points in mind when working with DVD+RW devices:
I I
You cannot blank (or erase) DVD+RW media. You can re-use a DVD+RW media by writing a new image onto the media. The cdrw command automatically formats and overwrites the existing media.
27
For instructions on adding a USB mass storage class-compliant CD or DVD-RW device to your system, see Using USB Mass Storage Devices on page 133.
The -b fast option does a quick erase of the media. Instead of taking 10-15 minutes to erase the media, this option erases the media in about 30 seconds. Using this option erases the TOC of the media. If the media is damaged, you need to use -b all to clear the whole media. Use the -L option to unclose a previously closed CD-RW media. This option erases the last leadout and enables you to add more sessions to a multi-session CD-RW.
28
Access removable media Format removable media Write data CDs and DVDs and music CDs
Automatically mounts removable media. For a comparison of manual and automatic mounting, see the following section. Enables you to access removable media without having to become superuser. Allows you to give other systems on the network automatic access to any removable media on your local system. For more information, see Chapter 3.
I I
1 2 3
Insert media. Become superuser. Determine the location of the media device.
Insert media. For diskettes, use the volcheck command. Volume management (vold) automatically performs many of the tasks previously required to manually mount and work with removable media.
4 5
Create a mount point. Make sure you are not in the mount point directory.
29
TABLE 11 Comparison of Manual and Automatic Mounting of Removable Media Steps Manual Mounting Automatic Mounting
(Continued)
6 7 8 9 10 11 12
Mount the device and use the proper mount options. Exit the superuser account. Work with les on media. Become superuser. Unmount the media device. Eject media. Exit the superuser account. Eject media. Work with les on media.
Files on the rst diskette Files on the removable hard disk Files on the rst CD Files on the rst DVD
The diskette and type volcheck on the command line The removable hard disk and type volcheck on the command line The CD and wait for a few seconds The DVD and wait for a few seconds
Files on the rst PCMCIA The PCMCIA and wait for a few seconds
If your system has more than one type of removable device, see the following table for their access points.
TABLE 13 Where to Access Removable Media Media Device Access File Systems With This Path Access Raw Data With This Path
/floppy/floppy0
/vol/dev/aliases/floppy0
30
(Continued)
Access Raw Data With This Path
Second diskette drive First CD-ROM drive Second CD-ROM drive First or second removable hard disk First PCMCIA drive
31
32
C H A P T E R
This chapter describes how to manage removable media from the command line in the Solaris OS. For information on the procedures associated with managing removable media, see Managing Removable Media (Task Map) on page 33. For background information on removable media, see Chapter 1.
1. Load media. 2. (Optional) Format the diskette. 3. (Optional) Add a UFS or PCFS le system.
Insert the diskette into the drive and type the How to Load Removable volcheck command. Media on page 35 Format diskette. Add a UFS or PCFS le system to use the media for transferring les. Add a UFS or UDFS le system to a DVD-RAM device. How to Format a Diskette (rmformat) on page 36 How to Create a File System on Removable Media on page 37 How to Create a File System on a DVD-RAM on page 39 How to Check a File System on Removable Media on page 39 How to Repair Bad Blocks on Removable Media on page 40 How to Enable or Disable Write Protection on Removable Media on page 41
4. (Optional) Check the media. 5. (Optional) Repair bad blocks on the media. 6. (Optional) Apply read or write and password protection.
Verify the integrity of the le system on the media. Repair any bad blocks on the media, if necessary. Apply read or write protection or password protection on the media, if necessary.
33
Formatting Diskettes
Formatting Diskettes
The rmformat command is a utility that you can use to format and protect rewritable diskettes. This utility does not require superuser privilege unless vold is not running. Volume management (vold) mounts le systems automatically. So, you might have to unmount media before you can format it, if the media contains an existing le system. The rmformat command has three formatting options:
I
quick This option formats diskettes without certication or with limited certication of certain tracks on the media. long This option completely formats diskettes. For some devices, the use of this option might include the certication of the whole media by the drive. force This option formats completely without user conrmation. For diskettes with a password-protection mechanism, this option clears the password before formatting. This feature is useful when a password is forgotten. On diskettes without password protection, this option forces a long format.
SPARC and x86 UFS formats are different. SPARC uses little-endian bit coding, x86 uses big-endian. Media formatted for UFS is restricted to the hardware platform on which they were formatted. So, a diskette formatted for UFS on a SPARC based platform cannot be used for UFS on an x86 platform. Likewise, a diskette formatted for UFS on an x86 platform cannot be used on a SPARC platform. The same restriction is applies to PCMCIA memory cards. A complete format for SunOSTM le systems consists of the basic bit formatting in addition the structure to support a SunOS le system. A complete format for a DOS le system consists of the basic bit formatting in addition the structure to support either an MS-DOS or an NEC-DOS le system. The procedures required to prepare a media for each type of le system are different. Therefore, before you format a diskette or PCMCIA memory card, consider which procedure to follow. For more information, see Managing Removable Media (Task Map) on page 33.
For information on diskette names, see Table 31. Diskettes that are not named (that is, they have no label) are assigned the default name of noname.
34
Formatting Diskettes
UDFS
On a Solaris system (either SPARC or x86), you can format diskettes with the following densities.
Diskette Size
Diskette Density
Capacity
3.5 3.5
By default, the diskette drive formats a diskette to a like density. This default means that a 1.44 Mbyte drive attempts to format a diskette for 1.44 Mbytes, regardless of whether the diskette is, in fact, a 1.44 Mbyte diskette, unless you instruct it otherwise. In other words, a diskette can be formatted to its capacity or lower, and a drive can format to its capacity or lower.
1 2
(Optional) Notify volume management if you are using a legacy, non-USB diskette device.
$ volcheck -v
Two status messages are possible: media was found Volume management detected the media and will attempt to mount it in the directory described in Table 31. If the media is formatted properly, no error messages appear in the console. If the media is not formatted, the media was found message is still displayed. However, error messages similar to the following appear in the system console window: fd0: unformatted diskette or no diskette in the drive fd0: read failed (40 1 0) fd0: bad format
Chapter 2 Managing Removable Media (Tasks) 35
Formatting Diskettes
You must format the media before volume management can mount it. For more information, see Chapter 2. no media was found Volume management did not detect the media. Ensure that the media is inserted properly, and run volcheck again. If unsuccessful, check the media, which could be damaged. You can also try to mount the media manually.
Verify that the media was mounted by listing its contents. For example, do the following for a diskette:
$ ls /floppy floppy0 myfiles
Tip floppy0 is a symbolic link to the actual name of the diskette. In this case, myfiles. If the diskette has no name but is formatted correctly, the system refers to it as unnamed_floppy.
If nothing appears under the /floppy directory, the diskette was either not mounted or is not formatted properly. To nd out, run the mount command and look for the line that begins with /floppy (usually at the end of the listing): /floppy/name on /vol/dev/diskette0/name If this line does not appear, the diskette was not mounted. Check the system console window for error messages.
Verify that volume management is running. If so, you can use the shorter nickname for the device name.
$ svcs volfs STATE online STIME FMRI 10:39:12 svc:/system/filesystem/volfs:default
For information on starting vold, see How to Stop and Start Volume Management (vold) on page 46. For information on identifying media device names, see Using Removable Media Names on page 44.
2
See Formatting Diskettes on page 34 for more information on rmformat formatting options.
36
Formatting Diskettes
If the rmformat output indicates bad blocks, see How to Repair Bad Blocks on Removable Media on page 40.
3
Formatting a Diskette
This example shows how to format a diskette.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y .........................................................................
M
1
Become superuser. Determine the appropriate le system type and select one of the following:
I
37
Formatting Diskettes
Example 22
Example 23
This example shows how to create a PCFS le system without an fdisk partition.
$ rmformat -F quick /dev/rdiskette Formatting will erase all the data on disk. Do you want to continue? (y/n) y $ su # mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette Construct a new FAT file system on /dev/rdiskette: (y/n)? y #
38
Formatting Diskettes
1 2
5 6 7
Verify that you can read or write to the le system. When nished, eject the DVD-RAM. Restart vold.
# svcadm enable volfs
M
1 2
39
Formatting Diskettes
Example 24
Supply the block number in decimal, octal, or hexadecimal format from a previous rmformat session.
2
40
Formatting Diskettes
How to Enable or Disable Read or Write Protection and Set a Password on Removable Media
You can apply a password with a maximum of 32 characters for removable media that support this feature. You will receive a warning message if you attempt to apply a password on media that does not support this feature.
Determine whether you want to enable or disable read protection or write protection and set a password. Select one of the following:
I
41
Formatting Diskettes
$ rmformat -R enable device-name Please enter password (32 chars maximum): xxx Please reenter password:
I
Verify whether the medias read protection or write protection is enabled or disabled.
$ rmformat -p device-name
Example 25
This example shows to disable read protection and remove the password on a diskette.
$ rmformat -R disable /vol/dev/aliases/floppy0 Please enter password (32 chars maximum): xxx
42
C H A P T E R
This chapter describes how to access removable media from the command line in the Solaris OS. For information on the procedures associated with accessing removable media, see the following:
I I
Accessing Removable Media (Task Map) on page 43 Accessing Removable Media on a Remote System (Task Map) on page 49
1. (Optional) Add the removable media drive. 2. (Optional) Decide whether you want to use removable media with or without volume management (vold). 3. Access removable media.
Add the removable media drive to your system, if necessary. Volume management (vold) runs by default. Decide whether you want to use removable media with or without volume management.
How to Add a New Removable Media Drive on page 45 How to Stop and Start Volume Management (vold) on page 46
Access different kinds of removable How to Access Information on media with or without volume Removable Media on page 46 management running. Copy les or directories from the How to Copy Information From media as you would from any other Removable Media on page 47 location in the le system.
43
Task
Description
For Instructions
Before ejecting the media, nd out if it is still in use. When you nish, eject the media from the drive.
How to Determine If Removable Media Is Still in Use on page 48 How to Eject Removable Media on page 48
Media
Device Name
/floppy
/vol/dev/aliases/floppy0
First, second, /cdrom0 third CD-ROM or /cdrom1 DVD-ROM drives /cdrom2 First, second, third PCMCIA drive /pcmem/pcmem0 /pcmem/pcmem1 /pcmem/pcmem2 USB memory stick /rmdisk/noname
/vol/dev/rdsk/cntn[dn]/ volume-name
/vol/dev/rdsk/cntndn/ volume-name
/vol/dev/dsk/cntndn/volume-name:c
44
Create the /reconfigure le. Reboot the system so that volume management recognizes the new media drive.
4 5
Turn off power to the system. Connect the new media drive. See your hardware handbook for specic instructions.
Turn on power to the system. The system automatically comes up to multiuser mode.
Chapter 3 Accessing Removable Media (Tasks) 45
Ensure that the media is not being used. If you are not sure whether you have found all users of the media, use the fuser command, see How to Determine If Removable Media Is Still in Use on page 48.
2 3
M
1
(Optional) Check for media in the drive if you are using a legacy, non-USB diskette device.
% volcheck
Use the appropriate device name to access information by using the command-line interface. See Table 31 for an explanation of device names.
Example 31
$ ls /rmdisk rmdisk0/
rmdisk1/
This example shows how to view the symbolic links on a DVD or CD.
$ ls -lL /cdrom/cdrom0 total 24 dr-xr-xr-x 2 root drwxr-xr-x 18 root drwxr-xr-x 2 root drwxr-xr-x 2 root drwxr-xr-x 2 root drwxr-xr-x 2 root
23 23 23 23 23 23
s0 s1 s2 s3 s4 s5
This example shows how to access information on a PCMCIA memory card as follows:
$ ls /pcmem/pcmem0 pcmem0 myfiles
The ls command displays the contents of a mounted media. If no contents are displayed, see How to Access Information on Removable Media on page 46.
2
(Optional) Copy the les or directories. For example, for a DVD, you would do the following:
$ cp /cdrom/sol_10_305_sparc/s0/Solaris_10/Tools/add_install_client . $ ls -l -rwxr-xr-x 1 pmorph gelfs 66393 Jun 14 16:08 add_install_client
Chapter 3 Accessing Removable Media (Tasks) 47
For example, for a PCMCIA memory card, you would do the following:
$ cp /pcmem/pcmem0/readme2.doc . $ cp -r /pcmem/pcmem0/morefiles .
M
1 2
The -u displays the user of the media. For more information, see fuser(1M).
3
Example 32
M
1
48
For example, for a USB memory stick, you would do the following:
# eject rmdisk0
For example, for a PCMCIA memory card, you would do the following:
# eject pcmem0
congure your system to share its media drives to make any media in those drives available to other systems. Access the remote media on the local system.
How to Make Local Media Available to Other Systems on page 49 How to Access Information on Removable Media on page 46
1 2
The dummy mount point can be any directory name, for example, /dummy. This directory will not contain any les. Its only purpose is to wake up the NFS daemon so that it notices your shared media drive.
Chapter 3 Accessing Removable Media (Tasks) 49
When you start the NFS server service, it will encounter this entry, wake up, and notice the shared media drive.
4
The following output is returned from the svcs command if NFS server service is running:
online 5 14:28:43 svc:/network/nfs/server:default
Identify the NFS server status, and select one of the following:
I I
If the NFS server service is running, go to Step 7. If the NFS server service is not running, go to the next step.
These lines share any media loaded into your systems CD-ROM drive. You can, however, limit sharing to a particular CD or series of CDs, as described in share(1M).
10
11
Load the media. The media you now load, and all subsequent media, is available to other systems. Remember to wait until the light on the drive stops blinking before you verify this task. To access the media, the remote user must mount it by name, according to the instructions in How to Access Removable Media on Remote Systems on page 53.
12
Verify that the media is indeed available to other systems. If the media is available, its share conguration is displayed. The shared dummy directory is also displayed.
# share /dummy ro "" /cdrom/sol_10_305_sparc/s5 /cdrom/sol_10_305_sparc/s4 /cdrom/sol_10_305_sparc/s3 /cdrom/sol_10_305_sparc/s2 /cdrom/sol_10_305_sparc/s1 /cdrom/sol_10_305_sparc/s0
ro ro ro ro ro ro
Example 33
ro ro ro ro ro ro
Example 34
Example 35
52
""
Select an existing directory to serve as the mount point. Or create a mount point.
$ mkdir /directory
where /directory is the name of the directory that you create to serve as a mount point for the remote systems CD.
2
Is the name of the system whose media you will mount. Is the name of the media you want to mount. Is the local directory onto which you will mount the remote media.
Log out as superuser. Verify that the media has been mounted.
$ ls /media
Example 36
Example 37
Example 38
54
C H A P T E R
This chapter provides step-by-step instructions for writing and copying data CDs and DVDs and audio CDs with the cdrw command.
I I I I I I I I I
How to Restrict User Access to Removable Media With RBAC on page 58 How to Identify a CD or DVD Writer on page 59 How to Check the CD or DVD Media on page 60 How to Create an ISO 9660 File System for a Data CD or DVD on page 61 How to Create a Multi-Session Data CD on page 61 How to Create an Audio CD on page 64 How to Extract an Audio Track on a CD on page 65 How to Copy a CD on page 66 How to Erase CD-RW Media on page 66
Create data CDs and DVDs. Create audio CDs. Extract audio data from an audio CD. Copy CDs and DVDs. Erase CD-RW media.
Software Supplement for the Solaris 8 Operating Environment 1/01 CD Part of the SolarisTM release starting in the Solaris 9 release
55
Term
Description
CD read media that can be written once and after that, can only be read from. CD rewritable media that can be written to and erased. CD-RW media can only be read by CD-RW devices. Digital video disk (recordable) that can be written once and after that, can only be read from. These devices have much larger capacity than CD-R media. Digital video disk (recordable) that can be written once and after that, can only be read from. DVD+R devices have more complete error management system than DVD-R, which allows for more accurate burning to media, independent of the quality of the media. Digital video disk (rewritable) with storage capacity equal to a DVD-R. This media can be re-recorded by rst erasing the entire disk. Digital video disk (random-access rewritable) with storage capacity equal to a DVD+R. This medium allows overwriting of individual blocks without erasing the entire disk. Digital video disk (random access memory, rewritable) with circular rather than spiral tracks and hard sectoring. ISO, an acronym for Industry Standards Organization, is an organization that sets standards for computer storage formats. An ISO 9660 le system is a standard CD or DVD le system that enables you to read the same CD or DVD on any major computer platform. The standard, issued in 1988, was written by an industry group named High Sierra, named after the High Sierra Hotel in Nevada. Almost all computers with CD or DVD drives can read les from an ISO 9660 le system.
DVD+R
DVD-RW
DVD+RW
56
Term
Description
Adds Windows le system information. Adds UNIX le system information. (Rock Ridge is named after the town in the movie Blazing Saddles.)
Note These extensions are not exclusive. You can specify both
mkisofs -R and -j options for compatibility with both systems. (See mkisofs(1M) for details.) MMC-compliant recorder Acronym for Multi Media Command, which means these recorders comply with a common command set. Programs that can write to one MMC-compliant recorder should be able to write to all other recorders. Acronym for Compact Disc Digital Audio, which is an industry standard method for storing digital audio on compact discs. Also known by the term Red Book format. The ofcial industry specication calls for one or more audio les sampled in 16-bit stereo sound at a sampling rate of 44.1 kilohertz (kHz).
Term
Description
The process of erasing data from the CD-RW media. The command to create ISO le system on a CD. A complete track with lead-in and lead-out information. A complete data or audio unit.
The media cannot handle the drive speed. For example, some media are only certied for 2x or 4x speeds. The system is running too many heavy processes that are starving the writing process. Network congestion is causing delays in reading the image, and the image is on a remote system. The source drive is slower than the destination drive.
57
I I I
If any of these problems occur, you can lower the writing speed of the device by using the cdrw -p option. For example, the following command shows how to simulate writing at 4x speed:
$ cdrw -iS -p 4 image.iso
Note CD-R, CD-RW (not MRW formatted), DVD-R, and DVD-RW media support simulation
mode (-S), but DVD-RAM, DVD+R, DVD+RW, and any MRW-formatted media and some others do not support simulation mode. The following message is displayed if simulation mode is not supported:
Media does not support simulated writing
For more information about media types, see CD/DVD Media Commonly Used Terms on page 56. You can also use the cdrw -C option to use the stated media capacity for copying an 80-minute CD. Otherwise, the cdrw command uses a default value of 74 minutes for copying an audio CD. For more information, see cdrw(1).
1 2
For more information on starting the console, see Starting the Solaris Management Console in System Administration Guide: Basic Administration.
58 System Administration Guide: Devices and File Systems November 2006
Set up a role that includes the Device Management rights. For more information, see Chapter 9, Using Role-Based Access Control (Tasks), in System Administration Guide: Security Services.
4 5
Add users who need to use the cdrw command to the newly created role. Comment the following line in the /etc/security/policy.conf le:
AUTHS_GRANTED=solaris.device.cdrw
If you do not do this step, all users still have access to the cdrw command, not just the members of the device management role. After this le is modied, the device management role members are the only users who can use the cdrw command. Everyone else is denied access with the following message:
Authorization failed, Cannot access disks.
M
1
Identify whether the media is blank or whether a table of contents exists on the media. For example:
$ cdrw -M Device : YAMAHA CRW8824S Firmware : Rev. 1.00 (26/04/00) Media is blank %
59
Insert a CD or DVD into the drive. The CD or DVD can be any CD or DVD that the drive can read.
(Optional) If you do not see the drive in the list, select one of the following so that the system recognizes the drive.
I
60
1 2
Creates Rock Ridge information and resets le ownerships to zero. Identies the path name used to create the ISO 9660 le system. Identies the name of the le system to be put on the CD or DVD.
61
Identies the name of the ISO le system. Creates Rock Ridge information and resets le ownerships to zero. Identies a volume label to be used as the mount point by vold. Identies the ISO image directory to create.
Copy the ISO le system for the rst session onto the CD.
$ cdrw -iO infoA Initializing device...done. Writing track 1...done. done. Finalizing (Can take several minutes)...done.
-i infoA -O
3 4
Identies the name of the image le to write to the CD. Keeps the CD open for writing.
Re-insert the CD after it is ejected. Identify the path name of the CD media to include in the next write session.
$ eject -n . . . cdrom0 -> /vol/dev/rdsk/c2t4d0/my_infoA
Identify the next writeable address on the CD to write the next session.
% cdrw -M /cdrom Device : YAMAHA CRW8424S Firmware : Rev. 1.0d (06/10/99) Track No. |Type |Start address ----------+--------+------------1 |Audio |0 2 |Audio |33057 3 |Data |60887
62
4 5 Leadout
Note the address in the Next writable address output so that you can provide this address when you write the next session.
6
Create the next ISO le system for the next CD session, and write it onto the CD.
$ mkisofs -o infoB -r -C 0,91118 -M /vol/dev/rdsk/c2t4d0/my_infoA /data/infoB Total translation table size: 0 Total rockridge attributes bytes: 16602 Total directory bytes: 22528 Path table size(bytes): 86 Max brk space used 20000 97196 extents written (189 Mb)
Identies the name of the ISO le system. Creates Rock Ridge information and resets le ownerships to zero. Identies the starting address of the rst session and the next writable address. Species the path of the existing ISO image to be merged. Identies the ISO image directory to create.
Creating an Audio CD
You can use the cdrw command to create audio CDs from individual audio tracks or from .au and .wav les. The supported audio formats are describes in the following table:
Format
Description
Sun .au le with data in Red Book CDDA format RIFF (.wav) le with data in Red Book CDDA format .cda le with raw CD audio data, which is 16-bit PCM stereo at 44.1 kHz sample rate in little-endian byte order
63
Format
Description
aur
If no audio format is specied, the cdrw command tries to determine the audio le format based on the le extension. The case of the characters in the extension is ignored.
1 2
Creating an Audio CD
The following example shows how to create an audio CD.
$ cdrw -a bark.wav chirp.au meow.wav Initializing device...done. Writing track 1...done. done. Writing track 2...done. Writing track 3...done. done. Finalizing (Can take several minutes)...done.
The following example shows how to create a multisession audio CD. The CD is ejected after the rst session is written. You would need to re-insert the CD before the next writing session.
$ cdrw -aO groucho.wav chico.au harpo.wav Initializing device...done. Writing track 1...done. done. Writing track 2...done. Writing track 3...done. done. Finalizing (Can take several minutes)...done.
64 System Administration Guide: Devices and File Systems November 2006
<Re-insert CD> $ cdrw -a zeppo.au Initializing device...done. Writing track 1...done. done. Finalizing (Can take several minutes)...done.
1 2
-x T audio-type audio-le
3
Extracts audio data from an audio CD. Identies the type of audio le to be extracted. Supported audio types are sun, wav, cda, or aur. Identies the audio track to be extracted.
Example 43
How to Copy a CD
This procedure describes how to extract all the tracks from an audio CD into a directory and then copy all of them onto a blank CD.
Note By default, the cdrw command copies the CD into the /tmp directory. The copying might require up to 700 Mbytes of free space. If there is insufcient space in the /tmp directory for copying the CD, use the -m option to specify an alternate directory.
1 2
Insert an audio CD into a CD-RW drive. Create a directory for the audio les.
$ mkdir /music_dir
An Extracting audio ... message is display for each track. The CD is ejected when all the tracks are extracted.
4
Insert a blank CD and press Return. After the tracks are extracted, the audio CD is ejected. You are prompted to insert a blank CD.
Example 44
Copying a CD
This example shows how to copy one CD to another CD. You must have two CD-RW devices to do this task.
$ cdrw -c -s cdrom0 -d cdrom1
66
Erasing just the last session with the -b session option is faster than erasing the entire media with the -b all option. You can use the -b session option even if you used the cdrw command to create a data or audio CD in just one session.
I
67
68
C H A P T E R
This chapter provides overview information and step-by-step instructions for managing peripheral devices, such as disks, CD-ROMs, and tape devices, in the Solaris release. This is a list of the overview information in this chapter.
I I I I I I
Whats New in Device Management in the Solaris 10 11/06 Release? on page 69 Whats New in Device Management in the Solaris 10 Release? on page 72 Where to Find Device Management Tasks on page 74 About Device Drivers on page 74 Automatic Conguration of Devices on page 75 Displaying Device Conguration Information on page 76
How to Display System Conguration Information on page 77 How to Add a Device Driver on page 82 How to Add a Peripheral Device on page 81
For information about accessing peripheral devices, see Chapter 10. Device management in the Solaris release usually involves adding and removing peripheral devices from systems, possibly adding a third-party device driver to support a device, and displaying system conguration information.
Support for extended PCIe conguration space Support for PCIe baseline error handling and MSI interrupts Modied IEEE-1275 properties for PCIe devices PCIe hotplug support (both native and ACPI-based) by enhancing the cfgadm_pci component of the cfgadm command ATTN Button usage based PCIe peripheral autoconguration
The administrative model for hotplugging PCIe peripherals is the same as for PCI peripherals, which uses the cfgadm command. Check your hardware platform guide to ensure that PCIe and PCIe hotplug support is provided on your system. In addition, carefully review the instructions for physically inserting or removing adapters on your system and the semantics of device auto-conguration, if applicable. For information about using the cfgadm command with PCIe peripherals, see PCI or PCIe Hot-Plugging With the cfgadm Command (Task Map) on page 99.
These enhancements mean that the above utilities might detect some of the following usage scenarios:
I
70
I I I I
Device is a dump or swap device Mounted le system or an entry for the device exists in the /etc/vfstab le Device is part of live upgrade conguration Device is part of a Solaris Volume Manager conguration or Veritas Volume Manager conguration
For example, if you attempt to use the format utility to access an active device, you will see a message similar to the following:
# format . . . Specify disk (enter its number): 1 selecting c0t1d0 [disk formatted] Warning: Current Disk has mounted partitions. /dev/dsk/c0t1d0s0 is currently mounted on /. Please see umount(1M). /dev/dsk/c0t1d0s1 is currently used by swap. Please see swap(1M).
However, these utilities do not detect all scenarios in the same way. For example, you can use the newfs command to create a new le system on a device in a live upgrade conguration. You cannot use the newfs command to create a new le system on a device that is part of a live upgrade conguration if it also has a mounted le system.
devices by setting the remvalue to true in the /kernel/drv/scsa2usb.conf le. Setting this parameter to true means that the device is treated as a removable media device at the driver level, if that behavior is preferred. For more information on using these devices, see scsa1394(7D)and Using USB Mass Storage Devices (Task Map) on page 132.
Operations in the /devices directory result in attaching device entries. Unused device entries are detached. Increases system boot performance because only device entries that are needed to boot the system are attached. New device entries are added as the devices are accessed.
The default settings in the /etc/power.conf le ensure Energy Star compliance and fully support power management of these systems. The following adapters connect external Fibre Channel storage devices:
I I
Sun StorEdge PCI Dual Fibre Channel Host Adapter Sun StorEdge PCI Single Fibre Channel Network Adapter
If a combination of the above adapters and Sun systems are used to attach external Fibre Channel storage devices, the external storage devices will also be power managed by default. Under the following conditions, power management should be disabled:
I
If the system has Fibre Channel attached disks that are connected to a storage area network (SAN) If the system has Fibre Channel attached disks that are used in a multi-initiator conguration, such as with the SunCluster software If the system is using IP over a Fibre Channel interface (see fcip(7D))
Power management should not be enabled when more than one Solaris system might share the same devices, as in the above conditions.
Chapter 5 Managing Devices (Overview/Tasks) 73
You can disable power management for the system by changing the autopm keyword in the /etc/power.conf le as follows:
autopm disable
Then, recongure power management by running the pmconfig command or by rebooting the system. For more information, see power.conf(4) and pmconfig(1M).
Chapter 13 or Chapter 14 SCSI Hot-Plugging With the cfgadm Command on page 89 or PCI or PCIe Hot-Plugging With the cfgadm Command on page 99 Using USB Mass Storage Devices (Task Map) on page 132 How to Add a Peripheral Device on page 81 Chapter 8, Managing Terminals and Modems (Overview), in System Administration Guide: Advanced Administration Chapter 1, Managing Printing Services (Overview), in System Administration Guide: Advanced Administration Chapter 4, Controlling Access to Devices (Tasks), in System Administration Guide: Security Services
Hot-plug a USB device. Add a CD-ROM or tape device. Add a modem. Add a printer. Secure a device.
74
I I I
The Solaris software does not directly communicate with all these devices. Each type of device requires different data formats, protocols, and transmission rates. A device driver is a low-level program that allows the operating system to communicate with a specic piece of hardware. The driver serves as the operating systems interpreter for that piece of hardware.
Platform-specic kernel components Kernel components common to all platforms that are needed for booting the system Kernel components common to all platforms within a particular instruction set
The system determines what devices are attached to it at boot time. Then, the kernel congures itself dynamically, loading needed modules into memory. At this time, device drivers are loaded when devices, such as disk devices and tape devices, are accessed. This process is called autoconguration because all kernel modules are loaded automatically when they are needed. You can customize the way in which kernel modules are loaded by modifying the /etc/system le. For instructions on modifying this le, see system(4).
75
Main memory is used more efciently because modules are loaded when needed. There is no need to recongure the kernel when new devices are added to the system. Drivers can be loaded and tested without having to rebuild the kernel and reboot the system.
Autoconguration is used when you add a new device (and driver) to the system. At this time, you might need to perform reconguration boot so that the system recognizes the new device unless the device is hot-pluggable. For information about hot-plugging devices, see Chapter 6.
prtconf
Displays system conguration information, including the total amount of memory and the device conguration as described by the systems device hierarchy. The output displayed by this command depends upon the type of system. Displays device conguration information, including system hardware, pseudo devices, loadable modules, and selected kernel parameters.
prtconf(1M)
sysdef
sysdef(1M)
76
Command
Description
Man Page
dmesg
Displays system diagnostic messages as well as a list of devices attached to the system since the last reboot.
dmesg(1M)
For information on the device names that are used to identify devices on the system, see Device Naming Conventions on page 180.
This message does not always mean that a driver is unavailable for this device. This message means that no driver is currently attached to the device instance because no device exists at this node or the device is not in use. Drivers are loaded automatically when the device is accessed. They are unloaded when the device is not in use.
Display all the devices connected to a system. For example, the following prtconf -v output on a SunBlade 1000 identies the disk devices connected to the system. The detailed disk information is described in the Device Minor Nodes section within the ssd/fp driver section.
$ /usr/sbin/prtconf -v | more . . . Device Minor Nodes: dev=(118,8) dev_path=/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w210000
77
2037bde864,0:a spectype=blk type=minor dev_link=/dev/dsk/c0t1d0s0 dev_path=/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w210000 2037bde864,0:a,raw spectype=chr type=minor dev_link=/dev/rdsk/c0t1d0s0 dev=(118,9) dev_path=/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w210000 2037bde864,0:b spectype=blk type=minor dev_link=/dev/dsk/c0t1d0s1 dev_path=/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w210000 2037bde864,0:b,raw . . .
I
Display information about one specic device connected to the system. For example, the following prtconf output on a SunBlade 1000 displays the ssd instance number for /dev/dsk/c0t1d0s0.
# prtconf -v /dev/dsk/c0t1d0s0 ssd, instance #1
Display device usage information. For example, the following fuser command displays which processes are accessing the /dev/console device.
# fuser -d /dev/console /dev/console: 346o #
323o
Example 51
78
packages (driver not attached) SUNW,builtin-drivers (driver not attached) deblocker (driver not attached) disk-label (driver not attached) terminal-emulator (driver not attached) obp-tftp (driver not attached) dropins (driver not attached) kbd-translator (driver not attached) ufs-file-system (driver not attached) chosen (driver not attached) openprom (driver not attached) client-services (driver not attached) options, instance #0 aliases (driver not attached) memory (driver not attached) virtual-memory (driver not attached) SUNW,UltraSPARC-III, instance #0 memory-controller, instance #0 SUNW,UltraSPARC-III, instance #1 memory-controller, instance #1 pci, instance #0 ebus, instance #0 flashprom (driver not attached) bbc (driver not attached) ppm, instance #0 i2c, instance #0 dimm-fru, instance #0 dimm-fru, instance #1 dimm-fru, instance #2 dimm-fru, instance #3 nvram, instance #4 idprom (driver not attached) i2c, instance #1 cpu-fru, instance #5 temperature, instance #0 cpu-fru, instance #6 temperature, instance #1 fan-control, instance #0 motherboard-fru, instance #7 i2c-bridge (driver not attached) beep, instance #0 rtc, instance #0 gpio (driver not attached) pmc (driver not attached) floppy (driver not attached) parallel (driver not attached) serial, instance #0 network, instance #0
Chapter 5 Managing Devices (Overview/Tasks) 79
firewire, instance #0 usb, instance #0 scsi (driver not attached) disk (driver not attached) tape (driver not attached) scsi (driver not attached) disk (driver not attached) tape (driver not attached) pci, instance #1 SUNW,qlc, instance #0 fp (driver not attached) disk (driver not attached) fp, instance #1 ssd, instance #1 ssd, instance #0 (driver not attached) ssd, instance #2 (driver not attached) ssd, instance #3 (driver not attached) ssd, instance #4 (driver not attached) ssd, instance #5 (driver not attached) ssd, instance #6 (driver not attached) upa, instance #0 SUNW,ffb, instance #0 (driver not attached) ppm, instance #0 pseudo, instance #0
isa, instance #0 motherboard (driver not attached) pnpADP,1542, instance #0 asy, instance #0 asy, instance #1 lp, instance #0 (driver not attached) fdc, instance #0 fd, instance #0 fd, instance #1 (driver not attached) kd (driver not attached) kdmouse (driver not attached) . . .
Shutting down the system Connecting the device to the system Rebooting the system
Use How to Add a Peripheral Device on page 81 to add the following devices that are not hot-pluggable to a system:
I I I I
In some cases, you might have to add a third-party device driver to support the new device. For information on hot-plugging devices, see Chapter 6.
M
1 2
The /reconfigure le causes the Solaris software to check for the presence of any newly installed devices the next time you turn on or boot your system.
Chapter 5 Managing Devices (Overview/Tasks) 81
-i0 -g30 -y
Brings the system to the 0 init state, which is the appropriate state for turning the system power off for adding and removing devices. Shuts the system down in 30 seconds. The default is 60 seconds. Continues the system shutdown without user intervention. Otherwise, you are prompted to continue the shutdown process.
Select one of the following to turn off power to the system after it is shut down:
I I
For SPARC platforms, it is safe to turn off power if the ok prompt is displayed. For x86 platforms, it is safe to turn off power if the type any key to continue prompt is displayed.
Turn off power to all peripheral devices. For the location of power switches on any peripheral devices, refer to the hardware installation guides that accompany your peripheral devices.
Install the peripheral device, making sure that the device you are adding has a different target number than the other devices on the system. Often, a small switch is located at the back of the disk for selecting the target number. Refer to the hardware installation guide that accompanies the peripheral device for information on installing and connecting the device.
Turn on the power to the system. The system boots to multiuser mode, and the login prompt is displayed.
Verify that the peripheral device has been added by attempting to access the device. For information on accessing the device, see Chapter 10.
1 2
Become superuser. Place the tape, diskette, or CD-ROM into the drive.
82
-d device package-name
4
Identies the device path name that contains the package. Identies the package name that contains the device driver.
The system prompt returns with no response if the package is installed correctly.
Example 52
83
84
C H A P T E R
This chapter provides instructions for dynamically conguring devices in the Solaris OS. You can add, remove, or replace devices in the Solaris OS while the system is still running, if the system components support hot-plugging. If the system components do not support hot-plugging, you can reboot the system to recongure the devices. For information on the procedures associated with dynamically conguring devices, see the following:
I I I I
SCSI Hot-Plugging With the cfgadm Command (Task Map) on page 88 PCI or PCIe Hot-Plugging With the cfgadm Command (Task Map) on page 99 Application Developer RCM Script (Task Map) on page 107 System Administrator RCM Script (Task Map) on page 108
For information on hot-plugging USB devices with the cfgadm command, see Hot-Plugging USB Devices With the cfgadm Command on page 156. For information about accessing devices, see Chapter 10.
In addition, you can hot-plug the following devices with the cfgadm command:
85
I I I I
USB devices on SPARC and x86 platforms SCSI devices on SPARC and x86 platforms PCI devices on SPARC and x86 platforms PCIe devices on SPARC or x86 platforms
Displaying system component status Testing system components Changing component congurations Displaying conguration help messages
The benet of using the cfgadm command to recongure systems components is that you can add, remove, or replace components while the system is running. An added benet is that the cfgadm command guides you through the steps needed to add, remove, or replace system components. For step-by-step instructions on hot-plugging components, see the following:
I I I
SCSI Hot-Plugging With the cfgadm Command on page 89 PCI or PCIe Hot-Plugging With the cfgadm Command on page 99 cfgadm(1M)
Note Not all SCSI and PCI controllers support hot-plugging with the cfgadm command.
As part of Suns high availability strategy, dynamic reconguration is expected to be used in conjunction with additional layered products, such as alternate pathing or fail over software. Both products provide fault tolerance in the event of a device failure. Without any high availability software, you can replace a failed device by manually stopping the appropriate applications, unmounting noncritical le systems, and then proceeding with the add or remove operations.
Note Some systems have slots that hot-pluggable and slots that are not hot-pluggable. For
information about hot-plugging devices on your specic hardware conguration, such as on enterprise-level systems, refer to your hardware conguration documentation.
Attachment Points
The cfgadm command displays information about attachment points, which are locations in the system where dynamic reconguration operations can occur. An attachment point consists of the following:
I I
An occupant, which represents a hardware component that can be congured into the system A receptacle, which is the location that accepts the occupant
86
Attachment points are represented by logical and physical attachment point IDs (Ap_Ids). The physical Ap_Id is the physical path name of the attachment point. The logical Ap_Id is a user-friendly alternative for the physical Ap_Id. For more information on Ap_Ids, refer to cfgadm(1M). The logical Ap_Id for a SCSI Host Bus Adapter (HBA), or SCSI controller, is usually represented by the controller number, such as c0. In cases where no controller number has been assigned to a SCSI HBA, then an internally generated unique identier is provided. An example of a unique identier for a SCSI controller is the following: fas1:scsi The logical Ap_Id for a SCSI device usually has this format: HBA-logical-apid::device-identier In the following example, c0 is the logical Ap_Id for the SCSI HBA: c0::dsk/c0t3d0 The device identier is typically derived from the logical device name for the device in the /dev directory. For example, a tape device with logical device name, /dev/rmt/1, has the following logical Ap_Id: c0::rmt/1 If a logical Ap_Id of a SCSI device cannot be derived from the logical name in the /dev directory, then an internally generated unique identier is provided. An example of an identier for the /dev/rmt/1 tape device is the following: c0::st4 For more information on SCSI Ap_Ids, refer to cfgadm_scsi(1M). The cfgadm command represents all resources and dynamic reconguration operations in terms of a common set of states (such as congured and uncongured) and operations (such as connect, congure, uncongure, and so on). For more information on these common states and operations, see cfgadm(1M). The following table shows the receptacle and occupant states for the SCSI HBA attachment points.
Receptacle State
Description
Occupant State
Description
configured unconfigured
The following table shows the receptacle and occupant states for SCSI device attachment points.
Chapter 6 Dynamically Conguring Devices (Tasks) 87
Receptacle State
Description
Occupant State
Description
configured unconfigured
The state of SCSI attachment points is unknown unless special hardware indicates otherwise. For instructions on displaying SCSI component information, see How to Display Information About SCSI Devices on page 90.
The device driver must support hot-plugging. Critical resources must be accessible through an alternate pathway.
For example, if a system has only one Ethernet card installed in it, the Ethernet card cannot be detached without losing the network connection. This detachment requires additional layered software support to keep the network connection active.
There are slots available. The device driver supports hot-plugging for this adapter card.
For step-by-step instructions on adding or removing a PCI adapter card, see PCI or PCIe Hot-Plugging With the cfgadm Command on page 99.
88
Task
Description
For Instructions
Uncongure a SCSI controller. Congure a SCSI controller. Congure a SCSI device. Disconnect a SCSI controller. Connect a SCSI controller. Add a SCSI device to a SCSI bus. Replace an identical device on a SCSI controller. Remove a SCSI device. Troubleshoot SCSI conguration problems.
Uncongure a SCSI controller. Congure a SCSI controller that was previously uncongured. Congure a specic SCSI device. Disconnect a specic SCSI controller. Connect a specic SCSI controller that was previously disconnected. Add a specic SCSI device to a SCSI bus. Replace a device on the SCSI bus with another device of the same type. Remove a SCSI device from the system. Resolve a failed SCSI uncongure operation.
How to Uncongure a SCSI Controller on page 90 How to Congure a SCSI Controller on page 91 How to Congure a SCSI Device on page 91 How to Disconnect a SCSI Controller on page 92 SPARC: How to Connect a SCSI Controller on page 93 SPARC: How to Add a SCSI Device to a SCSI Bus on page 94 SPARC: How to Replace an Identical Device on a SCSI Controller on page 95 SPARC: How to Remove a SCSI Device on page 96 How to Resolve a Failed SCSI Uncongure Operation on page 98
consult your hardware documentation to conrm whether hot-plugging is supported for your SCSI devices. These procedures use specic devices as examples to illustrate how to use the cfgadm command to hot-plug SCSI components. The device information that you supply, and that the cfgadm command displays, depends on your system conguration.
89
Display information about a systems SCSI controllers and their attached devices.
# cfgadm -al Ap_Id c0 c0::dsk/c0t0d0 c0::rmt/0 c1 c1::dsk/c1t3d0 c1::dsk/c1t4d0 Type scsi-bus disk tape scsi-bus disk unavailable Receptacle connected connected connected connected connected connected Occupant configured configured configured configured configured unconfigured Condition unknown unknown unknown unknown unknown unknown
Note The cfgadm -l commands displays information about SCSI HBAs but not SCSI devices. Use the cfgadm -al command to display information about SCSI devices such as disk and tapes.
1 2
90
Notice that the Occupant column for c1 species unconfigured, indicating that the SCSI bus has no congured occupants. If the uncongure operation fails, see How to Resolve a Failed SCSI Uncongure Operation on page 98.
1 2
The previous uncongure procedure removed all devices on the SCSI bus. Now all the devices are congured back into the system.
1 2
The following procedure uses SCSI controller c1 in the example of disconnecting a SCSI device.
1 2
Become superuser. Verify that the device is connected before you disconnect it.
# cfgadm -al Ap_Id c0 c0::dsk/c0t0d0 c0::rmt/0 c1 c1::dsk/c1t3d0 c1::dsk/c1t4d0 Type scsi-bus disk tape scsi-bus disk disk Receptacle connected connected connected connected connected connected Occupant configured configured configured configured configured configured Condition unknown unknown unknown unknown unknown unknown
92
Caution This command suspends all I/O activity on the SCSI bus until the cfgadm -c connect command is used. The cfgadm command does some basic checking to prevent critical partitions from being disconnected, but it cannot detect all cases. Inappropriate use of this command can result in a system hang and could require a system reboot.
The controller and all the devices that are attached to it are disconnected from the system.
1 2
c1::dsk/c1t4d0
disk
connected
configured
unknown
1 2
Add the SCSI device to the SCSI bus. a. Type the following cfgadm command. For example:
# cfgadm -x insert_device c1 Adding device to SCSI HBA: /devices/sbus@1f,0/SUNW,fas@1,8800000 This operation will suspend activity on SCSI bus: c1
I/O activity on the SCSI bus is suspended while the hot-plug operation is in progress. c. Connect the device and then power it on. d. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt.
Enter y if operation is complete or n to abort (yes/no)? y 4
94
1 2
Replace a device on the SCSI bus with another device of the same type. a. Type the following cfgadm command. For example:
# cfgadm -x replace_device c1::dsk/c1t4d0 Replacing SCSI device: /devices/sbus@1f,0/SUNW,fas@1,8800000/sd@4,0 This operation will suspend activity on SCSI bus: c1
b. Type y at the Continue (yes/no)? prompt to proceed. I/O activity on the SCSI bus is suspended while the hot-plug operation is in progress.
Continue (yes/no)? y SCSI bus quiesced successfully. It is now safe to proceed with hotplug operation.
95
d. Add the replacement device. Then, power it on. The replacement device should be of the same type and at the same address (target and lun) as the device to be removed. e. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt.
Enter y if operation is complete or n to abort (yes/no)? y 4
1 2
Remove the SCSI device from the system. a. Type the following cfgadm command. For example:
# cfgadm -x remove_device c1::dsk/c1t4d0 Removing SCSI device: /devices/sbus@1f,0/SUNW,fas@1,8800000/sd@4,0 This operation will suspend activity on SCSI bus: c1
96
I/O activity on the SCSI bus is suspended while the hot-plug operation is in progress. c. Power off the device to be removed and remove it. d. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt.
Enter y if operation is complete or n to abort (yes/no)? y 4
Verify that the device has been removed from the system.
# cfgadm -al Ap_Id c0 c0::dsk/c0t0d0 c0::rmt/0 c1 c1::dsk/c1t3d0 Type scsi-bus disk tape scsi-bus disk Receptacle connected connected connected connected connected Occupant configured configured configured configured configured Condition unknown unknown unknown unknown unknown
Cause You attempted to remove or replace a device with a mounted le system. Solution Unmount the le system that is listed in the error message and retry the cfgadm operation. Error Message
cfgadm: Component system is busy, try again: failed to offline: device-path Resource Information ------------------ -------------------------/dev/dsk/device-name swap area
Chapter 6 Dynamically Conguring Devices (Tasks) 97
Cause If you use the cfgadm command to remove a system resource, such as a swap device or a dedicated dump device, a similar error message is displayed if the system resource is still active. Solution Uncongure the swap areas on the device that is specied and retry the cfgadm operation. Error Message
cfgadm: Component system is busy, try again: failed to offline: device-path Resource Information ------------------ -------------------------/dev/dsk/device-name dump device (swap)
Cause You attempted to remove or replace a dump device that is congured on a swap area. Solution Uncongure the dump device that is congured on the swap area and retry the cfgadm operation. Error Message
cfgadm: Component system is busy, try again: failed to offline: device-path Resource Information ------------------ -------------------------/dev/dsk/device-name dump device (dedicated)
Cause You attempted to remove or replace a dedicated dump device. Solution Uncongure the dedicate dump device and retry the cfgadm operation.
1 2
98
Display the status of PCI hot-pluggable devices and slots on the system. Uncongure the card, disconnect power from the slot, and remove the card from the system. Insert the adapter card into a hot-pluggable slot, connect power to the slot, and congure the card.
How to Display PCI Slot Conguration Information on page 100 How to Remove a PCI Adapter Card on page 101 How to Add a PCI Adapter Card on page 103
Identify error message and possible Troubleshooting PCI solutions to resolve PCI Conguration Problems on page conguration problems. 105
99
1 2
The logical Ap_Id, pci1:hpc0_slot0, is the logical Ap_Id for hot-pluggable slot, Slot 7. The component hpc0 indicates the hot-pluggable adapter card for this slot, and pci1 indicates the PCI bus instance. The Type eld indicates the type of PCI adapter card that is present in the slot.
100 System Administration Guide: Devices and File Systems November 2006
system chassis. Refer to your platform guide for the cfgadm output of the hot-pluggable slots. The Busy eld can be displayed to ensure that the Ap_Id is not transitioning to another state before a hot-plug operation is attempted.
1 2
Become superuser. Determine which slot the PCI adapter card is in. For example:
# cfgadm pci Ap_Id pcie1 pcie2 pcie3 pcie4 Type unknown unknown unknown etherne/hp Receptacle empty empty empty connected Occupant unconfigured unconfigured unconfigured configured Condition unknown unknown unknown ok
101
pcie5 pcie6 3
pci-pci/hp unknown
Stop the application that has the device open. For example, if the device is an Ethernet card, use the ifconfig command to bring down the interface and unplumb the interface.
Uncongure the device manually by using the cfgadm(1M) command as shown below. Or, if you have a PCIe adapter card, use the auto-conguration method, such as pressing the slots Attention Button as dened by your platform guide.
# cfgadm -c unconfigure pcie4
Note The Type and Condition also become unknown when the device is uncongured.
Disconnect the power to the slot manually. If the auto-conguration method is used, this step is not necessary. Refer to your platform guide for more information.
# cfgadm -c disconnect pcie4
102
Follow appropriate instructions in your platform guide to remove the PCI adapter card. After the card is removed, the receptable state is empty. For example:
# cfgadm pci Ap_Id pcie1 pcie2 pcie3 pcie4 pcie5 pcie6 Type unknown unknown unknown unknown pci-pci/hp unknown Receptacle empty empty empty empty connected disconnected Occupant unconfigured unconfigured unconfigured unconfigured configured unconfigured Condition unknown unknown unknown unknown ok unknown
Note The auto-conguration method can be enabled or disabled at boot, depending on the platform
1 2
Become superuser. Identify the hot-pluggable slot and open latches. For example, pcie3.
# cfgadm pci Ap_Id pcie1 pcie2 pcie3 pcie4 pcie5 pcie6 Type unknown unknown unknown unknown pci-pci/hp unknown Receptacle empty empty empty empty connected disconnected Occupant unconfigured unconfigured unconfigured unconfigured configured unconfigured Condition unknown unknown unknown unknown ok unknown
3 4
Follow the appropriate instructions in your platform guide to insert a PCI adapter card into the slot. Determine which slot the PCI adapter card is in after it is inserted. For example:
# cfgadm pci Ap_Id pcie1 pcie2 pcie3 pcie4 Type unknown unknown unknown unknown Receptacle empty empty disconnected empty Occupant unconfigured unconfigured unconfigured unconfigured Condition unknown unknown unknown unknown
103
pcie5 pcie6 5
pci-pci/hp unknown
Connect the power to the slot manually using the cfgadm command. Or, if you have a PCIe adapter card, use the auto-conguration method, such as pressing the slots Attention Button as dened by your platform guide. For example:
# cfgadm -c connect pcie3
Congure the PCI adapter card manually by using the cfgadm command as shown below. If using the auto-conguration method, this step should not be necessary. Refer to your platform guide for more information. For example:
# cfgadm -c configure pcie3
Verify the conguration of the PCI adapter card in the slot. For example:
# cfgadm pci Ap_Id pcie1 pcie2 pcie3 pcie5 pcie6 Type unknown unknown etherne/hp pci-pci/hp unknown Receptacle empty empty connected connected disconnected Occupant Condition unconfigured unknown unconfigured unknown configured unknown configured ok unconfigured unknown
Congure any supporting software if this device is a new device. For example, if this device is an Ethernet card, use the ifconfig command to set up the interface.
Note The auto-conguration method can be enabled or disabled at boot, depending on the platform
104
Cause An invalid transition was attempted. Solution Check whether the cfgadm -c command was issued appropriately. Use the cfgadm command to check the current receptacle and occupant state and to make sure that the Ap_Id is correct. Error Message
cfgadm: Attachment point not found
Cause The specied attachment point was not found. Solution Check whether the attachment point is correct. Use the cfgadm command to display a list of available attachment points. Also check the physical path to see if the attachment point is still there.
Automatically release a device when you dynamically remove a device. This process also closes the device if the device is opened by an application.
105
Run site-specic tasks when you dynamically remove a device from the system.
An executable shell script (Perl, sh, csh, or ksh) or binary program that the RCM daemon runs. Perl is the recommended language. A script that runs in its own address space by using the user ID of the script le owner. A script that is run by the RCM daemon when you use the cfgadm command to dynamically recongure a system resource.
I I
An RCM script performs the following basic steps: 1. 2. 3. 4. Takes the RCM command from command-line arguments. Executes the command. Writes the results to stdout as name-value pairs. Exits with the appropriate exit status.
The RCM daemon runs one instance of a script at a time. For example, if a script is running, the RCM daemon does not run the same script until the rst script exits.
scriptinfo Gathers script information register Registers interest in resources resourceinfo Gathers resource information
106
I I I
preremove Releases the resource postremove Provides post-resource removal notication undoremove Undoes the actions done in preremove
The scripts register command to gather the list of resources (device names) that are identied in the script. The scripts queryremove and preremove commands prior to removing the resource if the scripts registered resources are affected by the dynamic remove operation. The scripts postremove command if the remove operation succeeds. However, if the remove operation fails, the RCM daemon runs the scripts undoremove command.
Task
Description
For Instructions
Identify the resources (device names) your application uses that you could potentially dynamically remove.
cfgadm(1M)
2. Identify the commands to release Identify the commands for the resource. notifying the application to cleanly release the resource from the application. 3. Identify the commands for post-removal of the resource. Include the commands for notifying the application of the resource removal.
Application documentation
rcmscript(4)
107
Task
Description
For Instructions
4. Identify the commands if the resource removal fails. 5. Write the RCM script. 6. Install the RCM script. 7. Test the RCM script
Include the commands for notifying the application of the available resource. Write the RCM script based on the information identied in tasks 1-4. Add the script to the appropriate script directory.
rcmscript(4)
Tape Backup RCM Script Example on page 111 How to Install an RCM Script on page 109
Test the script by running the script How to Test an RCM Script commands manually and by on page 110 initiating a dynamic reconguration operation.
Task
Description
For Instructions
1. Identify the resources to be dynamically removed. 2. Identify the applications to be stopped. 3. Identify the commands for pre-removal and post-removal of the resource. 4. Write the RCM script. 5. Install the RCM script. 6. Test the RCM script.
Identify the resources (device names) to be potentially removed by using the cfgadm -l command. Identify the commands for stopping the applications cleanly. Identify the actions to be taken before and after the resource is removed. Write the RCM script based on the information identied in tasks 1-3. Add the script to the appropriate script directory.
cfgadm(1M)
Tape Backup RCM Script Example on page 111 How to Install an RCM Script on page 109
Test the script by running the script How to Test an RCM Script on page 110 commands manually and by initiating a dynamic reconguration operation.
vendor service
Is the stock symbol of the vendor that provides the script, or any distinct name that identies the vendor. Is the name of the service that the script represents.
Scripts for specic systems Scripts for a specic hardware implementation Scripts for a specic hardware class Scripts for any hardware
M
1 2
Change the user ID and the group ID of the script to the desired values.
# chown user:group /usr/lib/rcm/scripts/SUNW,sample.pl
109
M
1 2
M
1
Test the script by running the script commands manually from the command line. For example:
$ $ $ $ script-name script-name script-name script-name scriptinfo register preremove resource-name postremove resource-name
3 4
Make sure that each RCM script command in your script prints appropriate output to stdout. Install the script in the appropriate script directory. For more information, see How to Install an RCM Script on page 109.
Test the script by initiating a dynamic remove operation. For example, assume your script registers the device, /dev/dsk/c1t0d0s0. Try these commands.
$ cfgadm -c unconfigure c1::dsk/c1t0d0 $ cfgadm -f -c unconfigure c1::dsk/c1t0d0 $ cfgadm -c configure c1::dsk/c1t0d0
Caution Make sure that you are familiar with these commands because they can alter the state of the
110
4. Registers all tape drives in the system by printing all tape drive device names to stdout.
rcm_resource_name=/dev/rmt/$f
6. Sets up the preremove information by checking if the backup application is using the device. If the backup application is not using the device, the dynamic reconguration operation continues. If the backup application is using the device, the script checks RCM_ENV_FORCE. If RCM_ENV_FORCE is set to FALSE, the script denies the dynamic reconguration operation and prints the following message:
rcm_failure_reason=tape backup in progress pid=...
If RCM_ENV_FORCE is set to TRUE, the backup application is stopped, and the reconguration operation proceeds.
If you use the cfgadm command and the backup application is not using the tape device, the operation succeeds. If you use the cfgadm command and the backup application is using the tape device, the operation fails.
Here are the various outcomes if you use the cfgadm command to remove a tape device with the RCM script.
Chapter 6 Dynamically Conguring Devices (Tasks) 111
If you use the cfgadm command and the backup application is not using the tape device, the operation succeeds. If you use the cfgadm command without the -f option and the backup application is using the tape device, the operation fails with an error message similar to the following:
tape backup in progress pid=...
If you use the cfgadm -f command and the backup application is using the tape device, the script stops the backup application and the cfgadm operation succeeds.
if (defined($dispatch{$cmd})) { &{$dispatch{$cmd}}; } else { exit (2); } sub do_scriptinfo { print "rcm_script_version=1\n"; print "rcm_script_func_info=Tape backup appl script for DR\n";
112 System Administration Guide: Devices and File Systems November 2006
exit (0); } sub do_register { my ($dir, $f, $errmsg); $dir = opendir(RMT, "/dev/rmt"); if (!$dir) { $errmsg = "Unable to open /dev/rmt directory: $!"; print "rcm_failure_reason=$errmsg\n"; exit (1); } while ($f = readdir(RMT)) { # ignore hidden files and multiple names for the same device if (($f !~ /^\./) && ($f =~ /^[0-9]+$/)) { print "rcm_resource_name=/dev/rmt/$f\n"; } } closedir(RMT); exit (0); } sub do_resourceinfo { my ($rsrc, $unit); $rsrc = shift(@ARGV); if ($rsrc =~ /^\/dev\/rmt\/([0-9]+)$/) { $unit = $1; print "rcm_resource_usage_info=Backup Tape Unit Number $unit\n"; exit (0); } else { print "rcm_failure_reason=Unknown tape device!\n"; exit (1); } } sub do_preremove { my ($rsrc); $rsrc = shift(@ARGV); # check if backup application is using this resource #if (the backup application is not running on $rsrc) {
Chapter 6 Dynamically Conguring Devices (Tasks) 113
# allow the DR to continue # exit (0); #} # # If RCM_ENV_FORCE is FALSE deny the operation. # If RCM_ENV_FORCE is TRUE kill the backup application in order # to allow the DR operation to proceed # if ($ENV{RCM_ENV_FORCE} eq TRUE) { if ($cmd eq preremove) { # kill the tape backup application } exit (0); } else { # # indicate that the tape drive can not be released # since the device is being used for backup by the # tape backup application # print "rcm_failure_reason=tape backup in progress pid=...\n" ; exit (3); } }
114
C H A P T E R
This chapter provides an overview of Universal Serial Bus (USB) devices in the Solaris OS. This is a list of the overview information in this chapter.
I I I I I
Whats New in USB Devices in the Solaris 10 6/06 Release? on page 115 Whats New in USB Devices in the Solaris 10 1/06 Release? on page 117 Whats New in USB Devices in the Solaris 10 Release? on page 118 Overview of USB Devices on page 120 About USB in the Solaris OS on page 125
For recent information about USB devices, go to the following site: http://www.sun.com/io_technologies/USB-Faq.html For general information about USB devices, go to the following site: http://developers.sun.com/solaris/developer/support/driver/usb.html For step-by-step instructions on using USB devices in the Solaris OS, see Chapter 8. For general information about dynamic reconguration and hot-plugging, see Chapter 6. For information on conguring USB printers, see Whats New in Printing? in System Administration Guide: Advanced Administration.
Changed USB Device Hotpluggable Behavior on page 116 USB Power Budgeting on page 116 ZFS Support on USB Devices on page 116 Support for Prolic and Keyspan Serial Adapters on page 117
115
For information about using USB mass storage devices, see Using USB Mass Storage Devices on page 133. For information about creating and mounting ZFS le systems, see zfs(1M) and zpool(1M).
116 System Administration Guide: Devices and File Systems November 2006
x86: Support for USB CDs and DVDs in GRUB-Based Booting on page 117 USB Virtual Keyboard and Mouse Support on page 117 vold Provides Awareness of Hot-Plugged USB Devices on page 118
Installing from USB CD or DVD drives Booting from USB storage devices. You must install the Solaris release on the USB drive before you can boot from it.
For more information about GRUB-based booting, see Chapter 8, Shutting Down and Booting a System (Overview), in System Administration Guide: Basic Administration.
For information on using USB devices without vold running, see How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139. For information about manually mounting a USB mass storage device, see How to Mount or Unmount a USB Mass Storage Device Without vold Running on page 149.
USB Wheel Mouse Support on page 127 USB 2.0 Features on page 125 USB Driver Enhancements on page 122
For a complete listing of new Solaris features and a description of Solaris releases, see Solaris 10 Whats New.
Solaris 9 releases
Solaris 10
General USB 1.1 device support SPARC and x86 General USB 2.0 device support SPARC only Specic USB 1.1 and USB 2.0 device support
118
Solaris 9 releases
Solaris 10
USB 1.1 only: Not supported on a USB 2.0 hub SPARC and x86 SPARC and x86 SPARC and x86 SPARC and x86 SPARC and x86
USB 1.1 only: Supported on a USB 2.0 hub SPARC and x86 SPARC and x86 SPARC and x86 SPARC and x86 SPARC and x86
generic USB driver (ugen(7D)) hid devices (keyboard and mouse devices, hid(7D)) hubs (hubd(7D)) printers serial devices (Edgeport (usbser_edge(7D)), Prolic (usbsprl(7D)), Keyspan (usbsksp(7D)) storage devices (scsa2usb(7D)) user-space USB device management library (libusb(3LIB))
SPARC only SPARC and x86 SPARC and x86 SPARC and x86 SPARC and x86
Notes:
I I
Only USB 1.x audio devices are supported. No USB 2.0 audio devices are supported. A USB 1.x audio device that is connected to a USB 2.0 hub, which is connected to a USB 2.0 port, can be used in the Solaris 10 releases only. For more information, see usb_ac(7D) and usb_as(7D). Devices that are not supported by a USB driver might have libusb applications such as gphoto2, gtkam, and pilotlink. For more information, refer to /usr/sfw/share/doc/libusb/libusb.txt. Solaris 8 and Solaris 9 releases For USB dual framework issues, refer to the following site: http://www.sun.com/io_technologies/USB-Faq.html
For task information associated with mass storage devices, see Chapter 8. For more information about ugen, see USB Driver Enhancements on page 122.
119
Acronym
Denition
USB generic driver Universal Serial Bus Universal Serial Bus Architecture (Solaris) USBA Client Driver Interface (Solaris) USB host controller driver Enhanced Host Controller Interface Open Host Controller Interface Universal Host Controller Interface
System
Hub
Hub
Printer
cdrw
Keyboard
Mouse
USB Host Controller and Root Hub Compound Device Composite Device
FIGURE 71 USB Physical Device Hierarchy
Figure 71 shows a system with three active USB ports. The rst USB port connects a USB memory stick. The second USB port connects an external hub, which in turn, connects a cdrw device and a composite keyboard/mouse device. As a composite device, this keyboard contains a USB controller, which operates both the keyboard and an attached mouse. The keyboard and the mouse share a common USB bus address because they are directed by the same USB controller. Figure 71 also shows an example of a hub and a printer as a compound device. The hub is an external hub that is enclosed in the same casing as the printer. The printer is permanently connected to the hub. The hub and printer have separate USB bus addresses. The device tree path name for some of the devices that are displayed in Figure 71 are listed here. Memory stick Keyboard Mouse cdrw device Printer /pci@1f,4000/usb@5/storage@1 /pci@1f,4000/usb@5/hub@2/device@1/keyboard@0 /pci@1f,4000/usb@5/hub@2/device@1/mouse@1 /pci@1f,4000/usb@5/hub@2/storage@3 /pci@1f,4000/usb@5/hub@3/printer@1
121
Each USB device contains descriptors that reect the class of the device. A device class species how its members should behave in conguration and data transfer. You can obtain additional class information from: http://www.usb.org For more information about USB devices supported in the Solaris release, see usb(7D).
Generic USB driver USB devices can now be accessed and manipulated by applications using standard UNIX read(2) and write(2) system calls, and without writing a special kernel driver. Additional features include:
I I
Applications have access to raw device data and device status. The driver supports control, bulk, and interrupt (in and out) transfers.
Starting in the Solaris 10 6/06 release, the ugen driver no longer needs to bind explicitly to a device. By default, usb_mid binds to devices that lack a class driver and exports a ugen interface that works with libusb. For example, you can plug in a USB camera that is not a mass-storage device and use a libusb application to access it. In addition, both scsa2usb and usbprn drivers export ugen interfaces and libusb applications can be used on these classes of devices directly.
122
Digi Edgeport USB support The Edgeport USB driver only works with Edgeport devices and not with other USB serial devices.
I I
New devices are accessed as /dev/term/[0-9]* and /dev/cua/[0-9]*. USB serial ports are usable as any other serial port would be, except that they cannot serve as a local serial console. The fact that their data is run through a USB port is transparent to the user.
http://www.digi.com http://www.sun.com/io
For more information about Edgeport compatibility issues, go to the following site: http://www.sun.com/io_technologies/USB-Faq.html
I
Keyspan The Keyspan USB serial driver only works with Keyspan devices, which currently supports the USA-19HS and USA-49WLC models. For more information, see usbsksp(7D). Prolic The Prolic USB serial driver only works with devices based on the PL2303 chipset. For more information, see usbsprl(7D).
Documentation and binary support for user-written kernel and userland drivers For up-to-date information on USB driver development, go to:
I I I I I I I
http://www.sun.com/io_technologies/USB-Faq.html http://developers.sun.com/solaris/developer/support/driver/usb.html Chapter 19, USB Drivers, in Writing Device Drivers Appendix C, Making a Device Driver 64-Bit Ready, in Writing Device Drivers Device Driver Tutorial Intro(7), Intro(9F), and Intro(9S) http://developers.sun.com/ prodtech/solaris/driverdev/reference/codesamples/usb_security/index.html
Complies with enhanced host controller interface that supports USB 2.0. Supports high-speed control, bulk, and interrupt transfers. Currently, there is no support for high-speed isochronous. The USB 2.0 chip has one EHCI controller and one or more OHCI or UHCI controllers.
123
A USB 1.1 device is dynamically assigned to the OHCI or UHCI controller when it is plugged in. A USB 2.0 device is dynamically assigned to the EHCI controller when it is plugged in.
Use the prtconf command output to identify whether your system supports USB 1.1 or USB 2.0 devices. For example:
# prtconf -D | egrep "ehci|ohci|uhci"
If your prtconf output identies an EHCI controller, your system supports USB 2.0 devices. If your prtconf output identies an OHCI or UHCI controller, your system supports USB 1.1 devices.
124
Better performance Increased data throughput for devices connected to USB 2.0 controllers, up to 40 times faster than USB 1.1 devices. You can take advantage of the high-speed USB protocol when accessing high-speed mass storage devices, such as DVDs and hard disks.
Backward Compatibility Compatibility with 1.0 and 1.1 devices and drivers so that you can use the same cables, connectors, and software interfaces.
For a description of USB devices and terminology, see Overview of USB Devices on page 120.
Here are some of the USB devices that are supported in this Solaris release:
I
Mass storage devices, such as CD-RWs, hard disks, DVDs, digital cameras, diskettes, tape drives, memory sticks, and multi-format card readers Keyboards and mouse devices Audio devices, such as speakers and microphones
I I
For a full listing of USB devices that have been veried on the Solaris release, go to: http://www.sun.com/io_technologies/USB.html Additional storage devices might work by modifying the scsa2usb.conf le. For more information, see scsa2usb(7D). Solaris USB 2.0 device support includes the following features:
125
Increased USB bus speed from 12 Mbyte/sec to 480 Mbyte/sec. This increase means devices that support the USB 2.0 specication can run signicantly faster than their USB 1.1 counterparts, when they are connected to a USB 2.0 port. A USB 2.0 port might be one of the following possibilities:
I I I
A port on a USB 2.0 PCI card A port on a USB 2.0 hub that is connected to USB 2.0 port A port on a SPARC or x86 computer motherboard
A USB 2.0 PCI card might be needed for older SPARC platforms.
I
For a list of USB 2.0 PCI cards that have been veried for the Solaris release, go to: http://www.sun.com/io_technologies/USB.html USB 1.1 devices work as they have in the past, even if you have both USB 1.1 and USB 2.0 devices on the same system. While USB 2.0 devices operate on a USB 1.x port, their performance is signicantly better when they are connected to a USB 2.0 port. A USB 2.0 host controller has one high-speed Enhanced Host Controller Interface (EHCI) and one or more OpenHCI Host Controller Interface (OHCI) or Universal Host Controller Interface (UHCI) embedded controllers. Devices connected to a USB 2.0 port are dynamically assigned to either an EHCI or OHCI controller, depending on whether they support USB 2.0.
Note USB 2.0 storage devices that are connected to a port on a USB 2.0 PCI card, and that were
used with a prior Solaris release in the same hardware conguration, can change device names after upgrading to this release. This change occurs because these devices are now seen as USB 2.0 devices and are taken over by the EHCI controller. The controller number, w in /dev/[r]dsk/cwtxdysz, is changed for these devices. Also note that the speed of a USB device is limited to what the parent port can support. For example, if a USB 2.0 external hub is followed by a USB 1.x hub and a USB 2.0 device downstream, devices that are connected to the USB 2.0 external hub run at full speed and not high speed. For more information on USB 2.0 device support, see ehci(7D) and usba(7D).
Bus-Powered Devices
Bus-powered hubs use power from the USB bus to which they are connected, to power devices connected to them. Special care must be taken to not overload these hubs, because the power these hubs offer to their downstream devices is limited. Starting in the Solaris 10 6/06 release, power budgeting is implemented for USB devices. This feature has the following limitations:
I
126
I I
Each bus-powered hub is allowed a maximum of 100 mA only for each port. Only self-powered or low bus-powered devices are allowed to connect to a bus-powered hub. High bus-powered devices are denied the connection. Some hubs or devices can report a false power source, such that the connection might be unpredictable.
Do not move the keyboard and mouse during a reboot or at the ok prompt on a SPARC system. You can move the keyboard and mouse to another hub at any time after a system reboot. After you plug in a keyboard and mouse, they are fully functional again. The keys just to the left of the keypad might not function on some third-party USB keyboards. SPARC Keep the following issues in mind when using USB keyboards and mouse devices on SPARC systems:
I
I I
The power key on a USB keyboard behaves differently than the power key on the Sun type 5 keyboard. On a USB keyboard, you can suspend or shut down the system by using the SUSPEND/SHUTDOWN key. However, you cannot use that key to power up the system. Before the boot process nishes, the OpenBoot PROM (OBP) limits keyboard and mouse devices to the motherboard root hub ports only. USB keyboard and mouse devices cannot be used simultaneously with Sun Type 3, 4, or 5 keyboards on legacy SPARC systems, such as the Ultra 80.
For information about multiple keyboard and mouse device support, see virtualkm(7D).
Support for more than 3 buttons is available on USB or PS/2 mouse devices. Wheel mouse scrolling is available on a USB or PS/2 mouse device. This support means that rolling the wheel on a USB or a PS/2 mouse results in a scroll in the application or window under mouse focus. StarOfceTM, Firefox, and GNOME applications support wheel mouse scrolling. However, other applications might not support wheel mouse scrolling.
Monitoring the insertion or removal of a device on its ports Power managing individual devices on its ports Controlling power to its ports
127
The USB host controller has an embedded hub called the root hub. The ports that are visible at the systems back panel are the ports of the root hub. The USB host controller is responsible for the following:
I I
Directing the USB bus. Individual devices cannot arbitrate for the bus. Polling the devices by using a polling interval that is determined by the device. The device is assumed to have sufcient buffering to account for the time between the polls. Sending data between the USB host controller and its attached devices. Peer-to-peer communication is not supported.
Do not cascade hubs beyond four levels on either SPARC based systems or x86 based systems. On SPARC systems, the OpenBootTM PROM cannot reliably probe beyond four levels of devices. Do not plug a bus-powered hub into another bus-powered hub in a cascading style. A bus-powered hub does not have its own power supply. Do not connect a device that requires a large amount of power to a bus-powered hub. These devices might be denied connection to bus-powered hubs or might drain the hub of power for other devices. An example of such a device is a USB diskette device.
128
Always use USB 2.0 compliant, fully rated (480 Mbit/sec) 20/28 AWG cables for connecting USB 2.0 devices. The maximum cable length that is supported is 5 meters. Do not use cable extenders. For best results, use a self-powered hub to extend cable length.
I I
129
130
C H A P T E R
This chapter provides step-by-step instructions for using USB devices in the Solaris OS. For information on the procedures associated with using USB devices, see the following:
I I I I
Managing USB Devices in the Solaris OS (Roadmap) on page 131 Using USB Mass Storage Devices (Task Map) on page 132 Using USB Audio Devices (Task Map) on page 152 Hot-Plugging USB Devices With the cfgadm Command (Task Map) on page 156
For recent information about USB devices, go to the following site: http://www.sun.com/io_technologies/USB-Faq.html For overview information about using USB devices, see Chapter 7.
131
Task
Description
For Instructions
A USB mass storage device must Using USB Mass Storage Devices contain a le system before you can (Task Map) on page 132 add data to it. In addition, a USB diskette must be formatted before le systems can be created and mounted on them. This section also describes how to physically add or remove USB devices from your system.
Use this task map to identify tasks associated with adding USB audio devices. You can logically add or remove USB devices to and from your system with the cfgadm command.
Using USB Audio Devices (Task Map) on page 152 Hot-Plugging USB Devices With the cfgadm Command (Task Map) on page 156
Add or remove USB devices to and from your system with the cfgadm command.
Add or remove a USB mass storage Select one of the following to add a device. USB mass storage device: Add a USB mass storage device without vold running. Add a USB camera to access digital images. How to Add a USB Mass Storage Device Without vold Running on page 137 How to Add a USB Camera on page 137
Remove a USB mass storage device How to Remove a USB Mass without vold running. Storage Device Without vold Running on page 139 Add a non-compliant USB mass storage device. Prepare to use a USB mass storage device. Add a non-compliant USB mass storage device by adding an entry to scsa2usb.conf. Prepare to use a USB mass storage device with vold running. How to Use a Non-Complaint USB Mass Storage Device on page 135 Preparing to Use a USB Mass Storage Device With vold Running on page 139
132
Task
Description
For Instructions
Prepare to use a USB mass storage device without vold running. Display USB device information. Create a le system on a USB mass storage device. Modify partitions and create a le system on a USB mass storage device. Create a Solaris partition and modify the slices on a USB mass storage device. Mount a USB mass storage device without vold running. (Optional) Disable a USB device driver. (Optional) Remove unused USB device links. Display information about USB devices. You must create a le system on a device before you can put data on it. You might need to modify existing partitions before creating le systems on a USB mass storage device. You will need to create a le with slice information before using the rmformat to modify the slice information. Mount a USB mass storage device without vold running. Disable a USB device driver if you do not want USB support on your system. Remove USB device links with the devfsadm command.
How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139 How to Display USB Device Information on page 140 How to Create a File System on a USB Mass Storage Without vold Running on page 141 How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device Without vold Running on page 143 How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device Without vold Running on page 147 How to Mount or Unmount a USB Mass Storage Device Without vold Running on page 149 How to Disable Specic USB Drivers on page 151 How to Remove Unused USB Device Links on page 151
CD-RWs Hard disks DVDs Digital cameras Diskette devices SmartMedia and CompactFlash devices
For information about using USB mass storage devices with the Solaris ZFS le system, see Whats New in USB Devices in the Solaris 10 1/06 Release? on page 117. For a complete list of USB devices that are supported in the Solaris OS, see: http://www.sun.com/io_technologies/USB.html
Chapter 8 Using USB Devices (Tasks) 133
In previous Solaris releases, all USB storage devices were identied as removable media devices, which provides many of the following advantages, including automatic mounting by vold. In the Solaris 10 6/06 release, USB mass storage devices are identied as hotpluggable devices but also enjoy the advantages of USB removable devices that are listed below. For more information about the hotpluggable behavior, see USB and 1394 (FireWire) Support Enhancements on page 71.
I
Starting in the Solaris 10 1/06 release, vold automatically mounts a hot-plugged device. For more information, see vold Provides Awareness of Hot-Plugged USB Devices on page 118. USB storage devices with standard MS-DOS or Windows (FAT) le systems are supported. You can use the user-friendly rmformat command to create slices. You can also use the fdisk command to partition a USB device, but never use the format utility or the rmformat -F command to physically format a USB drive. Use the rmformat command to display all USB devices with media inserted. For example, see How to Display USB Device Information on page 140. Non-root users can now access USB storage devices, since the mount command is no longer needed. The device is automatically mounted by vold and is available under the /rmdisk directory. If a new device is connected while the system is down, do a reconguration boot with the boot -r command so that vold recognizes the device. These devices can be managed with or without volume management. Disks with FAT le systems can be mounted and accessed. For example:
mount -F pcfs /dev/dsk/c2t0d0s0:c /mnt
I I
I I
All USB storage devices are now power managed, except for those that support LOG SENSE pages. Devices with LOG SENSE pages are usually SCSI drives connected through a USB-to-SCSI bridge device. Applications might work differently with USB mass storage devices. Keep the following issues in mind when using applications with USB storage devices:
I
Applications might make incorrect assumptions about the size of the media since only smaller devices like diskettes were removable previously. Requests by applications to eject media on devices where this would be inapplicable, such as a hard drive, will succeed and do nothing. If you prefer the behavior in previous Solaris releases where not all USB mass storage were treated as removable media devices, then you can force the old behavior by updating the /kernel/drv/scsa2usb.conf le.
For more information on using USB mass storage devices, see scsa2usb(7D).
driver will fail. Applications that issue only read(2) and write(2) calls will succeed. Other applications, such as SunPCI and rmformat, also succeed. Volume management (vold) sees the USB diskette device as a SCSI removable media device. Volume management makes the device available for access under the /rmdisk directory. For more information on how to use USB diskette devices, see Chapter 1.
Become superuser. Add an entry to the /kernel/drv/scsa2usb.conf le. The following entry is appropriate for a USB memory stick.
attribute-override-list = "vid=* reduced-cmd-support=true";
Either reboot the system or do the following: a. Remove the device. b. Manually update the driver.
# update_drv -f scsa2usb
The le system can be mounted from the device if it is valid and vold recognizes it. If it fails to mount, stop vold.
# svcadm disable volfs
Then, try a manual mount. Before hot-removing the device, nd the name of the device in the eject -n commands alias name. Then eject the devices media. If you dont do this, vold still releases the device and the port is usable again, but the lesystem on the device might have been damaged. When you hot-plug a USB device, the device is immediately seen in the systems device hierarchy, as displayed in the prtconf command output. When you remove a USB device, the device is removed from the systems device hierarchy, unless you are using the device. If you are using a device when it is unplugged, the device node remains, but the driver controlling this device stops all activity on the device. Any new I/O activity issued to this device returns an error. In this situation, the system prompts you to plug in the original device. If the device is no longer available, stop the applications. After a few seconds, the port becomes available again.
Note Data integrity might be impaired if you remove an active or open device. Always close the
device before removing, except the attached keyboard and mouse, which can be moved while active.
to:
136 System Administration Guide: Devices and File Systems November 2006
(Optional) For information on disabling vold, see How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139. Verify that vold is not running.
# svcs volfs STATE disabled STIME FMRI 10:39:12 svc:/system/filesystem/volfs:default
3 4
Connect the USB mass storage device. Verify that the USB device has been added. Locate the USB disk device links, which might be among device links of non-USB storage devices, as follows:
$ rmformat Looking for devices... 1. Logical Node: /dev/rdsk/c3t0d0p0 Physical Node: /pci@0,0/pci108e,4131@2,1/storage@4/disk@0,0 Connected Device: USB2.0 Flash Disk 2.00 Device Type: Removable
Become superuser. Plug in and turn on the USB camera. The system creates a logical device for the camera. After the camera is plugged in, output is written to the /var/adm/messages le to acknowledge the devices connection. The system treats the camera as a storage device.
Examining this output enables you to determine which logical device was created so that you can then use that device to access your images. The output looks similar to the following:
Jul 15 09:53:35 buffy usba: [ID 349649 kern.info] OLYMPUS, C-3040ZOOM, 000153719068 Jul 15 09:53:35 buffy genunix: [ID 936769 kern.info] scsa2usb1 is /pci@0,0/pci925,1234@7,2/storage@2 Jul 15 09:53:36 buffy scsi: [ID 193665 kern.info] sd3 at scsa2usb1: target 0 lun 0
Match the device with a mountable /dev/dsk link entry, by doing the following:
# ls -l /dev/dsk/c*0 | grep /pci@0,0/pci925,1234@7,2/storage@2 lrwxrwxrwx 1 root root 58 Jun 30 2004 c3t0d0p0 -> ../../devices/pci@0,0/pci925,1234@7,2/storage@2/disk@0,0:a 4
Mount the USB camera le system. The cameras le system is most likely a PCFS le system. If le system is PCFS, then it should be automatically mounted by vold. To manually mount the le system on an x86 system, you would use syntax similar to the following:
# mount -F pcfs /dev/dsk/c3t0d0p0:c /mnt
To manually mount the le system on a SPARC system, you would use syntax similar to the following:
# mount -F pcfs /dev/dsk/c3t0d0s0:c /mnt
For information on mounting le systems, see Chapter 19. For information on mounting different PCFS le systems, see mount_pcfs(1M).
5
View and manipulate the image les created by the USB camera. For example:
# /usr/dt/bin/sdtimage P7220001.JPG &
8
138
(Optional) For information on disabling vold, see How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139. Become superuser. Verify that vold is not running.
# svcs volfs STATE disabled STIME Sep_29 FMRI svc:/system/filesystem/volfs:default
2 3
4 5 6
Stop any active applications that are using the device. Unmount the device. Remove the device.
How to Prepare to Use USB Mass Storage Devices Without vold Running
You can use USB mass storage devices without volume management (vold) running. Stop vold by issuing the following command:
# svcadm disable volfs
Chapter 8 Using USB Devices (Tasks) 139
Or, use the following procedure to keep vold running, but do not register the USB mass storage devices with vold.
1 2
Remove volume management registration of USB mass storage devices by commenting the following line in the /etc/vold.conf le.
# use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d
the system, vold registration for these devices is disabled as well. For more information, see vold.conf(4).
140
disk (driver not attached) storage, instance #1 disk (driver not attached)
For example, use the rmformat command to display USB device information.
$ rmformat Looking for devices... 1. Volmgt Node: /vol/dev/aliases/rmdisk3 Logical Node: /dev/rdsk/c1t0d3s2 Physical Node: /pci@1e,600000/usb@a/storage@2/disk@0,3 Connected Device: SMSC 223 U HS-SD/MMC 1.95 Device Type: Removable 2. Volmgt Node: /vol/dev/aliases/cdrom0 Logical Node: /dev/rdsk/c2t2d0s2 Physical Node: /pci@1e,600000/ide@d/sd@2,0 Connected Device: JLMS XJ-HD166S D3S4 Device Type: DVD Reader 3. Volmgt Node: /vol/dev/aliases/rmdisk4 Logical Node: /dev/rdsk/c4t0d0s2 Physical Node: /pci@1e,600000/usb@a/storage@1/disk@0,0 Connected Device: IC25T048 ATDA05-0 DA8O Device Type: Removable
How to Create a File System on a USB Mass Storage Without vold Running
Use this procedure to add a le system to a USB mass storage device. A USB diskette must be formatted before you can add a le system to it. All other USB mass storage devices just need a PCFS or UFS le system before they can be used. Keep the following key points in mind when formatting a USB diskette:
I I
Do not use the rmformat -F except on a USB diskette. If the default slices are not acceptable, use the rmformat -s command to create slices. Use the fdisk utility to partition a USB device, if needed. For step-by-step instructions, see:
I
How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device Without vold Running on page 143 How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device Without vold Running on page 147
(Optional) For information on disabling vold, see How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139.
Chapter 8 Using USB Devices (Tasks) 141
Add the USB device to your system. For information on hot-plugging USB devices, see:
I I
Hot-Plugging USB Mass Storage Devices on page 136 Hot-Plugging USB Devices With the cfgadm Command (Task Map) on page 156
(Optional) Identify the USB device. The following example identies a USB diskette device.
# cd /dev/rdsk # ls -l c*0 | grep usb lrwxrwxrwx 1 root root 55 Mar 5 10:35 c2t0d0s0 -> ../../devices/pci@1f,0/usb@c,3/storage@3/disk@0,0:a,raw
Insert a diskette into the diskette drive, if necessary. Format the diskette, if necessary.
% rmformat -Flong raw-device
Specify the -size option in 512-byte blocks. The following example shows how to create a PCFS le system on a 1.4-Mbyte diskette on a SPARC system:
# mkfs -F pcfs -o nofdisk,size=2880 /dev/rdsk/c4t0d0s2
The following example shows how to create a PCFS le system on a 1.4-Mbyte diskette on an x86 system:
142 System Administration Guide: Devices and File Systems November 2006
The following example shows how to create a PCFS le system on a 100-Mbyte USB memory stick on a SPARC system:
# mkfs -F pcfs /dev/rdsk/c5t0d0s2:c
The following example shows how to create a PCFS le system on a 100-Mbyte USB memory stick on an x86 system:
# mkfs -F pcfs /dev/rdsk/c5t0d0p0:c
For example:
# newfs /dev/rdsk/c4t0d0s7
Consider using the newfs -f 4096 option or newfs -T option for large USB hard disks.
Note UFS le system overhead consumes a signicant portion of space on a diskette, due to a
diskettes limited storage capacity. See the next two procedures for a detailed example of creating a PCFS le system and modifying slices on a USB mass storage device.
How to Modify Partitions and Create a PCFS File System on a USB Mass Storage Device Without vold Running
The following steps describe how to delete an existing partition, create a new partition, and then create a PCFS le system on the USB device. Make sure you backup any data before you perform this task.
1 2
Partition ========= 1
% === 97
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 3 4
Partition ========= 1
% === 97
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Specify the partition number to delete (or enter 0 to exit): 1 Partition deleted. 5
144
Partition =========
Status ======
End ===
Length ======
% ===
WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 1 6
Partition =========
Status ======
% ===
WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI 0=Exit? c 7
Partition =========
Status ======
% ===
1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: Specify the percentage of disk to use for this partition (or type "c" to specify the size in cylinders). 100 8
Select whether the new partition should be the active partion or an inactive partition.
Total disk size is 29 cylinders Cylinder size is 2048 (512 byte) blocks Cylinders Type Start End Length ============ ===== === ======
Partition =========
Status ======
% ===
WARNING: no partitions are defined! SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Select the partition type to create: Should this become the active partition? If yes, it will be activated each time the computer is reset or turned on. Please type "y" or "n". n 9
Partition ========= 1
Status ======
% === 97
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit)
146 System Administration Guide: Devices and File Systems November 2006
How to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device Without vold Running
The following steps illustrate how to create a Solaris partition and modify the slices. For information on disabling vold, see How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139. Make sure you backup any data before you perform this task.
1 2
First Sector Last Sector Count Sector Mount Directory 0 93755340 93755339 0 93755340 93755339
Make sure each slice starts on a cylinder boundary. For example, slice 1 starts at 822280000 bytes, which is the cylinder size in bytes multiplied by 1000. For more information, see the -s option description in rmformat(1).
5
Create the slices by including the slice le created above. For example:
# rmformat -s slice_file /dev/rdsk/c5t0d0s2
148
* 63587280 30168060 93755339 * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 8 00 0 10485760 10485759 1 3 01 16065000 12582912 28647911 2 5 00 0 92274688 92274687 6 4 00 32130000 31457280 63587279
How to Mount or Unmount a USB Mass Storage Device Without vold Running
See How to Prepare to Use USB Mass Storage Devices Without vold Running on page 139 for information on disabling vold. Become superuser. Verify that vold is not running.
# svcs volfs STATE disabled STIME FMRI 10:39:12 svc:/system/filesystem/volfs:default
2 3
Select one of the following to mount or unmount a USB mass storage device:
I
This example shows how to mount a device with a PCFS le system on a SPARC system:
# mount -F pcfs /dev/dsk/c3t0d0s2:c /mnt
This example shows how to mount a device with a PCFS le system on an x86 system:
Chapter 8 Using USB Devices (Tasks) 149
Unmount a USB mass storage device. First, be sure no one is using the le system on the device. For example:
# fuser -c -u /mnt # umount /mnt
For example:
# eject /dev/rdsk/c1t0d0s2
If USB devices are added or removed when the system is down, you must perform a reconguration boot.
ok boot -r
If you have problems accessing a device that was connected while the system is running, try the following command:
# devfsadm
I
Do not move devices around if the system has been powered down by a suspend operation. For more information, see SPARC: USB Power Management on page 128. If a device has been hot removed while in use by applications and is no longer available, then stop the applications. Use the prtconf command to see whether the device node has been removed.
The following table identies some USB device types and their corresponding drivers.
Device Type
Driver to Disable
If you disable a driver for a USB device that is still connected to the system, you see a console message similar to the following:
usba10: WARNING: usba: no driver found for device name
M
1 2
1 2 3
Become superuser. Close all applications that might be accessing the device. Remove the unused links for a specic USB class. For example:
# devfsadm -C -c audio
Chapter 8 Using USB Devices (Tasks) 151
Add USB audio devices. Identify your systems primary audio device. Change the primary USB audio device.
Identify which audio device is your How to Identify Your Systems primary audio device. Primary Audio Device on page 154 You might want to make one audio How to Change the Primary USB device the primary audio device if Audio Device on page 155 you remove or change your USB audio devices. How to Remove Unused USB If you remove a USB audio device while the system is powered off, the Device Links on page 151 /dev/audio device might be pointing to a /dev/sound/* device that doesnt exist. Use this section if no sound comes from the USB speakers. Troubleshooting USB Audio Device Problems on page 155
USB audio devices are supported on SPARC UltraTM and x86 platforms that have USB connectors. USB audio devices that are supported in the Solaris 8 10/01, Solaris 8 2/02, or Solaris 9 releases must support a xed 44100 or 48000 Hz sampling frequency to play or record. The 44100 Hz or 48000 Hz sampling frequency is no longer required in the Solaris 10 release. For fully supported audio data format information, see usb_ac(7D).
The primary audio device is /dev/audio. You can verify that /dev/audio is pointing to USB audio by using the following command:
% mixerctl Device /dev/audioctl: Name = USB Audio Version = 1.0 Config = external Audio mixer for /dev/audioctl is enabled
After you connect your USB audio devices, you access them with the audioplay and audiorecord command through the /dev/sound/N device links. Note that the /dev/audio and /dev/sound/N devices can refer to speakers, microphones, or combination devices. If you refer to the incorrect device type, the command fails. For example, the audioplay command fails if you try to use it with a microphone. You can select a specic default audio device for most Sun audio applications, such as audioplay and audiorecord, by setting the AUDIODEV shell variable or by specifying the -d option for these commands. However, setting AUDIODEV does not work for third-party applications that have /dev/audio hardcoded as the audio le. When you plug in a USB audio device, it automatically becomes the primary audio device, /dev/audio, unless /dev/audio is in use. For instructions on changing /dev/audio from on-board audio to USB audio and vice versa, refer to How to Change the Primary USB Audio Device on page 155, and usb_ac(7D).
153
M
1
(Optional) Remove the speaker. Then, plug it back in. If you remove the speaker, the /dev/audio device reverts back to on-board audio.
% ls -l /dev/audio lrwxrwxrwx 1 root root 7 Feb 13 08:47 /dev/audio -> sound/0
Display your systems new audio links with the ls command. For example:
% ls -lt /dev/audio* lrwxrwxrwx 1 root root 7 Jul 23 15:46 /dev/audio -> usb/audio0 lrwxrwxrwx 1 root root 10 Jul 23 15:46 /dev/audioctl -> usb/audioctl0/ % ls -lt /dev/sound/* lrwxrwxrwx 1 root root 74 Jul 23 15:46 /dev/sound/1 -> ../../devices/pci@1f,4000/usb@5/hub@1/device@3/sound-control@0:... lrwxrwxrwx 1 root root 77 Jul 23 15:46 /dev/sound/1ctl -> ../../devices/pci@1f,4000/usb@5/hub@1/device@3/sound-control@0:... lrwxrwxrwx 1 root other 66 Jul 23 14:21 /dev/sound/0 -> ../../devices/pci@1f,4000/ebus@1/SUNW,CS4231@14,200000:sound,audio lrwxrwxrwx 1 root other 69 Jul 23 14:21 /dev/sound/0ctl -> ../../devices/pci@1f,4000/ebus@1/SUNW,CS4231@14,200000:sound,audioctl %
Notice that the primary audio device, /dev/audio, is pointing to the newly plugged in USB audio device, /dev/usb/audio0.
I
You can also examine your systems USB audio devices with the prtconf command and look for the USB device information.
154
% prtconf . . . usb, instance #0 hub, instance #0 mouse, instance #0 keyboard, instance #1 device, instance #0 sound-control, instance #0 sound, instance #0 input, instance #0 . . .
If you want the on-board audio device to become the primary audio device, remove the USB audio devices. The /dev/audio link then points to the /dev/sound/0 entry. If the /dev/sound/0 entry is not the primary audio device, then either shut down the system and use the boot -r command, or run the devfsadm -i command as root. If you want the USB audio device to become primary audio device, just plug it in and check the device links.
When you plug in a USB audio device and you are logged in on the console, the console is the owner of the /dev/* entries. This situation means you can use the audio device as long as you are logged in to the console. If you are not logged in to the console when you plug in a USB audio device, root becomes the owner of the device. However, if you log in to the console and attempt to access the USB audio device, device ownership changes to the console. For more information, see logindevperm(4).
155
When you remotely log in with the rlogin command and attempt to access the USB audio device, the ownership does not change. This means that, for example, unauthorized users cannot listen to conversations over a microphone owned by someone else.
Logically uncongure a USB device How to Uncongure a USB that is still physically connected to Device on page 158 the system. Congure a USB device that was previously uncongured. How to Congure a USB Device on page 159
You can logically disconnect a USB How to Logically Disconnect a device if you are not physically near USB Device on page 159 the system. Logically connect a USB device that How to Logically Connect a USB was previously logically Device on page 160 disconnected or uncongured. Disconnect a USB device subtree, which is the hierarchy (or tree) of devices below a hub. Reset a USB device to logically remove and re-create the device. Change the default conguration of a multi-conguration USB device. How to Logically Disconnect a USB Device Subtree on page 160 How to Reset a USB Device on page 160 How to Change the Default Conguration of a Multi-Conguration USB Device on page 161
Reset a USB device. Change the default conguration of a multi-conguration USB device.
The cfgadm command displays information about attachment points, which are locations in the system where dynamic reconguration operations can occur. An attachment point consists of the following:
I
An occupant, which represents a hardware resource, such as a USB device, that might be congured into the system A receptacle, which is the location that accepts the occupant, such as a USB port
Attachment points are represented by logical and physical attachment point IDs (Ap_Ids). The physical Ap_Id is the physical path name of the attachment point. The logical Ap_Id is a user-friendly alternative for the physical Ap_Id. For more information on Ap_Ids, see cfgadm_usb(1M). The cfgadm command provides the following USB device status information.
Receptacle State
Description
empty/unconfigured disconnected/unconfigured
The device is not physically connected. The device is logically disconnected and unavailable, even though the device could still be physically connected. The device is logically connected, but unavailable. The device is visible in prtconf output. The device is connected and available.
connected/unconfigured connected/configured
The following sections describe how to hot-plug a USB device through the software with the cfgadm command. All of the sample USB device information in these sections has been truncated to focus on relevant information.
usb0/4.5.6 usb0/4.5.7
configured ok unconfigured ok
In the preceding example, usb0/4.5.1 identies a device connected to port 1 of the second-level external hub, which is connected to port 5 of rst-level external hub, which is connected to the rst USB controllers root hub, port 4.
2
1 2
158
ok ok ok ok ok ok ok
M
1 2
1 2
1 2
1 2
1
160
Become superuser.
System Administration Guide: Devices and File Systems November 2006
2 3
Make sure that the device is not in use. Reset the device. For example:
# cfgadm -x usb_reset -y usb0/4.7
A USB device conguration denes how a device presents itself to the operating system. This method is different from system device congurations discussed in other cfgadm sections. Some USB devices support multiple congurations, but only one conguration can be active at a time. Multi-conguration devices can be identied by examining the cfgadm -lv output. Nconfigs will be greater than 1. The default USB conguration is conguration 1. The current conguration is reected in cfgadm -lv output as Config. Changes to the default conguration persist across reboots, hot-removes, and the reconguration of the device, as long as the device is reconnected to the same port.
1 2
Make sure that the device is not in use. Change the default USB conguration. For example:
# cfgadm -x usb_config -o config=2 usb0/4 Setting the device: /devices/pci@1f,0/usb@c,3:4 to USB configuration 2 This operation will suspend activity on the USB device Continue (yes/no)? yes
Busy Phys_Id usb0/4 connected unconfigured ok Mfg: Sun 2000 Product: USB-B0B0 aka Robotech With 6 EPPS High Clk Mode NConfigs: 7 Config: 2 : EVAL Board Setup unavailable usb-device n /devices/pci@1f,0/usb@c,3:4
162
C H A P T E R
InniBand (IB) is a new I/O technology based on switch fabrics introduced in the Solaris 10 release. It provides high bandwidth, low latency interconnect for attaching I/O devices to hosts and for host-to-host communication. This is a list of the overview information in this chapter.
I I
Overview of InniBand Devices on page 163 Dynamically Reconguring IB Devices (cfgadm) on page 166
For information on the procedures associated with using IB devices, see the following:
I I
Dynamically Reconguring IB Devices (Task Map) on page 164 Using the uDAPL Application Interface With InniBand Devices on page 175
For general information about dynamic reconguration and hot-plugging, see Chapter 6.
IB Port devices IB virtual physical point of attachment (VPPA) devices IB HCA service (HCA_SVC) devices Pseudo devices I/O controller (IOC) devices
The IB nexus driver queries the Solaris IB Device Manager (IBDM) for services, referred in this guide as communication services, to enumerate the IB Port, HCA_SVC, and IB VPPA devices. The Port devices bind a communication service to a given port# of a Host Channel Adapter (HCA). The VPPA devices bind a communication service to a port#, p_key# combination instead. The HCA_SVC devices bind a communication service to a given HCA. Note that the Port devices and the
163
HCA_SVC devices always use a p_key (partition key) whose value is zero. The Port, HCA_SVC, and VPPA devices are children of the HCA and are enumerated through the ib.conf le. For more information, see ib(7D). The IOC devices are children of the IB nexus driver and are part of an I/O unit. The pseudo devices are also children of the IB nexus driver and refer to all other devices that provide their own conguration les to enumerate. For more information, see ib(4). The possible IB device tree path name(s) are listed in the following table.
/ib/ioc@1730000007F510C,173000007F50 /ib/<driver>@<unit-address> /pci@1f,2000/pci@1/pci15b3,5a44@0/ibport@<port#>, <p_key>,<service> /pci@1f,2000/pci@1/pci15bc,5a44@0/ibport@0,0,<service> /pci@1f,2000/pci@1/pci15b3,5a44@0/ibport@<port#>,0, <service> /pci@1f,2000/pci@1/pci15b3,5a44@0
IOC device IB pseudo device IB VPPA device IB HCA_SVC device IB Port device HCA
Note that the IB HCA_SVC devices have zero as the port# and the p_key. The IB components in the preceding table are described as follows: <services> <p_key> <port> <unit-address> Is a communication service. For example, ipib is the communication service used by the ibd kernel client driver. Is the partition key value being used. Is the port number. Refers to IB kernel client drivers property by this name specied in its driver.conf le. For more information, see driver.conf(4).
Display information about the IB devices on your system. Select one of the following:
164
Task
Description
For Instructions
Uncongure an IOC device. Congure an IOC device. Congure or uncongure a port or VPPA device. Select one of the following: Uncongure a port or a VPPA device. Congure a port or a VPPA device.
How to Uncongure an IOC Device on page 168 How to Congure an IOC Device on page 169
How to Uncongure an IB Port, HCA_SVC, or a VPPA Device on page 169 How to Congure a IB Port, HCA_SVC, or a VPPA Device on page 170
Select one of the following: Uncongure an IB pseudo device. Congure an IB pseudo device. How to Uncongure an IB Pseudo Device on page 170 How to Congure an IB Pseudo Device on page 171
How to Display Kernel IB Clients You might need to display information about kernel IP clients of an HCA on page 171 of an HCA, particularly if youre going to uncongure an HCA. Select one of the following: Uncongure IB devices that are connected to an HCA. Congure IB devices that are connected to an HCA. How to Uncongure IB Devices Connected to an HCA on page 172 Conguring an IB HCA on page 173 How to Update the IB p_key Tables on page 173
If the p_key table information of a HCA port(s) changes, IBTF and IBDM need to be notied so that their internal p_key databases are updated.
Display IB communication services Display the IB communication services that are currently in use by the IBTF.
165
Task
Description
For Instructions
Select one of the following: Add a VPPA communication service. Remove a VPPA communication service. How to Add a VPPA Communication Service on page 173 How to Remove an Existing IB Port, HCA_SVC, or a VPPA Communication Service on page 174
You can update the properties of all How to Update an IOC the IOC device nodes or update a Conguration on page 175 particular IOC Ap_Id.
Receptacle State
Description
connected/configured/ok connected/unconfigured/unknown
The device is connected and available. The devinfo node is present. The device is unavailable and no devinfo node or device driver exists for this device. Or, the device was never congured for use by ib nexus driver. The device might be known to the IB Device Manager.
The following sections describe how to dynamically recongure (DR) IB devices with the cfgadm command. All of the sample IB device information in these sections has been truncated to focus on relevant information.
166 System Administration Guide: Devices and File Systems November 2006
In the preceding example, pci15b3,5a44 refers to an IB HCA. Use the following steps to display specic IB device information.
1 2
In the preceding example output, the components are described as follows: Ap_Id ib::1730000008072,0,sdp Identies an IB Port device that is connected to port 2 and is bound to the sdp service.
167
Ap_Id ib::1730000008072,8001,ipib
Identies an IB VPPA device that is connected to port 2, using a p_key value of 0x8001, and is bound to the ibd service. Identies an IB HCA_SVC device bound to the hnfs service. Identies an IOC device. Identies a pseudo device.
The preceding output displays the number of ports and their GUIDs.
1 2
168
M
1 2
1 2
169
1 2
1 2
170
1 2
171
nfs/ib
no
1 2
Become superuser. List the kernel IB clients of the HCA. For example:
# cfgadm -x list_clients hca:173000007F50 Ap_Id IB Client ib::1730000007F51D0 ibgen ib::1730000007F51D1 ibgen ib::1730000007F51,8001,ipib ibd ib::ibgen,0 ibgen ibdm ibmf nfs/ib Alternate HCA no no no no no no no
Uncongure kernel IB clients, such as Port, VPPA, HCA_SVC, or IOC devices, that do not have alternate HCA(s) present. For example:
# cfgadm -x unconfig_clients hca:1730000008070 Unconfigure Clients of HCA /devices/ib:1730000008070 This operation will unconfigure IB clients of this HCA Continue (yes/no)? y
172
Conguring an IB HCA
Invoke the bus-specic cfgadm plugin to congure the HCA. The exact details are beyond the scope of this chapter.
1 2
1 2
Become superuser.
173
Verify that the new service has been added. For example:
# cfgadm -x list_services ib Port communication services: srp VPPA communication services: ibd new HCA_SVC communication services: nfs_service #
1 2
Verify that the communication service has been removed. For example:
# cfgadm -x list_services ib Port communication services: srp VPPA communication services: ibd HCA_SVC communication services: hnfs #
174
For more information on these properties, see ib(7D). Note that these properties may not get updated if there is no conguration change. The following example describes how to update a particular IOCs conguration. If you need to update the conguration of all the IOCs, then specify the static ib Ap_Id instead of the particular IOC Ap_Id.
1 2
Verify that the properties have been updated by running prtconf -v.
A standard DAT registry library, libdat. For more information, see libdat(3LIB). A standard service provider registration le, dat.conf. For more information, see dat.conf(4). Support for multiple service providers so that each provider species their own uDAPL library path, version number, etc. in their own service_provider.conf le. For more information, see, service_provider.conf(4).
175
An administrative tool, the datadm command, to congure dat.conf. For more information, see datadm(1M). A new resource control property, project.max-device-locked-memory, to regulate the amount of locked down physical memory. A naming scheme that uses either IPv4 or IPv6 addresses that leverage the IP infrastructure, such as ARP in IPv4 and neighbor discovery in IPv6, for address resolution. The Solaris uDAPL Interface Adapter directly maps to an IPoIB device instance. Support for the standard Address Translation Scheme that is used by the DAT collaborative community. A uDAPL service provider library to support the Mellanox Tavor Host Channel Adapter with automatic registration to the dat.conf registration le. Supports both SPARC platform and x86 platforms.
M
1 2
SUNWib Sun InniBand Framework SUNWtavor Sun Tavor HCA Driver SUNWipoib Sun IP over InniBand SUNWudaplr Direct Access Transport (DAT) registry package (root) SUNWudaplu Direct Access Transport (DAT) registry packages (usr) SUNWudapltr Service Provider for Tavor packages (root) SUNWudapltu Service Provider for Tavor packages (usr)
Manually plumb the interfaces with the ifconfig and datadm commands. For example:
# ifconfig ibd1 plumb # ifconfig ibd1 192.168.0.1/24 up # datadm -a /usr/share/dat/SUNWudaplt.conf
176
Become superuser. Update the DAT static registry after you add or remove IPoIP interface adapters from the system.
# datadm -u
Become superuser. Update the DAT static registry after you add Suns service provider for the Mellanox Tavor Host Channel Adapter.
# datadm -a /usr/share/dat/SUNWudaplt.conf
Become superuser. Update the DAT static registry after you remove Suns service provider for the Mellanox Tavor Host Channel Adapter from the system.
# datadm -r /usr/share/dat/SUNWudaplt.conf
177
178
10
C H A P T E R
I I I I
1 0
This chapter provides information about how to access the devices on a system. This is a list of the overview information in this chapter. Accessing Devices on page 179 Logical Disk Device Names on page 180 Logical Tape Device Names on page 183 Logical Removable Media Device Names on page 184
Accessing Devices
You need to know how to specify device names when using commands to manage disks, le systems, and other devices. In most cases, you can use logical device names to represent devices that are connected to the system. Both logical and physical device names are represented on the system by logical and physical device les.
device instances. Then, devfsadm creates the device les in the /devices directory and the logical links in the /dev directory. In addition to managing the /dev and /devices directories, the devfsadm command also maintains the path_to_inst instance database. For more information, see path_to_inst(4). Both reconguration boot processing and updates to the /dev and /devices directories in response to dynamic reconguration events are handled by devfsadmd, the daemon version of the devfsadm command. This daemon is started from the /etc/rc* scripts when a system is booted. Because the devfsadmd daemon automatically detects device conguration changes generated by any reconguration event, there is no need to run this command interactively. For more information, see devfsadm(1M).
Physical device name Represents the full device path name in the device information hierarchy. The physical device name is created by when the device is rst added to the system. Physical device les are found in the /devices directory. Instance name Represents the kernels abbreviation name for every possible device on the system. For example, sd0 and sd1 represent the instance names of two disk devices. Instance names are mapped in the /etc/path_to_inst le. Logical device name The logical device name is created by when the device is rst added to the system. Logical device names are used with most le system commands to refer to devices. For a list of le commands that use logical device names, see Table 101. Logical device les in the /dev directory are symbolically linked to physical device les in the /devices directory.
The preceding device name information is displayed with the following commands:
I I I I
Add a new disk to the system. Move a disk from one system to another system. Access or mount a le system residing on a local disk. Back up a local le system.
Many administration commands take arguments that refer to a disk slice or le system.
180 System Administration Guide: Devices and File Systems November 2006
Refer to a disk device by specifying the subdirectory to which it is symbolically linked, either /dev/dsk or /dev/rdsk, followed by a string identifying the particular controller, disk, and slice.
/dev/[r]dsk/cvtwdx[sy,pz] Slice number (s0 to s7) or fdisk partition number (p0 to p4) Drive number Physical bus target number Logical controller number Raw disk device subdirectory Devices directory
FIGURE 101 Description of Logical Device Names
When a command requires the raw device interface, specify the /dev/rdsk subdirectory. (The r in rdsk stands for raw.) When a command requires the block device interface, specify the /dev/dsk subdirectory. When you are not sure whether a command requires use of /dev/dsk or /dev/rdsk, check the man page for that command.
I I
The following table shows which interface is required for some commonly used disk and le system commands.
TABLE 101 Device Interface Type Required by Some Frequently Used Commands Command Reference Interface Type Example of Use
181
TABLE 101 Device Interface Type Required by Some Frequently Used Commands Command Reference Interface Type Example of Use
(Continued)
prtvtoc(1M)
Raw
prtvtoc /dev/rdsk/c0t0d0s2
To indicate the entire Solaris fdisk partition, specify slice 2 (s2). If you have only one controller on your system, w is usually 0.
182
cvtwdx[sy,pz] Slice number (s0 to s7) or fdisk partition number (p0 to p4) Drive number Physical bus target number Logical controller number
FIGURE 103 Disks With Bus-Oriented Controllers
On a SPARC based system with directly connected disks such as the IDE disks on an UltraSPARC system, the naming convention is the same as that for systems with bus-oriented controllers. If you have only one controller on your system, w is usually 0. For SCSI controllers, x is the target address set by the switch on the back of the unit, and y is the logical unit number (LUN) of the drive attached to the target. If the disk has an embedded controller, y is usually 0. For more information about SCSI addressing on SPARC based systems, see the SunSolveSM Info Doc 48041 and scsi_address(9S). To indicate the whole disk, specify slice 2 (s2).
The rst tape device connected to the system is 0 (/dev/rmt/0). Tape density values (l, m, h, c, and u) are described in Chapter 30.
Chapter 10 Accessing Devices (Overview) 183
184
11
C H A P T E R
I I I I I I I I I I I
1 1
This chapter provides overview information about Solaris disk slices and introduces the format utility. This is a list of overview information in this chapter. Whats New in Disk Management in the Solaris 10 11/06 Release? on page 185 Whats New in Disk Management in the Solaris 10 6/06 Release? on page 186 Whats New in Disk Management in the Solaris 10 1/06 Release? on page 187 Whats New in Disk Management in the Solaris 10 Release? on page 188 Where to Find Disk Management Tasks on page 193 Overview of Disk Management on page 193 Disk Terminology on page 193 About Disk Slices on page 194 format Utility on page 198 About Disk Labels on page 201 Partitioning a Disk on page 203
For instructions on how to add a disk to your system, see Chapter 13 or Chapter 14.
You can use the iscsitadm command to set up and manage your iSCSI target devices. For the disk device that you select as your iSCSI target, youll need to provide an equivalently sized ZFS or UFS le system as the backing store for the iSCSI daemon. After the target device is set up, use the iscsiadm command to identify your iSCSI targets, which will discover and use the iSCSI target device. For more information, see Chapter 15, iscsiadm(1M), and iscsitadm.1m.
Dynamic target removal support Provides the ability to remove (or log out) an iSCSI target without rebooting the system. If you try to remove or disable a discovery method or address, and the target is not in use, the target is removed and related resources are released. If the target is in use, the discovery address or method remains enabled, and in use message is displayed. For more information, see How to Remove Discovered iSCSI Targets on page 261. Internet Storage Name Service (iSNS) client support Enables the iSCSI initiator to discover the targets to which it has access using as little conguration as possible. It also provides state change notication functionality to notify the iSCSI initiator when changes in operational state of storage nodes occur. The iscsiadm command has been enhanced to support iSNS discovery. For more information, see How to Congure iSCSI Target Discovery on page 260. Multiple session target (MS/T) support Provides the ability to create more iSCSI sessions or paths to a target on demand. The additional iSCSI paths provide higher bandwidth aggregation and availability in specic congurations, such as iSCSI arrays that support login redirection. The iSCSI MS/T feature should be used in combination with MPxIO or other multipathing software. The iscsiadm command has been enhanced to support MS/T.
For more information about conguring Solaris iSCSI initiators, see Chapter 15 and iscsiadm(1M).
186
x86: Disk Management in the GRUB Boot Environment on page 187 Solaris iSCSI Initiator Support on page 188 Support for SCSI Disks That are Larger Than 2 Tbytes on page 188
Solaris failsafe boot A Solaris failsafe boot option that boots into the miniroot so you can recover from a problem that is preventing the system from booting without having to boot from an alternative device. Use the arrow keys to select the following option from the GRUB boot menu and then press return:
Solaris failsafe
Youll need to reboot the system after using the Solaris failsafe boot option.
I
Network boot Boot from the network by pressing the F12 key during the BIOS conguration phase. Single-user boot Boot to single-user mode by selecting this option from the Solaris failsafe boot menu:
kernel /platform/i86pc/multiboot
Then, use the e (edit) option to add the -s single-user option. For example:
kernel /platform/i86pc/multiboot -s
Press return and then press the b key to boot the system. Press control-D to boot the system back to multiuser mode. In the GRUB environment, you cannot use the fmthard command to install the boot blocks automatically when run on an x86 system. You must install the boot blocks separately. For detailed feature information and instructions on using the new GRUB based booting on x86 systems, see Chapter 11, GRUB Based Booting (Tasks), in System Administration Guide: Basic Administration. For instructions for managing disks in the GRUB boot environment, see the following references:
Chapter 11 Managing Disks (Overview) 187
I I
x86: How to Install a Boot Block on a System Disk on page 250 x86: How to Connect a System Disk on page 239
Multiterabyte Disk Support With EFI Disk Label on page 188 Common SCSI Drivers for SPARC and x86 Systems on page 192 New fdisk Partition Identier on page 192
The EFI label provides support for physical disks and virtual disk volumes. This release also includes updated disk utilities for managing disks greater than 1 terabyte. The UFS le system is compatible with the EFI disk label, and you can create a UFS le system greater than 1 terabyte. For information on creating a multiterabyte UFS le system, see 64-bit: Support of Multiterabyte UFS File Systems on page 305. The unbundled Sun QFS le system is also available if you need to create le systems greater than 1 terabyte. For information on the Sun QFS le system, see Sun QFS, Sun SAM-FS, and Sun SAM-QFS File System Administrators Guide. The Solaris Volume Manager software can also be used to manage disks greater than 1 terabyte in this Solaris release. For information on using Solaris Volume Manager, see Solaris Volume Manager Administration Guide. The VTOC label is still available for disks less than 1 terabyte in size. If you are only using disks smaller than 1 terabyte on your systems, managing disks will be the same as in previous Solaris releases. In addition, you can use the format-e command to label a disk less than 1 terabyte with an EFI label. For more information, see Example 126.
Provides support for disks greater than 1 terabyte in size. Provides usable slices 06, where slice 2 is just another slice. Partitions (or slices) cannot overlap with the primary or backup label, nor with any other partitions. The size of the EFI label is usually 34 sectors, so partitions start at sector 34. This feature means that no partition can start at sector zero (0). No cylinder, head, or sector information is stored in the EFI label. Sizes are reported in blocks. Information that was stored in the alternate cylinders area, the last two cylinders of the disk, is now stored in slice 8. If you use the format utility to change partition sizes, the unassigned partition tag is assigned to partitions with sizes equal to zero. By default, the format utility assigns the usr partition tag to any partition with a size greater than zero. You can use the partition change menu to reassign partition tags after the partitions are changed. However, you cannot change a partition with a non-zero size to the unassigned partition tag.
I I
The SCSI driver, ssd or sd, supports only up to 2 terabytes. Layered software products intended for systems with EFI-labeled disks might be incapable of accessing a disk with an EFI disk label. A disk with an EFI label is not recognized on systems running previous Solaris releases.
189
I I
You cannot boot from a disk with an EFI disk label. You cannot use the fdisk command on a disk with an EFI label that is greater than 1 terabyte in size. You cannot use the Solaris Management Consoles Disk Manager tool to manage disks with EFI labels. Use the format utility to partition disks with EFI labels. Then, you can use the Solaris Management Consoles Enhanced Storage Tool to manage volumes and disk sets with EFI-labeled disks. The EFI specication prohibits overlapping slices. The entire disk is represented by cxtydz. The EFI disk label provides information about disk or partition sizes in sectors and blocks, but not in cylinders and heads. The following format options are either not supported or are not applicable on disks with EFI labels:
I
I I
The save option is not supported because disks with EFI labels do not need an entry in the format.dat le. The backup option is not applicable because the disk driver nds the primary label and writes it back to the disk.
Previous label information is not converted to the EFI disk label. You will have to recreate the labels partition information manually with the format command. You cannot use the fdisk command on a disk with an EFI label that is greater than 1 terabyte in size. The fdisk command is not intended for disks that are larger than 1 terabyte. For more information about EFI disk labels, see the preceding section.
Current partition table (original): Total disk sectors available: 2576924638 + 16384 (reserved sectors) Part Tag 0 root 1 unassigned 2 unassigned 3 unassigned 4 unassigned 5 unassigned 6 unassigned 8 reserved Flag wm wm wm wm wm wm wm wm First Sector 34 0 0 0 0 0 0 2576924638 Size 1.20TB 0 0 0 0 0 0 8.00MB Last Sector 2576924636 0 0 0 0 0 0 2576941021
Task
If the system is already installed, connect the disk to the system and perform a reconguration boot. Repartition the disk by using the format utility, if necessary. Create disk volumes, and if needed, create soft partitions by using Solaris Volume Manager. Create UFS le systems for the new disk by using the newfs command. Or, create a QFS le system. Clone a disk with an EFI label
SPARC: Adding a System Disk or a Secondary Disk (Task Map) on page 227 SPARC: How to Create Disk Slices and Label a Disk on page 230 Chapter 2, Storage Management Concepts, in Solaris Volume Manager Administration Guide SPARC: How to Create a UFS File System on page 235 http://docs.sun.com/db/coll/20445.2 Example 292
Cause You attempted to create a partition on a SCSI device that is larger than 2 terabytes. Solution Create a partition on a SCSI device that is less than 2 terabytes.
Chapter 11 Managing Disks (Overview) 191
Error Message
Dec 3 09:26:48 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/ sf@1,0/ssd@w50020f23000002a4,0 (ssd1): Dec 3 09:26:48 holoship disk has 2576941056 blocks, which is too large for a 32-bit kernel
Cause You attempted to boot a system running a 32-bit SPARC or x86 kernel with a disk greater than 1 terabyte. Solution Boot a system running a 64-bit SPARC or x86 kernel with a disk greater than 1 terabyte. Error Message
Dec 3 09:12:17 holoship scsi: WARNING: /sbus@a,0/SUNW,socal@d,10000/ sf@1,0/ssd@w50020f23000002a4,0 (ssd1): Dec 3 09:12:17 holoship corrupt label - wrong magic number
Cause You attempted to add a disk to a system running an older Solaris release. Solution Add the disk to a system running the Solaris release that supports the EFI disk label.
SPARC sd for SCSI devices x86 sd for Fibre Channel and SCSI devices SPARC ssd for Fibre Channel devices
In previous Solaris releases, 3 separate drivers were needed to provide support of SCSI and Fibre Channel disk devices on the SPARC and x86 platforms. All of the disk utilities, such as the format, fmthard, and fdisk commands, have been updated to support these changes. For more information, see sd.7D and ssd.7D.
A new fdisk menu option enables you to switch back and forth between the new and old identier. The fdisk identier can be changed even when the le system that is contained in the partition is mounted. Two type values in the fdisk menu reect the old and new identiers as follows:
I I
For step-by-step instructions on changing the Solaris fdisk partition identier, see How to Change the Solaris fdisk Identier on page 239.
Format a disk and examine a disk label. Add a new disk to a SPARC system. Add a new disk to an x86 system. Hot-plug a SCSI or PCI disk.
Disk Terminology
Before you can effectively use the information in this section, you should be familiar with basic disk architecture. In particular, you should be familiar with the following terms:
Disk Term
Description
Track
A concentric ring on a disk that passes under a single stationary disk head as the disk rotates.
193
Disk Term
Description
The set of tracks with the same nominal distance from the axis about which the disk rotates. Section of each disk platter. A sector holds 512 bytes. A data storage area on a disk. A disk block is 512 bytes. A chip and its associated circuitry that controls the disk drive. The rst sector of a disk that contains disk geometry and partition information. A kernel module that controls a hardware or virtual device.
For additional information, see the product information from your disks manufacturer.
Each disk slice holds only one le system. No le system can span multiple slices.
Slices are set up slightly differently on SPARC and x86 platforms. The following table summarizes the differences.
TABLE 111 Slice Differences on SPARC and x86 Platforms SPARC Platform x86 Platform
The entire disk is devoted to Solaris OS. VTOC The disk is divided into 8 slices, numbered 07. EFI The disk is divided into 7 slices, numbered 06.
Disk is divided into fdisk partitions, one fdisk partition per operating system. VTOC The Solaris fdisk partition is divided into 10 slices, numbered 09. EFI The disk is divided into 7 slices, numbered 06
194
Solaris Volume Manager, previously the Solstice DiskSuiteTM, has a partitioning feature, soft partitions. Soft partitions enable more than eight partitions per disk. For general information about Solaris Volume Manager, see Chapter 2, Storage Management Concepts, in Solaris Volume Manager Administration Guide. For information on soft partitions, see Chapter 12, Soft Partitions (Overview), in Solaris Volume Manager Administration Guide.
Disk Slices
The following table describes the slices that might be found on a system that runs the Solaris OS. On x86 systems:
I
Disks are divided into fdisk partitions. An fdisk partition is a section of the disk that is reserved for a particular operating system, such as the Solaris OS. The Solaris OS places ten slices, numbered 09, on a Solaris fdisk partition.
TABLE 112 Customary Disk Slices Usually Found on Client or Server Systems?
Slice
File System
Comments
root (/)
Both
Holds les and directories that make up the OS. EFI You cannot boot from a disk with an EFI label.
1 2
swap
Both Both
Provides virtual memory, or swap space. VTOC Refers to the entire disk, by convention. The size of this slice should not be changed. EFI Optional slice to be dened based on your sites needs.
Both
Optional slice that can be dened based on your sites needs. Can be used on a server to hold alternative versions of operating systems that are required by client systems.
Both
195
(Continued)
Usually Found on Client or Server Systems? Comments
Both
Optional slice to be dened based on your sites needs. Can be used to hold application software added to a system. If a slice is not allocated for the /opt le system during installation, the /opt directory is put in slice 0.
/usr
Both
Holds OS commands (also known as executables). This slice also holds documentation, system programs (init and syslogd, for example), and library routines. Holds les that are created by users.
/home or /export/home
Both
N/A
N/A
VTOC Not applicable. EFI A reserved slice created by default. This area is similar to the VTOCs alternate cylinders. Do not modify or delete this slice.
9 (x86 only)
Both
EFI Not applicable. VTOC Provides an area that is reserved for alternate disk blocks. Slice 9 is known as the alternate sector slice.
Block 0 where the disk label is stored Slice 2, which represents the entire disk with a VTOC label
196
Note A slice cannot be split between two or more disks. However, multiple swap slices on separate
disks are allowed. For instance, a single disk might hold the root (/) le system, a swap area, and the /usr le system, while another disk holds the /export/home le system and other le systems that contain user data. In a multiple disk arrangement, the disk that contains the OS and swap space (that is, the disk that holds the root (/) and /usr le systems and the slice for swap space) is called the system disk. Other disks are called secondary disks or non-system disks. When you arrange a systems le systems on multiple disks, you can modify le systems and slices on the secondary disks without having to shut down the system or reload the OS. When you have more than one disk, you also increase input-output (I/O) volume. By distributing disk load across multiple disks, you can avoid I/O bottlenecks.
Each system conguration can use slices in a different way. The following table lists some examples.
TABLE 113 System Congurations and Slices Slice Servers Stand-alone Systems
0 1 2 3 6 7
For more information about system congurations, see Overview of System Types in System Administration Guide: Basic Administration.
Chapter 11 Managing Disks (Overview) 197
Note The Solaris installation utility provides default slice sizes based on the software you select for
installation.
format Utility
Read the following overview of the format utility and its uses before proceeding to the how-to or reference sections. The format utility is a system administration tool that is used to prepare hard disk drives for use on your Solaris system. The following table shows the features and associated benets that the format utility provides.
TABLE 114 Features and Benets of the format Utility Feature Benet
Reports on the following: Target location I Disk geometry I Whether the disk is formatted I If the disk has mounted partitions
I
Retrieves disk labels Repairs defective sectors Formats and analyzes a disk Partitions a disk Labels a disk
Convenient for repair operations Allows administrators to repair disk drives with recoverable errors instead of sending the drive back to the manufacturer Creates sectors on the disk and veries each sector Divides a disk into slices so that individual le systems can be created on separate slices Writes disk name and conguration information to the disk for future retrieval (usually for repair operations)
Display slice information Partition a disk Add a disk drive to an existing system Format a disk drive
198
I I I
The main reason a system administrator uses the format utility is to partition a disk. These steps are covered in Chapter 13 and Chapter 14. See the following section for guidelines on using the format utility.
Format a disk.
Any existing data is destroyed when you reformat a disk. The need for formatting a disk drive has decreased as more and more manufacturers ship their disk drives formatted and partitioned. You might not need to use the format utility when you add a disk drive to an existing system. If a disk has been relocated and is displaying many disk errors, you can attempt to reformat it. Reformatting automatically remaps any bad sectors. Data from the damaged system disk must be restored from a backup medium. Otherwise, the system will have to be reinstalled by using the installation utility.
SPARC: How to Connect a System Disk and Boot on page 228, x86: How to Connect a System Disk on page 239, or, if the system must be reinstalled, Solaris 10 Installation Guide: Basic Installations
SPARC: How to Create Disk Any existing data is destroyed when you repartition and relabel a disk with existing slices. Slices and Label a Disk on page 230 or x86: How to Create Disk Existing data must be copied to backup media Slices and Label a Disk on page before the disk is repartitioned and restored. 248 Any existing data must be restored from backup media if the secondary disk is reformatted or repartitioned. SPARC: How to Connect a Secondary Disk and Boot on page 229 or x86: How to Connect a Secondary Disk and Boot on page 241
199
(Continued)
For More Information
Some customer sites prefer to replace rather than Repairing a Defective Sector on page 222 repair defective drives. If your site has a repair contract with the disk drive manufacturer, you might not need to use the format utility to repair disk drives. The repair of a disk drive usually means that a bad sector is added to a defect list. New controllers remap bad sectors with no system interruption. If the system has an older controller, you might need to remap a bad sector and restore any lost data.
Formatting a Disk
In most cases, disks are formatted by the manufacturer or reseller. So, they do not need to be reformatted when you install the drive. To determine if a disk is formatted, use the format utility. For more information, see How to Determine if a Disk Is Formatted on page 208. If you determine that a disk is not formatted, use the format utility to format the disk. When you format a disk, you accomplish two steps:
I I
The disk media is prepared for use. A list of disk defects based on a surface analysis is compiled.
Caution Formatting a disk is a destructive process because it overwrites data on the disk. For this
reason, disks are usually formatted only by the manufacturer or reseller. If you think disk defects are the cause of recurring problems, you can use the format utility to do a surface analysis. However, be careful to use only the commands that do not destroy data. For details, see How to Format a Disk on page 209. A small percentage of total disk space that is available for data is used to store defect and formatting information. This percentage varies according to disk geometry, and decreases as the disk ages and develops more defects. Formatting a disk might take anywhere from a few minutes to several hours, depending on the type and size of the disk.
200
Number
07
VTOC Partitions or slices, numbered 07. EFI Partitions or slices, numbered 06.
Tag
0=UNASSIGNED 1=BOOT 2=ROOT A numeric value that usually describes the le system 3=SWAP 4=USR 5=BACKUP mounted on this partition. 7=VAR 8=HOME 11=RESERVED wm wu rm The partition is writable and mountable. The partition is writable and unmountable. This state is the default for partitions that are dedicated for swap areas. (However, the mount command does not check the not mountable ag.) The partition is read only and mountable.
Flags
rm
Partition ags and tags are assigned by convention and require no maintenance. For more information on displaying the partition table, see the following references:
I I I
Displaying Partition Table Information on page 201 How to Display Disk Slice Information on page 211 How to Examine a Disk Label on page 215
Total disk cylinders available: 38756 + 2 (reserved cylinders) Part Tag 0 root 1 swap 2 backup 3 unassigned 4 unassigned 5 unassigned 6 unassigned 7 home 8 boot 9 alternates partition> Flag wm wu wm wm wm wm wm wm wu wu Cylinders 3 - 2083 2084 - 3124 0 - 38755 0 0 0 0 3125 - 38755 0 0 1 2 Size 4.00GB 2.00GB 74.51GB 0 0 0 0 68.50GB 1.97MB 3.94MB Blocks (2081/0/0) 8390592 (1041/0/0) 4197312 (38756/0/0) 156264192 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (35631/0/0) 143664192 (1/0/0) 4032 (2/0/0) 8064
The partition table displayed by the format utility contains the following information.
Column Name
Description
Part Tag Flag Cylinders Size Blocks First Sector Last Sector
Partition or slice number. See Table 116 for a description of this column. Partition tag. See Table 116 for a description of this column. Partition ag. See Table 116 for a description of this column. The starting and ending cylinder number for the slice. Not displayed on EFI-labeled disks. The slice size in Mbytes. The total number of cylinders and the total number of sectors per slice. Not displayed on EFI-labeled disks. EFI The starting block number. Not displayed on VTOC-labeled disks. EFI The ending block number. Not displayed on VTOC-labeled disks.
The following is an example of an EFI disk label displayed by using the prtvtoc command.
# * * * * * * * * *
202
prtvtoc /dev/rdsk/c4t1d0s0 /dev/rdsk/c4t1d0s0 partition map Dimensions: 512 bytes/sector 2576941056 sectors 2576940989 accessible sectors Flags: 1: unmountable
Partitioning a Disk
* 10: read-only * * First Sector Last * Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 34 629145600 629145633 1 4 00 629145634 629145600 1258291233 6 4 00 1258291234 1318633404 2576924637 8 11 00 2576924638 16384 2576941021
The output of the prtvtoc command provides information in the following three sections:
I I I
Description
Partition Tag Flags First Sector Sector Count Last Sector Mount Directory
Partition or slice number. For a description of this column, see Table 116. Partition tag. For a description of this column, see Table 116. Partition ag. For a description of this column, see Table 116. The rst sector of the slice. The total number of sectors in the slice. The last sector of the slice. The last mount point directory for the le system.
Partitioning a Disk
The format utility is most often used by system administrators to partitioning a Disk. The steps are as follows:
I I I I I
Determining which slices are needed Determining the size of each slice or partition Using the format utility to partition the disk Labeling the disk with new partition information Creating the le system for each partition
The easiest way to partition a disk is to use the modify command from the partition menu of the format utility. The modify command allows you to create partitions by specifying the size of each partition without having to keep track of the starting cylinder boundaries. The modify command also keeps tracks of any disk space that remains in the free hog slice.
203
Partitioning a Disk
204
12
C H A P T E R
1 2
This chapter contains disk administration procedures. Many procedures described in this chapter are optional if you are already familiar with how disks are managed on systems running the SolarisTM OS. For information on the procedures associated with administering disks, see Administering Disks (Task Map) on page 205. For overview information about disk management, see Chapter 11.
If you are not sure of the types of disks on a system, use the format utility to identify the disk types. Determine whether a disk is already formatted by using the format utility. In most cases, disks are already formatted. Use the format utility if you need to format a disk.
How to Identify the Disks on a System on page 206 How to Determine if a Disk Is Formatted on page 208 How to Format a Disk on page 209 How to Display Disk Slice Information on page 211 How to Label a Disk on page 213
Display slice information by using the format utility. Create the disk label by using the format utility.
205
Task
Description
For Instructions
Examine the disk label by using the How to Examine a Disk Label prtvtoc command. on page 215 You can attempt to recover a disk label that was damaged due to a system or power failure. Create a format.dat entry to support a third-party disk. You can automatically congure a SCSI disk with the SCSI-2 specication for disk device mode sense pages even if the specic drive type is not listed in the /etc/format.dat le. Identify a defective disk sector by using the format utility. Fix a defective disk sector by using the format utility. How to Recover a Corrupted Disk Label on page 217 How to Create a format.dat Entry on page 220 How to Automatically Congure a SCSI Drive on page 221
How to Identify a Defective Sector by Using Surface Analysis on page 223 How to Repair a Defective Sector on page 224
M
1
Identify the disks that are recognized on the system by using the format utility.
# format
The format utility displays a list of disks that it recognizes under AVAILABLE DISK SELECTIONS.
Example 121
206
# format AVAILABLE DISK SELECTIONS: 0. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0
The output associates a disks physical and logical device name to the disks marketing name, which appears in angle brackets <>. See the example below. This method is an easy way to identify which logical device names represent the disks that are connected to your system. For a description of logical and physical device names, see Chapter 10. The following example uses a wildcard to display the four disks that are connected to a second controller.
# format /dev/rdsk/c2* AVAILABLE DISK SELECTIONS: 0. /dev/rdsk/c2t10d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /sbus@3,0/SUNW,fas@3,8800000/sd@a,0 1. /dev/rdsk/c2t11d0s0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133> /sbus@3,0/SUNW,fas@3,8800000/sd@b,0 2. /dev/rdsk/c2t14d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@3,0/SUNW,fas@3,8800000/sd@e,0 3. /dev/rdsk/c2t15d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248> /sbus@3,0/SUNW,fas@3,8800000/sd@f,0 Specify disk (enter its number):
The following example shows how to identify the disks on a SPARC based system.
# format 0. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0 Specify disk (enter its number):
The output identies that disk 0 (target 1) is connected to the second SCSI host adapter (scsi@2), which is connected to the second PCI interface (/pci@1f0/pci@1,1...). The output also associates both the physical and logical device name to the disks marketing name, SUN36G. The following example shows how to identify the disks on an x86 based system.
# format AVAILABLE DISK SELECTIONS: 0. c0d0 <DEFAULT cyl 615 alt 2 hd 64 sec 63> /pci@0,0/pci-ide@7,1/ata@0/cmdk@0,0 1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63> /pci@0,0/pci-ide@7,1/ata@0/cmdk@1,0 2. c1d0 <DEFAULT cyl 817 alt 2 hd 256 sec 63> /pci@0,0/pci-ide@7,1/ata@1/cmdk@0,0 Specify disk (enter its number):
Chapter 12 Administering Disks (Tasks) 207
Formatting a Disk
The output shows that disk 0 is connected to the rst PCI host adapter (pci-ide@7...), which is connected to the ATA interface (ata...). The format output on an x86 based system does not identify disks by their marketing names.
More Information
Go to Chapter 13 or Chapter 14. Go to Creating a format.dat Entry on page 220. Go to How to Label a Disk on page 213. Connect the disk to the system by using your disk hardware documentation.
Formatting a Disk
Disks are typically formatted by the manufacturer or reseller. They usually do not need to be reformatted when you install the drive. A disk must be formatted before you can do the following:
I I
Write data to the disk. However, most disks are already formatted. Use the Solaris installation utility to install the system.
Caution Formatting a disk is a destructive process because it overwrites data on the disk. For this
reason, disks are usually formatted only by the manufacturer or reseller. If you think disk defects are the cause of recurring problems, you can use the format utility to do a surface analysis. However, be careful to use only the commands that do not destroy data.
M
1 2
Verify that the disk you chose is formatted by noting the following message:
[disk formatted]
Example 122
208
Formatting a Disk
# format /dev/rdsk/c1* AVAILABLE DISK SELECTIONS: 0. /dev/rdsk/c1t0d0s0 <SUN18G cyl 7506 /sbus@2,0/QLGC,isp@2,10000/sd@0,0 1. /dev/rdsk/c1t1d0s0 <SUN18G cyl 7506 /sbus@2,0/QLGC,isp@2,10000/sd@1,0 2. /dev/rdsk/c1t8d0s0 <SUN18G cyl 7506 /sbus@2,0/QLGC,isp@2,10000/sd@8,0 3. /dev/rdsk/c1t9d0s0 <SUN18G cyl 7506 /sbus@2,0/QLGC,isp@2,10000/sd@9,0 Specify disk (enter its number): 0 selecting /dev/rdsk/c1t0d0s0 [disk formatted]
alt 2 hd 19 sec 248> alt 2 hd 19 sec 248> alt 2 hd 19 sec 248> alt 2 hd 19 sec 248>
M
1 2
To begin formatting the disk, type format at the format> prompt. Conrm the command by typing y.
format> format Ready to format. Formatting cannot be interrupted and takes 23 minutes (estimated). Continue? yes
Verify that the disk format was successful by noting the following messages:
Beginning format. The current time Tue ABC xx xx:xx:xx xxxx Formatting... done Verifying media... pass 0 - pattern = 0xc6dec6de 2035/12/18
209
Formatting a Disk
Example 123
Formatting a Disk
The following example shows how to format the disk c0t6d0.
# format Searching for disks...done
AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SUNW18G cyl 7506 alt 2 hd 19 sec 248 /pci@1f,0/pci@1,1/scsi@2/sd@0,0 1. c0t1d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@1,0 2. c0t2d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@2,0 3. c0t3d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@3,0 4. c0t4d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@4,0 5. c0t5d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@5,0 6. c0t6d0 <FUJITSU MAN3367M SUN36G 1804 43d671f> /pci@1f,0/pci@1,1/scsi@2/sd@6,0 Specify disk (enter its number): 6 selecting c0t6d0 [disk formatted] format> format Ready to format. Formatting cannot be interrupted and takes 332 minutes (estimated). Continue? y Beginning format. The current time is Wed Jan 7 16:16:05 2004 Formatting... 99% complete (00:00:21 remaining) done Verifying media... pass 0 - pattern = 0xc6dec6de 71132922 pass 1 - pattern = 0x6db6db6d
210 System Administration Guide: Devices and File Systems November 2006
M
1 2
Type the number of the disk for which you want to display slice information.
Specify disk (enter its number):1
Verify the displayed slice information by identifying specic slice tags and slices. If the screen output shows that no slice sizes are assigned, the disk probably does not have slices.
Chapter 12 Administering Disks (Tasks) 211
Example 124
For a detailed description of the slice information in these examples, see Chapter 11. The following example shows the slice information for a disk with an EFI label.
# format Searching for disks...done Specify disk (enter its number): 9 selecting c4t1d0 [disk formatted] format> partition partition> print Current partition table (original): partition> q format> q Part Tag Flag First Sector 0 root wm 34 1 usr wm 629145634 2 unassigned wm 0 3 unassigned wm 0 4 unassigned wm 0 5 unassigned wm 0 6 usr wm 1258291234 8 reserved wm 2576924638
212
Label a disk with a VTOC label or a disk greater than 1 terabyte with an EFI label. Label a disk that is greater than 1 terabyte with an EFI label.
If you want to put an EFI label on disk smaller than 1 terabyte, see Example 126.
1 2
If the format utility recognizes the disk type, the next step is to search for a backup label to label the disk. Labeling the disk with the backup label labels the disk with the correct partitioning information, the disk type, and disk geometry.
4
If the disk is unlabeled and was successfully congured, go to Step 5 to label the disk. The format utility will ask if you want to label the disk. If the disk is labeled but you want to change the disk type, or if the format utility was not able to automatically congure the disk, proceed to Step 6 to set the disk type and label the disk.
213
Or, select 0 to automatically congure a SCSI-2 disk. For more information, see How to Automatically Congure a SCSI Drive on page 221.
8
Label the disk. If the disk is not labeled, the following message is displayed.
Disk not labeled. Label it now? y
10
Example 125
Labeling a Disk
The following example shows how to automatically congure and label a 1.05-Gbyte disk.
# format c1t0d0: configured with capacity of 1002.09MB AVAILABLE DISK SELECTIONS: 0. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c1t0d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 Specify disk (enter its number): 1 Disk not labeled. Label it now? yes format> verify format> q #
214
Example 126
1 2
Become superuser or assume an equivalent role. Display the disk label information.
# prtvtoc /dev/rdsk/device-name
* * * * * * * * * * * * * *
Dimensions: 512 bytes/sector 63 sectors/track 15 tracks/cylinder 945 sectors/cylinder 8894 cylinders 8892 accessible cylinders Flags: 1: unmountable 10: read-only First Partition Tag Flags Sector 0 2 00 1048950 1 3 01 0 2 5 00 0 7 8 00 4430160 Sector Count 3381210 1048950 8402940 3972780 Last Sector Mount Directory 4430159 / 1048949 8402939 8402939 /export/home
The following example shows disk label information for a disk with an EFI label.
# * * * * * * * * * * * * * prtvtoc /dev/rdsk/c3t1d0s0 /dev/rdsk/c3t1d0s0 partition map Dimensions: 512 bytes/sector 2479267840 sectors 2479267773 accessible sectors Flags: 1: unmountable 10: read-only First Sector Last Partition Tag Flags Sector Count Sector Mount Directory 0 2 00 34 262144 262177 1 3 01 262178 262144 524321 6 4 00 524322 2478727100 2479251421 8 11 00 2479251422 16384 2479267805
216
M
1
The format utility attempts to automatically congure any unlabeled SCSI disk. If the format utility is able to congure the unlabeled and corrupted disk, it will display this message:
cwtxdy: configured with capacity of abcMB
The format utility then displays a numbered list of disks on the system.
3
If the disk was congured successfully, follow Steps 5 and 6. Then go to step 12. If the disk was not congured successfully, follow Steps 711. Then go to step 12.
use the backup command. Backup label contents: Volume name = < > ascii name = <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> pcyl = 2038 ncyl = 2036 acyl = 2 nhead = 14 nsect = 72 Part Tag Flag Cylinders Size 0 root wm 0 - 300 148.15MB 1 swap wu 301 - 524 110.25MB 2 backup wm 0 - 2035 1002.09MB 3 unassigned wm 0 0 4 unassigned wm 0 0 5 unassigned wm 0 0 6 usr wm 525 - 2035 743.70MB 7 unassigned wm 0 0 6
Blocks (301/0/0) 303408 (224/0/0) 225792 (2036/0/0) 2052288 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (1511/0/0) 1523088 (0/0/0) 0
If the format utility was able to nd a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.
format> backup Disk has a primary label, still continue? y Searching for backup labels...found. Restoring primary label
If the format utility was not able to automatically congure the disk, specify the disk type by using the type command.
format> type
Select 0 to automatically congure the disk. Or, select a disk type from the list of possible disk types.
Specify disk type (enter its number)[12]: 12
If the disk was successfully congured, reply with no when the format utility asks if you want to label the disk.
Disk not labeled. Label it now? no
10
218
. . . 11
If the format utility was able to nd a backup label and the backup label contents appear satisfactory, use the backup command to label the disk with the backup label.
format> backup Disk has a primary label, still continue? y Searching for backup labels...found. Restoring primary label
13
Verify the le systems on the recovered disk by using the fsck command. For information on using the fsck command, see Chapter 22.
If you are adding a SCSI disk, you might to try the format utilitys automatic conguration feature. For more information, see Automatically Conguring SCSI Disk Drives on page 220. You might try hot-plugging a PCI, SCSI, or USB disk. For more information, see Chapter 5.
If the third-party disk is designed to work with standard SunOS compatible device drivers, then the creation of an appropriate format.dat entry should sufce to allow the disk to be recognized by the format utility. In other cases, you need to load a third-party device driver to support the disk.
Note Sun cannot guarantee that its format utility will work properly with all third-party disk
drivers. If the disk driver is not compatible with the Solaris format utility, the disk drive vendor should supply you with a custom disk formatting program. This section discusses what to do if some of this software support is missing. Typically, you discover that software support is missing when you invoke the format utility and nd that the disk type is not recognized. Supply the missing software as described in this section. Then, refer to the appropriate conguration procedure for adding system disks or secondary disks in Chapter 13 or Chapter 14.
Chapter 12 Administering Disks (Tasks) 219
the SCSI-2 drivers if the disks are powered on during a reconguration boot. For step-by-step instructions on conguring a SCSI disk drive automatically, see How to Automatically Congure a SCSI Drive on page 221. If your disk is unrecognized, use a text editor to create an entry in format.dat for the disk. You need to gather all the pertinent technical specications about the disk and its controller before you start. This information should have been provided with the disk. If not, contact the disk manufacturer or your supplier.
M
1 2
Modify the /etc/format.dat le to include an entry for the third-party disk. Use the format.dat information that is described in Chapter 16. Also, use the disks hardware product documentation to gather the required information.
If you are adding a SCSI disk, you might to try the format utilitys automatic conguration feature. You might try hot-plugging a PCI, SCSI, or USB disk. For more information, see Chapter 5.
The following steps are involved in conguring a SCSI drive by using automatic conguration:
I I
Shutting down the system Attaching the SCSI disk drive to the system
220
I I I
Turning on the disk drive Performing a reconguration boot Using the format utility to automatically congure the SCSI disk drive
After the reconguration boot, invoke the format utility. The format utility will attempt to congure the disk and, if successful, alert the user that the disk was congured. For step-by-step instructions on automatically conguring a SCSI disk drive, see How to Automatically Congure a SCSI Drive on page 221. Heres an example of a partition table for a 1.3-Gbyte SCSI disk drive that was displayed by the format utility.
Part 0 1 2 6 Tag Flag root wm swap wu backup wu usr wm Cylinders 0 - 96 97 - 289 0 - 1964 290 - 1964 Size 64.41MB 128.16MB 1.27GB 1.09GB Blocks (97/0/0) (193/0/0) (1965/0/0) (1675/0/0)
M
1 2
-i0 -gn -y
Brings the system down to init level 0, the power-down state. Noties logged-in users that they have n seconds before the system begins to shut down. Species that the command should run without user intervention.
Turn off the power to the system and all external peripheral devices. Ensure that the disk you are adding has a different target number than the other devices on the system. Typically, a small switch is located at the back of the disk for this purpose.
Connect the disk to the system, and check the physical connections. Refer to the disks hardware installation guide for details.
Turn on the power to the system. The system boots and displays the login prompt.
9 10
Log back in as superuser or assume an equivalent role. Invoke the format utility, and select the disk that you want to congure automatically.
# format Searching for disks...done c1t0d0: configured with capacity of 1002.09MB AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): 1
11
Type yes in response to the prompt to label the disk. Typing y causes the disk label to be generated and written to the disk by using SCSI automatic conguration.
Disk not labeled. Label it now? y
12
13
Run surface analysis on a disk For more information on the analysis feature of the format utility, see analyze Menu on page 283. The defective area reported while your system is running might not be accurate. Because the system does disk operations many sectors at a time, it is often hard to pinpoint exactly which sector caused a given error. To nd the exact sector or sectors, use How to Identify a Defective Sector by Using Surface Analysis on page 223.
Get multiple error messages from the disk driver concerning a particular portion of the disk while your system is running. Console messages that are related to disk errors appear similar to the following:
222
WARNING: /io-unit@f,e0200000/sbi@0,0/QLGC,isp@1,10000/sd@3,0 (sd33): Error for command read Error Level: Retryable Requested Block 126, Error Block: 179 Sense Key: Media Error Vendor name: ASC = 0x11 (unrecovered read error), ASCQ = 0x0, FRU = 0x0
This message indicates that block 179 might be defective. You would relocate the bad block by using the format utilitys repair command. Or, you would use the analyze command with the repair option enabled.
1 2
Set up the analysis parameters by typing setup at the analyze> prompt. Use the parameters shown here:
analyze> setup Analyze entire disk [yes]? n Enter starting block number [0, 0/0/0]: 12330 Enter ending block number [2052287, 2035/13/71]: 12360 Loop continuously [no]? y Repair defective blocks [yes]? n Stop after first error [no]? n Use random bit patterns [no]? n
223
Enter number of blocks per transfer [126, 0/1/54]: 1 Verify media after formatting [yes]? y Enable extended messages [no]? n Restore defect list [yes]? y Create defect label [yes]? y 7
M
1 2
If you are unsure of the format that is used to identify the defective sector, see How to Identify a Defective Sector by Using Surface Analysis on page 223 for more information.
224
In this example, the series of numbers under Inquiry represent the hexadecimal value of the inquiry data that is displayed to the right of the numbers.
# format -M Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): selecting c0t3d0 [disk formatted] format> inquiry Inquiry: 00 00 02 02 8f 00 00 12 53 45 41 53 54 31 31 32 30 30 4e 20 53 55 38 33 35 38 30 30 30 33 30 32 30 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 43 6f 70 79 72 69 67 68 74 20 39 39 32 20 53 65 61 67 61 74 65 72 69 67 68 74 73 20 72 65 73 65 30 30 30 Vendor: name Product: ST11200N SUN1.05 Revision: 8358 format> 0
47 4e 39 00 00 00 28 20 72
41 31 00 00 00 00 63 41 76
54 2e 00 00 00 00 29 6c 65
45 30 00 00 00 00 20 6c 64
20 35 00 00 00 00 31 20 20
........NAME.... ST11200N SUN1.05 835800030209.... ................ ................ ................ .Copyright (c) 1 992 NAME All rights reserved 000
225
In this example, the disk label from c2t0d0s0 is copied to four other disks.
# for i in 1 2 3 5 > do > prtvtoc /dev/rdsk/c2t0d0s0 | fmthard > done fmthard: New volume table of contents fmthard: New volume table of contents fmthard: New volume table of contents fmthard: New volume table of contents #
226
13
C H A P T E R
1 3
This chapter describes how to add a disk to a SPARC system. For information on the procedures associated with adding a disk to a SPARC system, see SPARC: Adding a System Disk or a Secondary Disk (Task Map) on page 227. For overview information about disk management, see Chapter 11. For step-by-step instructions on adding a disk to an x86 based system, see Chapter 14.
System Disk Connect the new disk and boot from a local or remote Solaris CD or DVD. Secondary Disk Connect the new disk and perform a reconguration boot so that the system will recognize the disk.
Create disk slices and label the disk if the disk manufacturer has not already done so.
SPARC: How to Create Disk Slices and Label a Disk on page 230
227
Task
Description
For Instructions
3. Create le systems.
Create UFS le systems on the disk SPARC: How to Create a UFS File slices by using the newfs System on page 235 command. You must create the root (/) or /usr le system, or both, for a system disk. Restore the root (/) or /usr le Chapter 27 system, or both, on the system disk. If necessary, restore le systems on the secondary disk. System Disk Only. Install the boot block on the root (/) le system so that the system can boot. SPARC: How to Install a Boot Block on a System Disk on page 236
4. Restore le systems.
You can reinstall the entire Solaris OS. Or, you can replace the system disk and restore your le systems from a backup medium.
A secondary disk does not contain the root (/) and /usr le systems. A secondary disk usually contains space for user les. You can add a secondary disk to a system for more disk space. Or, you can replace a damaged secondary disk. If you replace a secondary disk on a system, you can restore the old disks data on the new disk.
1 2
Connect the replacement system disk to the system and check the physical connections. Refer to the disks hardware installation guide for details.
Follow the instructions in the following table, depending on whether you are booting from a local Solaris CD or DVD or a remote Solaris CD or DVD from the network.
System Administration Guide: Devices and File Systems November 2006
228
Boot Type
Action
1. Make sure the Solaris Software 1 CD or the Solaris DVD is in the drive. 2. Boot from the media to single-user mode: ok boot cdrom -s
1 2
Become superuser or assume an equivalent role. (Optional) If the disk type is unsupported by the Solaris software, add the device driver for the disk by following the instructions included with the hardware. For information on creating a format.dat entry for the disk, see How to Create a format.dat Entry on page 220, if necessary.
(Optional) Create the /reconfigure le that will be read when the system is booted.
# touch /reconfigure
The /reconfigure le causes the SunOSTM software to check for the presence of any newly installed peripheral devices when you power on or boot your system later.
4
-i0 -gn
Changes to run level 0, the power-down state. Noties logged-in users that they have n seconds before the system begins to shut down.
229
-y
Turn off the power to the system and all external peripheral devices. Ensure that the disk you are adding has a different target number than the other devices on the system. Typically, a small switch is located at the back of the disk for this purpose.
Connect the disk to the system and check the physical connections. Refer to the disks hardware installation guide for details.
8 9
Turn on the power to all external peripheral devices. Turn on the power to the system. The system boots and displays the login prompt.
More Information
M
1 2
A numbered list of available disks is displayed. For more information, see format(1M).
3
230
For more information about the free hog slice, see Using the Free Hog Slice on page 204.
8
Identify the free hog partition (slice) and the sizes of the slices when prompted. When adding a system disk, you must set up slices for:
I I
After you identify the slices, the new partition table is displayed. For an example of creating disk slices, see Example 131.
10
Make the displayed partition table the current partition table by answering y when prompted.
Okay to make this the current partition table[yes]? y
If you do not want the current partition table and you want to change it, answer no and go to Step 6.
11
Label the disk with the new partition table after you have nished allocating slices on the new disk.
Ready to label disk, continue? yes
13
14
15
231
Example 131
Blocks (0/0/0) 0 (0/0/0) 0 (7506/0/0) 35368272 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0 (0/0/0) 0
0.00mb, 0.00gb]: 4gb 0.00mb, 0.00gb]: 4gb 0.00mb, 0.00gb]: 0.00mb, 0.00gb]: 0.00mb, 0.00gb]: 0.00mb, 0.00gb]: Size Blocks 4.00GB (1781/0/0) 8392072 4.00GB (1781/0/0) 8392072
232
2 3 4 5 6 7
wu wm wm wm wm wm
16.86GB 0 0 0 8.86GB 0
Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "disk0" Ready to label disk, continue? yes partition> quit format> verify format> quit
Example 132
233
7 unassigned
wm
(0/0/0)
Do you wish to continue creating a new partition table based on above table[yes]? y Free Hog partition[6]? 7 Enter size of partition 0 [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition 1 [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition 3 [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition 4 [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition 5 [0b, 0c, 0.00mb, 0.00gb]: Enter size of partition 6 [0b, 0c, 0.00mb, 0.00gb]: Part Tag Flag Cylinders Size Blocks 0 root wm 0 0 (0/0/0) 0 1 swap wu 0 0 (0/0/0) 0 2 backup wu 0 - 7505 16.86GB (7506/0/0) 35368272 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 usr wm 0 0 (0/0/0) 0 7 unassigned wm 0 - 7505 16.86GB (7506/0/0) 35368272 Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "home" Ready to label disk, continue? y partition> q format> verify format> q #
The following example shows how to use the format utility to divide a 1.15 terabyte disk with an EFI label into three slices.
# format . . . partition> modify Select partitioning base: 0. Current partition table (original) 1. All Free Hog Choose base (enter number) [0]? 1 Part Tag Flag First Sector 0 root wm 0 1 usr wm 0 2 unassigned wm 0 3 unassigned wm 0 4 unassigned wm 0 5 unassigned wm 0
Size 0 0 0 0 0 0
Last Sector 0 0 0 0 0 0
234
6 usr wm 0 0 0 8 reserved wm 2576924638 8.00MB 2576941021 Do you wish to continue creating a new partition table based on above table[yes]? y Free Hog partition[6]? 4 Enter size of partition 0 [0b, 34e, 0mb, 0gb, 0tb]: Enter size of partition 1 [0b, 34e, 0mb, 0gb, 0tb]: Enter size of partition 2 [0b, 34e, 0mb, 0gb, 0tb]: 400gb Enter size of partition 3 [0b, 838860834e, 0mb, 0gb, 0tb]: 400gb Enter size of partition 5 [0b, 1677721634e, 0mb, 0gb, 0tb]: Enter size of partition 6 [0b, 1677721634e, 0mb, 0gb, 0tb]: Part Tag Flag First Sector Size Last Sector 0 unassigned wm 0 0 0 1 unassigned wm 0 0 0 2 usr wm 34 400.00GB 838860833 3 usr wm 838860834 400.00GB 1677721633 4 usr wm 1677721634 428.77GB 2576924637 5 unassigned wm 0 0 0 6 unassigned wm 0 0 0 8 reserved wm 2576924638 8.00MB 2576941021 Ready to label disk, continue? yes partition> q
More Information
M
1 2
where /dev/rdsk/cwtxdysx is the raw device for the le system to be created. For more information about the newfs command, see Chapter 18 or newfs(1M).
3
235
More Information
System Disk You need to restore the root (/) and /usr le systems on the disk.
I I
Go to Chapter 27. After the root (/) and /usr le systems are restored, install the boot block. Go to SPARC: How to Install a Boot Block on a System Disk on page 236.
Secondary Disk You might need to restore le systems on the new disk. Go to Chapter 27. If you are not restoring le systems on the new disk, you are nished adding a secondary disk. For information on making the le systems available to users, see Chapter 19.
M
1 2
/usr/platform/uname -i/lib/fs /ufs/bootblk Is the boot block code. /dev/rdsk/cwtxdys0 Is the raw device of the root (/) le system. For more information, see installboot(1M).
3
Verify that the boot blocks are installed by rebooting the system to run level 3.
# init 6
Example 133
236
14
C H A P T E R
1 4
This chapter describes how to add a disk to an x86 based system. For information on the procedures associated with adding a disk to an x86 based system, see x86: Adding a System Disk or a Secondary Disk (Task Map) on page 237. For overview information about disk management, see Chapter 11. For step-by-step instructions on adding a disk to a SPARC based system, see Chapter 13.
System Disk Connect the new disk and boot from a local or remote Solaris CD or DVD. Secondary Disk Connect the new disk and perform a reconguration boot so that the system will recognize the disk.
237
Task
Description
For Instructions
The Solaris 10 fdisk partition identier on x86 systems has been changed from 130 (0x82) to 191 (0xbf). You can use a new fdisk menu option to switch back and forth between the new and old identier.
Create disk slices and label the disk if the disk manufacturer has not already done so. Create UFS le systems on the disk slices with the newfs command. You must create the root (/) or /usr le system (or both) for a system disk. Restore the root (/) or /usr le system (or both) on the system disk. If necessary, restore le systems on the secondary disk. System Disk Only. Install the boot block on the root (/) le system so that the system can boot.
x86: How to Create a Solaris fdisk Partition on page 242 and x86: How to Create Disk Slices and Label a Disk on page 248 x86: How to Create File Systems on page 250
4. Create le systems.
5. Restore le systems.
Chapter 27
You can reinstall the entire Solaris OS. Or, you can replace the system disk and restore your le systems from a backup medium.
A secondary disk doesnt contain the root (/) and /usr le systems. A secondary disk usually contains space for user les. You can add a secondary disk to a system for more disk space. Or, you can replace a damaged secondary disk. If you replace a secondary disk on a system, you can restore the old disks data on the new disk.
238
1 2
Connect the replacement system disk to the system, and check the physical connections. Refer to the disks hardware installation guide for details.
Boot the system. This procedure assumes that you are booting from GRUBs Solaris failsafe boot option. a. Press any key to reboot the system if the system displays the Press any key to reboot prompt. Or, use the reset button to restart the system if the system is shut down. The GRUB menu is displayed after a few minutes. b. Use the arrow keys to select the Solaris failsafe boot option. c. Press return. d. At the Do you wish to automatically update boot archives? prompt answer no. The root prompt (#) is displayed.
Note You must reboot the system when you want to exit Solaris failsafe boot mode. You cannot
reboot the system to multiuser mode until the system disk is successfully added, the data is restored, and the bootblocks are installed.
More Information
I I
1 2
Partition ========= 1 2 3
Select option 4 from the fdisk menu to change the fdisk partition identier back to 0x82
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 4
4 5
Select option 5 to update your disk conguration and exit. If necessary, select option 4 from the fdisk menu to change the fdisk partition identier back to 0xbf. For example:
Total disk size is 39890 cylinders Cylinder size is 4032 (512 byte) blocks Cylinders Type Start End Length % ============ ===== === ====== === x86 Boot 1 6 6 0 Solaris 7 39889 39883 100
Partition ========= 1 2
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit)
240 System Administration Guide: Devices and File Systems November 2006
1 2
Become superuser or assume an equivalent role. (Optional) If the disk is unsupported by the Solaris software, add the device driver for the disk by following the instructions included with the hardware. (Optional) Create the /reconfigure le that will be read when the system is booted.
# touch /reconfigure
The /reconfigure le causes the SunOSTM software to check for the presence of any newly installed peripheral devices when you power on or boot your system later.
4
-i0 -gn -y
Brings the system down to run level 0, the power-down state. Noties logged-in users that they have n seconds before the system begins to shut down. Species that the command should run without user intervention.
Turn off the power to the system and all external peripheral devices. Ensure that the disk you are adding has a different target number than the other devices on the system. Typically, a small switch is located at the back of the disk for this purpose.
Connect the disk to the system and check the physical connections. Refer to the disks hardware installation guide for details.
Turn on the power to the system. The system boots and displays the login prompt.
More Information
The fdisk command cannot be used on disks with an EFI label that are greater than 1 terabyte in size. The disk can be divided into a maximum of four fdisk partitions. One of partitions must be a Solaris partition. The Solaris partition must be made the active partition on the disk. The active partition is partition whose operating system will be booted by default at system startup. Solaris fdisk partitions must begin on cylinder boundaries. Solaris fdisk partitions must begin at cylinder 1, not cylinder 0, on the rst disk because additional boot information, including the master boot record, is written in sector 0. The Solaris fdisk partition can be the entire disk. Or, you might want to make it smaller to allow room for a DOS partition. You can also make a new fdisk partition on a disk without disturbing existing partitions (if sufcient space is available) to create a new partition.
I I
x86 only Solaris slices are also called partitions. Certain interfaces might refer to a slice as a partition.
fdisk partitions are supported only on x86 based systems. To avoid confusion, Solaris documentation tries to distinguish between fdisk partitions and the entities within the Solaris fdisk partition. These entities might be called slices or partitions.
M
Before You Begin
1 2
242
Type the number of the disk on which to create a Solaris fdisk partition.
Specify disk (enter its number): disk-number
where disk-number is the number of the disk on which you want to create a Solaris fdisk partition.
4
The fdisk menu that is displayed depends upon whether the disk has existing fdisk partitions. Determine the next step by using the following table.
Task
Go To
Create a Solaris fdisk partition to span the entire disk. Create a Solaris fdisk partition and preserve one or more existing non Solaris fdisk partitions. Create a Solaris fdisk partition and one or more additional non Solaris fdisk partition.
Step 5 Step 6
Step 6
Example 143
Create and activate a Solaris fdisk partition that spans the entire disk by specifying y at the prompt. Then, go to step 13.
No fdisk table exists. The default partition for the disk is: a 100% "SOLARIS System" partition Type "y" to accept the default partition, otherwise type "n" to edit the partition table. y
Specify n at the prompt if you do not want the Solaris fdisk partition to span the entire disk.
Type "y" to accept the default partition, otherwise type "n" to edit the partition table. n Total disk size is 3498 cylinders Cylinder size is 1199 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ======== ===== === ====== === SELECT ONE OF THE FOLLOWING:
Chapter 14 x86: Adding a Disk (Tasks) 243
1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 7
Identify the percentage of the disk to be reserved for the Solaris fdisk partition. Keep in mind the size of any existing fdisk partitions when you calculate this percentage.
Specify the percentage of disk to use for this partition (or type "c" to specify the size in cylinders). nn
10
The Enter Selection prompt is displayed after the fdisk partition is activated.
11
Select option 1, Create a partition, to create another fdisk partition. See steps 810 for instructions on creating an fdisk partition.
12
Update the disk conguration, and exit the fdisk menu from the selection menu.
Selection: 5
13
14
244
Example 141
x86: Creating a Solaris fdisk Partition That Spans the Entire Drive
The following example uses the format utilitys fdisk option to create a Solaris fdisk partition that spans the entire drive.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0d0 <DEFAULT cyl 2466 alt 2 hd 16 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0 1. c0d1 <DEFAULT cyl 522 alt 2 hd 32 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0 2. c1d0 <DEFAULT cyl 13102 alt 2 hd 16 sec 63> /pci@0,0/pci-ide@7,1/ide@1/cmdk@0,0 Specify disk (enter its number): 0 selecting c0d0 Controller working list found [disk formatted] format> fdisk No fdisk table exists. The default partitioning for your disk is: a 100% "SOLARIS System" partition. Type "y" to accept the default partition, otherwise type "n" to edit the partition table. y format> label Ready to label disk, continue? yes format> quit
Example 142
x86: Creating a Solaris fdisk Partition While Preserving an Existing fdisk Partition
The following example shows how to create a Solaris fdisk partition on a disk that has an existing DOS-BIG fdisk partition.
format> fdisk Total disk size is 3498 cylinders Cylinder size is 1199 (512 byte) blocks Cylinders Partition Status Type Start End Length ========= ====== ============ ===== === ====== 1 Active DOS-BIG 1 699 699 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs
Chapter 14 x86: Adding a Disk (Tasks)
% === 20
245
5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 1 Indicate the type of partition you want to create 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI 0=Exit?1 Indicate the percentage of the disk you want this partition to use (or enter "c" to specify in cylinders). 80 Should this become the active partition? If yes, it will be activated each time the computer is or turned on. Please type "y" or "n". y Total disk size is 3498 cylinders Cylinder size is 1199 (512 byte) blocks Cylinders Partition Status Type Start End Length ========= ====== ============ ===== === ====== 1 DOS-BIG 1 699 699 2 Active Solaris2 700 3497 2798 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection:5 Partition 2 is now the active partition format> label Ready to label disk, continue? yes format> q
% === 20 80
Example 143
246
========= ====== ============ ===== === ====== SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 1 Indicate the type of partition you want to create 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI 0=Exit? 8 Specify the percentage of disk to use for this partition (or type "c" to specify the size in cylinders)20 Should this to become the Active partition? If yes, it will be activated each time the computer is reset or turned on. again. Please type "y" or "n". n Total disk size is 3498 cylinders Cylinder size is 1199 (512 byte) blocks Cylinders Partition Status Type Start End Length ========= ====== ============ ===== === ====== 1 DOS-BIG 1 699 699 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 1 Indicate the type of partition you want to create 1=SOLARIS2 2=UNIX 3=PCIXOS 4=Other 5=DOS12 6=DOS16 7=DOSEXT 8=DOSBIG 9=DOS16LBA A=x86 Boot B=Diagnostic C=FAT32 D=FAT32LBA E=DOSEXTLBA F=EFI 0=Exit? 1 Indicate the percentage of the disk you want this partition to use (or enter "c" to specify in cylinders). 80 Should this become the active partition? If yes, it will be activated each time the computer is reset or turned on. Please type "y" or "n". y Total disk size is 3498 cylinders Cylinder size is 1199 (512 byte) blocks Cylinders Partition Status Type Start End Length ========= ====== ============ ===== === ======
Chapter 14 x86: Adding a Disk (Tasks)
===
% === 20
% ===
247
1 DOS-BIG 1 699 2 Active Solaris2 700 3497 SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection: 5 Partition 2 is now the Active partition format> q More Information
699 2798
20 80
M
1 2
where disk-number is the number of the disk that you want to repartition.
4
For more information about the free hog slice, see Using the Free Hog Slice on page 204.
248 System Administration Guide: Devices and File Systems November 2006
Identify the free hog partition (slice) and the sizes of the slices when prompted. When adding a system disk, you must set up slices for the following:
I I
After you identify the slices, the new partition table is displayed.
10
Make the displayed partition table the current partition table by answering yes when prompted.
Okay to make this the current partition table[yes]? yes
If you dont want the current partition table and you want to change it, answer no and go to Step 6.
11
Label the disk with the new partition table after you have nished allocating slices on the new disk.
Ready to label disk, continue? yes
13
14
15
More Information
249
M
1 2
where /dev/rdsk/cwtxdysz is the raw device for the le system to be created. For more information about the newfs command, see Chapter 18 or newfs(1M).
3
More Information
System Disk You need to restore the root (/) and /usr le systems on the disk.
I I
Go to Chapter 27. After the root (/) and /usr le systems are restored, install the boot block. Go to x86: How to Install a Boot Block on a System Disk on page 250.
Secondary Disk You might need to restore le systems on the new disk. Go to Chapter 27. If you are not restoring le systems on the new disk, you are nished adding a secondary disk. For information on making the le systems available to users, see Chapter 19.
M
1 2
Is the partition boot le. Is the boot block code. Is the raw device name that represents the location of the GRUB menu, /boot/grub/menu.lst on the Solaris root slice.
Verify that the boot blocks are installed by rebooting the system to run level 3.
# init 6
250
Example 144
251
252
15
C H A P T E R
1 5
This chapter describes how to congure Solaris iSCSI initiators starting in the Solaris 10 1/06 release. For information on the procedures associated with conguring iSCSI initiators, see Setting Up Solaris iSCSI Initiators (Task Map) on page 254. For information about new Solaris iSCSI initiator features in the Solaris 10 6/06 release, see Whats New in Disk Management in the Solaris 10 6/06 Release? on page 186 For troubleshooting Solaris iSCSI conguration problems, see Troubleshooting iSCSI Conguration Problems on page 270.
iSCSI block devices or tape Translates SCSI commands and data from the block level into IP packets. The advantage of using iSCSI in your network is when you need to have block-level access between one system and the target device, such as a tape device or a database. Access to a block-level device is not locked so that you could not have multiple users or systems accessing a block-level device such as an iSCSI target device. NFS Transfers le data over IP. The advantage of using NFS in your network is that you can share le data across many systems. Access to le data is locked appropriately when many users are accessing data that is available in an NFS environment.
253
You can use any supported network interface card (NIC), Ethernet hub or switch. One IP port can handle multiple iSCSI target devices. You can use existing infrastructure and management tools for IP networks.
I I
There is no upper limit on the maximum number of congured iSCSI target devices. The protocol an be used to connect to Fibre Channel or iSCSI Storage Area Network (SAN) environments with the appropriate hardware.
Here are the current limitations or restrictions of using the Solaris iSCSI initiator software:
I I I I
No support for iSCSI devices that use SLP is currently available. No boot support for iSCSI devices is currently available. Do not congure iSCSI targets as dump devices. iSCSI supports multiple connections per session, but the current Solaris implementation only supports a single connection per session. For more information, see RFC 3720. You should consider the impact of transferring large amounts of data over your existing network.
iSCSI target software and devices The Solaris 10 1/06 or later release The following software packages:
I I
SUNWiscsir Sun iSCSI Device Driver (root) SUNWiscsiu Sun iSCSI Management Utilities (usr)
Note The Solaris iSCSI technology includes the iSCSI initiator software only.
I
Identify the software and hardware iSCSI Software and Hardware requirements for setting up an Requirements on page 254 iSCSI-based storage network.
254
Task
Description
For Instructions
Connect and set up your iSCSI target devices. Make sure you have the correct software versions and hardware installed.
See your vendors iSCSI target device documentation for setup instructions. How to Prepare for a Solaris iSCSI Conguration on page 257
4. (Optional) Set up authentication Decide whether you want to use in your Solaris iSCSI conguration. authentication in your Solaris iSCSI conguration: Consider using unidirectional CHAP or bidirectional CHAP Consider using a third-party RADIUS server to simplify CHAP management. 5. Congure the iSCSI target discovery method. 6. (Optional) Remove discovered iSCSI targets. 7. Monitor your iSCSI conguration. 8. (Optional) Modify your iSCSI conguration. Select the iSCSI target discovery method best suited for your environment. You might need to remove a discovered iSCSI target. Monitor your iSCSI conguration with the iscsiadm command. You might want to change your iSCSI target settings such as the header and data digest parameters. How to Congure CHAP Authentication for Your iSCSI Conguration on page 258 How to Congure RADIUS for Your iSCSI Conguration on page 259 How to Congure iSCSI Target Discovery on page 260 How to Remove Discovered iSCSI Targets on page 261 Monitoring Your iSCSI Conguration on page 263 How to Modify iSCSI Initiator and Target Parameters on page 266 How to Enable Multiple iSCSI Sessions for a Target on page 269
9. (Optional) Enable multiple iSCSI Use this procedure to create sessions for your target. multiple iSCSI sessions that connect to a single target.
Identifying the hardware and software requirements Conguring your IP network Connecting and setting up your iSCSI target device (Optional) Congure iSCSI authentication between the iSCSI initiator and the iSCSI target, if necessary Conguring the iSCSI target discovery method
255
I I
The iSCSI conguration information is stored in the /etc/iscsi directory. This information requires no administration.
iSCSI Terminology
Review the following terminology before conguring iSCSI initiators.
Term
Description
The driver that initiates SCSI requests to the iSCSI target. Represents the iSCSI storage component. Discovery is the process that presents the initiator with a list of available targets Describes the way in which the iSCSI targets can be found. Three methods are currently available: I Internet Storage Name Service (iSNS) - Potential targets are discovered by interacting with one or more iSNS servers.
I
SendTargets Potential targets are discovered by using a discovery-address. Static Static target address is congured.
Dynamic device discovery If an iSCSI node exposes a large number of targets, such as an iSCSI to Fibre-Channel bridge, you can supply the iSCSI node IP address/port combination and allow the iSCSI initiator to use the SendTargets features to perform the device discovery. Two dynamic device discovery methods are available: SendTargets and iSNS.
I
SendTargets - If an iSCSI node exposes a large number of targets, such as an iSCSI to Fibre-Channel bridge, you can supply the iSCSI node IP address/port combination and allow the iSCSI initiator to use the SendTargets features to perform the device discovery. iSNS - iSNS (Internet Storage Name Service) allows the iSCSI initiator to discover the targets to which it has access using as little conguration as possible. It also provides state change notication functionality to notify the iSCSI initiator when changes in operational state of storage nodes occur. To use the iSNS discovery option, you can supply the iSNS server address/port combination and allow the iSCSI initiator to query the iSNS servers that you specied to perform the device discovery. The default port for iSNS server is 3205. For more information about iSNS, see RFC 4171:
256
http://www.ietf.org/rfc/rfc4171.txt
I
Static device discovery If an iSCSI node has a small number of targets or if you want to restrict the targets that the initiator attempts to access, you can statically congure the target-name by using the following static target address naming convention: target,target-address[:port-number] You can determine the static target address from the arrays management tool.
Note Do not congure an iSCSI target to be discovered by both static and dynamic device discovery
methods. The consequence of using redundant discovery methods might be slow performance when communicating with the iSCSI target device.
M
1 2
3 4 5
Verify that you are running a Solaris 10 1/06 or later release. Conrm that your TCP/IP network is setup. Connect your third-party iSCSI target devices and conrm that they are congured. For example, determine if the iSCSI target device is reachable by using the telnet command to connect to the iSCSI target device using port 3260. If the connection is refused, see Troubleshooting iSCSI Conguration Problems on page 270. For information about connecting your third-party iSCSI target devices, see your hardware documentation.
In a less secure environment, the target cannot determine if a connection request is truly from a given host. In that case, the target can authenticate an initiator by using the Challenge-Handshake Authentication Protocol (CHAP). CHAP authentication uses the notion of a challenge and response, which means that the target challenges the initiator to prove its identity. For the challenge/response method to work, the target must know the initiators secret key and the initiator must be set up to respond to a challenge. Refer to the array vendors documentation for instructions on setting up the secret key on the array. iSCSI supports unidirectional and bidirectional authentication:
I I
Unidirectional authentication enables the target to authenticate the identity of the initiator. Bidirectional authentication adds a second level of security by providing a means for the initiator to authenticate the identity of the target.
Become superuser. Determine whether you want to congure unidirectional or bidirectional CHAP.
I
Unidirectional authentication enables the target to validate the initiator. This method is the default method. Complete steps 35 only. Bidirectional authentication adds a second level of security by providing a means for the initiator to authenticate the target. Complete steps 39.
Unidirectional CHAP Set the secret key on the initiator. For example, the following command initiates a dialogue to dene the CHAP secret key.
# iscsiadm modify initiator-node --CHAP-secret
Note The CHAP secret length must be a minimum of 12 characters and a maximum of 16
characters.
4
(Optional) Unidirectional CHAP Set the CHAP name on the initiator. By default, the initiators CHAP name is set to the initiator node name. You can use the following command to change the initiators CHAP name.
# iscsiadm modify initiator-node --CHAP-name new-CHAP-name
Unidirectional CHAP Enable CHAP authentication on the initiator after the secret has been set.
# iscsiadm modify initiator-node --authentication CHAP
258
CHAP requires that the initiator node have both a username and password. The username is typically used by the target to lookup the secret for the given username. In the Solaris environment, the CHAP name is always set to the initiator node name by default. The CHAP name can be set to any length text that is less than 512 bytes. The 512-byte length limit is a Solaris limitation. However, if you do not set the CHAP name, it is set to the initiator node name upon initialization.
6
Bidirectional CHAP Enable bidirectional authentication parameters on the target. For example:
# iscsiadm modify target-param -B enable eui.5000ABCD78945E2B
Bidirectional CHAP Set authentication method to CHAP on the target. For example:
# iscsiadm modify target-param --authentication CHAP eui.5000ABCD78945E2B
Bidirectional CHAP Set the target device secret key on the target. For example, the following command initiates a dialogue to dene the CHAP secret key.
# iscsiadm modify target-param --CHAP-secret eui.5000ABCD78945E2B
Bidirectional CHAP - Set the CHAP name on the target. By default, the targets CHAP name is set to the target name. You can use the following command to change the targets CHAP name.
# iscsiadm modify target-param --CHAP-name target-CHAP-name
Using a Third-Party Radius Server to Simplify CHAP Management in Your iSCSI Conguration
You can use a third-party RADIUS server to simplify CHAP secret management. A RADIUS server is a centralized authentication service. While you must still specify the initiators CHAP secret, you are no longer required to specify each targets CHAP secret on each initiator when using bidirectional authentication with a RADIUS server. For more information, see:
I I
Become superuser.
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 259
Congure the initiator node with the IP address and port (the default port is 1812) of the RADIUS server. For example:
# iscsiadm modify initiator-node --radius-server 10.0.0.72:1812
Congure the initiator node with the shared secret of the RADIUS server.
# iscsiadm modify initiator-node --radius-shared-secret
Note The Solaris iSCSI implementation requires that the RADIUS server is congured with a shared
secret before the Solaris iSCSI software can interact with the RADIUS server.
4
WARNING: RADIUS packet authentication failed Cause: The initiator failed to authenticate the RADIUS data packet. This error can occur if the shared secret congured on the initiator-node is different from the shared secret on the RADIUS server.
Solution: Recongure the initiator with the correct RADIUS shared secret. For more information, see How to Congure RADIUS for Your iSCSI Conguration on page 259.
1 2
260
The iSCSI connection is not initiated until the discovery method is enabled. See the next step.
I
The iSCSI connection is not initiated until the discovery method is enabled. See the next step.
I
The iSCSI connection is not initiated until the discovery method is enabled. See the next step.
3
Enable the iSCSI target discovery method using one of the following:
I
If you have congured a dynamically discovered (SendTargets) device, enable the SendTargets discovery method.
# iscsiadm modify discovery --sendtargets enable
If you have congured a dynamically discovered (iSNS) device, enable the iSNS discovery method.
# iscsiadm modify discovery --isns enable
If you have congured static targets, enable the static target discovery method.
# iscsiadm modify discovery --static enable
1 2
Become superuser. (Optional) Disable an iSCSI target discovery method using one of the following:
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 261
If you need to disable the SendTargets method of discovery, use the following command:
# iscsiadm modify discovery --sendtargets disable
If you need to disable the iSNS method of discovery, use the following command:
# iscsiadm modify discovery --iSNS disable
If you need to disable the static targets, use the following command:
# iscsiadm modify discovery --static disable
Note If you attempt to disable or remove discovery information that has an associated logical unit in
use, the disable or remove operation fails with the following message:
logical unit in use
If this occurs, stop all associated I/O on the logical unit, unmount the le systems, and so on. Then, repeat the disable or remove operation.
In the following format output, disks 2 and 3 are iSCSI LUNs that are not under MPxIO control. Disks 21 and 22 are iSCSI LUNs under MPxIO control.
# format AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e010685cf1,0 1. c0t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424> /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w500000e0106e3ba1,0 2. c3t0d0 <ABCSTORAGE-100E-00-2.2 cyl 20813 alt 2 hd 16 sec 63> /iscsi/disk@0000iqn.2001-05.com.abcstorage%3A6-8a0900-477d70401b0fff044352423a2-hostname-020000,0 3. c3t1d0 <ABCSTORAGE-100E-00-2.2 cyl 20813 alt 2 hd 16 sec 63> /iscsi/disk@0000iqn.2001-05.com.abcstorage%3A6-8a0900-3fcd70401 -085ff04434f423a2-hostname-010000,0 . . . 21. c4t60A98000686F694B2F59775733426B77d0 <ABCSTORAGE-LUN-0.2 cyl 4606 alt 2 hd 16 sec 256> /scsi_vhci/ssd@g60a98000686f694b2f59775733426b77 22. c4t60A98000686F694B2F59775733434C41d0 <ABCSTORAGE-LUN-0.2 cyl 4606 alt 2 hd 16 sec 256> /scsi_vhci/ssd@g60a98000686f694b2f59775733434c41
1 2
Become superuser. Display information about the iSCSI initiator. For example:
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:0003ba4d233b.425c293c Initiator node alias: zzr1200 Login Parameters (Default/Configured): Header Digest: NONE/Data Digest: NONE/Authentication Type: NONE RADIUS Server: NONE RADIUS access: unknown Configured Sessions: 1
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 263
Display information about which discovery methods are in use. For example:
# iscsiadm list discovery Discovery: Static: enabled Send Targets: enabled iSNS: enabled
Example 151
The authentication settings for the target The default settings for the target login parameters The congured value for each login parameter
The iscsiadm list target-param -v command displays the default parameter value before the / designator and the congured parameter value after the / designator. If you have not congured any parameters, the congured parameter value displays as a hyphen (-). For more information, see the following examples.
# iscsiadm list target-param -v eui.50060e8004275511 Target: eui.50060e8004275511 Alias: Bi-directional Authentication: disabled Authentication Type: NONE Login Parameters (Default/Configured): Data Sequence In Order: yes/Data PDU In Order: yes/Default Time To Retain: 20/Default Time To Wait: 2/Error Recovery Level: 0/First Burst Length: 65536/Immediate Data: yes/Initial Ready To Transfer (R2T): yes/Max Burst Length: 262144/Max Outstanding R2T: 1/Max Receive Data Segment Length: 65536/Max Connections: 1/Header Digest: NONE/Data Digest: NONE/Configured Sessions: 1
The following example iscsiadm list target-param -v output displays the parameters that were negotiated between the target and the initiator.
264 System Administration Guide: Devices and File Systems November 2006
# iscsiadm list target -v eui.50060e8004275511 Target: eui.50060e8004275511 TPGT: 1 ISID: 4000002a0000 Connections: 1 CID: 0 IP address (Local): 172.90.101.71:32813 IP address (Peer): 172.90.101.40:3260 Discovery Method: Static Login Parameters (Negotiated): Data Sequence In Order: yes Data PDU In Order: yes Default Time To Retain: 0 Default Time To Wait: 3 Error Recovery Level: 0 First Burst Length: 65536 Immediate Data: yes Initial Ready To Transfer (R2T): yes Max Burst Length: 262144 Max Outstanding R2T: 1 Max Receive Data Segment Length: 65536 Max Connections: 1 Header Digest: NONE Data Digest: NONE
iSCSI initiator node name - You can change the initiator node name to a different name. If you change the initiator node name, the targets that were discovered by iSNS might be removed from the initiators target list, depending on the discovery domain conguration on the iSNS server at the time when the name was changed. For more information, see How to Modify iSCSI Initiator and Target Parameters on page 266. Header digest The value can be none, the default value, or CRC32. Data digest The value can be none, the default value, or CRC32. Authentication and CHAP secret For more information about setting up authentication, see How to Congure CHAP Authentication for Your iSCSI Conguration on page 258. Congured sessions For more information about conguring multiple sessions, see How to Enable Multiple iSCSI Sessions for a Target on page 269.
I I I
The iSCSI driver provides default values for the iSCSI initiator and iSCSI target device parameters. If you modify the parameters of the iSCSI initiator, the modied parameters are inherited by the iSCSI target device, unless the iSCSI target device is already set to a different value.
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 265
Caution Ensure that the target software supports the parameter to be modied. Otherwise, you might be unable to log in to the iSCSI target device. See your array documentation for a list of supported parameters.
Modifying iSCSI parameters should be done when I/O between the initiator and the target is complete. The iSCSI driver reconnects the session after the changes are made with the iscsiadm modify command.
Become superuser. List the current parameters of the iSCSI initiator and target device. a. List the current parameters of the iSCSI initiator. For example:
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:0003ba4d233b.425c293c Initiator node alias: zzr1200 Login Parameters (Default/Configured): Header Digest: NONE/Data Digest: NONE/Authentication Type: NONE RADIUS Server: NONE RADIUS access: unknown Configured Sessions: 1
b. List the current parameters of the iSCSI target device. For example:
# iscsiadm list target-param -v iqn.1992-08.com.abcstorage:sn.84186266 Target: iqn.1992-08.com.abcstorage:sn.84186266 Alias: Bi-directional Authentication: disabled Authentication Type: NONE Login Parameters (Default/Configured): Data Sequence In Order: yes/Data PDU In Order: yes/Default Time To Retain: 20/Default Time To Wait: 2/Error Recovery Level: 0/First Burst Length: 65536/Immediate Data: yes/Initial Ready To Transfer (R2T): yes/Max Burst Length: 262144/266 System Administration Guide: Devices and File Systems November 2006
Max Outstanding R2T: 1/Max Receive Data Segment Length: 65536/Max Connections: 1/Header Digest: NONE/Data Digest: NONE/Configured Sessions: 1
Note that both header digest and data digest parameters are currently set to NONE for both the iSCSI initiator and the iSCSI target device. To review the default parameters of the iSCSI target device, see the iscsiadm list target-param output in Example 151.
3
Modify the parameter of the iSCSI initiator. For example, set header digest to CRC32.
# iscsiadm modify initiator-node -h CRC32
If you change the initiator node name, the targets that were discovered by iSNS might be logged out and removed from the initiators target list, if the new name does not belong to the same discovery domain as that of the targets. If, however, the targets are in use and busy, they are not removed. For example, if a le is opened or a le system is mounted on these targets. You may also see new targets after the name change if these targets and the new initiator node name belong to the same discovery domain.
4
Verify that the parameter was modied. a. Display the updated parameter information for the iSCSI initiator. For example:
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:0003ba4d233b.425c293c Initiator node alias: zzr1200 Login Parameters (Default/Configured): Header Digest: NONE/CRC32 Data Digest: NONE/Authentication Type: NONE RADIUS Server: NONE RADIUS access: unknown Configured Sessions: 1
Note that the header digest is now set to CRC32. b. Display the updated parameter information for the iSCSI target device. For example:
# iscsiadm list target-param -v iqn.1992-08.com.abcstorage:sn.84186266 Target: iqn.1992-08.com.abcstorage:sn.84186266 Alias: Bi-directional Authentication: disabled Authentication Type: NONE Login Parameters (Default/Configured):
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 267
Data Sequence In Order: yes/Data PDU In Order: yes/Default Time To Retain: 20/Default Time To Wait: 2/Error Recovery Level: 0/First Burst Length: 65536/Immediate Data: yes/Initial Ready To Transfer (R2T): yes/Max Burst Length: 262144/Max Outstanding R2T: 1/Max Receive Data Segment Length: 65536/Max Connections: 1/Header Digest: CRC32/Data Digest: NONE/Configured Sessions: 1
Verify that the iSCSI initiator has reconnected to the iSCSI target. For example:
# iscsiadm list target -v iqn.1992-08.com.abcstorage:sn.84186266 Target: iqn.1992-08.com.abcstorage:sn.84186266 TPGT: 2 ISID: 4000002a0000 Connections: 1 CID: 0 IP address (Local): nnn.nn.nn.nnn:64369 IP address (Peer): nnn.nn.nn.nnn:3260 Discovery Method: SendTargets Login Parameters (Negotiated): . . . Header Digest: CRC32 Data Digest: NONE
Unset an iSCSI initiator parameter or an iSCSI target device parameter. You can unset a parameter by setting it back to its default setting with the iscsiadm modify command. Or, you can use the iscsiadm remove command to reset all target properties to the default settings. The iscsiadm modify target-param command changes only the parameters that are specied on the command line. The following example shows how to reset the header digest to none:
# iscsiadm modify target-param -h none iqn.1992-08.com.abcstorage:sn...
For information about using the iscsiadm remove target-param command, see iscsiadm.1m.
268 System Administration Guide: Devices and File Systems November 2006
1 2
Become superuser. List the current parameters for the iSCSI initiator and target. a. List the current parameters for the iSCSI initiator. For example:
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:0003ba4d233b.425c293c Initiator node alias: zzr1200 . . . Configured Sessions: 1
b. List the current parameters of the iSCSI target device. For example:
# iscsiadm list target-param -v iqn.1992-08.com.abcstorage:sn.84186266 Target: iqn.1992-08.com.abcstorage:sn.84186266 Alias: . . . Configured Sessions: 1
The congured sessions value is the number of congured iSCSI sessions that will be created for each target name in a target portal group.
3
Select one of the following to modify the number of congured sessions at either the initiator node, to apply to all targets, or at a target level, to apply to a specic target. The number of sessions for a target must be between 1 and 4.
I
269
Congured sessions can also be bound to a specic local IP address. Using this method, one or more local IP addresses are supplied in a comma-separated list. Each IP address represents an iSCSI session. This method can also be done at the initiator-node or target-param level. For example:
# iscsiadm modify initiator-node -c 10.0.0.1,10.0.0.2
Note If the specied IP address is not routable, the address is ignored and the default Solaris route
Verify that the parameter was modied. a. Display the updated information for the initiator node. For example:
# iscsiadm list initiator-node Initiator node name: iqn.1986-03.com.sun:01:0003ba4d233b.425c293c Initiator node alias: zzr1200 . . . Configured Sessions: 2
b. Display the updated information for the target node. For example:
# iscsiadm list target-param -v iqn.1992-08.com.abcstorage:sn.84186266 Target: iqn.1992-08.com.abcstorage:sn.84186266 Alias: . . . Configured Sessions: 2
snoop This tool has been updated to support iSCSI packets. ethereal This freeware product is available from http://www.ethereal.com.
Both tools can lter iSCSI packets on port 3260. The following sections describe various iSCSI troubleshooting and error message resolution scenarios.
270
If no connections are listed in the iscsiadm list target output, check the /var/adm/messages le for possible reasons why the connection failed. You can also verify whether the connection is accessible by using the ping command or by connecting to the storage devices iSCSI port with the telnet command to ensure the iSCSI service is available. The default port is 3260. In addition, check the storage devices log le for errors.
If your target is not listed in the iscsiadm list target output, check the /var/adm/messages le for possible causes. If you are using SendTargets as the discovery method, try listing the discovery-address using the -v option to ensure that the expected targets are visible to the host. For example:
# iscsiadm list discovery-address -v 10.0.0.1 Discovery Address: 10.0.0.1:3260 Target name: eui.210000203787dfc0 Target address: 10.0.0.1:11824 Target name: eui.210000203787e07b Target address: 10.0.0.1:11824
If you are using iSNS as the discovery method, try enabling the iSNS discovery mode and listing the isns-server using the -v option to ensure that the expected targets are visible to the host. For example:
# iscsiadm list isns-server -v iSNS Server IP Address: 10.20.56.56:3205 Target name: iqn.1992-08.com.xyz:sn.1234566 Target address: 10.20.57.161:3260, 1 Target name: iqn.2003-10.com.abc:group-0:154:abc-65-01 Target address: 10.20.56.206:3260, 1 Target name: iqn.2003-10.com.abc:group-0:154:abc-65-02 Target address: 10.20.56.206:3260, 1
Chapter 15 Conguring Solaris iSCSI Initiators (Tasks) 271
. . .
Become superuser. Identify the LUNs that were discovered on this target during enumeration. For example:
# iscsiadm list target -S Target: iqn.2001-05.com.abcstorage:6-8a0900-37ad70401-bcfff02df8a421df-zzr1200-01 TPGT: default ISID: 4000002a0000 Connections: 1 LUN: 0 Vendor: ABCSTOR Product: 0010 OS Device Name: /dev/rdsk/c3t34d0s2
The -S option shows which LUNs where discovered on this target during enumeration. If you think a LUN should be listed but it is not, review the /var/adm/messages le to see if an error was reported. Check the storage devices log les for errors. Also, ensure that any storage device LUN masking is properly congured.
Is either connection or session. Is the object ID of the connection or session. This ID is unique for an OS instance. Is a description of the condition. These values are returned in an iSCSI login response as dened by RFC 3720.
iscsi connection(OID) login failed - Miscellaneous iSCSI initiator errors. Cause: The device login failed due to some form of initiator error. iscsi connection(OID) login failed - Initiator could not be successfully authenticated. Cause: The device could not successfully authenticate the initiator.
Solution: If applicable, verify that the settings for CHAP names, CHAP passwords or RADIUS are
correct. iscsi connection(OID) login failed - Initiator is not allowed access to the given target. Cause: The device will not allow the initiator access to the iSCSI target device.
Solution: Verify your initiator name and conrm that it is properly masked or provisioned by the storage device.
iscsi connection(OID) login failed - Requested ITN does not exist at this address. Cause: The device does not provide access to the iSCSI target name (ITN) that you are requesting.
Solution: Verify the initiator discovery information is entered properly and that the storage device is congured properly.
iscsi connection(OID) login failed - Requested ITN has been removed and no forwarding address is provided. Cause: The device can no longer provide access to the iSCSI target name (ITN) that you are requesting.
273
Solution: Verify that the initiator discovery information has been specied properly and the storage device has been congured properly.
iscsi connection(OID) login failed - Requested iSCSI version range is not supported by the target. Cause: The initiators iSCSI version is not supported by the storage device. iscsi connection(OID) login failed - No more connections can be accepted on this Session ID (SSID). Cause: The storage device cannot accept another connection for this initiator node to the iSCSI target device. iscsi connection(OID) login failed - Missing parameters (e.g., iSCSI initiator and/or target name). Cause: The storage device is reporting that the initiator or target name has not been properly specied.
Solution: Properly specify the iSCSI initiator or target name.
iscsi connection(OID) login failed - Target hardware or software error. Cause: The storage device encountered a hardware or software error.
Solution: Consult the storage documentation or contact the storage vendor for further assistance.
iscsi connection(OID) login failed - iSCSI service or target is not currently operational. Cause: The storage device is currently not operational.
Solution: Consult the storage documentation or contact the storage vendor for further assistance.
iscsi connection(OID) login failed - Target has insufficient session, connection or other resources. Cause: The storage device has insufcient resources.
Solution: Consult the storage documentation or contact the storage vendor for further assistance.
iscsi connection(OID) login failed - unable to initialize authentication iscsi connection(OID) login failed - unable to set authentication iscsi connection(OID) login failed - unable to set username iscsi connection(OID) login failed - unable to set password iscsi connection(OID) login failed - unable to set ipsec iscsi connection(OID) login failed - unable to set remote authentication Cause: The initiator was unable to initialize or set authentication properly.
Solution: Verify that your initiator settings for authentication are properly congured.
274
iscsi connection(OID) login failed - unable to make login pdu Cause: The initiator was unable to make a login payload data unit (PDU) based on the initiator or storage device settings.
Solution: Try resetting any target login parameters or other nondefault settings.
iscsi connection(OID) login failed - failed to transfer login iscsi connection(OID) login failed - failed to receive login response Cause: The initiator failed to transfer or receive a login payload data unit (PDU) across the network connection.
Solution: Verify that the network connection is reachable.
iscsi connection(OID) login failed - received invalid login response (OP CODE) Cause: The storage device has responded to a login with an unexpected response. iscsi connection(OID) login failed - login failed to authenticate with target Cause: The initiator was unable to authenticate the storage device.
Solution: Verify that your initiator settings for authentication are properly congured.
iscsi connection(OID) login failed - initiator name is required Cause: An initiator name must be congured to perform all actions.
Solution: Verify that the initiator name is congured.
iscsi connection(OID) login failed - authentication receive failed iscsi connection(OID) login failed - authentication transmit failed Cause: The initiator was unable to transmit or receive authentication information.
Solution: Verify the network connectivity with storage device or the RADIUS server as applicable.
iscsi connection(OID) login failed - login redirection invalid Cause: The storage device attempted to redirect the initiator to an invalid destination.
Solution: Consult the storage documentation or contact the storage vendor for further assistance.
iscsi connection(OID) login failed - target protocol group tag mismatch, expected <TPGT>, received <TPGT> Cause: The initiator and target had a TPGT (target portal group tag) mismatch.
Solution: Verify your TPGT discovery settings on the initiator or the storage device.
iscsi connection(OID) login failed - cant accept PARAMETER in security stage Cause: The device responded with an unsupported login parameter during the security phase of login.
275
Solution: The parameter name is noted for reference. Consult the storage documentation or contact the storage vendor for further assistance.
iscsi connection(OID) login failed - HeaderDigest=CRC32 is required, cant accept V ALUE iscsi connection(OID) login failed - DataDigest=CRC32 is required, cant accept V ALUE Cause: The initiator is only congured to accept HeaderDigest or DataDigest that is set to CRC32 for this target. The device returned the value of V ALUE.
Solution: Verify that the initiator and device digest settings are compatible.
iscsi connection(OID) login failed - HeaderDigest=None is required, cant accept V ALUE iscsi connection(OID) login failed - DataDigest=None is required, cant accept V ALUE Cause: The initiator is only congured to accept HeaderDigest or DataDigest that is set to none for this target. The device returned the value of V ALUE.
Solution: Verify that the initiator and device digest settings are compatible.
iscsi connection(OID) login failed - cant accept PARAMETER Cause: The initiator does not support this parameter. iscsi connection(OID) login failed - cant accept MaxOutstandingR2T V ALUE Cause: The initiator does not accept MaxOutstandingR2T of the noted V ALUE. iscsi connection(OID) login failed - cant accept MaxConnections V ALUE Cause: The initiator does not accept the maximum connections of the noted V ALUE. iscsi connection(OID) login failed - cant accept ErrorRecoveryLevel V ALUE Cause: The initiator does not accept an error recovery level of the noted V ALUE. iscsi session(OID) NAME offline Cause: All connections for this target NAME have been removed or failed. iscsi connection(OID) failure - unable to schedule enumeration Cause: The initiator was unable to enumerate the LUNs on this target.
Solution: You can force LUN enumeration by running the devfsadm -i iscsi command. For more information, see devfsadm(1M).
iscsi connection(OID) unable to connect to target NAME (errno:ERRNO) Cause: The initiator failed to establish a network connection.
276
Solution: For information about the specic ERRNO on the connection failure, see the /usr/include/sys/errno.h le.
277
278
16
C H A P T E R
I I I I I
1 6
This chapter describes the format utilitys menus and commands. This is a list of the reference information in this chapter. Recommendations and Requirements for Using the format Utility on page 279 format Menu and Command Descriptions on page 280 format.dat File on page 286 Rules for Input to format Commands on page 291 Getting Help on the format Utility on page 293
For a overview of when to use the format utility, see format Utility on page 198.
Keep the following guidelines in mind when you use the format utility and want to preserve the existing data:
I I
Back up all les on the disk drive. Save all your defect lists in les by using the format utilitys dump command. The le name should include the drive type, model number, and serial number. Save the paper copies of the manufacturers defect list that was shipped with your drive.
279
select a disk select (define) a disk type select (define) a partition table describe the current disk format and analyze the disk run the fdisk program (x86 only) repair a defective sector write label to the disk surface analysis defect list management search for backup labels read and display labels save new disk/partition definitions show vendor, product and revision set 8-character volume name execute <cmd>, then return
The following table describes the main menu items for the format utility.
TABLE 161 The Main Menu Item Descriptions for the format Utility Menu Item Command or Menu? Description
disk
Command
Lists all of the systems drives. Also lets you choose the disk you want to use in subsequent operations. This disk is referred to as the current disk. Identies the manufacturer and model of the current disk. Also displays a list of known drive types. Choose the Auto configure option for all SCSI-2 disk drives. Creates and modies slices. For more information, see partition Menu on page 282. Displays the following information about the current disk: Device name and device type I Number of cylinders, alternate cylinders, heads and sectors I Physical device name
I
type
Command
partition current
Menu Command
280
TABLE 161 The Main Menu Item Descriptions for the format Utility Menu Item Command or Menu? Description
(Continued)
format
Command
Formats the current disk by using one of these sources of information in this order: 1. Information that is found in the format.dat le 2. Information from the automatic conguration process 3. Information that you type at the prompt if no format.dat entry exists This command does not apply to IDE disks. IDE disks are preformatted by the manufacturer.
fdisk
Menu
x86 platform only: Runs the fdisk program to create a Solaris fdisk partition. The fdisk command cannot be used on disks with an EFI label that are greater than 1 terabyte in size.
Repairs a specic block on the current disk. Writes a new label to the current disk. Runs read, write, and compare tests. For more information, see analyze Menu on page 283. Retrieves and displays defect lists. For more information, see defect Menu on page 285. This feature does not apply to IDE disks. IDE disks manage defects automatically. VTOC Searches for backup labels. EFI Not supported.
backup
Command
verify
Command
Displays the following information about the current disk: I Device name and device type I Number of cylinders, alternate cylinders, heads and sectors I Partition table VTOC Saves new disk and partition information. EFI Not applicable.
save
Command
SCSI disks only Displays the vendor, product name, and revision level of the current drive. Labels the disk with a new eight-character volume name that you specify. Exits the format menu.
281
partition Menu
The partition menu appears similar to the following:
format> partition PARTITION MENU: 0 - change 0 partition 1 - change 1 partition 2 - change 2 partition 3 - change 3 partition 4 - change 4 partition 5 - change 5 partition 6 - change 6 partition 7 - change 7 partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk quit partition>
change n partition
Enables you to specify the following information for the new partition: Identication tag I Permission ags I Starting cylinder I Size
I
Enables you to choose a predened partition table. Enables you to change all the slices in the partition table. This command is preferred over the individual change x partition commands. Enables you to specify a name for the current partition table. Displays the current partition table. Writes the partition map and the label to the current disk. Exits the partition menu.
format> fdisk Total disk size is 14169 cylinders Cylinder size is 2510 (512 byte) blocks Cylinders Type Start End Length % ============ ===== === ====== === x86 Boot 1 9 9 0 Solaris2 10 14168 14159 100
Partition ========= 1 2
SELECT ONE OF THE FOLLOWING: 1. Create a partition 2. Specify the active partition 3. Delete a partition 4. Change between Solaris and Solaris2 Partition IDs 5. Exit (update disk configuration and exit) 6. Cancel (exit without updating disk configuration) Enter Selection:
Create a partition
Creates an fdisk partition. You must create a separate partition for each OS such as Solaris or DOS. There is a maximum of four partitions per disk. You are prompted for the size of the fdisk partition as a percentage of the disk. Enables you to specify the partition to be used for booting. This menu item identies where the rst stage boot program looks for the second stage boot program. Deletes a previously created partition. This command destroys all the data in the partition. Changes partition IDs from 130 (0x82) to 191 (0xbf) and vice versa. Writes a new version of the partition table and exits the fdisk menu. Exits the fdisk menu without modifying the partition table.
Delete a partition Change between Solaris and Solaris2 Partition IDs Exit (update disk configuration and exit) Cancel (exit without updating disk configuration)
analyze Menu
The analyze menu appears similar to the following.
Chapter 16 The format Utility (Reference) 283
format> analyze ANALYZE MENU: read refresh test write compare purge verify print setup config quit analyze>
read only test (doesnt harm read then write (doesnt harm pattern testing (doesnt harm write then read (corrupts write, read, compare (corrupts write, read, write (corrupts write entire disk, then verify display data buffer set analysis parameters show analysis parameters
Reads each sector on the current disk. Repairs defective blocks as a default. Reads then writes data on the current disk without harming the data. Repairs defective blocks as a default. Writes a set of patterns to the disk without harming the data. Repairs defective blocks as a default. Writes a set of patterns to the disk then reads back the data on the disk. Destroys existing data on the disk. Repairs defective blocks as a default. Writes a set of patterns to the disk, reads back the data, and then compares it to the data in the write buffer. Destroys existing data on the disk. Repairs defective blocks as a default. Removes all data from the disk so that the data cannot be retrieved by any means. Data is removed by writing three distinct patterns over the entire disk (or a section of the disk). If the verication passes, a hex-bit pattern is written over the entire disk (or a section of the disk). Repairs defective blocks as a default.
purge
verify
In the rst pass, writes unique data to each block on the entire disk. In the next pass, reads and veries the data. Destroys existing data on the disk. Repairs defective blocks as a default. Displays the data in the read/write buffer.
284
(Continued)
setup
Enables you to specify the following analysis parameters: Analyze entire disk? yes Starting block number: depends on drive Ending block number: depends on drive Loop continuously? no Number of passes: 2 Repair defective blocks? yes Stop after first error? no Use random bit patterns? no Number of blocks per transfer: 126 (0/n/nn) Verify media after formatting? yes Enable extended messages? no Restore defect list? yes Restore disk label? yes
config quit
defect Menu
The defect menu appears similar to the following:
format> defect DEFECT MENU: primary grown both print dump quit defect>
extract manufacturers defect list extract manufacturers and repaired defects lists extract both primary and grown defects lists display working list dump working list to file
primary
Reads the manufacturers defect list from the disk drive and updates the in-memory defect list.
285
format.dat File
(Continued)
Reads the grown defect list and then updates the in-memory defect list. Grown defects are defects that have been detected during analysis. Reads both the manufacturers defect list and the grown defect list. Then, updates the in-memory defect list. Displays the in-memory defect list. Saves the in-memory defect list to a le. Exits the defect menu.
format.dat File
The format.dat le that is shipped with the Solaris OS supports many standard disks. If your disk drive is not listed in the format.dat le, you can do the following:
I I
Add an entry to the format.dat le for the disk. Add entries with the format utility by selecting the type command and choosing the other option.
Adding an entry to the format.dat le can save time if the disk drive will be used throughout your site. To use the format.dat le on other systems, copy the le to each system that will use the specic disk drive that you added to the format.dat le. You might need to modify the /etc/format.dat le for your system if you have one of the following:
I I
A disk that is not supported by the Solaris OS A disk with a partition table that is different from the Solaris OSs default conguration
Note Do not alter default entries in the /etc/format.dat le. If you want to alter the default entries, copy the entry, give the entry a different name, and make the appropriate changes to avoid confusion.
286
format.dat File
The pound sign (#) is the comment character. Any text on a line after a pound sign is not interpreted by the format utility. Each denition in the format.dat le appears on a single logical line. If the denition is longer than one line long, all lines but the last line of the denition must end with a backslash (\). A denition consists of a series of assignments that have an identier on the left side and one or more values on the right side. The assignment operator is the equal sign (=). The assignments within a denition must be separated by a colon (:). White space is ignored by the format utility. If you want an assigned value to contain white space, enclose the entire value in double quotation marks ("). This syntax causes the white space within the quotes to be preserved as part of the assignment value. Some assignments can have multiple values on the right side. Separate values by a comma.
disk_type
Denes the controller and disk model. Each disk_type denition contains information that concerns the physical geometry of the disk. The default data le contains denitions for the controllers and disks that the Solaris OS supports. You need to add a new disk_type denition only if you have an unsupported disk. You can add as many disk_type denitions to the data le as you want.
partition
Denes a partition table for a specic disk type. The partition table contains the partition information, plus a name that lets you refer to it in the format utility. The default format.dat le contains default partition denitions for several kinds of disk drives. Add a partition denition if you recreated partitions on any of the disks on your system. Add as many partition denitions to the data le as you need.
format.dat File
format.dat le contains denitions for the controllers and disks that the Solaris OS supports. You need to add a new disk_type only if you have an unsupported disk. You can add as many disk_type denitions to the data le as you want. The keyword itself is assigned the name of the disk type. This name appears in the disks label, and is used to identify the disk type whenever the format utility is run. Enclose the name in double quotation marks to preserve any white space in the name. The following table describes the identiers that must also be assigned values in all disk_type denitions.
TABLE 167 Required disk_type Identiers (format.dat) Identier Description
Identies the controller type for the disk type. Currently, the supported values are SCSI and ATA. Species the number of data cylinders in the disk type. This determines how many logical disk cylinders the system will be allowed to access. Species the number of alternate cylinders in the disk type. These cylinders are used by the format utility to store information such as the defect list for the drive. You should always reserve at least two cylinders for alternates. Species the number of physical cylinders in the disk type. This number is used to calculate the boundaries of the disk media. This number is usually equal to ncyl plus acyl. Species the number of heads in the disk type. This number is used to calculate the boundaries of the disk media. Species the number of data sectors per track in the disk type. This number is used to calculate the boundaries of the disk media. Note that this number includes only the data sectors. Any spares are not reected in the number of data sections per track. Species the rotations per minute of the disk type. This information is put in the label and later used by the le system to calculate the optimal placement of le data.
pcyl
nhead nsect
rpm
Other identiers might be necessary, depending on the controller. The following table describes the identiers that are required for SCSI controllers.
TABLE 168 Required disk_type Identiers for SCSI Controllers format.dat Identier Description
fmt_time cache
Species a number that indicates how long it takes to format a given drive. See the controller manual for more information. Species a number that controls the operation of the on-board cache while the format utility is operating. See the controller manual for more information.
288
format.dat File
TABLE 168 Required disk_type Identiers for SCSI Controllers format.dat Identier Description
(Continued)
trks_zone asect
Species a number that identies how many tracks that exist per defect zone, to be used in alternate sector mapping. See the controller manual for more information. Species a number that identies how many sectors are available for alternate mapping within a given defect zone. See the controller manual for more information.
disk
The name of the disk_type that this partition table is dened for. This name must appear exactly as it does in the disk_type denition.
289
format.dat File
TABLE 169 Required Identiers for Partition Tables (format.dat) Identier Description
(Continued)
ctlr
The disk controller type that this partition table can be attached to. Currently, the supported values are ATA for ATA controllers and SCSI for SCSI controllers. The controller type that is specied here must also be dened for the disk_type that you specied in the disk_type denition.
The other identiers in a slice denition describe the actual partition information. The identiers are the numbers 0 through 7. These identiers are optional. Any partition that is not explicitly assigned is set to 0 length. The value of each of these identiers is a pair of numbers separated by a comma. The rst number is the starting cylinder for the partition. The second is the number of sectors in the slice.
EXAMPLE 162 Required Identiers for Partition Tables (format.dat)
290
Specify the block number as an integer Specify the block number in the cylinder/head/sector format
You can specify the information as an integer that represents the logical block number. You can specify the number in any base, but the default is decimal. The maximum operator (a dollar sign, $) can also be used here so that format utility can select the appropriate value. Logical block format is used by the SunOS disk drivers in error messages. The other way to specify a block number is by using cylinder/head/sector format. In this method, you must specify explicitly the three logical components of the block number: the cylinder, head, and sector values. These values are still logical. However, they allow you to dene regions of the disk that are related to the layout of the media. If any of the cylinder/head/sector numbers are not specied, the value is assumed to be zero. You can also use the maximum operator in place of any of the numbers. Then, the format utility will select the appropriate value. The following are some examples of cylinder, head, and sector values:
Enter Enter Enter Enter Enter Enter Enter defective defective defective defective defective defective defective block block block block block block block number: number: number: number: number: number: number: 34/2/3 23/1/ 457// 12345 Oxabcd 334/$/2 892//$
291
The format utility always displays block numbers in both formats. Also, the help facility shows you the upper and lower limits of the block number expected, in both formats.
change 0 partition change 1 partition change 2 partition change 3 partition change 4 partition change 5 partition change 6 partition change 7 partition select a predefined table modify a predefined partition table name the current table display the current table write partition map and label to the disk
292
format(1M) Describes the basic format utility capabilities and provides descriptions of all command-line variables. format.dat(4) Describes disk drive conguration information for the format utility.
293
294
17
C H A P T E R
I I I I I I I I I I I I
1 7
Managing le systems is one of your most important system administration tasks. This is a list of the overview information in this chapter. Whats New in File Systems in the Solaris 10 11/06 Release? on page 295 Whats New in File Systems in the Solaris 10 6/06 Release? on page 296 Whats New in File Systems in the Solaris 10 Release? on page 304 Where to Find File System Management Tasks on page 308 Overview of File Systems on page 309 Types of File Systems on page 309 Commands for File System Administration on page 314 Default Solaris File Systems on page 316 Swap Space on page 314 UFS File System on page 317 Mounting and Unmounting File Systems on page 320 Determining a File Systems Type on page 324
$ fsstat zfs new name name attr attr lookup rddir read read write write file remov chng get set ops ops ops bytes ops bytes 268K 145K 93.6K 28.0M 71.1K 186M 2.74M 12.9M 56.2G 1.61M 9.46G zfs
For example, the following fsstat command displays all le system operations since the /export/ws le system mounted.
$ fsstat /export/ws new name name attr attr lookup rddir read read write write file remov chng get set ops ops ops bytes ops bytes 0 0 0 18.1K 0 12.6M 52 0 0 0 0 /export/ws
The default form is to report statistical information in easy to understand values, such as Gbytes, Kbytes, and Mbytes. For more information, see fsstat(1M).
ZFS File System on page 296 Enhancements to UFS File System Utilities (fsck, mkfs, and newfs) on page 297
Backup and restore capabilities Device management support GUI administration tool Persistent snapshots and cloning features Quotas that can be set for le systems RBAC-based access control Storage pool space reservations for le systems Support for Solaris systems that have zones installed
You can set up both ZFS and UFS le systems on the same Solaris system. However, you cannot use ZFS as a root le system. For information about additional limitations when using ZFS, see The Solaris ZFS File System in Solaris 10 Whats New. For more information about using ZFS, see Solaris ZFS Administration Guide.
296 System Administration Guide: Devices and File Systems November 2006
Checks and repairs le systems more thoroughly and provides improved error messages. For example, in some scenarios, fsck determines what structures are missing and replaces them appropriately. Automatically searches for backup superblocks. Reports when fsck needs to be rerun. When clearing directories, fsck now attempts to recover directory contents immediately and therefore, reduces the time spent rerunning this utility. If fsck nds duplicate blocks, and not all les that reference the duplicate blocks were cleared, fsck reports the inode numbers at the end of the fsck run. Then, you can use the find command to review the inodes that are damaged. Improved error messages regarding the status of extended attributes and other special les, such as device les and ACL entries, are included. Includes a -v option to enable more verbose messages.
I I I
In addition, the newfs and mkfs commands have been updated to include new options for displaying a le systems superblock information in text or dumping the superblock information in binary format.
newfs [ -S or -B ] /dev/rdsk/...
-S -B
Displays the le systems superblock in text Dumps the le systems superblock in binary
-o calcsb -o calcbinsb
Displays the le systems superblock in text Dumps the le systems superblock in binary
The fsck utility uses this superblock information to search for backup superblocks. The following sections describe specic fsck enhancements and their corresponding error messages. For step-by-step instructions on using the fsck utility to repair a damaged superblock, see How to Restore a Bad Superblock (Solaris 10 6/06 Release Only) on page 406.
297
parameters, such as ntrack or nsect, using fscks automatically discovered superblock for the repair process could damage your le system. In the case of a le system that was created with customized parameters and it has a bad superblock, fsck provides the prompt to cancel the fsck session:
CANCEL FILESYSTEM CHECK?
I
If the le system was created with the newfs command and fsck responds that just the primary superblocks are corrupted, then consider letting fsck restore the superblock.
# fsck /dev/dsk/c1t2d0s0 ** /dev/rdsk/c1t2d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? no
LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? yes FOUND ALTERNATE SUPERBLOCK 32 WITH NEWFS USE ALTERNATE SUPERBLOCK? yes FOUND ALTERNATE SUPERBLOCK AT 32 USING NEWFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? no ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3a - Check Connectivity ** Phase 3b - Verify Shadows/ACLs ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cylinder Groups CORRECT GLOBAL SUMMARY SALVAGE? y
298
UPDATE STANDARD SUPERBLOCK? y 81 files, 3609 used, 244678 free (6 frags, 30584 blocks, 0.0% fragmentation) ***** FILE SYSTEM WAS MODIFIED *****
I
If the le system was created with the mkfs command and fsck responds that just the primary superblocks are corrupted, then consider letting fsck restore the superblock.
# fsck /dev/dsk/c1t2d0s0 ** /dev/rdsk/c1t2d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS USE ALTERNATE SUPERBLOCK? yes FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? no ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3a - Check Connectivity ** Phase 3b - Verify Shadows/ACLs ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cylinder Groups CORRECT GLOBAL SUMMARY SALVAGE? y
UPDATE STANDARD SUPERBLOCK? y 81 files, 3609 used, 243605 free (117 frags, 30436 blocks, 0.0% fragmentation) ***** FILE SYSTEM WAS MODIFIED *****
299
The following example illustrates what would happen if you specied fscks -y option in a damaged superblock scenario. You are automatically dropped out of the fsck session. A message is displayed to rerun it with the alternate superblock.
# fsck -y /dev/dsk/c1t2d0s0 # ** /dev/rdsk/c1t2d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes
LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? yes SEARCH FOR ALTERNATE SUPERBLOCKS FAILED. USE GENERIC SUPERBLOCK FROM MKFS? yes CALCULATED GENERIC SUPERBLOCK WITH MKFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? yes Please verify that the indicated block contains a proper superblock for the filesystem (see fsdb(1M)). FSCK was running in YES mode. If you wish to run in that mode using the alternate superblock, run fsck -y -o b=453920 /dev/rdsk/c1t2d0s0.
The following fsck error message scenario illustrates the new prompts for the backup superblock, but the fsck run is not canceled, in this example. Canceling the fsck session would be an appropriate response if this le system was created with customized parameters or if there is some other concern about running fsck on this le system. The various superblock error conditions are provided in italics as follows:
# fsck /dev/rdsk/c0t1d0s0 ** /dev/rdsk/c0t1d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DATA BLOCKS OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: INODES PER GROUP OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: MAGIC NUMBER WRONG BAD SUPERBLOCK AT BLOCK 16: BAD V ALUES IN SUPER BLOCK
300
BAD SUPERBLOCK AT BLOCK 16: NCG OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: CPG OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: NCYL IS INCONSISTENT WITH NCG*CPG BAD SUPERBLOCK AT BLOCK 16: SIZE OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DIRECTORIES OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: ROTATIONAL POSITION TABLE SIZE OUT OF RANGE BAD SUPERBLOCK AT BLOCK 16: SIZE OF CYLINDER GROUP SUMMARY AREA WRONG BAD SUPERBLOCK AT BLOCK 16: INOPB NONSENSICAL RELATIVE TO BSIZE LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS USE ALTERNATE SUPERBLOCK? yes FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? no ** ** ** ** ** ** ** ** Last Mounted on Phase 1 - Check Blocks and Sizes Phase 2a - Check Duplicated Names Phase 2b - Check Pathnames Phase 3a - Check Connectivity Phase 3b - Verify Shadows/ACLs Phase 4 - Check Reference Counts Phase 5 - Check Cylinder Groups
SALVAGE? yes
UPDATE STANDARD SUPERBLOCK? yes 82 files, 3649 used, 244894 free (6 frags, 30611 blocks, 0.0% fragmentation) ***** FILE SYSTEM WAS MODIFIED *****
301
Or:
Please rerun fsck(1M) to correct this.
These new prompts resolve the previous difculty in determining whether fsck should be rerun or not. Unless you are prompted to rerun fsck as in the above messages, there is no need to run fsck, even after you see the following message:
***** FILE SYSTEM WAS MODIFIED *****
However, it doesnt harm the le system to rerun fsck after this message. This message is just informational about fscks corrective actions.
302
File I=107 should NOT be marked as extended attribute I=107 OWNER=root MODE=100644 SIZE=0 MTIME=Jul 21 16:36 2005 FILE=?/attfsdir-7-att FIX? yes DIR I=106 CONNECTED.
fsck processes objects as fragments, but in previous Solaris releases, only reported object information as blocks. It now correctly reports as fragments. If fsck nds error conditions that involve duplicate blocks or fragments, fsck offers to display the uncleared les at end of the fsck output. For example, you might see output similar to the following:
LIST REMAINING DUPS? yes Some blocks that were found to be in multiple files assigned to file(s). Fragments sorted by inode and logical offsets: Inode 38: Logical Offset 0x00000000 Physical Logical Offset 0x00000800 Physical Logical Offset 0x00001000 Physical Logical Offset 0x00001800 Physical are still
Then, you can use the find -i inode-number command to identify the name of inode 38, in this example.
303
UFS Logging Is Enabled by Default on page 304 NFS Version 4 on page 305 64-bit: Support of Multiterabyte UFS File Systems on page 305 libc_hwcap on page 308
When logging is explicitly disabled. If there is insufcient le system space for the log.
In previous Solaris releases, you had to manually enable UFS logging. For more information about UFS logging, see UFS Logging on page 318. Keep the following issues in mind when using UFS logging in this release:
I
Ensure that you have enough disk space for your general system needs, such as for users and applications, and for UFS logging. If you dont have enough disk space for logging data, a message similar to the following is displayed:
# mount /dev/dsk/c0t4d0s0 /mnt /mnt: No space left on device Could not enable logging for /mnt on /dev/dsk/c0t4d0s0. #
size 142M
A UFS le system with logging enabled that is generally empty will have some disk space consumed for the log. If you upgrade to this Solaris release from a previous Solaris release, your UFS le systems will have logging enabled, even if the logging option was not specied in the /etc/vfstab le. To disable logging, add the nologging option to the UFS le system entries in the /etc/vfstab le.
304
NFS Version 4
This Solaris release includes the Sun implementation of the NFS version 4 distributed le access protocol. NFS version 4 integrates le access, le locking, and mount protocols into a single, unied protocol to ease traversal through a rewall and improve security. The Solaris implementation of NFS version 4 is fully integrated with Kerberos V5, also known as SEAM, thus providing authentication, integrity, and privacy. NFS version 4 also enables the negotiation of security avors to be used between the client and the server. With NFS version 4, a server can offer different security avors for different le systems. For more information about NFS Version 4 features, see Whats New With the NFS Service in System Administration Guide: Network Services.
to indicate that caching is no longer performed. If you want to implement your CacheFS mounts as in previous Solaris releases, then specify NFS version 3 in your CacheFS mount commands. For example:
mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,vers=3 starbug:/docs /docs
305
# ufsdump 0f /dev/md/rdsk/d97 /dev/md/rdsk/d98 DUMP: Date of this level 0 dump: Tue Jan 07 14:23:36 2003 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/md/rdsk/d98 to /dev/md/rdsk/d97. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Forcing larger tape block size (2048). DUMP: Writing 32 Kilobyte records DUMP: Estimated 4390629500 blocks (2143862.06MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files]
Administering UFS le systems that are less than 1 terabyte remains the same. No administration differences exist between UFS le systems that are less than one terabyte and le systems that are greater than 1 terabyte. You can initially create a UFS le system that is less than 1 terabyte and specify that it can eventually be expanded into a multiterabyte le system by using the newfs -T option. This option sets the inode and fragment density to scale appropriately for a multiterabyte le system. Using the newfs -T option when you create a UFS le system less than 1 terabyte on a system running a 32-bit kernel enables you to eventually expand this le system by using the growfs command when you boot this system under a 64-bit kernel. For more information, see newfs(1M). You can use the fstyp -v command to identify whether a UFS le system has multiterabyte support by checking the following value in the magic column:
# /usr/sbin/fstyp -v /dev/md/rdsk/d3 | head -5 ufs magic decade format dynamic time Fri May 21 11:10:10 2004
A UFS le system with no multiterabyte support has the following fstyp output:
# /usr/sbin/fstyp -v /dev/md/rdsk/d0 | head -5 ufs magic 11954 format dynamic time Fri May 21 11:46:40 2004
You can use the growfs command to expand a UFS le system to the size of the slice or the volume without loss of service or data. For more information, see growfs(1M). Two new related features are multiterabyte volume support with the EFI disk label and multiterabyte volume support with Solaris Volume Manager. For more information, see Multiterabyte Disk Support With EFI Disk Label on page 188 and the Solaris Volume Manager Administration Guide.
306
Provides the ability to create a UFS le system up to 16 terabytes in size. Provides the ability to create a le system less than 16 terabytes that can later be increased in size up to 16 terabytes. Multiterabyte le systems can be created on physical disks, Solaris Volume Managers logical volumes, and Veritas VxVM logical volumes. Multiterabyte le systems benet from the performance improvements of having UFS logging enabled. Multiterabyte le systems also benet from the availability of logging because the fsck command might not have to be run when logging is enabled. When you create a partition for your multiterabyte UFS le system, the disk will be labeled automatically with an EFI disk label. For more information on EFI disk labels, see Multiterabyte Disk Support With EFI Disk Label on page 188. Provides the ability to snapshot a multiterabyte le system by creating multiple backing store les when a le system is over 512 Gbytes.
This feature is not supported on 32-bit systems. You cannot mount a le system greater than 1 terabyte on a system that is running a 32-bit Solaris kernel. You cannot boot from a le system greater than 1 terabyte on a system that is running a 64-bit Solaris kernel. This limitation means that you cannot put a root (/) le system on a multiterabyte le system. There is no support for individual les greater than 1 terabyte. The maximum number of les is 1 million les per terabyte of a UFS le system. For example, a 4-terabyte le system can contain 4 million les. This limit is intended to reduce the time it takes to check the le system with the fsck command. The maximum quota that you can set on a multiterabyte UFS le system is 2 terabytes of 1024-byte blocks.
I I
307
How to Create a Multiterabyte UFS File System on page 329 How to Expand a Multiterabyte UFS File System on page 331 How to Expand a UFS File System to a Multiterabyte UFS File System on page 332
Example 262 Troubleshooting Multiterabyte UFS File System Problems on page 333
libc_hwcap
The mount output on an x86 system might include a loopback mount of a libc_hwcap library, a hardware-optimized implementation of libc. This libc implementation is intended to optimize the performance of 32-bit applications. This loopback mount requires no administration and consumes no disk space.
Create new le systems. Make local and remote les available to users. Connect and congure new disk devices. Design and implement a backup schedule and restore les and le systems, as needed. Check for and correct le system inconsistencies.
308
A particular type of le system: disk-based, network-based, or virtual The entire le tree, beginning with the root (/) directory The data structure of a disk slice or other media storage device A portion of a le tree structure that is attached to a mount point on the main le tree so that the les are accessible
Usually, you know from the context which meaning is intended. The Solaris OS uses the virtual le system (VFS) architecture, which provides a standard interface for different le system types. The VFS architecture enables the kernel to handle basic operations, such as reading, writing, and listing les. The VFS architecture also makes it easier to add new le systems.
To identify the le system type, see Determining a File Systems Type on page 324.
Format Description
UFS
UNIX le system (based on the BSD Fat Fast File system that was provided in the 4.3 Tahoe release). UFS is the default disk-based le system for the Solaris OS. Before you can create a UFS le system on a disk, you must format the disk and divide it into slices. For information on formatting disks and dividing disks into slices, see Chapter 11.
ZFS
The ZFS le system is new in the Solaris 10 6/06 release. For more information, see the Solaris ZFS Administration Guide.
309
Format Description
HSFS
High Sierra, Rock Ridge, and ISO 9660 le system. High Sierra is the rst CD-ROM le system. ISO 9660 is the ofcial standard version of the High Sierra le system. The HSFS le system is used on CD-ROMs, and is a read-only le system. Solaris HSFS supports Rock Ridge extensions to ISO 9660. When present on a CD-ROM, these extensions provide all UFS le system features and le types, except for writability and hard links. PC le system, which allows read- and write- access to data and programs on DOS-formatted disks that are written for DOS-based personal computers. The Universal Disk Format (UDFS) le system, the industry-standard format for storing information on the optical media technology called DVD (Digital Versatile Disc or Digital Video Disc).
PCFS UDFS
Each type of disk-based le system is customarily associated with a particular media device, as follows:
I I I I
UFS with hard disk HSFS with CD-ROM PCFS with diskette UDF with DVD
However, these associations are not restrictive. For example, CD-ROMs and diskettes can have UFS le systems created on them.
Ability to access the industry-standard CD-ROM and DVD-ROM media when they contain a UDF le system Flexibility in exchanging information across platforms and operating systems A mechanism for implementing new applications rich in broadcast-quality video, high-quality sound, and interactivity using the DVD video specication based on UDF format
I I
Support for write-once media, (CD-RW), with either the sequential disk-at-once recording and incremental recording UFS components such as quotas, ACLs, transaction logging, le system locking, and le system threads, which are not part of the UDF 1.50 specication
At least the Solaris 7 11/99 release Supported SPARC or x86 platform Supported CD-ROM or DVD-ROM device
Support for industry-standard read/write UDF version 1.50 Fully internationalized le system utilities
For detailed information about the CacheFS le system, see Chapter 20.
The TMPFS le system can run out of space, just as regular le systems do. Because TMPFS allocates swap space to save le data (if necessary), some programs might not execute because of insufcient swap space.
For information about creating TMPFS le systems, see Chapter 18. For information about increasing swap space, see Chapter 21.
Caution Do not delete les in the /proc directory. The deletion of processes from the /proc directory does not kill them. /proc les do not use disk space, so there is no reason to delete les from this directory.
Description
CTFS
CTFS (the contract le system) is the interface for creating, controlling, and observing contracts. A contract enhances the relationship between a process and the system resources it depends on by providing richer error reporting and (optionally) a means of delaying the removal of a resource. The service management facility (SMF) uses process contracts (a type of contract) to track the processes which compose a service, so that a failure in a part of a multi-process service can be identied as a failure of that service.
Named pipe les that give processes common access to data Provides explicit names for opening les by using le descriptors Provides read-only access to the table of mounted le systems for the local system Used mostly by STREAMS for dynamic mounts of le descriptors on top of les The OBJFS (object) le system describes the state of all modules currently loaded by the kernel. This le system is used by debuggers to access information about kernel symbols without having to access the kernel directly. Provides access to character special devices and block devices Used by the kernel for swapping
You can use the runat command to add attributes and execute shell commands in the extended attribute namespace. This namespace is a hidden attribute directory that is associated with the specied le. To use the runat command to add attributes to a le, you rst have to create the attributes le.
$ runat filea cp /tmp/attrdata attr.1
Then, use the runat command to list the attributes of the le.
$ runat filea ls -l
For more information, see the runat(1) man page. Many Solaris le system commands have been modied to support le system attributes by providing an attribute-aware option. Use this option to query, copy, or nd le attributes. For more information, see the specic man page for each le system command.
Swap Space
The Solaris OS uses some disk slices for temporary storage rather than for le systems. These slices are called swap slices, or swap space. Swap space is used for virtual memory storage areas when the system does not have enough physical memory to handle current processes. Since many applications rely on swap space, you should know how to plan for, monitor, and add more swap space, when needed. For an overview about swap space and instructions for adding swap space, see Chapter 21.
clri df ff fsck
Clears inodes Reports the number of free disk blocks and les Lists le names and statistics for a le system Checks the integrity of a le system and repairs any damage found
314
TABLE 171 Generic Commands for File System Administration Command Description
(Continued)
Man Page
fsdb fstyp labelit mkfs mount mountall ncheck umount umountall volcopy
Debugs the le system Determines the le system type Lists or provides labels for le systems when they are copied to tape (for use only by the volcopy command) Creates a new le system Mounts local and remote le systems
Mounts all le systems that are specied in the virtual le mountall(1M) system table (/etc/vfstab) Generates a list of path names with their inode numbers Unmounts local and remote le systems Unmounts all le systems that are specied in the virtual le system table (/etc/vfstab) Creates an image copy of a le system ncheck(1M) mount(1M) mountall(1M) volcopy(1M)
le system, append an underscore and the abbreviation for the le system type to the generic command name. For example, to see the specic manual page for mounting a UFS le system, type the following:
$ man mount_ufs
root (/)
UFS
The top of the hierarchical le tree. The root (/) directory contains the directories and les that are critical for system operation, such as the kernel, the device drivers, and the programs used to boot the system. The root (/) directory also contains the mount point directories where local and remote le systems can be attached to the le tree. System les and directories that can be shared with other users. Files that run only on certain types of systems are in the /usr le system (for example, SPARC executables). Files that can be used on all types of systems, such as the man pages, are in the /usr/share directory. The mount point for user home directories, which store user work les. By default, the /home directory is an automounted le system. On stand-alone systems, the /home directory might be a UFS le system on a local disk slice. System les and directories that are likely to change or grow over the life of the local system. These include system logs, vi and ex backup les, and uucp les. Optional mount point for third-party software. On some systems, the /opt directory might be a UFS le system on a local disk slice. Temporary les, which are removed each time the system is booted or the /tmp le system is unmounted.
/usr
UFS
/export/home or /home
NFS, UFS
/var
UFS
/opt
NFS, UFS
/tmp
TMPFS
316
TABLE 172 The Default Solaris File Systems File System or Directory File System Type
(Continued)
Description
A list of active processes, by process number. A virtual le system that provides read-only access to the table of mounted le systems for the local system. A memory-based le system for storing temporary les that are not needed after the system is booted. A virtual le system that maintains contract information. A virtual le system that is used by debuggers to access information about kernel symbols without having to access the kernel directly.
The root (/) and /usr le systems are required to run a system. Some of the most basic commands in the /usr le system (like mount) are also included in the root (/) le system. As such, they are available when the system boots or is in single-user mode, and /usr is not mounted. For more detailed information on the default directories for the root (/) and /usr le systems, see Chapter 23.
UFS Feature
Description
Provides 32-bit user ID (UID), group ID (GID), and device numbers. Allows les of about 1 terabyte in size in a le system that can be up to 16 terabytes in size. You can create a multiterabyte UFS le system on a disk with an EFI disk label. UFS logging bundles the multiple metadata changes that comprise a complete UFS operation into a transaction. Sets of transactions are recorded in an on-disk log and are applied to the actual UFS le systems metadata. A multiterabyte le system enables creation of a UFS le system up to approximately 16 terabytes of usable space, minus approximately one percent overhead
Logging
Multiterabyte le systems
317
UFS Feature
Description
State ags
Shows the state of the le system: clean, stable, active, logging, or unknown. These ags eliminate unnecessary le system checks. If the le system is clean, stable, or logging, le system checks are not run.
For detailed information about the UFS le system structure, see Chapter 23.
Distribute the workload as evenly as possible among different I/O systems and disk drives. Distribute the /export/home le system and swap space evenly across disks. Keep pieces of projects or members of groups within the same le system. Use as few le systems per disk as possible. On the system (or boot) disk, you should have three le systems: root (/), /usr, and swap space. On other disks, create one or at most two le systems, with one le system preferrably being additional swap space. Fewer, roomier le systems cause less le fragmentation than many small, over crowded le systems. Higher-capacity tape drives and the ability of the ufsdump command to handle multiple volumes make it easier to back up larger le systems. If you have some users who consistently create very small les, consider creating a separate le system with more inodes. However, most sites do not need to keep similar types of user les in the same le system.
I I
For information on default le system parameters as well as procedures for creating new UFS le systems, see Chapter 18.
UFS Logging
UFS logging bundles the multiple metadata changes that comprise a complete UFS operation into a transaction. Sets of transactions are recorded in an on-disk log. Then, they are applied to the actual UFS le systems metadata. At reboot, the system discards incomplete transactions, but applies the transactions for completed operations. The le system remains consistent because only completed transactions are ever applied. This consistency remains even when a system crashes. A system crash might interrupt system calls and introduces inconsistencies into a UFS le system. UFS logging provides two advantages:
I
If the le system is already consistent due to the transaction log, you might not have to run the fsck command after a system crash or an unclean shutdown. For more information on unclean shutdowns, see What the fsck Command Checks and Tries to Repair on page 393.
318
Starting in the Solaris 9 12/02 release, the performance of UFS logging improves or exceeds the level of performance of non logging le systems. This improvement can occur because a le system with logging enabled converts multiple updates to the same data into single updates. Thus, reduces the number of overhead disk operations required.
Is allocated from free blocks on the le system Sized at approximately 1 Mbyte per 1 Gbyte of le system, up to a maximum of 64 Mbytes Continually ushed as it lls up Also ushed when the le system is unmounted or as a result of any lockfs command.
UFS logging is enabled by default for all UFS le systems. If you need to disable UFS logging, add the nologging option to the le systems entry in the /etc/vfstab le or when you manually mount the le system. If you need to enable UFS logging, specify the -o logging option with the mount command in the /etc/vfstab le or when you manually mount the le system. Logging can be enabled on any UFS le system, including the root (/) le system. Also, the fsdb command has new debugging commands to support UFS logging. In some operating systems, a le system with logging enabled is known as a journaling le system.
UFS Snapshots
You can use the fssnap command to create a read-only snapshot of a le system. A snapshot is a le systems temporary image that is intended for backup operations. See Chapter 26 for more information.
When a le system is mounted with this option, data is transferred directly between a users address space and the disk. When forced direct I/O is not enabled for a le system, data transferred between a users address space and the disk is rst buffered in the kernel address space. The default behavior is no forced direct I/O on a UFS le system. For more information, see mount_ufs(1M).
sbin
etc
opt
mount
fs
opt
SUNWrtvc
rc0
ufs
group
shutdown
mount
system
ttydefs
FIGURE 171 Sample root (/) File System
To access a local le system from the /opt le system that contains a set of unbundled products, you must do the following:
320 System Administration Guide: Devices and File Systems November 2006
First, you must create a directory to use as a mount point for the le system you want to mount, for example, /opt/unbundled. Once the mount point is created, you can mount the le system by using the mount command. This command makes all of the les and directories in /opt/unbundled available, as shown in the following gure.
/
sbin
etc
opt
mount
fs
opt
SUNWrtvc
unbundled
rc0
ufs
group
app1
app2
file1
file2
file3
/ ufs 1093882623
rw,intr,largefiles,logging,xattr,onerror
321
/devices /devices devfs dev=4340000 1093882603 ctfs /system/contract ctfs dev=4380001 1093882603 proc /proc proc dev=43c0000 1093882603 mnttab /etc/mnttab mntfs dev=4400001 1093882603 swap /etc/svc/volatile tmpfs xattr,dev=4440001 1093882603 /dev/dsk/c0t0d0s6 /usr ufs rw,intr,largefiles,logging,xattr,onerror =panic,dev=220000e 1093882623 objfs /system/object objfs dev=44c0001 1094150403 fd /dev/fd fd rw,dev=45c0001 1093882624 swap /var/run tmpfs xattr,dev=4440002 1093882625 swap /tmp tmpfs xattr,dev=4440003 1093882625 /dev/dsk/c0t0d0s7 /export/home ufs rw,intr,largefiles,logging,xattr ,onerror=panic,dev=220000f 1093882637 $
You can specify le systems to automatically mount when the system boots. You can mount le systems by using only the mount point name. The /etc/vfstab le contains the mapping between the mount point and the actual device slice name.
A default /etc/vfstab le is created when you install a system, depending on the selections during installation. However, you can edit the /etc/vfstab le on a system whenever you want. To add an entry, the information you need to specify is as follows:
I I I I
The device where the le system resides The le system mount point File system type Whether you want the le system to mount automatically when the system boots (by using the mountall command) Any mount options
The following is an example of an /etc/vfstab le. Comment lines begin with #. This example shows an /etc/vfstab le for a system with two disks (c0t0d0 and c0t3d0).
$ more /etc/vfstab #device device #to mount to fsck # fd 322
FS type fd
fsck pass -
/proc /dev/dsk/c0t0d0s1 /dev/dsk/c0t0d0s0 /dev/dsk/c0t0d0s6 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d0s5 /devices ctfs objfs swap $
proc swap ufs ufs ufs ufs devfs ctfs objfs tmpfs
1 1 2 2 -
In this example, the UFS le system entry for /export/home on the /dev/dsk/c0t0d0s7 slice will be automatically mounted on the /test mount point when the system boots. Note that, for root (/) and /usr, the mount at boot eld value is specied as no. These le systems are mounted by the kernel as part of the boot sequence before the mountall command is run. For descriptions of each /etc/vfstab eld and information on how to edit and use the le, see Chapter 19.
By using the share or shareall command By adding an entry to the /etc/dfs/dfstab (distributed le system table) le and rebooting the system
For information on how to share resources, see Chapter 19. For a complete description of NFS, see Chapter 4, Managing Network File Systems (Overview), in System Administration Guide: Network Services.
Chapter 17 Managing File Systems (Overview) 323
Automounting or AutoFS
You can mount NFS le system resources by using a client-side service called automounting (or AutoFS). AutoFS enables a system to automatically mount and unmount NFS resources whenever you access them. The resource remains mounted as long as you remain in the directory and are using a le within that directory. If the resource is not accessed for a certain period of time, it is automatically unmounted. AutoFS provides the following features:
I I I
NFS resources dont need to be mounted when the system boots, which saves booting time. Users dont need to know the root password to mount and unmount NFS resources. Network trafc might be reduced because NFS resources are mounted only when they are in use.
The AutoFS service is initialized by the automount utility, which runs automatically when a system is booted. The automountd daemon runs continuously and is responsible for the mounting and unmounting of NFS le systems on an as-needed basis. By default, the /home le system is mounted by the automount daemon. With AutoFS, you can specify multiple servers to provide the same le system. This way, if one of these servers is down, AutoFS can try to mount the le system from another machine. For complete information on how to set up and administer AutoFS, see System Administration Guide: IP Services.
The FS type eld in the virtual le system table (the /etc/vfstab le) The /etc/default/fs le for local le systems The /etc/dfs/fstypes le for NFS le systems
mount-point fs-table
Species the mount point name of the le system for which you want to know the le system type. For example, the /var directory. Species the absolute path to the le system table in which to search for the le systems type. If the le system is mounted, fs-table should be /etc/mnttab. If the le system isnt mounted, fs-table should be /etc/vfstab.
324
The following example uses the /etc/vfstab le to determine the le system type for the /export le system.
$ grep /export /etc/vfstab /dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /export ufs $
yes
The following example uses the /etc/mnttab le to determine the le system type of the currently mounted diskette. The diskette was previously mounted by vold.
$ grep /floppy /etc/mnttab /vol/dev/diskette0/unnamed_floppy nohidden,nofoldcase,dev=16c0009 $
325
326
18
C H A P T E R
1 8
This chapter describes how to create UFS, temporary (TMPFS), and loopback (LOFS) le systems. For UFS le systems, this chapter shows you how to create a le system by using the newfs command. Because TMPFS and LOFS are virtual le systems, you actually access them by mounting them. This is a list of the step-by-step instructions in this chapter.
I I I I I I
How to Create a UFS File System on page 328 How to Create a Multiterabyte UFS File System on page 329 How to Expand a Multiterabyte UFS File System on page 331 How to Expand a UFS File System to a Multiterabyte UFS File System on page 332 How to Create and Mount a TMPFS File System on page 334 How to Create and Mount an LOFS File System on page 335
Note For instructions on how to create UFS and DOS le systems on removable media, see
Chapter 1.
Note Solaris device names use the term slice (and the letter s in the device name) to refer to the slice
number. Slices are also called partitions. You need to create UFS le systems only occasionally, because the Solaris OS automatically creates them as part of the installation process. You need to create (or re-create) a UFS le system when you want to do the following:
I I I
Add or replace disks Change the existing partitioning structure of a disk Fully restore of a le system
The newfs command is the standard way to create UFS le systems. The newfs command is a convenient front end to the mkfs command, which actually creates the new le system. The newfs command reads parameter defaults, such as tracks per cylinder and sectors per track, from the label for the disk that will contain the new le system. The options you choose are passed to the mkfs command to build the le system. For information about the default parameters that are used by the newfs command, see newfs(1M).
M
Before You Begin
The disk must be formatted and divided into slices. If you are re-creating an existing UFS le system, unmount it. You need to know the device name of the slice that will contain the le system.
For information on nding disks and disk slice numbers, see Chapter 12. For information on formatting disks and dividing disks into slices, see Chapter 11.
1 2
You must be superuser or assume an equivalent role. Create the UFS le system.
# newfs [-N] [-b size] [-i bytes] /dev/rdsk/device-name
-N
Displays what parameters the newfs command would pass to the mkfs command without actually creating the le system. This option is a good way to test the newfs command. Species the block size for the le system, either 4096 or 8192 bytes per block. The default is 8192. Species the number of bytes per inode. The default varies depending on the disk size. For more information, see newfs(1M). Species the disk device name on which to create the new le system.
If you specify the wrong slice, you will erase its contents when the new le system is created. This error might cause the system to panic.
3
To verify the creation of the UFS le system, check the new le system.
# fsck /dev/rdsk/device-name
where device-name argument species the name of the disk device that contains the new le system. The fsck command checks the consistency of the new le system, reports any problems, and prompts you before it repairs the problems. For more information on the fsck command, see Chapter 22 or fsck(1M).
Example 181
More Information
329
Created a multiterabyte disk partition by using the format utility or the Solaris installation utilities Set up a multiterabyte volume with Solaris Volume Manager
For more information about multiterabyte UFS le systems, see 64-bit: Support of Multiterabyte UFS File Systems on page 305.
1 2
Become superuser. Create a multiterabyte UFS le system on a logical volume. For example, this command creates a UFS le system for a 1.8 terabyte volume:
# newfs /dev/md/rdsk/d99 newfs: construct a new file system /dev/md/rdsk/d99: (y/n)? y /dev/md/rdsk/d99: 3859402752 sectors in 628158 cylinders of 48 tracks, 128 sectors 1884474.0MB in 4393 cyl groups (143 c/g, 429.00MB/g, 448 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 878752, 1757472, 2636192, 3514912, 4393632, 5272352, 6151072, 702... Initializing cylinder groups: ........................................................................ super-block backups for last 10 cylinder groups at: 3850872736, 3851751456, 3852630176, 3853508896, 3854387616, 3855266336, 3856145056, 3857023776, 3857902496, 3858781216, #
330
1 2
331
1 2
Become superuser. Identify the size of the current disk or volume. For example, the following volume is 800 gigabytes:
# metastat d98 d98: Concat/Stripe Size: 1677754368 blocks (800 GB) Stripe 0: Device Start Block Dbase c0t1d0s4 0 No Stripe 1: Device Start Block Dbase c3t7d0s4 0 No
332
Expand the UFS le system for the disk or volume to greater than 1 terabyte. For example:
growfs -v /dev/md/rdsk/d98 /usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d98 2516631552 /dev/md/rdsk/d98: 2516631552 sectors in 68268 cylinders of 144 tracks, 256 sectors 1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 921888, 1843744, 2765600, 3687456, 4609312, 5531168, 6453024, 737... 8296736, Initializing cylinder groups: ...................................................... super-block backups for last 10 cylinder groups at: 2507714848, 2508636704, 2509558560, 2510480416, 2511402272, 2512324128, 2513245984, 2514167840, 2515089696, 2516011552,
Cause You attempted to mount a UFS le system that is greater than 1 terabyte on a system running a Solaris release prior to the Solaris 10 release. Solution Mount a UFS le system that is greater than 1 terabyte on a system running the Solaris 10 or later release. Error Message
"File system was not set up with the multi-terabyte format." "Its size cannot be increased to a terabyte or more."
333
Cause You attempted to expand a le system that was not created by using the newfs -T command. Solution 1. Back up the data for the le system that you want to expand to greater than 1 terabyte. 2. Re-create the le system by using the newfs command to create a multiterabyte le system. 3. Restore the backup data into the newly created le system.
M
1 2
-o size=number mount-point
Species the size limit of the TMPFS le system in Mbytes. Species the directory on which the TMPFS le system is mounted.
To set up the system to automatically mount a TMPFS le system at boot time, see Example 183.
4
334
Example 182
Example 183
For more information on the /etc/vfstab le, see Field Descriptions for the /etc/vfstab File on page 340.
M
1 2
Grant the appropriate permissions and ownership on the newly created directory.
335
Create the mount point where you want to mount the LOFS le system, if necessary.
# mkdir /mount-point
loopback-directory /mount-point
6
Species the le system to be mounted on the loopback mount point. Species the directory on which to mount the LOFS le system.
Example 184
Example 185
Ensure that the loopback entries are the last entries in the /etc/vfstab le. Otherwise, if the /etc/vfstab entry for a loopback le system precedes the le systems to be included in it, the loopback le system cannot be mounted.
See Also
For more information on the /etc/vfstab le, see Field Descriptions for the /etc/vfstab File on page 340.
336
19
C H A P T E R
I I I I I I I
1 9
This chapter describes how to mount and unmount le systems in the Solaris OS. This is a list of the step-by-step instructions in this chapter. How to Determine Which File Systems Are Mounted on page 342 How to Add an Entry to the /etc/vfstab File on page 343 How to Mount a File System (/etc/vfstab File) on page 344 How to Mount a UFS File System (mount Command) on page 345 How to Mount a UFS File System Without Large Files (mount Command) on page 346 How to Mount an NFS File System (mount Command) on page 347 x86: How to Mount a PCFS (DOS) File System From a Hard Disk (mount Command) on page 348 How to Verify a File System is Unmounted on page 350 How to Stop All Processes Accessing a File System on page 350 How to Unmount a File System on page 351
I I I
The mount command that you type manually from the command line.
337
The /etc/vfstab le, which mounts the le system automatically when the system is booted in multi user state.
I
The /etc/vfstab le, which automatically mounts the le system when the system is booted in multiuser state. AutoFS, which automatically mounts the le system when you access it or unmounts the le system when you change to another directory.
To enhance performance, you can also cache the remote le systems by using the CacheFS le system.
You can mount removable media that contains a le system by inserting the media into the drive and running the volcheck command, if necessary. For more information on mounting removable media, see Chapter 1.
mount mountall
Mounts le systems and remote resources. Mounts all le systems that are specied in the /etc/vfstab le. The mountall command runs automatically when the system enters multiuser mode. Unmounts le systems and remote resources. Unmounts all le systems that are specied in the /etc/vfstab le.
mount(1M) mountall(1M)
umount umountall
mount(1M) mountall(1M)
Keep the following key points in mind when using the mount and mountall commands:
I
The mount and mountall commands cannot mount a read/write le system that has known inconsistencies. If you receive an error message from the mount or mountall command, you might need to check the le system. See Chapter 22 for information on how to check the le system.
338
The umount and umountall commands do not unmount a le system that is busy. A le system is considered busy if one of the following is true:
I I I
A user is accessing a le or directory in the le system. A program has a le open in that le system. The le system is shared.
You can use the remount option when remounting from read-only access to read-write access only. You cannot remount from read-write access to read-only access.
bg | fg
NFS
If the rst mount attempt fails, retries another mount in the background (bg) or in the foreground (fg). This option is safe for non critical vfstab entries. The default is fg. Species the procedure if the server does not respond. The soft option indicates that an error is returned. The hard option indicates that the retry request is continued until the server responds. The default is hard. Species whether keyboard interrupts are delivered to a hung process while waiting for a response on a hard-mounted le system. The default is intr (interrupts allowed). Enables you to create les larger than 2 Gbytes. The largefiles option means that a le system mounted with this option might contain les larger than 2 Gbytes. If the nolargefiles option is specied, the le system cannot be mounted on a system that is running Solaris 2.6 or compatible versions. The default is largefiles.
hard | soft
NFS
intr | nointr
NFS
largefiles | nolargefiles
UFS
339
TABLE 192 Commonly Used -o Mount Options mount Option File System
(Continued)
Description
logging | nologging
UFS
Enables or disables logging for the le system. UFS logging is the process of storing transactions (changes that comprise a complete UFS operation) into a log before the transactions are applied to the UFS le system. Logging helps prevent UFS le systems from becoming inconsistent, which means fsck can be bypassed. Bypassing fsck reduces the time to reboot a system if it crashes, or after a system is shut down uncleanly. The log is allocated from free blocks on the le system, and is sized at about 1 Mbyte per 1 Gbyte of le system, up to a maximum of 64 Mbytes. The default is logging.
atime | noatime
UFS
Suppresses access time updates on les, except when they coincide with updates to the time of the last le status change or the time of the last le modication. For more information, see stat(2). This option reduces disk activity on le systems where access times are unimportant (for example, a Usenet news spool). The default is normal access time (atime) recording. Changes the mount options associated with an already-mounted le system. This option can generally be used with any option except ro. However, what can be changed with this option depends on the le system type. Retries the mount operation when it fails. n is the number of times to retry. Species read/write (rw) or read-only (ro). If you do not specify this option, the default is rw. The default option for HSFS is ro. Allows or disallows setuid execution. The default is to allow setuid execution.
remount
All
retry=n ro | rw
NFS CacheFS, NFS, PCFS, UFS, HSFS CacheFS, HSFS, NFS, UFS
suid | nosuid
340
TABLE 193 Field Descriptions for the /etc/vfstab File Field Name Description
device to mount
This eld identies one of the following: The block device name for a local UFS le system (for example, /dev/dsk/c0t0d0s0). The resource name for a remote le system (for example, myserver:/export/home). For more information about NFS, see System Administration Guide: IP Services. The block device name of the slice on which to swap (for example, /dev/dsk/c0t3d0s1). A directory for a virtual le system.
device to fsck
The raw (character) device name that corresponds to the UFS le system identied by the device to mount eld (for example, /dev/rdsk/c0t0d0s0). This eld determines the raw interface that is used by the fsck command. Use a dash (-) when there is no applicable device, such as for a read-only le system or a remote le system. Identies where to mount the le system (for example, /usr).
mount point
Identies the type of le system. The pass number used by the fsck command to decide whether to check a le system. When the eld contains a dash (-), the le system is not checked. When the eld contains a zero, UFS le systems are not checked. However, non-UFS le systems are checked. When the eld contains a value greater than zero, the le system is always checked. All le systems with a value of 1 in this eld are checked one at a time in the order they appear in the vfstab le. When the fsck command is run on multiple UFS le systems that have fsck pass values greater than 1 and the preen option (-o p) is used, the fsck command automatically checks the le systems on different disks in parallel to maximize efciency. Otherwise, the value of the pass number does not have any effect.
mount at boot
Set to yes or no for whether the le system should be automatically mounted by the mountall command when the system is booted. Note that this eld has nothing to do with AutoFS. The root (/), /usr and /var le systems are not mounted from the vfstab le initially. This eld should always be set to no for these le systems and for virtual le systems such as /proc and /dev/fd. A list of comma-separated options (with no spaces) that are used for mounting the le system. Use a dash (-) to indicate no options. For a list of commonly used mount options, see Table 192.
mount options
341
Note You must have an entry in each eld in the /etc/vfstab le. If there is no value for a eld, be
sure to specify a dash (-). Otherwise, the system might not boot successfully. Similarly, white space should not be used as a eld value.
This example shows how to use the mount command to display information about the le systems that are currently mounted.
$ mount / on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=... /devices on /devices read/write/setuid/dev=46c0000 on Thu Sep ... /system/contract on ctfs read/write/setuid/devices/dev=43c0001 ... /usr on /dev/dsk/c0t0d0s6 read/write/setuid/intr/largefiles/xattr/... /proc on /proc read/write/setuid/dev=4700000 on Thu Sep 2 ... /etc/mnttab on mnttab read/write/setuid/dev=47c0000 on Thu Sep 2 ... /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4480001 ... /system/object on objfs read/write/setuid/devices/dev=44c0001 ... /dev/fd on fd read/write/setuid/dev=4800000 on Thu Sep 2 ... /var/run on swap read/write/setuid/xattr/dev=1 on Thu Sep 2 ... /tmp on swap read/write/setuid/xattr/dev=2 on Thu Sep 2 ... /stuff on /dev/dsk/c0t0d0s5 read/write/setuid/intr/largefiles/xattr... /export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/... /home/rimmer on pluto:/export/home/rimmer remote/read/write/setuid/xattr/... $
342
M
1 2
There must be a mount point on the local system to mount a le system. A mount point is a directory to which the mounted le system is attached.
3
Edit the /etc/vfstab le and add an entry. Ensure that you do the following: a. Separate each eld with white space (a space or a tab). b. Specify a dash (-) if a eld has no contents. c. Save the changes. For detailed information about the /etc/vfstab eld entries, see Table 193.
Note Because the root (/) le system is mounted read-only by the kernel during the boot process,
only the remount option (and options that can be used in conjunction with remount) affect the root (/) entry in the /etc/vfstab le.
Example 192
The following example shows how to mount the /export/man directory from the system pluto as an NFS le system on mount point /usr/man. Neither a device to fsck nor a fsck pass is specied because its an NFS le system. In this example, mount options are ro (read-only) and soft.
#device device #to mount to fsck pluto:/export/man mount FS point type /usr/man nfs fsck pass mount mount at boot options yes ro,soft
343
The following example shows how to mount the root (/) le system on a loopback mount point, /tmp/newroot. LOFS le systems must always be mounted after the le systems that are in the LOFS le system.
#device #to mount # / device to fsck mount point FS type fsck pass mount mount at boot options yes -
/tmp/newroot lofs -
M
1 2
where /mount-point species an entry in the mount point or device to mount eld in the /etc/vfstab le. It is usually easier to specify the mount point.
Example 193
Example 194
When using the mountall command, all the le systems with a device to fsck entry are checked and xed, if necessary, before they are mounted. The following example shows how to mount all the local systems that are listed in the /etc/vfstab le.
# mountall -l # mount / on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=...
344 System Administration Guide: Devices and File Systems November 2006
/devices on /devices read/write/setuid/dev=46c0000 on Thu Sep ... /system/contract on ctfs read/write/setuid/devices/dev=43c0001 ... /usr on /dev/dsk/c0t0d0s6 read/write/setuid/intr/largefiles/xattr/... /proc on /proc read/write/setuid/dev=4700000 on Thu Sep 2 ... /etc/mnttab on mnttab read/write/setuid/dev=47c0000 on Thu Sep 2 ... /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4480001 ... /system/object on objfs read/write/setuid/devices/dev=44c0001 ... /dev/fd on fd read/write/setuid/dev=4800000 on Thu Sep 2 ... /var/run on swap read/write/setuid/xattr/dev=1 on Thu Sep 2 ... /tmp on swap read/write/setuid/xattr/dev=2 on Thu Sep 2 ... /stuff on /dev/dsk/c0t0d0s5 read/write/setuid/intr/largefiles/xattr... /export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/...
The following example shows how to mount all the remote le systems that are listed in the /etc/vfstab le.
# mountall -r # mount / on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=... /devices on /devices read/write/setuid/dev=46c0000 on Thu Sep ... /system/contract on ctfs read/write/setuid/devices/dev=43c0001 ... /usr on /dev/dsk/c0t0d0s6 read/write/setuid/intr/largefiles/xattr/... /proc on /proc read/write/setuid/dev=4700000 on Thu Sep 2 ... /etc/mnttab on mnttab read/write/setuid/dev=47c0000 on Thu Sep 2 ... /etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4480001 ... /system/object on objfs read/write/setuid/devices/dev=44c0001 ... /dev/fd on fd read/write/setuid/dev=4800000 on Thu Sep 2 ... /var/run on swap read/write/setuid/xattr/dev=1 on Thu Sep 2 ... /tmp on swap read/write/setuid/xattr/dev=2 on Thu Sep 2 ... /stuff on /dev/dsk/c0t0d0s5 read/write/setuid/intr/largefiles/xattr... /stuff on /dev/dsk/c0t0d0s5 read/write/setuid/intr/largefiles/xattr... /export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/... /home/rimmer on pluto:/export/home/rimmer remote/read/write/setuid/xattr/...
M
1 2
There must be a mount point on the local system to mount a le system. A mount point is a directory to which the mounted le system is attached.
3
-o mount-options /dev/dsk/device-name
Species mount options that you can use to mount a UFS le system. For a list of options, see Table 192 or mount_ufs(1M). Species the disk device name for the slice that contains the le system (for example, /dev/dsk/c0t3d0s7). To view slice information for a disk, see How to Display Disk Slice Information on page 211. Species the directory on which to mount the le system.
/mount-point
Example 195
How to Mount a UFS File System Without Large Files (mount Command)
When you mount a le system, the largefiles option is selected by default. This option enables you to create les larger than 2 Gbytes. Once a le system contains large les, you cannot remount the le system with the nolargefiles option or mount it on a system that is running Solaris 2.6 or compatible versions, until you remove any large les and run the fsck command to reset the state to nolargefiles. This procedure assumes that the le system is in the /etc/vfstab le.
1 2
Become superuser or assume an equivalent role. Create a mount point for the le system to be mounted, if necessary.
# mkdir /mount-point
There must be a mount point on the local system to mount a le system. A mount point is a directory to which the mounted le system is attached.
3
where /mount-point identies the mount point of the le system you want to check for large les.
4 5
Remove or move any large les in this le system to another le system, if necessary. Unmount the le system.
# umount /mount-point
346
Example 196
M
1 2
There must be a mount point on the local system to mount a le system. A mount point is a directory to which the mounted le system is attached.
3
Ensure that the resource (le or directory) is available from a server. To mount an NFS le system, the resource must be made available on the server by using the share command. For information on how to share resources, see About the NFS Service in System Administration Guide: Network Services.
-o mount-options
Species mount options that you can use to mount an NFS le system. See Table 192 for the list of commonly used mount options or mount_nfs(1M) for a complete list of options. Species the servers host name that contains the shared resource, and the path to the le or directory to mount. Species the directory on which to mount the le system.
server:/directory /mount-point
347
Example 197
x86: How to Mount a PCFS (DOS) File System From a Hard Disk (mount Command)
Use the following procedure to mount a PCFS (DOS) le system from a hard disk. Become superuser or assume an equivalent role. Create a mount point for the le system to be mounted, if necessary.
# mkdir /mount-point
1 2
There must be a mount point on the local system to mount a le system. A mount point is a directory to which the mounted le system is attached.
3
-o rw | ro /dev/dsk/device-name logical-drive
Species that you can mount a PCFS le system read/write (rw) or read-only (ro). If you do not specify this option, the default is rw. Species the device name of the whole disk (for example, /dev/dsk/c0t0d0p0). Species either the DOS logical drive letter (c through z) or a drive number (1 through 24). Drive c is equivalent to drive 1 and represents the primary DOS slice on the drive. All other letters or numbers represent DOS logical drives within the extended DOS slice. Species the directory on which to mount the le system.
/mount-point
x86: Mounting a PCFS (DOS) File System From a Hard Disk (mount Command)
The following example shows how to mount the logical drive in the primary DOS slice on the /pcfs/c directory.
# mount -F pcfs /dev/dsk/c0t0d0p0:c /pcfs/c
348
The following example shows how to mount read-only the rst logical drive in the extended DOS slice on the /mnt directory.
# mount -F pcfs -o ro /dev/dsk/c0t0d0p0:2 /mnt
The le system is no longer needed or has been replaced by a le system that contains more current software. You need to check and repair the le system by using the fsck command. For more information about the fsck command, see Chapter 22. File systems should be unmounted before doing a complete backup. For more information about doing backups, see Chapter 25.
Note File systems are automatically unmounted as part of the system shutdown procedure.
In an emergency situation, you can use the umount -f option to forcibly unmount a busy le system. This practice is not recommended under normal circumstances because the unmounting of a le system with open les could cause a loss of data. This option is only available for UFS and NFS le systems.
You must be superuser or assume an equivalent role. A le system must be available for unmounting. You cannot unmount a le system that is busy. A le system is considered busy if a user is accessing a directory in the le system, if a program has a le open in that le system, or if the le system is being shared. You can make a le system available for unmounting by doing the following:
I I I
Changing to a directory in a different le system. Logging out of the system. Using the fuser command to list all processes that are accessing the le system and to stop them, if necessary. For more details, see How to Stop All Processes Accessing a File System on page 350. Notify users if you need to unmount a le system that they are using.
349
Unsharing the le system. For information about unsharing a le system, see unshare(1M).
M
1 2
-c -u /mount-point
3
Reports on les that are mount points for le systems and any les within those mounted le systems. Displays the user login name for each process ID. Species the name of the le system for which you want to stop processes.
Example 199
350
Ensure that you have met the prerequisites listed in Prerequisites for Unmounting File Systems on page 349. Unmount the le system.
# umount /mount-point
where /mount-point is the name of the le system that you want to unmount. This can be one of the following:
I I I I
The directory name where the le system is mounted The device name path of the le system The resource for an NFS le system The loopback directory for an LOFS le system
Example 1910
The following example shows how to forcibly unmount the /export le system.
# umount -f /export #
The following example shows how to unmount all le systems in the /etc/vfstab le, except for the root (/), /proc, /var, and /usr le systems.
351
# umountall
All le systems are unmounted, except for those le systems that are busy.
352
C H A P T E R
20
2 0
This chapter describes how to set up and maintain CacheFSTM le systems. This is a list of task maps in this chapter.
I I I I I
High-Level View of Using the CacheFS File System (Task Map) on page 353 Creating and Mounting a CacheFS File System (Task Map) on page 356 Maintaining a CacheFS File System (Task Map) on page 361 Packing a Cached File System (Task Map) on page 366 Collecting CacheFS Statistics (Task Map) on page 375
For information on troubleshooting CacheFS errors, see Troubleshooting cachefspack Errors on page 372.
Note For important information about NFS version 4 and the CacheFS software, see NFS Version 4
Task
Description
For Instructions
Create the cache and mount the le Creating and Mounting a system in the cache. CacheFS File System (Task Map) on page 356
353
Task
Description
For Instructions
Display and modify a CacheFS le system by unmounting, removing, or re-creating the cache.
Determine whether you want to Packing a Cached File System pack the cache and use packing (Task Map) on page 366 lists. Packing the cache ensures that certain les and directories are always updated in the cache. Determine cache performance and appropriate cache size. Collecting CacheFS Statistics (Task Map) on page 375
354
Server
Client
The back le system is the le system that you specify to be mounted in the cache. A back le system can be either NFS or HSFS (High Sierra File System). When the user attempts to access les that are part of the back le system, those les are placed in the cache. The front le system is the le system that is mounted in the cache and is accessed from the local mount point. The front le system type must be UFS. To the user, the initial request to access a le in a CacheFS le system might seem slow. However, subsequent uses of the same le are faster.
Default Value
Denition
maxblocks minblocks
90 % 0%
Sets the maximum number of blocks that a CacheFS le system is allowed to claim within the front le system. Sets the minimum number of blocks that a CacheFS le system is allowed to claim within the front le system.
355
TABLE 201 CacheFS File System Parameters and Their Default Values CacheFS File System Parameter Default Value Denition
(Continued)
threshblocks
85 %
Sets the number of blocks that must be available in the front le system before a CacheFS le system can claim more than the blocks specied by minblocks. Sets the maximum number of available inodes (number of les) that a CacheFS le system is allowed to claim within the front le system. Sets the minimum number of available inodes that a CacheFS le system is allowed to claim within the front le system. Sets the number of inodes that must be available in the front le system before a CacheFS le system can claim more les than is specied in minfiles.
maxfiles
90 %
minfiles
0%
threshfiles
85 %
Typically, you should not change any of these parameter values. They are set to default values to achieve optimal cache behavior. However, you might want to modify the maxblocks and maxfiles values if you have some room in the front le system that is not used by the cache, and you want to use it for some other le system. You do so by using the cfsadmin command. For example:
$ cfsadmin -o maxblocks=60
1. Share the le system to be cached. 2. Create the cache. 3. Mount a le system in the cache.
Verify that the le system you want to cache is shared. Use the cfsadmin command to create the cache. Mount a le system in a cache by using one of the following methods: Mount a CacheFS le system by using the mount command.
356
Task
Description
For Instructions
Mount a CacheFS le system by editing the /etc/vfstab le. Mount a cached le system by using AutoFS.
How to Mount a CacheFS File System (/etc/vfstab) on page 360 How to Mount a CacheFS File System (AutoFS) on page 360
M
1 2
where cache-directory indicates the name of the directory where the cache resides. For more information, see cfsadmin(1M).
Note After you have created the cache, do not perform any operations within the cache directory
Example 201
Every time the system reboots in order to access the same le system.
357
Only once. The /etc/vfstab le remains unchanged after the system reboots. Only once. AutoFS maps remain unchanged after the system reboots.
Choose the method of mounting le systems that best suits your environment. You can mount only le systems that are shared. For information on sharing le systems, see share(1M).
Note The caching of the root (/) and /usr le systems is not supported in a CacheFS le system.
M
1 2
You can create the mount point from anywhere, but it must be a UFS le system. The CacheFS options used with the mount command, as shown in the next step, determine that the mount point you create is cached in the cache directory you specify.
3
fstype /cache-directory
Indicates the le system type of the back le system, which can be either NFS or HSFS. Indicates the name of the UFS directory where the cache resides. This name is the same name you specied when you created the cache in How to Create the Cache on page 357. Species other mount options that you can include when you mount a le system in a cache. For a list of CacheFS mount options, see mount_cachefs(1M). Species the mount point of the back le system to cache. If the back le system is an NFS le system, you must specify the host name of the server from which you are mounting the le system and the name of the le system to cache, separated by a colon. For example, merlin: /data/abc.
options
/back-lesystem
358
/mount-point
4
The /mount-point is the CacheFS le system that you created. For example:
# cachefsstat /docs /docs cache hit rate: consistency checks: modifies: garbage collection:
If the le system was not mounted in the cache, an error message similar to the following is displayed:
# cachefsstat /mount-point cachefsstat: mount-point: not a cachefs mountpoint
For more information about the cachefsstat command, see Collecting CacheFS Statistics on page 376.
Example 202
The following example shows how to make a Solaris 9 SPARCTM CD (HSFS le system) available as a CacheFS le system named /cfssrc. Because you cannot write to the CD, the ro argument is specied to make the CacheFS le system read-only. This example assumes that the vold daemon is not running.
# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /sol9 # mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/sol9 /dev/dsk/c0t6d0s0 /cfssrc # ls /cfssrc Copyright Solaris_9
The following example shows how to mount a Solaris 9 SPARC CD as a CacheFS le system with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/cdrom/sol_9_sparc/s0 /vol/dev/dsk/c0t2d0/sol_9_sparc/s0 /cfssrc
359
The following example shows how to mount a CD as a CacheFS le system with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/cdrom/epson /vol/dev/dsk/c0t2d0/epson /drvrs
The following example uses the demandconst option to specify consistency checking on demand for the NFS CacheFS le system /docs, whose back le system is merlin:/docs. For more information, see Consistency Checking of a CacheFS File System on page 363.
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,demandconst merlin:/docs /docs
M
1 2
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # starbug:/data/abc /local/abc /opt/cache cachefs 7 yes local-access,bg, nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache
360
For details on automount maps, see Task Overview for Autofs Administration in System Administration Guide: Network Services or automount(1M).
1 2
Become superuser on the client system. Using an editor, add the following line to the auto_direct map:
/mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs server:/le-system
Reboot the system. Verify that the entry was made correctly by changing to the le system you mounted in the cache, and then list the contents.
# cd /lesystem # ls
Example 204
Task
Description
For Instructions
Modify CacheFS le system behavior by unmounting, deleting, or re-creating the cache. Display information about CacheFS le systems by using the cfsadmin command.
Modifying a CacheFS File System on page 362 How to Display Information About a CacheFS File System on page 363
361
Task
Description
For Instructions
Perform consistency checking on demand by using the cfsadmin command. Delete a CacheFS le system by using the umount command and the cfsadmin command. Check the integrity of a CacheFS le system by using the fsck_cachefs command.
How to Specify Cache Consistency Checking on Demand on page 364 How to Delete a CacheFS File System on page 364 How to Check the Integrity of a CacheFS File System on page 366
# cfsadmin -c /local/mycache # init 6 . . . console login: password: # mount -F cachefs -o backfstype=nfs,cachedir=/local/cache1,demandconst merlin:/docs /docs #
1 2
where /cache-directory is the name of the directory where the cache resides.
Example 205
compares the current modication time to the previous modication time. If the modication times are different, all data and attributes for the directory or le are purged from the cache. Then, new data and attributes are retrieved from the back le system.
1 2
M
1 2
where /mount-point species the CacheFS le system that you want to delete.
3
364
cache-ID
Indicates the name of the CacheFS le system, which is the last line of the cfsadmin -l output. For more information, see How to Display Information About a CacheFS File System on page 363. You can delete all the CacheFS le systems in a particular cache by specifying all for cache-ID. Species the directory where the cache resides.
/cache-directory
5
Verify that the CacheFS le system has been deleted. The cache ID of the le system you just deleted should be missing from the cfsadmin -l output.
# cfsadmin -l /cache-directory cfsadmin: list cache FS information maxblocks 90% minblocks 0% threshblocks 85% maxfiles 90% minfiles 0% threshfiles 85% maxfilesize 3MB #
For more information about the elds that are specied in the command output, refer to cfsadmin(1M).
6
For more information, see How to Check the Integrity of a CacheFS File System on page 366.
Example 206
1 2
Become superuser on the client system. Check the le systems in the specied cache.
# fsck -F cachefs [-m -o noclean] /cache-directory
-m -o noclean /cache-directory
Example 207
Causes the fsck command to check a CacheFS le system without making any repairs. Forces a check on the CacheFS le systems only. Does not make any repairs. Indicates the name of the directory where the cache resides.
Task
Description
For Instructions
Identify les and directories to be How to Pack Files in the Cache loaded in the cache and pack them. on page 368 Packing ensures that current copies of these les are available in the cache. Create a packing list if you do not want to specify each individual le that you want packed in the cache. How to Create a Packing List on page 370
366
Task
Description
For Instructions
Pack les in the cache with a packing list. Unpack les or packing lists from the cache.
Specify the name of the packing list How to Pack Files in the Cache of the les to be packed in the With a Packing List on page 370 cache. Remove a le from the cache that is How to Unpack Files or Packing no longer needed. Lists From the Cache on page 371How to Unpack Files or Packing Lists From the Cache on page 371 View information about the les that youve packed, including their packing status. How to Display Packed Files Information on page 368
-p lename
Species that you want the le or les to be packed. This option is also the default. Species the name of the le or directory you want packed in the cache. When you specify a directory, all of its subdirectories are also packed. For more information, see cachefspack(1M).
Example 208
The following example shows three les being packed in the cache.
$ cachefspack -p projects updates master_plan
-i -v cached-lename-or-directory
Species that you want to view information about your packed les. Is the verbose option. Species the name of the le or directory for which to display information.
Example 209
368
In the following example, the /data/abc directory contains the bin subdirectory. The bin subdirectory has three les: big, medium, and small. Although the big and small les are specied to be packed, they are not. The medium le is successfully packed.
$ cd /data/abc $ cachefspack -i bin . . . cachefspack: file /bin/big marked packed YES, packed NO cachefspack: file /bin/medium marked packed YES, packed YES cachefspack: file /bin/small marked packed YES, packed NO . . .
If you use the -iv options together, you get additional information as to whether the le or directory specied has been ushed from the cache. For example:
$ cd /data/bin FSCACHEPACK-4$ cachefspack -iv bin . . . cachefspack: file /bin/big marked packed YES, packed NO, nocache YES cachefspack: file /bin/medium marked packed YES, packed YES, nocache NO cachefspack: file /bin/small marked packed YES, packed NO nocache NO . . .
The last line of this example shows that the directory contents have not been ushed from the cache.
369
This feature saves the time of having to specify each individual le that you want packed in the cache.
You can identify les in the packing list as regular expressions rather than literal le names so that you dont have to specify each individual le name. You can pack les from a shared directory by ensuring that you pack only those les that you own.
The path identied with the BASE statement is the directory where you have items you want to pack. The two LIST statements identify specic les within that directory to pack. The IGNORE statement identies the le type of .ps, which you do not want to pack.
I I
-f packing-list
Species that you want to use a packing list. Species the name of the packing list.
370
Example 2011
-u lename -U
Species that you want the le or les unpacked. You must specify a le name with this option. Species the name of the le or packing list that you want unpacked in the cache. Species that you want to unpack all les in the cache.
The following example shows three les being unpacked from the cache.
$ cd /data/abc/bin/big $ cachefspack -u big small medium
The following example shows how to unpack a packing list. A packing list is a le that contains the path to a directory of les:
$ cachefspack -uf list.pkg
The following example uses the -U option to specify that all les in a cache directory being unpacked.
371
$ cachefspack -U /local/mycache
You cannot unpack a cache that does not have at least one le system mounted. With the -U option, if you specify a cache that does not contain mounted le systems, output similar to the following is displayed:
$ cachefspack -U /local/mycache cachefspack: Could not unpack cache /local/mycache, no mounted filesystems in the cache.
Cause You might not have the correct permissions to access the le or directory. Action Set the correct permissions.
cachefspack: pathname - cant open directory: no such file or directory
Cause You might not have specied the correct le or directory. Action Check for a possible typo.
cachefspack: pathname - cant open directory: stale NFS file handle
Cause The le or directory might have been moved or deleted from the server at the time you attempted to access it. Action Verify that the le or directory on the server is still accessible.
cachefspack: pathname - cant open directory: interrupted system call
Cause You might have inadvertently pressed Control-C while issuing the command. Action Reissue the command.
372 System Administration Guide: Devices and File Systems November 2006
Cause You might have a hardware problem. Action Check your hardware connections.
cachefspack: error opening dir
Cause You might not have specied the correct le or directory. The path identied after the BASE command in the le format could be a le and not a directory. The path specied must be a directory. Action Check for a possible typo. Check the path identied after the BASE command in your le format. Ensure that the path identies a directory, not a le.
cachefspack: unable to get shared objects
Cause The executable might be corrupt or in a format that is not recognizable. Action Replace the executable.
cachefspack: lename - cant pack file: permission denied
Cause You might not have the correct permissions to access the le or directory. Action Set the correct permissions.
cachefspack: lename - cant pack file: no such file or directory
Cause You might not have specied the correct le or directory. Action Check for a possible typo.
cachefspack: lename- cant pack file: stale NFS file handle
Cause The le or directory might have been moved or deleted from the server at the time you attempted to access it. Action Verify that the le or directory on the server is still accessible.
Chapter 20 Using The CacheFS File System (Tasks) 373
Cause You might have inadvertently pressed Control-C while issuing the command. Action Reissue the command.
cachefspack: lename- cant pack file: I/O error
Cause You might have a hardware problem. Action Check your hardware connections.
cachefspack: lename- cant pack file: no space left on device.
Cause The cache is out of disk space. Action You need to increase the size of the cache by increasing disk space.
cachefspack: lename - cant unpack file: permission denied
Cause You might not have the correct permissions to access the le or directory. Action Set the correct permissions.
cachefspack: lename - cant unpack file: no such file or directory
Cause You might not have specied the correct le or directory. Action Check for a possible typo.
cachefspack: lename- cant unpack file: stale NFS file handle
Cause The le or directory might have been moved or deleted from the server at the time you attempted to access it. Action Verify that the le or directory on the server is still accessible.
cachefspack: lename- cant unpack file: interrupted system call
Cause You might have inadvertently pressed Control-C while issuing the command.
374 System Administration Guide: Devices and File Systems November 2006
Cause You might have a hardware problem. Action Check your hardware connections.
cachefspack: only one d, i, p, or u option allowed
Cause You specied more than one of these options in a command session. Action Select one option for the command session.
cachefspack: cant find environment variable.
Cause You forgot to set a corresponding environment variable to match the $ in your conguration le. Action Dene the environment variable in the proper location.
cachefspack: skipping LIST command - no active base
Cause A LIST command is present in your conguration le but has no corresponding BASE command. Action Dene the BASE command.
Task
Description
For Instructions
Set up logging.
Set up logging on a CacheFS le system by using the cachefslog command. Locate the log le by using the cachefslog command.
How to Set Up CacheFS Logging on page 377 How to Locate the CacheFS Log File on page 377
375
Task
Description
For Instructions
Stop logging. View the cache size. View the cache statistics.
Stop logging by using the cachefslog command. View the cache size by using the cachefswssize command. View the statistics by using the cachefsstat command.
How to Stop CacheFS Logging on page 378 How to View the Working Set (Cache) Size on page 378 How to View CacheFS Statistics on page 380
These statistics help you determine the trade-off between your cache size and the desired performance of the cache. The following table describes the CacheFS statistics commands.
Command
Description
Man Page
cachefslog
Species the location of the log le. This command also displays where the statistics are currently being logged, and enables you to stop logging. Interprets the log le to give a recommended cache size. Displays statistical information about a specic CacheFS le system or all CacheFS le systems. The information provided in the command output is taken directly from the cache.
cachefslog(1M)
cachefswssize cachefsstat
cachefswssize(1M) cachefsstat(1M)
Note You can issue the CacheFS statistics commands from any directory. You must be superuser to
issue the cachefswssize command. The CacheFS statistics begin accumulating when you create the log le. When the work session is over, stop the logging by using the cachefslog -h command, as described in How to Stop CacheFS Logging on page 378. Before using the CacheFS statistics commands, you must do the following:
376 System Administration Guide: Devices and File Systems November 2006
I I
Set up your cache by using the cfsadmin command. Decide on an appropriate length of time to allow statistical information to collect in the log le you create. The length of time should equal a typical work session. For example, a day, a week, or a month. Select a location or path for the log le. Ensure that sufcient space to allows for the growth of the log le. The longer you intend to allow statistical information to collect in the log le, the more space you need.
Note The following procedures are presented in a recommended order. This order is not required.
M
1
-f log-le-path /mount-point
Sets up logging. Species the location of the log le. The log le is a standard le you create with an editor, such as vi. Designates the mount point (CacheFS le system) for which statistics are being collected.
Example 2013
where /mount-point species the CacheFS le system for which you want to view the statistics.
377
You can also use the cachefslog command with no options to locate a log le for a particular mount point.
Example 2014
The following example shows that no log le has been set up for the specied le system.
$ cachefslog /home/zap not logged: /home/zap
If you get a system response other than the response specied here, you did not successfully stop logging. Determine if you are using the correct log le name and mount point.
1 2
Become superuser on the client system. View the current cache size and highest logged cache size.
# cachefswssize log-le-path
378
Example 2015
1472k 1472k
7168k 7168k
4688k 5000k
total for cache initial size: 110960k end size: 30872k high water size: 30872k
379
The rate of cache hits versus cache misses, followed by the actual number of hits and misses. A cache hit occurs when the user wants to perform an operation on a le or les, and the le or les are actually in the cache. A cache miss occurs when the le is not in the cache. The load on the server is the sum of cache misses, consistency checks, and modications (modies). The number of consistency checks performed, followed by the number that passed, and the number that failed. The number of modify operations. For example, writes or creates.
where /mount-point species the CacheFS le system for which you want to view the statistics. If you do not specify the mount point, statistics for all mounted CacheFS le systems will be displayed.
Example 2016
380
C H A P T E R
21
2 1
This chapter provides guidelines and step-by-step instructions for conguring additional swap space after the Solaris OS is installed. This is a list of the step-by-step instructions in this chapter.
I I
How to Create a Swap File and Make It Available on page 388 How to Remove Unneeded Swap Space on page 389
About Swap Space on page 381 How Do I Know If I Need More Swap Space? on page 383 How Swap Space Is Allocated on page 384 Planning for Swap Space on page 385 Monitoring Swap Resources on page 386 Adding More Swap Space on page 387
Swap space requirements The relationship between swap space and the TMPFS le system How to recover from error messages related to swap space
The virtual memory system maps physical copies of les on disk to virtual addresses in memory. Physical memory pages that contain the data for these mappings can be backed by regular les in the le system, or by swap space. If the memory is backed by swap space it is referred to as anonymous memory because no identity is assigned to the disk space that is backing the memory. The Solaris OS uses the concept of virtual swap space, a layer between anonymous memory pages and the physical storage (or disk-backed swap space) that actually back these pages. A systems virtual swap space is equal to the sum of all its physical (disk-backed) swap space plus a portion of the currently available physical memory. Virtual swap space has these advantages:
I
The need for large amounts of physical swap space is reduced because virtual swap space does not necessarily correspond to physical (disk) storage. A pseudo le system called SWAPFS provides addresses for anonymous memory pages. Because SWAPFS controls the allocation of memory pages, it has greater exibility in deciding what happens to a page. For example, SWAPFS might change the pages requirements for disk-backed swap storage.
Mount the TMPFS le system with the size option (-o size) to control how much swap resources TMPFS can use. Use your compilers TMPDIR environment variable to point to another larger directory. Using your compilers TMPDIR variable only controls whether the compiler is using the /tmp directory. This variable has no effect on other programs use of the /tmp directory.
dumps and faster reboot time after a system failure. You can congure a dedicated dump device by using the dumpadm command. For more information, see Chapter 24, Managing System Crash Information (Tasks), in System Administration Guide: Advanced Administration. If you are using a volume manager to manage your disks, such as Solaris Volume Manager, do not congure your dedicated dump device to be under its control. You can keep your swap areas under Solaris Volume Managers control, which is a recommended practice. However, for accessibility and performance reasons, congure another disk as a dedicated dump device outside of Solaris Volume Managers control.
When a systems swap space is at 100% allocation, an applications memory pages become temporarily locked. Application errors might not occur, but system performance will likely suffer. For information on adding more swap space to your system, see How to Create a Swap File and Make It Available on page 388.
Chapter 21 Conguring Additional Swap Space (Tasks) 383
The following message means that TMPFS ran out of physical memory while attempting to create a new le or directory:
directory: File system full, memory allocation failed
For information on recovering from the TMPFS-related error messages, see tmpfs(7FS).
The full path name of the swap slice or swap le File system type of the swap slice or swap le
The le system that contains a swap le must be mounted before the swap le is activated. So, in the /etc/vfstab le, ensure that the entry that mounts the le system comes before the entry that activates the swap le.
System Type
Workstation with about 4 Gbytes of 1 Gbyte physical memory Mid-range server with about 8 Gbytes of physical memory High-end server with about 16 to 128 Gbytes of physical memory 2 Gbytes 4 Gbytes
In addition to these general guidelines, consider allocating swap space or disk space for the following:
I I
A dedicated dump device. Determine whether large applications (such as compilers) will be using the /tmp directory. Then, allocate additional swap space to be used by TMPFS. For information about TMPFS, see Swap Space and the TMPFS File System on page 382.
385
The used value plus the available value equals the total swap space on the system, which includes a portion of physical memory and swap devices (or les). You can use the amount of available and used swap space (in the swap -s output) as a way to monitor swap space usage over time. If a systems performance is good, use swap -s to determine how much swap space is available. When the performance of a system slows down, check the amount of available swap space to determine if it has decreased. Then you can identify what changes to the system might have caused swap space usage to increase. When using this command, keep in mind that the amount of physical memory available for swap usage changes dynamically as the kernel and user processes lock down and release physical memory.
Note The swap -l command displays swap space in 512-byte blocks. The swap -s command
displays swap space in 1024-byte blocks. If you add up the blocks from swap -l and convert them to Kbytes, the result is less than used + available (in the swap -s output). The reason is that swap -l does not include physical memory in its calculation of swap space. The output from the swap -s command is summarized in the following table.
TABLE 211 Output of the swap -s Command Keyword Description
The total amount of swap space in 1024-byte blocks that is currently allocated as backing store (disk-backed swap space). The total amount of swap space in 1024-byte blocks that is not currently allocated, but claimed by memory for possible future use.
386
(Continued)
used available
The total amount of swap space in 1024-byte blocks that is either allocated or reserved. The total amount of swap space in 1024-byte blocks that is currently available for future reservation and allocation.
Creating a swap le by using the mkfile command. Activating the swap le by using the swap command. Adding an entry for the swap le in the /etc/vfstab le so that the swap le is activated automatically when the system is booted.
mkfile Command
The mkfile command creates a le that is suitable for use as either an NFS-mounted swap area or a local swap area. The sticky bit is set, and the le is lled with zeros. You can specify the size of the swap le in bytes (the default) or in Kbytes, blocks, or Mbytes by using the k, b, or m sufxes, respectively. The following table shows the mkfile command options.
TABLE 212 Options to the mkfile Command Option Description
-n
Creates an empty le. The size is noted. However, the disk blocks are not allocated until data is written to them.
387
(Continued)
-v
Note Use the -n option only when you create an NFS swap le.
M
1
2 3
Create a directory for the swap le, if needed. Create the swap le.
# mkfile nnn[k|b|m] lename
The swap le of the size nnn (in Kbytes, bytes, or Mbytes) with the lename you specify is created.
4
You must use the absolute path name to specify the swap le. The swap le is added and available until the le system is unmounted, the system is rebooted, or the swap le is removed. Keep in mind that you cannot unmount a le system while some process or program is swapping to the swap le.
5
Add an entry for the swap le to the /etc/vfstab le that species the full path name of the le, and designates swap as the le system type.
/path/lename swap no -
Example 211
388
(An entry is added for the swap le): /files/swapfile swap # swap -l swapfile dev swaplo blocks /dev/dsk/c0t0d0s1 136,1 16 1638608 /files/swapfile 16 204784
no
M
1 2
The swap le name is removed so that it is no longer available for swapping. The le itself is not deleted.
3 4
Edit the /etc/vfstab le and delete the entry for the swap le. Recover the disk space so that you can use it for something else.
# rm /path/lename
If the swap space is a le, remove it. Or, if the swap space is on a separate slice and you are sure you will not need it again, make a new le system and mount the le system. For information on mounting a le system, see Chapter 19.
5
Example 212
390
C H A P T E R
22
2 2
This chapter provides overview information and step-by-step instructions about checking UFS le system consistency. This is a list of step-by-step instructions in this chapter.
I
I I I I
How to Check the root (/), /usr, or /var File Systems From an Alternate Boot Device on page 400 How to Check Other File Systems (Not root (/), /usr, or /var) on page 402 How to Preen a UFS File System on page 404 How to Restore a Bad Superblock (Solaris 8, 9, and 10 Releases) on page 409 How to Restore a Bad Superblock (Solaris 10 6/06 Release Only) on page 406
File System Consistency on page 392 How the File System State Is Recorded on page 392 What the fsck Command Checks and Tries to Repair on page 393 Interactively Checking and Repairing a UFS File System on page 399 Restoring a Bad Superblock on page 405 Syntax and Options for the fsck Command on page 410
For new information about fsck in the Solaris 10 6/06 release, see Enhancements to UFS File System Utilities (fsck, mkfs, and newfs) on page 297. For information about fsck error messages, see Chapter 28, Resolving UFS File System Inconsistencies (Tasks), in System Administration Guide: Advanced Administration. For background information on the UFS le system structures referred to in this chapter, see Chapter 23.
391
Power failure Accidental unplugging of the system Turning off the system without proper shutdown procedure A software error in the kernel
File system inconsistencies, while serious, are not common. When a system is booted, a check for le system consistency is automatically performed (with the fsck command). Often, this le system check repairs problems it encounters. The fsck command places les and directories that are allocated but unreferenced in the lost+found directory. An inode number is assigned as the name of unreferenced le and directory. If the lost+found directory does not exist, the fsck command creates it. If there is not enough space in the lost+found directory, the fsck command increases its size. For a description of inodes, see Inodes on page 414.
FSACTIVE
Indicates a mounted le system that has modied data in memory. A mounted le system with this state ag indicates that user data or metadata would be lost if power to the system is interrupted. Indicates that the le system contains inconsistent le system data.
FSBAD
392
TABLE 221 Values of File System State Flags State Flag Value Description
(Continued)
FSCLEAN FSLOG
Indicates an undamaged, cleanly unmounted le system. Indicates that the le system has logging enabled. A le system with this ag set is either mounted or unmounted. If a le system has logging enabled, the only ags that it can have are FSLOG or FSBAD. A le system that has logging disable can have FSACTIVE, FSSTABLE, or FSCLEAN. Indicates an idle mounted le system. A mounted le system with this state ag indicates that neither user data nor metadata would be lost if power to the system is interrupted.
FSSTABLE
Superblock Checks
The superblock stores summary information, which is the most commonly corrupted component in a UFS le system. Each change to le system inodes or data blocks also modies the superblock. If the CPU is halted and the last command is not a sync command, the superblock almost certainly becomes corrupted. The superblock is checked for inconsistencies in the following:
I I I I
File system size Number of inodes Free block count Free inode count
Inodes
The list of inodes is checked sequentially starting with inode 2. (Inode 0 and inode 1 are reserved). Each inode is checked for inconsistencies in the following:
I I I I I
Format and type Link count Duplicate block Bad block numbers Inode size
Regular Directory Block special Character special FIFO (named pipe) Symbolic link Shadow (used for ACLs) Attribute directory Socket
When the le system is created, a xed number of inodes are set aside. However, these inodes are not allocated until they are needed. An allocated inode is one that points to a le. An unallocated inode does not point to a le and, therefore, should be empty. The partially allocated state means that the inode is incorrectly formatted. An inode can get into this state if, for example, bad data is written into the inode list because of a hardware failure. The only corrective action the fsck command can take is to clear the inode.
Discrepancies between the link count stored in the inode and the actual link count as determined by the fsck command might be one of three types:
I
The stored count is not 0, and the actual count is 0. This condition can occur if no directory entry exists for the inode. In this case, the fsck command puts the disconnected le in the lost+found directory.
The stored count is not 0 and the actual count is not 0. However, the counts are unequal. This condition can occur if a directory entry has been added or removed, but the inode has not been updated. In this case, the fsck command replaces the stored link count with the actual link count.
The stored count is 0, and the actual count is not 0. In this case, the fsck command changes the link count of the inode to the actual count.
Each inode contains a 64-bit size eld. This eld shows the number of characters (data bytes) in the le associated with the inode. A rough check of the consistency of the size eld of an inode uses the number of characters shown in the size eld to calculate how many blocks should be associated with the inode, and then compares that number to the actual number of blocks claimed by the inode.
Indirect Blocks
Indirect blocks are owned by an inode. Therefore, inconsistencies in an indirect block affect the inode that owns it. Inconsistencies that can be checked are the following:
I I
Blocks already claimed by another inode Block numbers outside the range of the le system
These consistency checks listed are also performed for direct blocks.
Data Blocks
An inode can directly or indirectly reference three kinds of data blocks. All referenced blocks must be of the same kind. The three types of data blocks are the following:
I I I
Plain data blocks contain the information stored in a le. Symbolic-link data blocks contain the path name stored in a symbolic link. Directory data blocks contain directory entries. The fsck command can check only the validity of directory data blocks. Directories are distinguished from regular les by an entry in the mode eld of the inode. Data blocks associated with a directory contain the directory entries. Directory data blocks are checked for inconsistencies involving the following:
I I I I
Directory inode numbers that point to unallocated inodes Directory inode numbers that are greater than the number of inodes in the le system Incorrect directory inode numbers for . and .. directories Directories that are disconnected from the le system
Disconnected Directories
The fsck command checks the general connectivity of the le system. If a directory that is not linked to the le system is found, the fsck command links the directory to the lost+found directory of the le system. This condition can occur when inodes are written to the le system. However, the corresponding directory data blocks are not.
1 - Check Blocks and Sizes 2 - Check Pathnames 3a - Check Connectivity 3b - Verify Shadows/ACLs 4 - Check Reference Counts 5 - Check Cylinder Groups 9 used, 2833540 free (20 frags, 354190 blocks, 0.0% fragmentation)
The last line of fsck output describes the following information about the le system: # files # used # free # frags # blocks % fragmentation Number of inodes in use Number of fragments in use Number of unused fragments Number of unused non-block fragments Number of unused full blocks Percentage of fragmentation, where: free fragments x 100 / total fragments in the le system
When they cannot be mounted When they develop inconsistencies while in use
When an in-use le system develops inconsistencies, error messages might be displayed in the console window or the system messages le. Or, the system might crash. For example, the system messages le, /var/adm/messages, might include messages similar to the following:
Sep 5 13:42:40 hostname ufs: [ID 879645 kern.notice] NOTICE: /: unexpected free inode 630916, run fsck(1M)
hostname is the system reporting the error. Before using the fsck command, you might want to refer to these references for information on resolving fsck error messages:
I I
Syntax and Options for the fsck Command on page 410 Chapter 28, Resolving UFS File System Inconsistencies (Tasks), in System Administration Guide: Advanced Administration
399
Keep the following points in mind when running the fsck command to check UFS le systems:
I
A le system should be inactive when you use fsck to check a le system. File system changes waiting to be ushed to disk or le system changes that occur during the fsck checking process can be interpreted as le system corruption. These issues may not be a reliable indication of a problem. A le system must be inactive when you use fsck to repair that le system. File system changes waiting to be ushed to disk or le system changes that occur during the fsck repairing process might cause the le system to become corrupted. Or, they might cause the system to crash. Unmount a le system before you use fsck on that le system. Doing so ensures that the le system data structures are consistent as possible. The only exceptions are for the active root (/), /usr, and /var le systems because they must be mounted to run fsck. If you need to repair the root (/), /usr, and /var le systems, boot the system from an alternate device, if possible, so that these le systems are unmounted and inactive. For step-by-step instructions on running fsck on the root (/), /usr, or /var le systems, see How to Check the root (/), /usr, or /var File Systems From an Alternate Boot Device on page 400.
How to Check the root (/), /usr, or /var File Systems From an Alternate Boot Device
For new information about fsck in the Solaris 10 6/06 release, see Enhancements to UFS File System Utilities (fsck, mkfs, and newfs) on page 297. There is no need to rerun fsck if you see the following message:
***** FILE SYSTEM WAS MODIFIED *****
However, it doesnt harm the le system to rerun fsck after this message. This message is just informational about fscks corrective actions. This procedure assumes that a local CD or network boot server is available so that you can boot the system from an alternate device. For information on restoring a bad superblock, see How to Restore a Bad Superblock (Solaris 10 6/06 Release Only) on page 406 or How to Restore a Bad Superblock (Solaris 8, 9, and 10 Releases) on page 409.
1 2
Become superuser or assume an equivalent role. For systems with mirrored root (/) le systems only: Detach the root (/) mirror before booting from the alternate device, or you risk corrupting the le system. For information on detaching the root (/) mirror, see Working With Submirrors in Solaris Volume Manager Administration Guide.
400
Identify the device, such as /dev/dsk/c0t0d0s0, of the root (/), /usr, or /var le system that needs to be checked. Youll need to supply this device name when booted from an alternate device. Identifying this device when you are already booted from the alternate device is more difcult.
Boot the system with the root (/), /usr, or /var le system that needs to be checked from an alternate device, such as a local CD or the network, in single-user mode. Doing so ensures that there is no activity on these le systems. For example:
# init 0 ok boot net -s . . . #
Check the device that contains the root (/), /usr, or /var le system as identied in Step 3. If the hardware for the le system to be checked or repaired has changed, the device names might have changed. Check that the fsck -n message Last Mounted on ... indicates the expected device for the le system. In this example, the root (/) le system to be checked is /dev/dsk/c0t0d0s0.
# fsck -n /dev/rdsk/c0t0d0s0 ** /dev/rdsk/c0t0d0s0 (NO WRITE) ** Last Mounted on / . . . fsck /dev/rdsk/c0t0d0s0 ** /dev/rdsk/c0t0d0s0 ** Last Mounted on / ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames . . .
Correct any reported fsck errors. For information on how to respond to the error message prompts while you interactively check one or more UFS le systems, see Chapter 28, Resolving UFS File System Inconsistencies (Tasks), in System Administration Guide: Advanced Administration.
If fsck cannot repair all of the problems after running it, see Fixing a UFS File System That the fsck Command Cannot Repair on page 404.
401
Mount the repaired le system to determine if any les exist in the lost+found directory. Individual les put in the lost+found directory by the fsck command are renamed with their inode numbers. If possible, rename the les and move them where they belong. Try to use the grep command to match phrases within individual les and the file command to identify le types. Eventually, remove unidentiable les or directories left in the lost+found directory so that it doesnt ll up unnecessarily.
10
For systems with mirrored root (/) le systems only: Reattach the root (/) mirror.
How to Check Other File Systems (Not root (/), /usr, or /var)
For new information about fsck in the Solaris 10 6/06 release, see Enhancements to UFS File System Utilities (fsck, mkfs, and newfs) on page 297. There is no need to rerun fsck if you see the following message:
***** FILE SYSTEM WAS MODIFIED *****
However, it doesnt harm the le system to rerun fsck after this message. This message is just informational about fscks corrective actions. This procedure assumes that the le system to be checked is unmounted. For information on restoring a bad superblock, see How to Restore a Bad Superblock (Solaris 10 6/06 Release Only) on page 406 or How to Restore a Bad Superblock (Solaris 8, 9, and 10 Releases) on page 409.
1 2
Become superuser or assume an equivalent role. Unmount the local le system to ensure that there is no activity on the le system. Specify the mount point directory or /dev/dsk/device-name as arguments to the fsck command. Any inconsistency messages are displayed. For example:
# umount /export/home # fsck /dev/rdsk/c0t0d0s7 ** /dev/dsk/c0t0d0s7 ** Last Mounted on /export/home .
402
. . 3
Correct any reported fsck errors. For information on how to respond to the error message prompts while you interactively check one or more UFS le systems, see Chapter 28, Resolving UFS File System Inconsistencies (Tasks), in System Administration Guide: Advanced Administration.
If fsck cannot repair all of the problems after running it, see Fixing a UFS File System That the fsck Command Cannot Repair on page 404. Mount the repaired le system to determine if there are any les in the lost+found directory. Individual les put in the lost+found directory by the fsck command are renamed with their inode numbers.
Rename and move any les put in the lost+found directory. If possible, rename the les and move them where they belong. Try to use the grep command to match phrases within individual les and the file command to identify le types. Eventually, remove unidentiable les or directories left in the lost+found directory so that it doesnt ll up unnecessarily.
Example 221
403
1 2
You can preen individual le systems by using /mount-point or /dev/rdsk/device-name as arguments to the fsck command.
Example 222
Fixing a UFS File System That the fsck Command Cannot Repair
The fsck command operates in several passes, and a problem corrected in a later pass can expose other problems that are only detected by earlier passes. Therefore, it is sometimes necessary to run fsck until it no longer reports any problems. Doing so ensures that all errors have been found and repaired.
404
Pay attention to the information displayed by the fsck command. This information might help you x the problem. For example, the messages might point to a damaged directory. If you delete the directory, you might nd that the fsck command runs cleanly. If the fsck command still cannot repair the le system, try to use the ff, clri, and ncheck commands to gure out and x what is wrong. For information about how to use these commands, see the following references:
I I I I
Ultimately, you might need to re-create the le system and restore its contents from backup media. For information about restoring complete le systems, see Chapter 27. If you cannot fully repair a le system but you can mount it read-only, try using the cp, tar, or cpio commands to retrieve all or part of the data from the le system. If hardware disk errors are causing the problem, you might need to reformat and repartition the disk again before re-creating and restoring le systems. Check that the device cables and connectors are functional before replacing the disk device. Hardware errors usually display the same error again and again across different commands. The format command tries to work around bad blocks on the disk. However, if the disk is too severely damaged, the problems might persist, even after reformatting. For information about using the format command, see format(1M). For information about installing a new disk, see Chapter 13 or Chapter 14.
Reinstall the system. Boot from the network or local CD, and attempt the following steps. If these steps fail, recreate the root (/) le system by using the newfs command and restore it from a backup copy.
405
parameters, such as ntrack or nsect, using fscks automatically calculated superblock for the repair process could irreparably damage your le system. In the case of a le system that was created with customized parameters and it has a bad superblock, fsck provides the following prompt to cancel the fsck session:
CANCEL FILESYSTEM CHECK?
Canceling the fsck session would be an appropriate response if this le system was created with customized parameters or if there is some other concern about running fsck on this le system.
1 2
Become superuser or assume an equivalent role. Check the le system with the suspected bad superblock.
# fsck /dev/rdsk/c0t1d0s0 ** /dev/rdsk/c0t1d0s0 BAD SUPERBLOCK at ...
Determine how the le system was created and select one of the following:
I
fsck responds that all superblocks are corrupt and it must use a generic superblock. Answer the fsck prompts as described in the example below.
Caution Do not use this option if the le system was created with customized parameters. This option should only be used as a last resort. Be prepared to restore the le system from a backup copy.
406
# fsck /dev/dsk/c1t2d0s0 ** /dev/rdsk/c1t2d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? no
LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? yes SEARCH FOR ALTERNATE SUPERBLOCKS FAILED. USE GENERIC SUPERBLOCK FROM MKFS? no
USE GENERIC SUPERBLOCK FROM NEWFS? yes CALCULATED GENERIC SUPERBLOCK WITH NEWFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? no ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3a - Check Connectivity ** Phase 3b - Verify Shadows/ACLs ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cylinder Groups CORRECT GLOBAL SUMMARY SALVAGE? y
UPDATE STANDARD SUPERBLOCK? y 81 files, 3609 used, 244678 free (6 frags, 30584 blocks, 0.0% fragmentation) ***** FILE SYSTEM WAS MODIFIED *****
I
fsck responds that it found an alternate superblock with a message similar to the following:
FOUND ALTERNATE SUPERBLOCK 32 WITH NEWFS
With this fsck scenario, follow the prompts as shown in Automatic Search for Backup Superblocks on page 298.
I
407
fsck responds that all superblocks are corrupt and must use a generic superblock. Answer the fsck prompts as described in the example below.
Caution Do not use this option if the le system was created with customized parameters. This option should only be used as a last resort. Be prepared to restore the le system from a backup copy.
# fsck /dev/dsk/c1t2d0s0 ** /dev/rdsk/c1t2d0s0 BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? yes
LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? no SEARCH FOR ALTERNATE SUPERBLOCKS FAILED. USE GENERIC SUPERBLOCK FROM MKFS? yes CALCULATED GENERIC SUPERBLOCK WITH MKFS If filesystem was created with manually-specified geometry, using auto-discovered superblock may result in irrecoverable damage to filesystem and user data. CANCEL FILESYSTEM CHECK? no ** Last Mounted on ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3a - Check Connectivity ** Phase 3b - Verify Shadows/ACLs ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cylinder Groups CORRECT GLOBAL SUMMARY SALVAGE? y
UPDATE STANDARD SUPERBLOCK? y 81 files, 3609 used, 243605 free (117 frags, 30436 blocks, 0.0% fragmentation)
I
fsck responds that it found an alternate superblock with a message similar to the following:
FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS
408
With this fsck scenario, follow the prompts as shown in Automatic Search for Backup Superblocks on page 298.
4
Answer the prompts to salvage and restore the superblock. There is no need to rerun fsck when you see the following message:
***** FILE SYSTEM WAS MODIFIED *****
However, it doesnt harm the le system to rerun fsck after this message. This message is just informational about fscks corrective actions.
1 2
If the bad superblock is in either the root (/), /usr, or /var le system, then boot from the network or a locally connected CD. From a locally-connected CD, use the following command:
ok boot cdrom -s
From the network where a boot or install server is already setup, use the following command:
ok boot net -s
If you need help stopping the system, see Chapter 10, Booting a System (Tasks), in System Administration Guide: Basic Administration or Chapter 11, GRUB Based Booting (Tasks), in System Administration Guide: Basic Administration.
I
If the bad superblock is not in either the root (/), /usr, /var le system, change to a directory outside the damaged le system and unmount the le system.
# umount /mount-point
Caution Be sure to use the newfs -N in the next step. If you omit the -N option, you will destroy
all of the data in the le system and replace it with an empty le system.
3
409
The command output displays the block numbers that were used for the superblock copies when the newfs command created the le system, unless the le system was created with special parameters. For information on creating a customized le system, see Customizing UFS File System Parameters on page 416.
4
The fsck command uses the alternate superblock you specify to restore the primary superblock. You can always try 32 as an alternate block. Or, use any of the alternate blocks shown by the newfs -N command.
Example 223
410
Description
Checks whether a le system can be mounted Assumes a yes response for all repairs Assumes a no response for all repairs Noninteractively preens the le system, xing all expected (innocuous) inconsistencies, but exits when a serious problem is encountered
411
412
C H A P T E R
23
2 3
Structure of Cylinder Groups for UFS File Systems on page 413 Customizing UFS File System Parameters on page 416
Block Type
Information used when the system is booted Detailed information about the le system All information about a le Data for each le
The following sections provide additional information about the organization and function of these blocks.
Boot Block
The boot block stores objects that are used in booting the system. If a le system is not to be used for booting, the boot block is left blank. The boot block appears only in the rst cylinder group (cylinder group 0) and is the rst 8 Kbytes in a slice.
413
Superblock
The superblock stores much of the information about the le system, which includes the following:
I I I I I I I I I
Size and status of the le system Label, which includes the le system name and volume name Size of the le system logical block Date and time of the last update Cylinder group size Number of data blocks in a cylinder group Summary data block File system state Path name of the last mount point
Because the superblock contains critical data, multiple superblocks are made when the le system is created. A summary information block is kept within the superblock. The summary information block is not replicated, but is grouped with the primary superblock, usually in cylinder group 0. The summary block records changes that take place as the le system is used. In addition, the summary block lists the number of inodes, directories, fragments, and storage blocks within the le system.
Inodes
An inode contains all the information about a le except its name, which is kept in a directory. An inode is 128 bytes. The inode information is kept in the cylinder information block, and contains the following:
I
Regular Directory Block special Character special FIFO, also known as named pipe Symbolic link Socket Other inodes Attribute directory and shadow (used for ACLs)
I I I I I I I
The mode of the le (the set of read-write-execute permissions) The number of hard links to the le The user ID of the owner of the le The group ID to which the le belongs The number of bytes in the le An array of 15 disk-block addresses The date and time the le was last accessed
414
I I
The date and time the le was last modied The date and time the inode was changed
The array of 15 disk-block addresses (0 to 14) points to the data blocks that store the contents of the le. The rst 12 are direct addresses. That is, they point directly to the rst 12 logical storage blocks of the le contents. If the le is larger than 12 logical blocks, the 13th address points to an indirect block, which contains direct-block addresses instead of le contents. The 14th address points to a double indirect block, which contains addresses of indirect blocks. The 15th address is for triple indirect addresses. The following gure shows this chaining of address blocks starting from the inode.
Inode
Address array
Data Blocks
Data blocks, also called storage blocks, contain the rest of the space that is allocated to the le system. The size of these data blocks is determined when a le system is created. By default, data blocks are allocated in two sizes: an 8-Kbyte logical block size, and a 1-Kbyte fragment size. For a regular le, the data blocks contain the contents of the le. For a directory, the data blocks contain entries that give the inode number and the le name of the les in the directory.
Free Blocks
Blocks that are not currently being used as inodes, as indirect address blocks, or as storage blocks are marked as free in the cylinder group map. This map also keeps track of fragments to prevent fragmentation from degrading disk performance. To give you an idea of the structure of a typical UFS le system, the following gure shows a series of cylinder groups in a generic UFS le system.
Chapter 23 UFS File System (Reference) 415
Cylinder Group n
Storage Blocks Superblock Cylinder Group Map Inodes Superblock Cylinder Group Map Inodes Storage Blocks Storage Blocks
Storage Blocks
Logical Block Size on page 416 Fragment Size on page 417 Minimum Free Space on page 417 Rotational Delay on page 418 (Obsolete) Optimization Type on page 418 Number of Inodes (Files) on page 418
For a description of the command options that customize these parameters, see newfs(1M) and mkfs_ufs(1M).
SPARC only You can specify only the 8192-byte block size on the sun-4uTM platform.
To choose the best logical block size for your system, consider both the performance you want and the available space. For most UFS systems, an 8-Kbyte le system provides the best performance, offering a good balance between disk performance and the use of space in primary memory and on disk. As a general rule, to increase efciency, use a larger logical block size for le systems when most of the les are very large. Use a smaller logical block size for le systems when most of the les are very small. You can use the quot -c lesystem command on a le system to display a complete report on the distribution of les by block size. However, the page size set when the le system is created is probably the best size in most cases.
Fragment Size
As les are created or expanded, they are allocated disk space in either full logical blocks or portions of logical blocks called fragments. When disk space is needed for a le, full blocks are allocated rst, and then one or more fragments of a block are allocated for the remainder. For small les, allocation begins with fragments. The ability to allocate fragments of blocks to les, rather than just whole blocks, saves space by reducing fragmentation of disk space that results from unused holes in blocks. You dene the fragment size when you create a UFS le system. The default fragment size is 1 Kbyte. Each block can be divided into 1, 2, 4, or 8 fragments, which results in fragment sizes from 8192 bytes to 512 bytes (for 4-Kbyte le systems only). The lower bound is actually tied to the disk sector size, typically 512 bytes. For multiterabyte le systems, the fragment size must be equal to the le system block size.
Note The upper bound for the fragment is the logical block size, in which case the fragment is not a
fragment at all. This conguration might be optimal for le systems with very large les when you are more concerned with speed than with space. When choosing a fragment size, consider the trade-off between time and space: A small fragment size saves space, but requires more time to allocate. As a general rule, to increase storage efciency, use a larger fragment size for le systems when most of the les are large. Use a smaller fragment size for le systems when most of the les are small.
Free space is important because le access becomes less and less efcient as a le system gets full. As long as an adequate amount of free space exists, UFS le systems operate efciently. When a le system becomes full, using up the available user space, only root can access the reserved free space. Commands such as df report the percentage of space that is available to users, excluding the percentage allocated as the minimum free space. When the command reports that more than 100 percent of the disk space in the le system is in use, some of the reserve has been used by root. If you impose quotas on users, the amount of space available to them does not include the reserved free space. You can change the value of the minimum free space for an existing le system by using the tunefs command.
Rotational Delay
This parameter is obsolete. The value is always set to 0, regardless of the value you specify.
Optimization Type
The optimization type parameter is set to either space or time.
I
Space When you select space optimization, disk blocks are allocated to minimize fragmentation and disk use is optimized. Time When you select time optimization, disk blocks are allocated as quickly as possible, with less emphasis on their placement. When sufcient free space exists, allocating disk blocks is relatively easy, without resulting in too much fragmentation. The default is time. You can change the value of the optimization type parameter for an existing le system by using the tunefs command.
418
Less than or equal to 1 Gbyte Less than 2 Gbytes Less than 3 Gbytes 3 Gbytes up to 1 Tbyte Greater than 1 Tbyte or created with -T option
If you have a le system with many symbolic links, they can lower the average le size. If your le system is going to have many small les, you can give this parameter a lower value. Note, however, that having too many inodes is much better than running out of inodes. If you have too few inodes, you could reach the maximum number of les on a disk slice that is practically empty.
419
420
C H A P T E R
24
2 4
This chapter provides guidelines and planning information for backing up and restoring le systems by using the ufsdump and ufsrestore commands. This is a list of the overview information in this chapter.
I I I I I I I I I
Where to Find Backup and Restore Tasks on page 421 Introduction to Backing Up and Restoring File Systems on page 422 Why You Should Back Up File Systems on page 422 Planning Which File Systems to Back Up on page 423 Choosing the Type of Backup on page 424 Choosing a Tape Device on page 425 High-Level View of Backing Up and Restoring File Systems (Task Map) on page 426 Considerations for Scheduling Backups on page 427 Sample Backup Schedules on page 430
Back up le systems by using the ufsdump command. Create UFS snapshots by using the fssnap command. Restore le systems by using the ufsrestore command. Copy les and directories by using the cpio, dd, pax, and cpio commands.
421
Back up one or more le systems to a local ufsdump tape device or a remote tape device. Create read-only copies of le systems. Back up all le systems for systems on a network from a backup server. Back up and restore an NIS+ master server. Copy, list, and retrieve les on a tape or diskette. Copy the master disk to a clone disk. fssnap Solstice Backup software nisbackup and nisrestore
Chapter 25 or Chapter 28 Chapter 26 Solstice Backup 6.1 Administration Guide System Administration Guide: Naming and Directory Services (NIS+) Chapter 29 Chapter 29 Chapter 27
Restore complete le systems or ufsrestore individual les from removable media to a working directory.
System crashes Accidental deletion of les Hardware failures Natural disasters such as re, hurricanes, or earthquakes Problems when you reinstall or upgrade a system
422
This le system contains the At regular intervals such as weekly or kernel and possibly the /var daily directory. The /var directory contains temporary les, logging les, or status les, and possibly contains frequently updated system accounting and mail les. The /usr and /opt le systems contain software and executables. The /opt directory is either part of root (/) or is its own le system. Occasionally
/export/home slice 7
This le system can contain the More often than root (/) or /usr, perhaps directories and subdirectories of as often as once a day, depending on your sites needs all users on the stand-alone system. The /export le system can contain the kernel and executables for diskless clients. The /var directory contains temporary les, logging les, or status les. As your site requires
423
TABLE 243 File Systems to Back Up for Servers File System to Back Up Description Back Up Interval
Once a day to once a month depending on your sites needs. If you frequently add and remove users and systems on the network, you have to change conguration les in this le system. In this case, you should do a full backup of the root (/) le system at intervals between once a week and once a month. If your site keeps user mail in the /var/mail directory on a mail server, which client systems then mount, you might want to back up root (/) daily. Or, backup the /var directory, if it is a separate le system.
/export slice 3
This le system can contain Once a day to once a month, depending on your the kernel and executables sites needs. for diskless clients. Because the information in this le system is similar to the servers root directory in slice 0, the le system does not change frequently. You need to back up this le system only occasionally, unless your site delivers mail to client systems. Then, you should back up /export more frequently. The /usr and /opt le systems contain software and executables. The /opt directory is either part of root (/) or is its own le system. This le system can contains the home directories of all the users on the system. The les in this le system are volatile. Once a day to once a month, depending on your sites needs. These le systems are fairly static unless software is added or removed frequently.
/export/home slice 7
424
TABLE 244 Differences Between Types of Backups Backup Type Result Advantages Disadvantages
Full
Requires large numbers of backup tapes that take a long time to write. Takes longer to retrieve individual les because the drive has to move sequentially to the point on the tape where the le is located. You might have to search multiple tapes. System performance might degrade while the snapshot is created. Finding which incremental tape contains a le can take time. You might have to go back to the last full backup.
Snapshot
Incremental
Copies only those les in the Easier to retrieve small specied le system that changes in le systems have changed since a previous backup
1/2-inch reel tape 2.5-Gbyte 1/4-inch cartridge (QIC) tape DDS3 4-mm cartridge tape (DAT) 14-Gbyte 8-mm cartridge tape DLT 7000 1/2-inch cartridge tape
140 Mbytes (6250 bpi) 2.5 Gbytes 1224 Gbytes 14 Gbytes 3570 Gbytes
425
Task
Description
For Instructions
1. Identify the le systems to back up. 2. Determine the type of backup. 3. Create the backup.
Identify which le systems need to be backed Planning Which File Systems up on a daily, weekly, or monthly basis. to Back Up on page 423 Determine the type of backup you need for the le systems at your site. Use one of the following methods: If you want to have full and incremental Chapter 25 backups of your le systems, use the ufsdump command. If you want to create a snapshot of a le system while it is active and mounted, consider using the fssnap command. Chapter 26 Choosing the Type of Backup on page 424
If you just want to have full backups of your Chapter 29 personal home directory or smaller, less-important le systems, use the tar, cpio, or pax commands. 4. (Optional) Restore a le system. Select the restoration method that is based on the command used to back up the les or le system: Restore a le system backup that was created with the ufsdump command. Chapter 27
Restore a le system that was created with the Chapter 29 tar, cpio, or pax command. 5. (Optional) Restore the root (/) or /usr le system. Restoring the root (/) or /usr le system is How to Restore the root (/) more complicated than restoring a and /usr File Systems on page noncritical le system. You need to boot from 468 a local CD or from the network while these le systems are being restored.
426
Your need to minimize the number of tapes that are used for backups The time available for doing backups The time available for doing a full restore of a damaged le system The time available for retrieving individual les that are accidentally deleted
Term
Denition
427
Term
Denition
Incremental backup
Copies only those les in the specied le system that have changed since a previous backup. Incremental backup types include the following: I Daily, cumulative Copies a days worth of le changes on Monday. Then, overwrites Mondays backup with le changes from Tuesday, Wednesday, and so on.
I
Daily, incremental Copies a days worth of le changes so that you have distinct tapes of Mondays changes, Tuesdays changes, and so on. Weekly cumulative Copies the les that have changed during the week and includes the previous weeks le changes. Weekly incremental Copies the les that have changed during the week since the previous weekly backup.
To restore different versions of les (for example, le systems that are used for word processing)
Do daily incremental backups every working day. Do not reuse the same tape for daily incremental backups.
This schedule saves all les modied that day, as well as those les still on disk that were modied since the last backup of a lower level. However, with this schedule, you should use a different tape each day because you might otherwise be unable to restore the needed version of the le. For example, a le that changed on Tuesday, and again on Thursday, goes onto Fridays lower-level backup appearing as it did Thursday night, not Tuesday night. If a user needs the Tuesday version, you cannot restore it unless you have a Tuesday backup tape (or a Wednesday backup tape). Similarly, a le that is present on Tuesday and Wednesday, but removed on Thursday, does not appear on the Friday lower-level backup.
428
TABLE 246 Guidelines for Backup Schedules File Restoration Need Backup Interval
(Continued)
Comments
To quickly restore a complete le system To back up a number of le systems on the same server To minimize the number of tapes used
Do lower-level backups more frequently. Consider staggering the schedule for different le systems.
This way youre not doing all level 0 backups on the same day.
Increase the level of incremental Only changes from day to day are saved backups that are done across the on each daily tape. week. Increase the level of backups that are done at the end of the week. Put each days and weeks incremental backups onto the same tape. Put each days and weeks incremental backups onto the same tape. Only changes from week to week (rather than the entire month) are saved on the weekly tapes.
To do so, use the no rewind option of the ufsdump command, such as specifying /dev/rmt/0n.
429
Monthly 0
Monday 9
Tuesday 9
Wednesday 9
Thursday 9
Friday 5
In the preceding example, you could have used other numbers in the 19 range to produce the same results. The key is using the same number Monday through Thursday, with any lower number on Friday. For example, you could have specied levels 4, 4, 4, 4, 2 or 7, 7, 7, 7, 5.
In the preceding example, you could have used the sequence 6, 7, 8, 9 followed by 2, or 5, 6, 7, 8 followed by 3. Remember, the numbers themselves have no dened meaning. You attribute meaning by ordering them in a specied sequence, as described in the examples.
Each day, all les that have changed since the lower-level backup at the end of the previous week are saved. For each weekday level 9 backup, the previous level 0 or level 5 backup is the closest backup at a lower level. Therefore, each weekday tape contains all the les that changed since the end of the previous week or the initial level 0 backup for the rst week. For each Friday level 5 backup, the closest lower-level backup is the level 0 backup done at the beginning of the month. Therefore, each Fridays tape contains all the les changed during the month up to that point.
TABLE 247 Daily Cumulative/Weekly Cumulative Backup Schedule Floating Mon Tues Wed Thurs Fri
0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 5 5 5 5
The following table shows how the contents of the tapes can change across two weeks with the daily cumulative, weekly cumulative schedule. Each letter represents a different le.
TABLE 248 Contents of Tapes for Daily Cumulative/Weekly Cumulative Backup Schedule Mon Tues Wed Thurs Fri
Week 1 Week 2
ab g
abc gh
abcd ghi
abcde ghij
abcdef abcdefghijk
One tape for the level 0 backup Four tapes for Fridays One or four daily tapes
If you need to restore a complete le system, you need the following tapes:
I
I I
The most recent Friday tape The most recent daily tape since the last Friday tape, if any
0 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 3 4 5 6
The following table shows how the contents of the tapes can change across two weeks with the daily cumulative, weekly incremental backup schedule. Each letter represents a different le.
TABLE 2410 Contents of Tapes for Daily Cumulative, Weekly Incremental Backup Schedule Mon Tues Wed Thurs Fri
Week 1 Week 2
ab g
abc gh
abcd ghi
abcde ghij
abcdef ghijk
Tape Requirements for the Daily Cumulative, Weekly Incremental Backup Schedule
With this schedule, you need six tapes if you want to reuse daily tapes. However, you need nine tapes if you want to use four different daily tapes:
I I I
One tape for the level 0 backup Four tapes for Fridays One or four daily tapes
If you need to restore a complete le system, you need the following tapes:
I I I
The level 0 tape All the Friday tapes The most recent daily tape since the last Friday tape, if any
432
0 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 2 2 2 2
The following table shows how the contents of the tapes can change across two weeks with the daily incremental, weekly cumulative schedule. Each letter represents a different le.
TABLE 2412 Contents of Tapes for Daily Incremental, Weekly Cumulative Backup Schedule Mon Tues Wed Thurs Fri
Week 1 Week 2
ab jkl
cd m
efg no
hi pq
1 tape for the level 0 backup 4 tapes for all the Friday backups 4 or 16 daily tapes
If you need to restore the complete le system, you need the following tapes:
I I I
The level 0 tape The most recent Friday tape All the daily tapes since the last Friday tape, if any
433
1st Sunday 1st Sunday 1st Sunday 1st Sunday 1st Monday 1st Tuesday 1st Wednesday 1st Thursday 1st Friday 1st Saturday
0 0 0 0 9 9 5 9 9 5 0 0 0 0 9 9 5 9 9 5 0 0 0
n tapes n tapes n tapes n tapes A B C D E F n tapes n tapes n tapes n tapes G H I J K L n tapes n tapes n tapes
2nd Sunday 2nd Sunday 2nd Sunday 2nd Sunday 2nd Monday 2nd Tuesday 2nd Wednesday 2nd Thursday 2nd Friday 2nd Saturday
434
TABLE 2413 Example of Monthly Backup Schedule for a Server Directory Date Dump Level
(Continued)
Tape Name
/export/home
3rd Sunday 3rd Monday 3rd Tuesday 3rd Wednesday 3rd Thursday 3rd Friday 3rd Saturday
0 9 9 5 9 9 5 0 0 0 0 9 9 5 9 9 5
4th Sunday 4th Sunday 4th Sunday 4th Sunday 4th Monday 4th Tuesday 4th Wednesday 4th Thursday 4th Friday 4th Saturday
With this schedule, you use 4n tapes, the number of tapes needed for 4 full backups of the root (/), /usr, /export, and /export/home le systems. Also, you need 24 additional tapes for the incremental backups of the /export/home le systems. This schedule assumes that each incremental backup uses one tape and that you save the tapes for a month. Heres how this schedule works: 1. On each Sunday, do a full backup (level 0) of the root (/), /usr, /export, and /export/home le systems. Save the level 0 tapes for at least three months. 2. On the rst Monday of the month, use tape A to do a level 9 backup of the /export/home le system. The ufsdump command copies all les changed since the previous lower-level backup. In this case, the previous lower-level backup is the level 0 backup that you did on Sunday. 3. On the rst Tuesday of the month, use tape B to do a level 9 backup of the /export/home le system. Again, the ufsdump command copies all les changed since the last lower-level backup, which is Sundays level 0 backup.
435
4. On the rst Wednesday of the month, use tape C to do a level 5 backup of the /export/home le system. The ufsdump command copies all les that changed since Sunday. 5. Do the Thursday and Friday level 9 backups of the /export/home le system on tapes D and E. The ufsdump command copies all les that changed since the last lower-level backup, which is Wednesdays level 5 backup. 6. On the rst Saturday of the month, use tape F to do a level 5 backup of /export/home. The ufsdump command copies all les changed since the previous lower-level backup (in this case, the level 0 backup you did on Sunday). Store tapes AF until the rst Monday of the next four-week period, when you use them again. 7. Repeat steps 16 for the next three weeks, using tapes GL and 4n tapes for the level 0 backup on Sunday, and so on. 8. For each four-week period, repeat steps 17, using a new set of tapes for the level 0 backups and reusing tapes AX for the incremental backups. The level 0 tapes could be reused after three months. This schedule lets you save les in their various states for a month. This plan requires many tapes, but ensures that you have a library of tapes to draw upon. To reduce the number of tapes, you could reuse Tapes AF each week.
436
C H A P T E R
25
2 5
This chapter describes the procedures for backing up le systems by using the ufsdump command. For information on these procedures, see Backing Up Files and File System (Task Map) on page 437. For overview information about performing backups, see Chapter 24. For information about backing up individual les to diskettes, see Chapter 29. For additional information on the ufsdump command, see Chapter 28.
Identify the le systems, the type of backup, and the tape device to be used for the backups.
Preparing for File System Backups on page 438 How to Determine the Number of Tapes Needed for a Full Backup on page 439 How to Back Up a File System to Tape on page 440
2. Determine the number of Determine the number of tapes that are tapes needed to back up a le needed for a full backup of a le system. system. 3. Back up le systems. Perform a full backup of le systems to get baseline copies of all les. Perform an incremental backup of le systems based on whether keeping copies of les that have changed on a daily basis is important at your site.
437
The le systems to back up The type of backup (full or incremental) to perform A backup schedule A tape drive
For more information, see Chapter 24. This section describes two other tasks you might need to perform before you back up le systems:
I I
Finding the names of le systems to back up Determining the number of tapes that are needed for a full backup
M
1
2 3
Look in the mount point column for the name of the le system. Use the directory name listed in the mount point column when you back up the le system.
Example 251
1 1 2 2 -
438
1 2
Use the S option to display the estimated number of bytes that are needed to do the backup if this is the rst backup of the le system. Use the 0S option to display the estimated number of bytes that are needed to do the backup if this is not the rst backup of the le system.
3
Divide the estimated size by the capacity of the tape to determine how many tapes you need. For a list of tape capacities, see Table 245.
Example 252
Use single-user mode or unmount the le system, unless you are creating a snapshot of a le system. For information about UFS snapshots, see Chapter 26. Be aware that backing up le systems when directory-level operations (such as creating, removing, and renaming les) and le-level activity are occurring simultaneously means that some data will not be included in the backup. You can run the ufsdump command from a single system and remotely back up groups of systems across the network through remote shell or remote login. In addition, you can direct the output to the system on which the tape device is located. Typically, the tape device is located on the system from which you run the ufsdump command, but it does not have to be. Another way to back up les to a remote device is to pipe the output from the ufsdump command to the dd command. For information about using the dd command, see Chapter 29.
If you are doing remote backups across the network, the system with the tape device must have entries in its /.rhosts le for each client that will be using the device. Also, the system that initiates the backup must be included in the /.rhosts le on each system that it will back up.
439
1 2
Become superuser or assume an equivalent role. Bring the system to run level S (single-user mode). For example:
# shutdown -g30 -y
The fsck -m command checks for the consistency of le systems. For example, power failures can leave les in an inconsistent state. For more information on the fsck command, see Chapter 22.
4
If you need to back up le systems to a remote tape drive, follow these steps: a. On the system to which the tape drive is attached (the tape server), add the following entry to its /.rhosts le:
host root
The host entry species the name of the system on which you will run the ufsdump command to perform the backup. b. On the tape server, verify that the host added to the /.rhosts le is accessible through the name service.
5
Identify the device name of the tape drive. The default tape drive is the /dev/rmt/0 device.
6 7
Insert a tape that is write-enabled into the tape drive. Back up le systems.
# ufsdump options arguments lenames
You can back up le systems or directories, or les within le systems. For information on backing up individual les, see tar(1) or cpio(1). The following examples show how to use the most common ufsdump options and arguments:
I I I
440
Example 256
If prompted, remove the tape and insert the next tape volume. Label each tape with the volume number, dump level, date, system name, disk slice, and le system. Bring the system back to run level 3 by pressing Control-D. Verify that the backup was successful.
# ufsrestore tf device-name
Example 253
0 species a 0 level dump (or a full backup). u species that the /etc/dumpdates le is updated with the date of this backup. c identies a cartridge tape device. f /dev/rmt/0 identies the tape device. / is the le system being backed up.
For example:
# init 0 ok boot -s # ufsdump 0ucf /dev/rmt/0 / DUMP: Date of this level 0 dump: Wed Jul 28 16:13:52 2004 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 363468 blocks (177.47MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: Tape rewinding DUMP: 369934 blocks (180.63MB) on 1 volume at 432 KB/sec DUMP: DUMP IS DONE DUMP: Level 0 dump on Wed Jul 28 16:13:52 2004 # ufsrestore tf /dev/rmt/0 2 . 3 ./lost+found
Chapter 25 Backing Up Files and File Systems (Tasks) 441
./usr ./export ./export/home ./var ./var/sadm ./var/sadm/install ./var/sadm/install/admin ./var/sadm/install/admin/default ./var/sadm/install/logs ./var/sadm/install/logs/SUNWmpatchmgr ./var/sadm/install/logs/Additional_Software_install... ./var/sadm/install/logs/Additional_Software_install... ./var/sadm/install/.lockfile ./var/sadm/install/install.db ./var/sadm/install/special_contents ./var/sadm/install/contents . . . # (Press Control-D to bring system to run level 3) Example 254
9 species a 9 level dump (or an incremental backup). u species that the /etc/dumpdates le is updated with the date of this backup. c identies a cartridge tape device. f /dev/rmt/0 identies the tape device. / is the le system being backed up.
# init 0 ok boot -s # ufsdump 9ucf /dev/rmt/0 / DUMP: Date of this level 9 dump: Wed Jul 28 14:26:50 2004 DUMP: Date of last level 0 dump: Wed Jul 28 11:15:41 2004 DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 335844 blocks (163.99MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 335410 blocks (163.77MB) on 1 volume at 893 KB/sec DUMP: DUMP IS DONE DUMP: Level 9 dump on Wed Jul 28 14:30:50 2004
442 System Administration Guide: Devices and File Systems November 2006
# ufsrestore tf /dev/rmt/0 2 . 3 ./lost+found 5696 ./usr 11392 ./var 17088 ./export 22784 ./export/home 28480 ./opt 5697 ./etc 11393 ./etc/default 11394 ./etc/default/sys-suspend 11429 ./etc/default/cron 11430 ./etc/default/devfsadm 11431 ./etc/default/dhcpagent 11432 ./etc/default/fs 11433 ./etc/default/inetinit 11434 ./etc/default/kbd 11435 ./etc/default/nfslogd 11436 ./etc/default/passwd 11437 ./etc/default/tar . . .
Example 255
0 species that this is a 0 level dump (or a full backup). u species that the /etc/dumpdates le is updated with the date of this backup. c identies a cartridge tape device. f /dev/rmt/0 identies the tape device. /export/home/kryten is the directory being backed up.
# ufsdump 0ucf /dev/rmt/0 /export/home/kryten DUMP: Date of this level 0 dump: Wed Jul 28 15:02:48 2004 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c0t0d0s7 (starbug:/export/home) to /dev/rmt/0. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 2412 blocks (1.18MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 2392 blocks (1.17MB) on 1 volume at 4241 KB/sec DUMP: DUMP IS DONE
Chapter 25 Backing Up Files and File Systems (Tasks) 443
# ufsrestore tf /dev/rmt/0 232 ./kryten 233 ./kryten/filea 234 ./kryten/fileb 235 ./kryten/filec 236 ./kryten/letters 237 ./kryten/letters/letter1 238 ./kryten/letters/letter2 239 ./kryten/letters/letter3 240 ./kryten/reports 241 ./kryten/reports/reportA 242 ./kryten/reports/reportB 243 ./kryten/reports/reportC #
Example 256
0 species a 0 level dump (or a full backup). u species that the /etc/dumpdates le is updated with the date of this backup. c identies a cartridge tape device. f earth:/dev/rmt/0 identies the remote system name and tape device. /export/home is the le system being backed up.
# ufsdump 0ucf earth:/dev/rmt/0 /export/home DUMP: Date of this level 0 dump: Wed Jul 28 15:52:59 2004 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c0t0d0s7 (mars:/export/home) to earth:/dev/rmt/0. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Writing 63 Kilobyte records DUMP: Estimated 8282 blocks (4.04MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: Tape rewinding DUMP: 8188 blocks (4.00MB) on 1 volume at 67 KB/sec DUMP: DUMP IS DONE DUMP: Level 0 dump on Wed Jul 28 15:52:59 2004 # ufsrestore tf earth:/dev/rmt/0 2 . 3 ./lost+found 4 ./kryten 5 ./kryten/filea
444 System Administration Guide: Devices and File Systems November 2006
6 7 8 9 10 11 12 . . . #
445
446
C H A P T E R
26
2 6
This chapter describes how to create and back up UFS snapshots. For information on the procedures associated with creating UFS snapshots, see Using UFS Snapshots (Task Map) on page 447. For overview information about performing backups, see Chapter 24.
1. Create a UFS snapshot. 2. Display UFS snapshot information. 3. (Optional) Delete a UFS snapshot. 4. (Optional) Back up a UFS snapshot.
Create a read-only copy of a le system by using the fssnap command. Identify UFS snapshot information such as the raw snapshot device.
How to Create a UFS Snapshot on page 451 How to Display UFS Snapshot Information on page 452
Delete a snapshot that is already backed up or How to Delete a UFS no longer needed. Snapshot on page 453 Choose one of the following backup methods: Create a full backup of a UFS snapshot by using the ufsdump command. Create an incremental backup of a UFS snapshot by using the ufsdump command. How to Create a Full Backup of a UFS Snapshot (ufsdump) on page 454 How to Create an Incremental Backup of a UFS Snapshot (ufsdump) on page 455
447
Task
Description
For Instructions
Back up a UFS snapshot by using the tar command. 5. (Optional) Restore data from a UFS snapshot. Restore the UFS snapshot the same way as you would restore data by using the ufsrestore command.
How to Back Up a UFS Snapshot (tar) on page 455 How to Restore a Complete File System on page 465
The destination path of the backing store les must have enough free space to hold the le system data. The size of the backing store les vary with the amount of activity on the le system. The backing store le location must be different from the le system that is being captured in a snapshot. The backing-store les can reside on any type of le system, including another UFS le system or an NFS le system. Multiple backing-store les are created when you create a snapshot of a UFS le system that is larger than 512 Gbytes. Backing-store les are sparse les. The logical size of a sparse le, as reported by the ls command, is not the same as the amount of space that has been allocated to the sparse le, as reported by the du command.
For more information about creating snapshots for a UFS le system larger than 512 Gbytes, see Creating a Multiterabyte UFS Snapshot on page 450.
The fssnap command gives administrators of non enterprise-level systems the power of enterprise-level tools, such as Sun StorEdgeTM Instant Image, without the large storage demands. The UFS snapshots feature is similar to the Instant Image product. Although UFS snapshots can make copies of large le systems, Instant Image is better suited for enterprise-level systems. UFS snapshots is better suited for smaller systems. Instant Image allocates space equal to the size of the entire le system that is being captured. However, the backing-store le that is created by UFS snapshots occupies only as much disk space as needed. This table describes specic differences between UFS snapshots and Instant Image.
UFS Snapshots
Size of the backing-store le depends on how much data has changed since the snapshot was taken Does not persist across system reboots Works on UFS le systems Available starting with the Solaris 8 1/01 release
Size of the backing-store le equals the size of the entire le system being copied Persists across system reboots Cannot be used with root (/) or /usr le systems Part of Sun StorEdge products
backup to fail. Check the /var/adm/messages le for possible snapshot errors. You can also specify a directory for the backing-store path, which means a backing store le is created in the directory specied. For example, if /var/tmp is specied for the backing-store path, the following backing-store le is created.
/var/tmp/snapshot0
Chapter 26 Using UFS Snapshots (Tasks) 449
If you created one large root (/) le system instead of creating separate le systems for /export/home, /usr, and so on, you will be unable to create a snapshot of those separate le systems. For example, this system does not have a separate le system for /usr as indicated under the Mounted on column:
# df -k /usr Filesystem /dev/dsk/c0t0d0s0
If you attempt to create a snapshot for the /usr le system, you will see a message similar to the following:
# fssnap -F ufs -o bs=/snaps/usr.back.file /usr snapshot error: Invalid backing file path
This message indicates that you cannot have the backing store le on the same le system as the le system being snapped, which is the case for the /usr le system, in this example. For more information, see the fssnap_ufs(1M) man page.
If you specify a backing store le name when the snapshot is created, then the subsequent backing store le names will be interated based on the le name that you specify. The subsequent backing-store les will have the same name, but with the sufxes .2, .3, and so on. If you only specify a backing store le destination (or directory) and not a backing store le name, then multiple backing store le names will be created and iterated with the sufxes .2, .3, and so on.
The fssnap -i command only reports the rst backing store le name even if multiple backing store les have been created. However, the reported backing-store length is the combined sizes of all the backing store les for the snapshot.
Note Backing-store les are sparse les. The logical size of a sparse le, as reported by the ls command, is not the same as the amount of space that has been allocated to the sparse le, as reported by the du command.
450
After you have backed up the snapshot or you would just like to remove the snapshot, you will have to remove the backing store les manually if you did not use the unlink option when the snapshot was created.
For an example of creating a snapshot for a le system that is larger than 512 Gbytes, see Example 262. For more information, see fssnap_ufs(1M).
M
1 2
Make sure that a backing-store le of the same name and location does not already exist.
# ls /backing-store-le
Example 261
The following example shows how to limit the backing-store le to 500 Mbytes.
# fssnap -F ufs -o maxsize=500m,bs=/scratch/usr.back.file /usr /dev/fssnap/1 Example 262
# fssnap -F ufs -o bs=/var/tmp /data2 /dev/fssnap/0 # /usr/lib/fs/ufs/fssnap -i Snapshot number : 0 Block Device : /dev/fssnap/0 Raw Device : /dev/rfssnap/0 Mount point : /data2 Device state : idle Backing store path : /var/tmp/snapshot0 Backing store size : 0 KB Maximum backing store size : Unlimited Snapshot create time : Fri Sep 10 13:13:02 2004 Copy-on-write granularity : 32 KB # ls /var/tmp snapshot0 snapshot0.2 snapshot0.3 snapshot0.4
Become superuser or assume an equivalent role. List all current snapshots. For example:
# /usr/lib/fs/ufs/fssnap -i Snapshot number Block Device Raw Device Mount point Device state Backing store path Backing store size Maximum backing store size Snapshot create time Copy-on-write granularity : : : : : : : : : : 0 /dev/fssnap/0 /dev/rfssnap/0 /export/home idle /var/tmp/home.snap0 0 KB Unlimited Thu Jul 01 14:50:38 2004 32 KB
452
1 2
If you did not use the -o unlink option when you created the snapshot, manually delete the backing-store le.
# rm /le-system/backing-store-le
453
Example 263
1 2
For example:
# /usr/lib/fs/ufs/fssnap -i /usr Snapshot number : 1 Block Device : /dev/fssnap/1 Raw Device : /dev/rfssnap/1 Mount point : /usr Device state : idle Backing store path : /var/tmp/usr.snap0 Backing store size : 0 KB Maximum backing store size : Unlimited Snapshot create time : Thu Jul 01 15:17:33 2004 Copy-on-write granularity : 32 KB
454 System Administration Guide: Devices and File Systems November 2006
For example:
# ufsdump 0ucf /dev/rmt/0 /dev/rfssnap/1 4
Verify that the snapshot has been backed up. For example:
# ufsrestore tf /dev/rmt/0
1 2
Become superuser or assume an equivalent role. Create an incremental backup of a UFS snapshot. For example:
# ufsdump 1ufN /dev/rmt/0 /dev/rdsk/c0t1d0s0 fssnap -F ufs -o raw,bs= /export/scratch,unlink /dev/rdsk/c0t1d0s0
In this example, the -o raw option is used to display the name of the raw device instead of the block device. By using this option, you make it easier to embed the fssnap command in commands (such as the ufsdump command) that require the raw device instead.
3
456
C H A P T E R
27
2 7
This chapter describes how to use the ufsrestore command to restore les and le systems that were backed up by using the ufsdump command. For information on the procedures associated with restoring les and le systems, see Restoring Files and File System Backups (Task Map) on page 457. For information about other commands you can use to archive, restore, copy, or move les and le systems, see Chapter 29. For information about backing up and restoring le systems, see Chapter 24.
Prepare to restore les and le systems. Determine which tapes to use. Restore les.
Identify the le systems or les to be restored, Preparing to Restore Files and the tape device, and how you will restore File Systems on page 458 them. Refer to your backup tapes to nd the date of How to Determine Which the last backup that contains the le or le Tapes to Use on page 459 system that you need to restore. Choose one of the following restore methods: Restore les interactively Use this method when you are unsure of the le names because you can browse the media contents and select individual les and directories. How to Restore Files Interactively on page 460
457
Task
Description
For Instructions
Restore les noninteractively Use this method when you already know the few le names to be restored.
Restore a le system Use this method when How to Restore a Complete you get a new disk drive or as part of a File System on page 465 recovery procedure. Restore the root (/) or /usr le systems. Restoring the root (/) or /usr le systems involves booting the system from a local CD or the network. How to Restore the root (/) and /usr File Systems on page 468
The tapes (or diskettes) you need to restore from The raw device name on which you want to restore the le system The type of tape device you will use The device name (local or remote) for the tape device
458
M
1 2
t a archive-name ./path/lename
Lists each le on the tape. Reads the table of contents from the online archive le instead of from the tape. Identies the online archive le name. Identies the le name or le names you are looking for on the online archive. If successful, the ufsrestore command prints out the inode number and le name. If unsuccessful, ufsrestore prints an error message.
Insert the media that contains the les to be restored in the drive and verify the correct media.
# ufsrestore tf /dev/rmt/n ./path/lename ./path/lename
Be sure to use the complete path for each lename. If a le is in the backup, its name and inode number are listed. Otherwise, a message states that the le is not on the volume.
5
If you have multiple backup les on the same tape, position the tape at the backup le you want to use.
# ufsrestore xfs /dev/rmt/n tape-number
Example 271
The following example shows how to verify that the /etc/passwd le is on the backup tape.
# ufsrestore tf /dev/rmt/0 ./etc/passwd
M
1 2 3 4
460
b. Change to a directory.
ufsrestore> cd directory-name
d. (Optional) Remove any directory or le from the list of les to be restored, if necessary.
ufsrestore> delete lename 7
Type the volume number and press Return. If you have only one volume, type 1 and press Return.
Specify next volume #: 1
The les and directories in the list are extracted and restored to the current working directory.
10
To maintain the mode of the current directory, enter n at the set owner/mode prompt.
set owner/mode for .? [yn] n
You must wait while the ufsrestore command performs its nal cleanup.
11
Verify the restored les. a. List the restored les and directories.
# ls -l
461
b. Check the list to be sure that all the les and directories you specied in the list have been restored.
13
Example 272
462
M
1 2 3 4
x v f /dev/rmt/n lename
Tells ufsrestore to copy specic les or directories in the lename argument. Displays the le names as they are restored. Identies the tape device name. Species one or more le names or directory names, separated by spaces. For example: ./export/home/user1/mail ./export/home/user2/mail.
Type the volume number where les are located. Press Return.
Specify next volume #: 1
To maintain the mode of the current directory, type n and press Return at the set owner/mode prompt.
set owner/mode for .? [yn] n
Verify the restored les. a. List the restored les and directories.
# ls -l
A list of les and directories is displayed. b. Check the list to be sure that all the les and directories you specied in the list have been restored.
9
463
Example 273
Example 274
464
1 2
Or:
# umount /le-system 3
You are asked if you want to construct a new le system on the raw device. Verify that the device-name is correct so that you dont destroy the wrong le system. For more information, see the newfs(1M) man page.
4
465
8 9
Insert the rst volume of the level 0 tape into the tape drive. Restore the les.
# ufsrestore rvf /dev/rmt/n
The dump level 0 backup is restored. If the backup required multiple tapes, you are prompted to load each tape in numeric order.
10
Remove the tape and load the next level tape in the drive. Always restore tapes starting with dump level 0 and continuing until you reach the highest dump level.
11 12
Repeat Step 8 through Step 10 for each dump level, from the lowest to the highest level. Verify that the le system has been restored.
# ls
13
The restoresymtable le that is created and used by the ufsrestore command to check-point the restore is removed.
14
15
16 17
Remove the last tape and insert a new tape that is not write-protected in the tape drive. Make a level 0 backup of the newly restored le system.
# ufsdump 0ucf /dev/rmt/n /dev/rdsk/device-name
A level 0 backup is performed. Always immediately do a full backup of a newly created le system because the ufsrestore command repositions the les and changes the inode allocation.
18
466
Example 275
467
. Add links Set directory mode, owner, and times. Check the symbol table. Check pointing the restore # rm restoresymtable # cd / # umount /mnt # ufsdump 0ucf /dev/rmt/0 /export/home . . . # mount /dev/dsk/c0t0d0s7 /export/home # ls /export/home
M
1 2
5 6
(Optional) Write-protect the tapes for safety. Create the links for the tape device.
# tapes
Remove the tape and load the next level tape in the drive. Always restore tapes starting with dump level 0 and continuing from the lowest to highest dump level.
468
Repeat Step 8 and Step 9 for each additional tape. Verify that the le system has been restored.
# ls
12
The restoresymtable le that is created and used by the ufsrestore command to check-point the restore is removed.
13
14
15
For more information, see the installboot(1M) man page. For an example of using the installboot command on a SPARC based system, see Example 276. On an x86 system:
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/cwtxdysz
For more information, see installgrub(1M). For an example of using the installgrub command on an x86 based system, see Example 277.
17
469
18
A dump level 0 backup is performed. Always immediately do a full backup of a newly created le system because the ufsrestore command repositions the les and changes the inode allocation.
19 20
Repeat steps 5 through 16 for the /usr le system, if necessary. Reboot the system.
# init 6
Example 277
470
# /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t3d0s0 stage1 written to partition 0 sector 0 (abs 2016) stage2 written to to partition 0, 227 sectors starting 50 (abs 2066) # ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t3d0s0 # init 6
471
472
C H A P T E R
28
2 8
This chapter contains reference information on the ufsdump and ufsrestore commands. This is a list of the information in this chapter.
I I I I
How the ufsdump Command Works on page 473 Specifying ufsdump Command Options and Arguments on page 477 The ufsdump Command and Security Issues on page 478 Specifying ufsrestore Options and Arguments on page 478
For overview information about performing backups, see Chapter 24. For information about backup tasks, see Chapter 25.
physical end of the media. This method works for most devices. If a device is not able to notify the ufsdump command that only a partial record has been written, a media error occurs as the ufsdump command tries to write another record.
Note DAT devices and 8-mm tape devices detect end-of-media. Cartridge tape devices and 1/2-inch
tape devices do not detect end-of-media. The ufsdump command automatically detects the end-of-media for most devices. Therefore, you do not usually need to use the -c, -d, -s, and -t options to perform multivolume backups. You need to use the end-of-media options when the ufsdump command does not understand the way the device detects the end-of-media. To ensure compatibility with the restore command, the size option can still force the ufsdump command to go to the next tape or diskette before reaching the end of the current tape or diskette.
The le system backed up The dump level of the last backup The day, date, and time of the backup
For example:
# cat /etc/dumpdates /dev/rdsk/c0t0d0s0 /dev/rdsk/c0t0d0s7 /dev/rdsk/c0t0d0s7
0 Wed Jul 28 16:13:52 2004 0 Thu Jul 29 10:36:13 2004 9 Thu Jul 29 10:37:12 2004
When you do an incremental backup, the ufsdump command checks the /etc/dumpdates le to nd the date of the most recent backup of the next lower dump level. Then, this command copies to the media all les that were modied since the date of that lower-level backup. After the backup is complete, a new information line, which describes the backup you just completed, replaces the information line for the previous backup at that level.
474 System Administration Guide: Devices and File Systems November 2006
Use the /etc/dumpdates le to verify that backups are being done. This verication is particularly important if you are having equipment problems. If a backup cannot be completed because of equipment failure, the backup is not recorded in the /etc/dumpdates le. If you need to restore an entire disk, check the /etc/dumpdates le for a list of the most recent dates and levels of backups so that you can determine which tapes you need to restore the entire le system.
Note The /etc/dumpdates le is a text le that can be edited. However, edit it only at your own risk. If you make changes to the le that do not match your archive tapes, you might be unable to nd the tapes (or les) you need.
Local tape drive Local diskette drive Remote tape drive Remote diskette drive Standard output
Use this argument when the destination is not the default local tape drive /dev/rmt/0. If you use the -f option, then you must specify a value for the dump-le argument.
Note The dump-le argument can also point to a le on a local disk or on a remote disk. If done by
Use the no-rewind option if you want to put more than one le onto the tape. If you run out of space during a backup, the tape does not rewind before the ufsdump command asks for a new tape. For a complete description of device-naming conventions, see Backup Device Names on page 502.
You can use the ufsdump and ufsrestore commands in a pipeline to copy a le system by writing to standard output with the ufsdump command and reading from standard input with the ufsrestore command. For example:
# ufsdump 0f - /dev/rdsk/c0t0d0s7 | (cd /home; ufsrestore xf -)
Note When you use the ufsdump command to back up one or more directories or les (rather than a
Automatically calculate the number of tapes or diskettes that are needed for backing up le systems. You can use the dry run mode (S option) to determine how much space is needed before actually backing up le systems. Provide built-in error checking to minimize problems when it backs up an active le system. Back up les that are remotely mounted from a server. Files on the server must be backed up on the server itself. Users are denied permission to run the ufsdump command on les they own that are located on a server.
I I
Is a single string of one-letter option names. Identies option arguments and might consist of multiple strings. The option letters and their associated arguments must be in the same order. Identies the les to back up. These arguments must always come last, each separated by a space.
These options do a level 9 incremental backup to the default tape drive at its preferred density. For a description of the ufsdump options, see ufsdump(1M).
Require superuser access for the ufsdump command. Ensure superuser access entries are removed from /.rhosts les on clients and servers if you are doing centralized backups. For general information on security, see System Administration Guide: Security Services.
options
Is a single string of one-letter option names. You must choose one and only one of these options: i, r, R, t, or x. For a description of the ufsrestore options, see ufsrestore(1M). Follows the option string with the arguments that match the options. The option letters and their associated arguments must be in the same order. Species the le or les to be restored as arguments to the x or t options. These arguments must always come last, separated by spaces.
arguments lenames
478
C H A P T E R
29
2 9
This chapter describes how to copy UFS les and le systems to disk, tape, and diskettes by using various backup commands. This is a list of the step-by-step instructions in this chapter.
I I I I I I I I I I I I I I I
How to Copy a Disk (dd) on page 482 How to Copy Directories Between File Systems (cpio) on page 486 How to Copy Files to a Tape (tar) on page 487 How to List the Files on a Tape (tar) on page 488 How to Retrieve Files From a Tape (tar) on page 489 Copying Files to a Tape With the pax Command on page 490 How to Copy All Files in a Directory to a Tape (cpio) on page 491 How to List the Files on a Tape (cpio) on page 492 How to Retrieve All Files From a Tape (cpio) on page 492 How to Retrieve Specic Files From a Tape (cpio) on page 493 How to Copy Files to a Remote Tape Device (tar and dd) on page 494 How to Extract Files From a Remote Tape Device on page 496 How to Copy Files to a Single Formatted Diskette (tar) on page 497 How to List the Files on a Diskette (tar) on page 498 How to Retrieve Files From a Diskette (tar) on page 498
TABLE 291 When to Use Various Backup Commands Task Command For More Information
Back up le systems to tape. Create a le system snapshot. Restore le systems from tape. Transport les to other systems. Copy les or le systems between disks. Copy les to diskette.
How to Back Up a File System to Tape on page 440 Chapter 26 How to Restore a Complete File System on page 465 Copying Files and File Systems to Tape on page 487 How to Copy a Disk (dd) on page 482 How to Copy Files to a Single Formatted Diskette (tar) on page 497
Command Name
The following table describes the advantages and disadvantages of some of these commands.
480
TABLE 293 Advantages and Disadvantages of tar, pax, and cpio Commands Command Function Advantages
I
Disadvantages
I
tar
Available on most UNIX operating systems Public domain versions are readily available
Is not aware of le system boundaries Length of full path name cannot exceed 255 characters Cannot be used to create multiple tape volumes
pax
Use to copy les, special les, or le systems that require multiple tape volumes. Or, use when you want to copy les to and from POSIX-compliant systems. Use to copy les, special les, or le systems that require multiple tape volumes. Or, use when you want to copy les from systems running current Solaris releases systems to systems running SunOS 4.0/4.1 releases.
Better portability than the tar or cpio commands for POSIX-compliant systems Multiple vendor support
Same disadvantages as the tar command, except that the pax command can create multiple tape volumes.
cpio
The command syntax is Packs data onto tape more efciently than the more difcult than the tar or pax commands. tar command Skips over any bad spots in a tape when restoring Provides options for writing les with different header formats, such as ( tar, ustar, crc, odc, bar), for portability between different system types Creates multiple tape volumes
The following sections describes step-by-step instructions and examples of how to use these commands.
volcopy dd
The next section describes how to use the dd command to copy le systems between disks.
You can specify a device name in place of standard input or standard output, or both. In this example, the contents of the diskette are copied to a le in the /tmp directory:
$ dd < /floppy/floppy0 > /tmp/output.file 2400+0 records in 2400+0 records out
The dd command reports on the number of blocks it reads and writes. The number after the + is a count of the partial blocks that were copied. The default block size is 512 bytes. The dd command syntax is different from most other commands. Options are specied as keyword=value pairs, where keyword is the option you want to set and value is the argument for that option. For example, you can replace standard input and standard output with this syntax:
$ dd if=input-le of=output-le
To use the keyword=value pairs instead of the redirect symbols, you would type the following:
$ dd if=/floppy/floppy0 of=/tmp/output.file
Do not use this procedure to copy a disk that is under the control of a volume manager. The primary methods for copying UFS le system data from one disk or system to another disk or system is by using the ufsdump and ufsrestore commands. For more information on using these commands, see Chapter 24. You can clone systems by creating a ash archive and copying it to destination systems. For more information about creating a ash archive, see Solaris 10 Installation Guide: Solaris Flash Archives (Creation and Installation). If you are copying a disk with an EFI disk label, see Example 292.
If you are still considering copying a disk with the dd command keep the following cautions in mind:
482 System Administration Guide: Devices and File Systems November 2006
I I I
Make sure that the source disk and destination disk have the same disk geometry. Check the UFS le systems on the disk to be copied with the fsck utility. Make sure the system is in single-user mode when copying a disk with the dd command.
1 2
Become superuser or assume an equivalent role. (Optional) Create the /reconfigure le so that the system will recognize the destination disk to be added when it reboots, if necessary.
# touch /reconfigure
4 5
Represents the overlap slice of the master disk device, usually slice 2. Represents the overlap slice of the destination disk device, usually slice 2. Identies the block size, such as 128 Kbytes or 256 Kbytes. A large block size decreases the time it takes to copy the disk.
10
Using a text editor, edit the destination disks /etc/vfstab le to reference the correct device names. For example, change all instances of c0t3d0 to c0t1d0.
483
11
12
13
14
Boot from the destination disk again and provide its system information, such as host name, time zone, and so forth.
# boot diskn
17
After the system is booted, log in as superuser to verify the system information.
hostname console login:
Example 291
484
# # # #
Example 292
2. Pipe the prtvtoc output of the disk to be copied to the fmthard command to create a new label for the cloned disk. For example:
# prtvtoc /dev/rdsk/c0t0d0 | fmthard -s - /dev/rdsk/c0t2d0
For more information about EFI disk labels, see Multiterabyte Disk Support With EFI Disk Label on page 188.
485
M
1 2
Copy the directory tree from lesystem1 to lesystem2 by using a combination of the find and cpio commands.
# find . -print -depth | cpio -pdm lesystem2
. -print -depth -p -d -m
Starts in the current working directory. Prints the le names. Descends the directory hierarchy and prints le names from the bottom up. Creates a list of les. Creates directories as needed. Sets the correct modication times on directories.
For more information, see cpio(1). The les from the directory name you specify are copied. The symbolic links are preserved. You might also specify the -u option. This option forces an unconditional copy. Otherwise, older les do not replace newer les. This option might be useful if you want an exact copy of a directory, and some of the les being copied might already exist in the target directory.
4
Verify that the copy was successful by displaying the contents of the destination directory.
# cd lesystem2 # ls
Example 293
486
Copying les to a tape with the -c option to the tar command destroys any les already on the tape at or beyond the current tape position. You can use le name substitution wildcards (? and *) as part of the le names that you specify when copying les. For example, to copy all documents with a .doc sufx, type *.doc as the le name argument. You cannot use le name substitution wildcards when you extract les from a tar archive.
M
1 2 3
c v f /dev/rmt/n lenames
Indicates that you want to create an archive. Displays the name of each le as it is archived. Indicates that the archive should be written to the specied device or le. Indicates the les and directories that you want to copy. Separate multiple les with spaces.
The le names that you specify are copied to the tape, overwriting any existing les on the tape.
4
Remove the tape from the drive. Write the names of the les on the tape label.
487
For more information on listing les on a tar tape, see How to List the Files on a Tape (tar) on page 488.
Example 294
M
1 2
t v f /dev/rmt/n
Example 295
Lists the table of contents for the les on the tape. Used with the t option, and provides detailed information about the les on the tape. Indicates the tape device.
28 28 28 28
488
M
1 2 3
x v f /dev/rmt/n lenames
Indicates that the les should be extracted from the specied archive le. All les on the tape in the specied drive are copied to the current directory. Displays the name of each le as it is retrieved. Indicates the tape device that contains the archive. Species a le to retrieve. Separate multiple les with spaces.
Example 296
Troubleshooting
The names of the les extracted from the tape must exactly match the names of the les that are stored on the archive. If you have any doubts about the names or paths of the les, rst list the les on the tape. For instructions on listing the les on the tape, see How to List the Files on a Tape (tar) on page 488.
489
-w -f /dev/rmt/n lenames
Enables the write mode. Identies the tape drive. Indicates the les and directories that you want to copy. Separate multiple les with spaces.
Remove the tape from the drive. Write the names of the les on the tape label.
Example 297
490
ls cpio -oc
Provides the cpio command with a list of le names. Species that the cpio command should operate in copy-out mode (-o) and write header information in ASCII character format (-c). These options ensure portability to other vendors systems. Species the output le.
> /dev/rmt/n
All les in the directory are copied to the tape in the drive you specify, overwriting any existing les on the tape. The total number of blocks that are copied is shown.
4
-c -i -v -t < /dev/rmt/n
5
Species that the cpio command should read les in ASCII character format. Species that the cpio command should operate in copy-in mode, even though the command is only listing les at this point. Displays the output in a format that is similar to the output from the ls -l command. Lists the table of contents for the les on the tape in the tape drive that you specify. Species the input le of an existing cpio archive.
Remove the tape from the drive. Write the names of the les on the tape label.
Example 298
491
< /dev/rmt/0 1 root other 1 root other 1 root other 2 root other 2 root other
0 0 0 0 0
28 28 28 28 28
Insert an archive tape into the tape drive. List the les on the tape.
$ cpio -civt < /dev/rmt/n
Example 299
0 0 0 0 0
28 28 28 28 28
492
Caution The use of absolute path names can be dangerous because you might overwrite existing les on your system.
1 2 3
Change to the directory where you want to put the les. Insert the tape into the tape drive. Extract all les from the tape.
$ cpio -icvd < /dev/rmt/n
-i -c -v -d < /dev/rmt/n
4
Extracts les from standard input. Species that the cpio command should read les in ASCII character format. Displays the les as they are retrieved in a format that is similar to the output from the ls command. Creates directories as needed. Species the output le.
Example 2910
M
1 2 3
493
-i -c -v "*le"
Extracts les from standard input. Species that the cpio command should read headers in ASCII character format. Displays the les as they are retrieved in a format that is similar to the output from the ls command. Species that all les that match the pattern are copied to the current directory. You can specify multiple patterns, but each pattern must be enclosed in double quotation marks. Species the input le.
< /dev/rmt/n
Example 2911
494
b. An entry for the remote system must be in the local systems /etc/inet/hosts le or in the name service hosts le.
2
To test whether you have the appropriate permission to execute a remote command, try the following:
$ rsh remotehost echo test
If test is echoed back to you, you have permission to execute remote commands. If Permission denied is echoed back to you, check your setup as described in Step 1.
3 4 5
Change to the directory where you want to put the les. Insert the tape into the tape drive. Copy the les to a remote tape drive.
$ tar cvf - lenames | rsh remote-host dd of=/dev/rmt/n obs=block-size
Creates a tape archive, lists the les as they are archived, and species the tape device. Provides additional information about the tar le entries. Represents a placeholder for the tape device. Identies the les to be copied. Separate multiple les with spaces. Pipes the tar commands output to a remote shell. Represents the output device. Represents the blocking factor.
Remove the tape from the drive. Write the names of the les on the tape label.
Example 2912
495
M
1 2
Indicates a remote shell that is started to extract the les from the tape device by using the dd command. Indicates the input device. Pipes the output of the dd command to the tar command, which is used to restore the les.
Example 2913
496
Copying les to a formatted diskette by using the tar -c command destroys any les that are already on the diskette. A diskette that contains a tar image is not mountable. If you need a multiple-volume interchange utility, use the cpio command. The tar command is only a single-volume utility.
I I
M
1 2 3
The le names that you specify are copied to the diskette, overwriting any existing les on the diskette.
6
For more information on listing les, see How to List the Files on a Diskette (tar) on page 498.
7 8
Remove the diskette from the drive. Write the names of the les on the diskette label.
497
Example 2914
M
1 2
Example 2915
M
1 2 3
498
Example 2916
The following example shows how to retrieve an individual le from a diskette. The le is extracted from the diskette and placed in the current working directory.
$ $ x $ volcheck tar xvf /vol/dev/aliases/floppy0 evaluation.doc evaluation.doc, 44032 bytes, 86 tape blocks ls -l
499
500
C H A P T E R
30
3 0
This chapter describes how to manage tape drives in the SolarisTM Operating System (Solaris OS). This is a list of the step-by-step instructions in this chapter.
I I I
How to Display Tape Drive Status on page 504 Retensioning a Magnetic Tape Cartridge on page 505 Rewinding a Magnetic Tape Cartridge on page 505
Choosing Which Media to Use on page 501 Backup Device Names on page 502 Displaying Tape Drive Status on page 504 Guidelines for Drive Maintenance and Media Handling on page 505
1/2-inch reel tape 1/4-inch streaming cartridge tape 8-mm cartridge tape 4-mm cartridge tape (DAT)
You can perform backups with diskettes, but doing so is time-consuming and cumbersome. The media that you choose depends on the availability of the equipment that supports it and of the media (usually tape) that you use to store the les. Although you must do the backup from a local system, you can write the les to a remote device. The following table shows typical tape devices that are used for backing up le systems. The storage capacity for each device depends on the type of drive and the data being written to the tape.
501
1/2-inch reel tape 2.5-Gbyte 1/4-inch cartridge (QIC) tape DDS3 4-mm cartridge tape (DAT) 14-Gbyte 8-mm cartridge tape DLT 7000 1/2-inch cartridge tape
140 Mbytes (6250 bpi) 2.5 Gbytes 1224 Gbytes 14 Gbytes 3570 Gbytes
Tape Diskette
/dev/rmt/n /vol/dev/rdiskette0/unlabeled
502
If you dont specify the density, a tape drive typically writes at its preferred density. The preferred density usually means the highest density the tape drive supports. Most SCSI drives can automatically detect the density or format on the tape and read it accordingly. To determine the different densities that are supported for a drive, look at the /dev/rmt subdirectory. This subdirectory includes the set of tape device les that support different output densities for each tape. Also, a SCSI controller can have a maximum of seven SCSI tape drives.
First drive, rewind First drive, no rewind Second drive, rewind Second drive, no rewind
First drive, low density, rewind First drive, low density, no rewind Second drive, medium density, rewind Second drive, medium density, no rewind
The additional density values are shown in Backup Device Names on page 502.
Chapter 30 Managing Tape Drives (Tasks) 503
M
1 2
Repeat steps 12, substituting tape drive numbers 0, 1, 2, 3, and so on to display information about all available tape drives.
Example 301
residual= 0
retries= 0
The following example shows the status for an Exabyte tape drive (/dev/rmt/1):
$ mt -f /dev/rmt/1 status Exabyte EXB-8200 8mm tape drive: sense key(0x0)= NO Additional Sense residual= 0 retries= 0 file no= 0 block no= 0
The following example shows a quick way to poll a system and locate all of its tape drives:
$ for drive in 0 1 2 3 4 5 6 7 > do > mt -f /dev/rmt/$drive status > done Archive QIC-150 tape drive: sense key(0x0)= No Additional Sense file no= 0 block no= 0 /dev/rmt/1: No such file or directory /dev/rmt/2: No such file or directory /dev/rmt/3: No such file or directory /dev/rmt/4: No such file or directory
504
residual= 0
retries= 0
/dev/rmt/5: No such file or directory /dev/rmt/6: No such file or directory /dev/rmt/7: No such file or directory $
Copying some les to the tape, reading the les back, and then comparing the original les with the copied les. Using the -v option of the ufsdump command to verify the contents of the media with the source le system. The le system must be unmounted or completely idle for the -v option to be effective.
505
Be aware that hardware can fail in ways that the system does not report. Always label your tapes after a backup. If you are using a backup strategy similar to the strategies suggested in Chapter 24, you should indicate on the label Tape A, Tape B, and so forth. This label should never change. Every time you do a backup, make another tape label that contains the following information:
I I I I I
The backup date The name of the machine and le system that is backed up The backup level The tape number (1 of n, if the backup spans multiple volumes) Any information specic to your site
Store your tapes in a dust-free safe location, away from magnetic equipment. Some sites store archived tapes in reproof cabinets at remote locations. You should create and maintain a log that tracks which media (tape volume) stores each job (backup) and the location of each backed-up le.
506
Index
B
backing up and restoring le systems commands for, 422 denition, 422 choosing le systems to, 423 full and incremental, denition, 424 preparing for (overview), 438-439 reasons for, 422 types of, 424 backup device names, 502-503 record of incremental, 474 backup schedules daily cumulative, weekly cumulative backups, 431 daily cumulative, weekly incremental backups, 432 daily incremental, weekly cumulative backups, 433 examples, 430, 436 for a server, 434-436 guidelines, 428 guidelines for, 427 using dump levels for, 429 bad block numbers, 396 bad inode number, 397 bad superblock, 405 block disk device interface denition, 181 when to use, 181 blocks bad, 396 boot, 413 data, 415 directory data, 397 duplicate, 396
A
accessing disk devices, 180 iSCSI disks (how to), 262 removable media (how to), 46 tape devices, 183 adding a disk (overview) SPARC, 228 x86, 238-251 a SCSI device to a SCSI bus (how to), 94 a USB camera (how to), 137 a USB mass storage device without vold running (how to), 137 entry to /etc/vfstab le (how to), 343 PCI adapter card (how to), 103 swap to vfstab, 385 USB audio devices (how to), 154 VPPA communication service (how to), 174 allocated inodes, 395 archiving, les to multiple diskettes with cpio command (how to), 499 autoconguration process, 75 autofs, 324 automounting, and /home, 324
507
Index
blocks (Continued) free, 415-416 indirect, 397 logical size, 416-417 regular data, 398 special inodes, 395 boot block, 413 BSD Fat Fast File system, 309 bus-oriented disk controllers, 182 bytes (number per inode), 418-419
C
CacheFS le systems (overview), 355 checking with fsck command (example of), 366 collecting CacheFS statistics (overview), 376 creating (how to), 357 creating a packing list (how to), 370 deleting (how to), 365 displaying information about (how to), 363 displaying packed les (example of), 368 displaying packed les (how to), 368 locating CacheFS log le, 378 mounting (how to), 358 packing with cachefspack command (how to), 368 packing with cachefspack command (overview), 367 parameters, 355 setting up CacheFS logging (how to), 377 stopping CacheFS logging, 378 troubleshooting cachefspack errors, 372 viewing CacheFS statistics, 380 cachefspack command how to use, 368 overview, 367 causes of le system damage, 392 cdrw command description, 55 restricting access to (how to), 58 writing data CDs and DVDs and audio CDs (overview), 57 CDs ISO 9660 format, 45 names, 44
508
CDs (Continued) UFS CDs SPARC vs. x86 format, 45 cfgadm PCI hot-plugging (overview), 85 SCSI hot-plugging (overview), 85 cfsadmin command, 357, 365 changing, primary USB audio device (how to), 155 character special inodes, 395 checking and repairing le systems, 399 CacheFS le systems (example of), 366 le system size, 394 format and type of inodes, 395 free blocks, 394 free inodes, 395 inode list for consistency, 394 clri command, 314 collecting, CacheFS statistics (overview), 376 conguring a SCSI controller (how to), 91 a SCSI device (how to), 91 a USB device (how to), 159 IB Port, HCA_SVC, or a VPPA device (how to), 170 IB pseudo device (how to), 171 IOC device (how to), 169 iSCSI target discovery (how to), 260 unidirectional or bidirectional CHAP authentication for iSCSI (how to), 258 connecting a SCSI controller (how to), 93 a USB device, logically (how to), 160 copying complete le systems (dd), 482 directories between le systems with cpio command (overview), 485 les to diskette (overview), 496 groups of les with cpio command (overview), 485 individual les with cpio command (overview), 485 cpio command (overview), 485 copying directories between le systems (how to), 486 extract all les from tape (how to), 493 listing les on tape (how to), 492 creating a data CD or DVD le system (how to), 61
Index
creating (Continued) a full backup of UFS snapshot information (how to), 454 a packing list (how to), 370 a UFS snapshot (example of), 451 a UFS snapshot (how to), 451 le systems (overview), 328 loopback le system (overview), 335 swap le, 387 CTFS le system, 313 custom parameters for le systems, 416-419 cylinder group, 413-416
D
daily discrete backups, 430 damage to le systems, 392 data block, 398, 415 data directory blocks, 397 datadm command, 177 dd command (overview), 482 cloning disks (how to), 483 default le system for /tmp (TMPFS), 312 SunOS le system, 316 deleting CacheFS le systems (how to), 365 UFS snapshot information (example of), 454 detecting end of media cpio command, 485 ufsdump command, 473-474, 474 determining le system types, 324 mounted le systems, 342 tape device name, 459 type of tape drive, 458 /dev/dsk directory, 181 /dev/rdsk directory, 181 devfsadm command, 179 device driver adding, 83 denition, 75
device names backup, 502-503 nding a le system name, 458 nding tape, 459 devices, accessing, 179 df command, 181, 314 dfstab le, conguring for shared local removable media (how to), 50 direct I/O, 319 directories copying between le systems with cpio command (overview), 485 inodes, 395 /proc, 312 /tmp, 312 unallocated blocks, 397 disconnect, a USB device, logically (how to), 159 disconnecting a SCSI controller (how to), 92 a USB device subtree, logically (how to), 160 disk adding to a (overview) x86, 238-251 automatic conguration of SCSI drives, 220 formatting a (overview), 200 repairing defective sectors, 222, 224 when to format (overview), 208 disk-based le systems, 309 disk controllers, 182 disk label creating (overview), 213 description, 201 disk slices denition, 194 determining which slices to use, 197 displaying information about (overview), 211-212 requirements for system congurations, 197 diskettes archiving les to multiple with cpio command (how to), 499 loading with volume management (how to), 35 disks adding to a (overview) SPARC, 228 connecting a secondary disk (example of) SPARC, 233
509
Index
disks (Continued) creating disk slices and labeling a disk (example of) SPARC, 232 creating disk slices and labeling a disk (how to) SPARC, 230 determining if formatted (how to), 208 recovering a corrupted disk label (how to), 217 recovering a corrupted disk label (overview), 217 displaying disk slice information (overview), 211 IB communication services (how to), 173 InniBand device information (how to), 167 information about SCSI devices, 90 kernel IB clients of an HCA (how to), 171 packed les (example of), 368 packed les (how to), 368 PCI slot conguration information (how to), 100 removable media user (how to), 48 swap space, 386-387 system conguration information, 76, 80 USB bus information (how to), 157 USB device information (how to), 140 DOS, le system, 310 driver not attached message, 77 dump levels daily, incremental backups, 430 denition, 429 duplicate blocks, 396 DVD-ROM, 310 dynamic reconguration, InniBand devices, 166 dynamic reconguration (overview), 85
end-of-media detection (Continued) ufsdump command, 473-474, 474 error messages, iSCSI, 273 /etc/dfs/dfstab le, conguring for shared removable media (how to), 50 /etc/dumpdates le, 474-475 /etc/rmmount.conf le, sharing removable media drives (how to), 50 extended fundamental types (UFS le system), 317
F
FDFS le system, 313 ff command, 314 FIFO inodes, 395 FIFOFS le system, 313 le system name, 458 le system table, virtual, 322 le systems /, 316 4.3 Tahoe, 309 BSD Fat Fast, 309 cached (overview), 355 checking and repairing, 399 checking size, 394 copying complete (dd), 482 creating (overview) loopback (LOFS), 335 CTFS, 313 custom parameters, 416-419 cylinder group struct, 413-416 damage to, 392 default SunOS, 316 description of administration commands, 314 disk-based, 309 DOS, 310 /export/home, 316 FDFS, 313 FIFOFS, 313 nding types, 324 xing, 404 High Sierra, 310 ISO 9660, 310 large, 339 making available (overview), 337-342
E
EFI label (overview), 189 comparison with VTOC label, 189 installing a system with, 190 restrictions of, 189 troubleshooting problems, 191 eject command, removable media (how to), 48 ejecting, removable media (how to), 48 enabling, uDAPL, 176 end-of-media detection cpio command, 485
510
Index
le systems (Continued) manual pages for, 315-316 MNTFS, 317 mount table, 321 NAMEFS, 313 network-based, 311 OBJFS, 313 /opt, 316 PCFS, 310 preening, 404 /proc, 317 process, (overview), 312-313 PROCFS, (overview), 312-313 pseudo, (overview), 311 reasons for inconsistencies, 393 sharing, 323 SPECFS, 313 stopping all processes accessing (how to), 350 SWAPFS, 313 TMPFS, 312 types of, 309 UFS, 309 UNIX, 309 /usr, 316 /var, 316 which to back up, 423 why you back up, 422 les archiving to multiple diskettes with cpio command (how to), 499 commands for copying to media (overview), 479 /etc/default/fs, 324 /etc/dfs/fstypes, 324 in the /proc directory, 313 retrieving from tape with tar command (how to), 489 sharing, 323 nding le system name, 458 tape device name, 459 type of le system, 324 xing inconsistent le systems, 404 format.dat le creating an entry (how to), 220 creating an entry (overview), 220 keywords, 287, 290 syntax rules, 287
format of inodes, 395 format utility (overview), 198 analyze menu, 283 automatic conguration of SCSI disk drives (how to), 222 automatic conguration of SCSI disk drives (overview), 220 creating a Solaris fdisk partition (how to), 242 creating disk slices and labeling disk (how to) SPARC, 230 x86, 248 defect menu, 285-286 determining if a disk is formatted (how to), 208 displaying disk slice information (example of), 212 entering command names (how to), 292 fdisk menu, 282 features and benets, 198 formatting a disk (example of), 210 guidelines for using, 199-200 identifying disks on a system (examples of), 208 identifying disks on a system (how to), 206 input to, 291, 292 labeling a disk example of, 214 main menu, 280 partition menu, 282 recovering corrupted disk label (how to), 217 specifying block numbers (how to), 291 using help facility, 293 when to use, 198 formatting, a USB mass storage device without vold running (how to), 141 formatting a disk, (overview), 200 fragment size, 417 free blocks, 394, 415-416 free hog slice, See donor slice free inodes, 395 free space (minimum), 417-418 fsck command, 181, 314 checking free blocks, 394 free inodes, 395 inode list size, 394 superblock, 394 conditions to repair, 393
511
Index
fsck command (Continued) FSACTIVE state ag, 392 FSBAD state ag, 392 FSCLEAN state ag, 392 FSSTABLE state ag, 392 preening, 404 state ags, 392 syntax and options, 410 using interactively, 399 fsdb command, 315 fssnap command, creating a UFS snapshot (how to), 451 fstyp command, 315 fstypes le, 324 full backup (example of), 441, 443 denition, 425 fuser command nding if removable media is in use (how to), 48 killing processes accessing removable media (how to), 48
hot-plugging (Continued) logically connecting a USB device (how to), 160 logically disconnecting a USB device (how to), 159 logically disconnecting a USB device subtree (how to), 160 PCI devices (overview), 99 removing a SCSI device (how to), 96 removing PCI adapter card (how to), 102 replacing an identical SCSI device on a SCSI controller (how to), 95 unconguring a SCSI device (how to), 90 unconguring a USB device (how to), 158 HSFS, See High Sierra le system
I
I/O, direct, 319 identifying devices, 77 disks on a system (how to), 206 primary USB audio device (how to), 154 inconsistencies in le systems, 393 incorrect . and .. entries, 398 incremental backup, 425, 474 (example of), 442 indirect blocks, 397 InniBand devices adding a VPPA communication service (how to), 174 conguring an IB Port, HCA_SVC, or a VPPA device (how to), 170 conguring an IB pseudo device (how to), 171 conguring an IOC device (how to), 169 displaying (how to), 167 displaying IB communication services (how to), 173 displaying kernel IB clients of an HCA (how to), 171 dynamic reconguration (overview), 166 overview, 163 removing an existing IB port, HCA_SVC, or a VPPA communication service (how to), 174 unconguring an IB Port, HCA_SVC, or a VPPA (how to), 169 unconguring an IB pseudo device (how to), 170 unconguring an IOC device (how to), 168 unconguring IB devices connected an HCA (how to), 172
G
grep command, 324 GRUB managing disks with GRUB x86, 187 Solaris failsafe boot x86, 187
H
High Sierra le system, 310 /home (automounted), 324 hot-plugging (overview), 85 adding a SCSI device to a SCSI bus (how to), 94 adding PCI adapter card (how to), 103 conguring a SCSI controller (how to), 91 conguring a SCSI device (how to), 91 conguring a USB device (how to), 159 connecting a SCSI controller (how to), 93 disconnecting a SCSI controller with cfgadm command (how to), 92
512
Index
InniBand devices (Continued) updating an IOC conguration (how to), 175 updating the IP p_key tables (how to), 173 inode list size, 394 inode states, 395 inodes, 414-415 bad number, 397 block special, 395 character special, 395 checking format and type, 395 directory, 395 FIFO, 395 link count, 395 number of bytes per, 418-419 regular, 395 size, 396 symbolic link, 395 installboot command, 236 installgrub command, 250 installing a boot block (how to), SPARC, 236 iSCSI (overview), 253 accessing iSCSI disks (how to), 262 conguring iSCSI target discovery (how to), 260 conguring unidirectional or bidirectional CHAP authentication for (how to), 258 general iSCSI error messages, 273 modifying iSCSI initiator and target parameters (how to), 266 monitoring your iSCSI conguration (how to), 263 preparing for a Solaris iSCSI conguration (how to), 257 removing discovered iSCSI targets (how to), 261 software and hardware requirements, 254 static and dynamic target discovery, 256 troubleshooting iSCSI conguration problems (how to), 270 iscsiadm add command, adding static or dynamic targets (example of), 261 iscsiadm list, displaying ISCSI conguration information (example of), 264 iscsiadm modify command enabling CHAP (example of), 259 enabling or disabling static or dynamic targets (example of), 262
iscsiadm remove command, removing static or dynamic targets (example of), 262 ISO 9660 le system, 310 ISO standards, 9660 CD format, 45
K
/kernel/drv directory, 76 killing all processes accessing a le system (how to), 350 processes accessing removable media (how to), 48
L
labelit command, 315 large les option, 339 level 0 backup, 429 link count of inodes, 395 loading, diskettes with volume management (how to), 35 locating, CacheFS log le, 378 log (record of dumps), 474-475 logical block size, 416-417 logical device name denition, 180 disk, 180 tape, 183 logical device names, removable media, 184 loopback le system (LOFS) creating (overview), 335 mounting, 344 lost+found directory, 392
M
maintaining tape drives, 505-506 managing disks with GRUB x86, 187 manual pages, for le systems, 315-316 media was found message, 35 memory storage (virtual), denition, 381 minimum free space, 417-418 mkfile command, 387, 388
513
Index
mkfs command, 315, 328 mkisofs command, create a data CD or DVD le system (how to), 61 MNTFS le system, 317 mnttab le, 321 modifying, iSCSI initiator and target parameters (how to), 266 monitoring, your iSCSI conguration (how to), 263 mount command, 181 mount point, denition, 320 mount table, 321 mountall command, 315 mounting a le system with /etc/vfstab, 344 a USB mass storage device without vold running (how to), 149 all les in vfstab le, 344 le systems automatically, 324 loopback le systems (LOFS), 344 NFS le systems, 343 PCMCIA memory cards on other systems (example of), 54 remote removable media manually (example of), 53, 54 removable media automatic mounting compared to, 29, 30 UFS le systems, 343 UFS le systems (how to) without large les, 346 mt command, 505
O
OBJFS le system, 313 /opt directory, 316 options, for ufsdump command, 477
P
parameters (le system), 416-419 partition (swap), denition, 381 passwd le, restoring from tape (example of), 464 PCFS le system, 310 PCI devices adding PCI adapter card (how to), 103 displaying PCI slot conguration information (how to), 100 removing PCI adapter card (how to), 102 troubleshooting PCI conguration problems, 105 PCMCIA memory cards accessing on other systems (example of), 54 mounting remotely (example of), 54 physical device name denition, 180 preening le systems, 404 preparing for backing up (overview), 438-439 to restore les (overview), 458-459 to use a USB mass storage device without vold running (how to), 140 preparing for, Solaris iSCSI conguration (how to), 257 /proc directory, 312, 317 process le system (PROCFS), 312-313 PROCFS le system, (overview), 312-313 prtvtoc command, 182 (example of), 215 pseudo le systems, (overview), 311
N
NAMEFS le system, 313 ncheck command, 315 network-based le systems, 311 newfs command, 181, 328 NFS description, 323 server description, 323 vfstab entry for, 343 nfsd daemon starting, 50 verifying if running, 50 no media was found message, 36
514
R
raw disk device interface, 181 RCM script commands for, 106 overview, 106 reconguration boot, 221 SPARC example, 229
Index
reconguration boot (Continued) x86 example, 241 record of dumps, 474-475 incremental backup, 474 registering, service provider in the DAT static registry (how to), 177 regular inodes, 395 removable media accessing (examples of), 46 accessing (how to), 46 accessing media on other systems (example of), 53, 54 ejecting (how to), 48 nding out if media is in use (how to), 48 killing processes accessing (how to), 48 mounting manual compared to automatic, 29, 30 mounting remote media (example of), 53, 54 names, 44 removing a SCSI device (how to), 96 a swap le from use, 389 a USB mass storage device without vold running (how to), 139 discovered iSCSI targets (how to), 261 existing IB port, HCA_SVC, or a VPPA communication service (how to), 174 PCI adapter card (how to), 102 replacing, an identical SCSI device on a SCSI controller (how to), 95 resetting, a USB device (how to), 161 resolving, a failed SCSI uncongure operation (how to), 98 restoring bad superblock, 405 restoring le systems complete (example of), 467 complete (how to), 465 determining which tapes to use (how to), 459 preparing to (overview), 458-459 root and /usr (SPARC) (example of), 470 root or /usr (x86) (example of), 470 type of tape drive, 458 restoring les interactive restore (example of), 462 non-interactive restore (example of), 464 restricting, removable media access (how to), 58
retrieving, les from tape with tar command (how to), 489 rmmount.conf le, sharing removable media drives (how to), 50 Rock Ridge extension (HSFS le system), 310 root (/) le system, 316
S
scheduling backups, 427 SCSI devices adding a SCSI device to a SCSI bus (how to), 94 conguring a SCSI controller (how to), 91 conguring a SCSI device (how to), 91 connecting a SCSI controller (how to), 93 disconnecting with cfgadm command (how to), 92 displaying information about (how to), 90 removing a SCSI device (how to), 96 replacing an identical SCSI device on a SCSI controller (how to), 95 resolving a failed SCSI uncongure operation (how to), 98 troubleshooting SCSI conguration problem, 97 unconguring a SCSI controller (how to), 90 SCSI disk drives, 220 SCSI tape drives, 503 secondary disk connecting to the system (how to) SPARC, 230 x86, 241 description, 197 setting up, CacheFS logging, 377 share command, 323 making removable media available to other systems (how to), 50 shareall command, 323 sharing, les, 323 size checking le system, 394 fragment, 417 inode, 396 slice (denition), 194 Solaris failsafe boot (how to) x86, 239
515
Index
Solaris failsafe boot (Continued) x86, 187 Solaris fdisk partition, guidelines, 242 space optimization type, 418 SPARC based systems, UFS format, 45 SPECFS le system, 313 specifying a disk slice, 182 starting nfsd daemon, 50 volume management (how to), 46 state ag fsck, 392 UFS le systems, 318 stopping all processes for a le system (how to), 350 CacheFS logging, 378 killing processes accessing removable media (how to), 48 volume management (how to), 46 storage (virtual memory), denition, 381 storage capacities (media), 425, 501 structure of cylinder groups, 413-416 SunOS default le system, 316 superblock, 394, 405, 414 swap command, 387 swap le adding to vfstab, 385 creating, 387 displaying, 386-387 removing from use, 389 swap partition, denition, 381 swapadd command, 385 SWAPFS le system, 313 symbolic links, 395 syntax, fsck command, 410 sysdef command, 77 system disk connecting (how to) x86, 239 description, 197
tape (Continued) characteristics, 477 retrieving les from with tar command (how to), 489 sizes, 425, 501 storage capacities, 425, 501 tape devices (naming), 183 tape drive determining type for restore, 458 maintaining, 505-506 maximum SCSI, 503 rewind, 503 tar command (overview), 487 copying les to remote tape with dd command (how to), 495 listing les on diskette (how to), 498 listing les on tape (how to), 488 retrieving les from diskette (how to), 499 retrieving les from remote tape with dd command (how to), 496 retrieving les from tape (how to), 489 temporary le system (TMPFS), overview, 312 time (optimization type), 418 /tmp directory, 312, 316 TMPFS le system, overview, 312 troubleshooting a failed SCSI uncongure operation, 98 cachefspack errors, 372 EFI disk labels, 191 iSCSI conguration problems (how to), 270 PCI conguration problems, 105 SCSI conguration problems, 97 USB audio device problems, 155 USB mass storage devices, 150 type of le systems, 309 type of inodes, 395
U T
tape capacity, 477
516
uDAPL (overview), 175 enabling (how to), 176 registering a service provider in the DAT static registry (how to), 177
System Administration Guide: Devices and File Systems November 2006
Index
uDAPL (Continued) unregistering a service provider in the DAT static registry (how to), 177 updating the DAT static registry (how to), 177 UDF le system, 310 UFS CDs, SPARC compared to x86 formats, 45 UFS le system, 309, 317 extended fundamental types, 317 large le systems, 317 logging, 317 mounting, 343 mounting with /etc/vfstab, 344 mounting without large les (how to), 346 multiterabyte le systems, 317 state ags, 318 UFS logging, overview, 318 UFS snapshot creating (how to), 451 creating a full backup of (how to), 454 description, 449 ufsdump command end-of-media detection, 473-474 full backup (example of), 441, 443 how data is copied with, 474 how it works, 473-477 incremental backup (example of), 442 limitations, 477 options and arguments, 477 ufsdump command (overview), 439 ufsrestore command, 478 determining which tapes to use (how to), 459 preparing to use (overview), 458 umount command, 315 umountall command, 315 unallocated directory blocks, 397 unallocated inodes, 395 unconguring a SCSI controller (how to), 90 a USB device (how to), 158 IB devices connected an HCA (how to), 172 IB Port, HCA_SVC, or a VPPA Device (how to), 169 IB pseudo device (how to), 170 IOC device (how to), 168 UNIX le system, 309 unmounting, a USB mass storage device without vold running (how to), 149
unregistering, service provider in the DAT static registry (how to), 177 unsupported devices, 76 updating DAT static registry (how to), 177 IOC conguration (how to), 175 IP p_key tables (how to), 173 USB devices (overview), 120 acronyms, 120 adding a mass storage device without vold running (how to), 137 adding a USB camera (how to), 137 adding audio devices (how to), 154 audio (overview), 152 changing the primary device (how to), 155 device ownership, 155 bus description, 120 bus-powered devices, 126 cables for, 129 composite device, 121 compound device, 121 conguring a USB device (how to), 159 connect a USB device (how to), 160 device classes, 122 device nodes, 124 diskette devices (overview), 135 displaying bus information (how to), 157 displaying USB device information (how to), 140 drivers, 122 formatting a mass storage device without vold running (how to), 141 host controller and root hub, 128 hot-plugging (overview), 136 identifying primary audio device (how to), 154 keyboards and mouse devices, 127 logically disconnecting a USB device (how to), 159 logically disconnecting a USB device subtree (how to), 160 mounting mass storage without vold running (how to), 149 names of, 121 overview of 2.0 devices, 125 physical device hierarchy, 120 power management, 128
517
Index
USB devices (Continued) preparing to use a mass storage device without vold running (how to), 140 removable mass storage (overview), 133 removing a mass storage device without vold running (how to), 139 resetting a USB device (how to), 161 Solaris USB Architecture (USBA), 124 troubleshooting audio device problems, 155 troubleshooting tips for mass storage devices, 150 unconguring a device (how to), 158 unmounting mass storage without vold running (how to), 149 using non-compliant mass storage devices (overview), 135 wheel mouse support, 127 /usr le system, 316
X
x86 based systems, UFS format, 45
V
/var directory, 316 verifying, nfsd daemon is running, 50 vfstab le, 324, 385 adding entries to (how to), 343 adding swap to, 385 default, 322 entry for LOFS, 336 mounting all les, 344 viewing, CacheFS statistics, 380 virtual le system table, 322 virtual memory storage, denition, 381 volcopy command, 315 volmgt start command, 46 volume management benets, 29 loading diskettes (how to), 35 manual compared to automatic mounting, 29, 30 restarting (how to), 46 stopping (how to), 46
W
writing, data CDs and DVDs and audio CDs (overview), 57
518 System Administration Guide: Devices and File Systems November 2006