Loading ...
Global Do...
News & Politics
26
0
Try Now
Log In
Pricing
SG24-5433-00 International Technical Support Organization www.redbooks.ibm.com AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Laurent Vanel, Ronald van der Knaap, Dugald Foreman, Keigo Matsubara, Antony Steel AIX Logical Volume Manager from A to Z: Troubleshooting and Commands March 2000 SG24-5433-00 International Technical Support Organization © Copyright International Business Machines Corporation 2000. All rights reserved. Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. First Edition (March 2000) This edition applies to AIX Version 4.3, Program Number 5765-C34. This document created or updated on March 20, 2000. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JN9B Building 003 Internal Zip 2834 11400 Burnet Road Austin, Texas 78758-3493 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Before using this information and the product it supports, be sure to read the general information in Appendix F, “Special notices” on page 401. Take Note! Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ix The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Chapter 1. LVM commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Volume group related commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.1 Add a volume group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.2 Activate a volume group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1.3 Deactivate a volume group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1.4 Remove a physical volume from a volume group . . . . . . . . . . . . . 8 1.1.5 Remove a volume group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.1.6 Bring a volume group into the system . . . . . . . . . . . . . . . . . . . . . 10 1.1.7 Add physical volume to an existing volume group . . . . . . . . . . . . 12 1.1.8 Change name of volume group. . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.1.9 Reorganize a volume group . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.1.10 Listing the volume groups on the system . . . . . . . . . . . . . . . . . 16 1.1.11 Listing the configuration of a volume group. . . . . . . . . . . . . . . . 18 1.1.12 List contents of a volume group . . . . . . . . . . . . . . . . . . . . . . . . 21 1.2 Logical volume related commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.2.1 Add a logical volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.2.2 Copy a logical volume to a new logical volume . . . . . . . . . . . . . . 26 1.2.3 Copy a logical volume to same sized or bigger logical volume . . 27 1.2.4 Copy a logical volume to a smaller logical volume . . . . . . . . . . . 28 1.2.5 Add a mirrored copy to a logical volume . . . . . . . . . . . . . . . . . . . 29 1.2.6 Set allocation policy for a logical volume . . . . . . . . . . . . . . . . . . 30 1.2.7 Set strictness for a logical volume . . . . . . . . . . . . . . . . . . . . . . . 32 1.2.8 Set write verify for a logical volume . . . . . . . . . . . . . . . . . . . . . . 33 1.2.9 Set schedule policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.2.10 Increase the maximum size of a logical volume . . . . . . . . . . . . 35 1.2.11 Increase the size of a logical volume . . . . . . . . . . . . . . . . . . . . 37 1.2.12 List the configuration of a logical volume . . . . . . . . . . . . . . . . . 38 1.2.13 List a logical volumes detailed mapping . . . . . . . . . . . . . . . . . . 41 1.3 Physical volume related commands . . . . . . . . . . . . . . . . . . . . . . . . . . 43 1.3.1 List all physical volumes in system . . . . . . . . . . . . . . . . . . . . . . . 44 1.3.2 List configuration of a physical volume . . . . . . . . . . . . . . . . . . . . 45 1.3.3 List contents of a physical volume . . . . . . . . . . . . . . . . . . . . . . . 47 1.3.4 Move data from a physical volume . . . . . . . . . . . . . . . . . . . . . . . 49 1.4 Journaled file system related commands . . . . . . . . . . . . . . . . . . . . . . 50 1.4.1 Add a JFS to a previously defined logical volume menu . . . . . . . 51 1.4.2 Change/show details of a file system . . . . . . . . . . . . . . . . . . . . . 52 1.4.3 Defrag a file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 © Copyright IBM Corp. 2000 iii 1.4.4 Mount a file system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 1.4.5 Unmount a file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Chapter 2. Problem determination and recovery . . . . . . . . . . . . . . . . . 59 2.1 A methodology for problem determination. . . . . . . . . . . . . . . . . . . . . . 60 2.1.1 Breaking up high-level commands . . . . . . . . . . . . . . . . . . . . . . . 60 2.2 Producing debug output for LVM Scripts . . . . . . . . . . . . . . . . . . . . . . 62 2.3 Corruption example 1: Simple ODM corruption . . . . . . . . . . . . . . . . . . 66 2.4 Gathering information about the problem . . . . . . . . . . . . . . . . . . . . . . 75 2.5 Corruption example 2: PVID corruption . . . . . . . . . . . . . . . . . . . . . . . 75 2.6 Inspection commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 2.6.1 Checking the errorlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 2.6.2 Checking for free file system space . . . . . . . . . . . . . . . . . . . . . . 93 2.6.3 The high-level commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 2.6.4 Checking fileset levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 2.6.5 Checking device availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 2.6.6 Checking the ODM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 2.6.7 The low-level commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 2.6.8 korn shell debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 2.6.9 Examining raw data on physical volumes and logical volumes . 121 2.6.10 Watching system calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 2.6.11 Examining internal kernel memory structures with crash. . . . . 127 2.7 Rebuilding and repair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 2.7.1 ODM corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 2.7.2 LVM control data corruption . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 2.7.3 JFS problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 2.7.4 Hardware failures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 2.7.5 Setting up notification of LVM_MISSPVADDED errors . . . . . . . 185 2.8 Special considerations for rootvg . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 2.8.1 rootvg problem determination in maintenance mode. . . . . . . . . 187 2.8.2 Reducing the size of hd6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Chapter 3. Replacing a drive in a mirrored configuration . . . . . . . . . 189 3.1 Replace a failed physical volume . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 3.1.1 Step 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 3.1.2 Step 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 3.1.3 Step 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 3.1.4 Step 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 3.1.5 Step 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 3.1.6 Step 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 3.1.7 Step 7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 3.1.8 Step 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 3.1.9 Step 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 iv AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 3.2 Using the replacepv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 3.2.1 Description of the test environment . . . . . . . . . . . . . . . . . . . . . 193 Appendix A. High-level LVM commands. . . . . . . . . . . . . . . . . . . . . . . . . 199 A.1 The chlv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 A.2 The chpv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203 A.3 The chvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204 A.4 The cplv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 A.5 The exportvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 A.6 The extendlv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 A.7 The extendvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 A.8 The importvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 A.9 The lslv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 A.10 The lspv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 A.11 The lsvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 A.12 The lsvgfs command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 A.13 The lvedit command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 A.14 The migratepv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 A.15 The mirrorvg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 A.16 The mkcd command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 A.17 The mklv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 A.18 The mklvcopy command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 A.19 The mksysb command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 A.20 The mkszfile command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 A.21 The mkvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 A.22 The mkvgdata command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 A.23 The readlvcopy command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 A.24 The redefinevg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 A.25 The reducevg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 A.26 The reorgvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 A.27 The replacepv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 A.28 The rmlv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267 A.29 The rmlvcopy command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 A.30 The restvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 A.31 The savevg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 A.32 The splitlvcopy command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 A.33 The synclvodm command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 A.34 The syncvg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 A.35 The unmirrorvg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 A.36 The updatelv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 A.37 The updatevg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 A.38 The varyoffvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 A.39 The varyonvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 v Appendix B. Intermediate-level commands . . . . . . . . . . . . . . . . . . . . . . 285 B.1 The allocp command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 B.2 The cfgvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 B.3 The chlvcopy command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 B.4 The copyrawlv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 B.5 The getlvcb command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 B.6 The getlvname command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 B.7 The getlvodm command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 B.8 The getvgname command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 B.9 The lchangelv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 B.10 The lchlvcopy command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 B.11 The lchangepv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 B.12 The lcreatelv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 B.13 The lcreatevg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 B.14 The ldeletelv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 B.15 The ldeletepv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 B.16 The lextendlv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 B.17 The linstallpv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 B.18 The lmigratelv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 B.19 The lmigratepp command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 B.20 The lquerylv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 B.21 The lquerypv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 B.22 The lqueryvg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 B.23 The lqueryvgs command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 B.24 The lreducelv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 B.25 The lresynclp command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 B.26 The lresynclv command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 B.27 The lresyncpv command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 B.28 The lvaryonvg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 B.29 The lvaryoffvg command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 B.30 The lvgenmajor command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 B.31 The lvgenminor command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 B.32 The lvchkmajor command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 B.33 The lvlstmajor command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 B.34 The lvmmsg command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 B.35 The lvrelmajor command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 B.36 The lvrelminor command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 B.37 The migfix command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 B.38 The putlvcb command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 B.39 The putlvodm command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Appendix C. ODM commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 C.1 The odmadd command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 vi AIX Logical Volume Manager from A to Z: Troubleshooting and Commands C.2 The odmchange command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 C.3 The odmcreate command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 C.4 The odmdelete command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 C.5 The odmdrop command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 C.6 The odmget command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 C.7 The odmshow command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Appendix D. Other related commands . . . . . . . . . . . . . . . . . . . . . . . . . . 321 D.1 The backup command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 D.2 The chfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 D.3 The chps command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 D.4 The cpio command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 D.5 The crfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 D.6 The defragfs command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 D.7 The df command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 D.8 The dfsck command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341 D.9 The dumpfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 D.10 The ff command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344 D.11 The file command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345 D.12 The fileplace command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 D.13 The fsck command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 D.14 The fsdb command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 D.15 The imfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 D.16 The ipl_varyon command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 D.17 The istat command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 D.18 The logform command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 D.19 The logredo command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 D.20 The lsfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 D.21 The lsps command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 D.22 The mkfs command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 D.23 The mount command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362 D.24 The ncheck command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 D.25 The restore command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 D.26 The rmfs command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 D.27 The savebase command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 D.28 The snap command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377 D.29 The sync command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 D.30 The sysdumpdev command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381 D.31 The tar command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384 D.32 The umount command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Appendix E. Scripts used during this residency . . . . . . . . . . . . . . . . . 393 E.1 trclvm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 vii E.2 dspmsg_index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 E.3 chpvid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 E.4 gather_maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 E.5 findlvm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 E.6 maker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 E.7 pvsinvg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 E.8 scraper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 Appendix F. Special notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 Appendix G. Related publications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 G.1 IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 G.2 IBM Redbooks collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 G.3 Other resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 G.4 Referenced Web sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 IBM Redbooks fax order form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 IBM Redbooks review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 viii AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Preface LVM: Logical Volume Manager. What is its role in the AIX operating System? How does it perform this function? Its role is to control disk resources by mapping data between a more simple and flexible logical view of storage space and the actual physical disks. How it performs this function is a topic vast enough to fill two books. The first volume, AIX Logical Volume Manager from A to Z: Introduction and Concepts, SG24-5432, describes the basic components and defines physical volumes, volume groups, and logical volumes. This second volume focuses on the practical aspects of the Logical Volume Manager and describes, in detail, the commands, including some undocumented commands and options. The last section of this volume is on troubleshooting and provides hints on how to handle certain problems, how to investigate them, and what commands are needed to run and solve these problems. Most importantly, this volume discusses what commands not to run in order to avoid ruining your entire system. This book is aimed at every IT specialist who wants to know more about the core element of AIX, which is the Logical Volume Manager. The team that wrote this redbook This redbook was produced by a team of specialists from around the world working at the International Technical Support Organization, Austin Center. Laurent Vanel is an AIX and RS/6000 specialist at the International Technical Support Organization, Austin Center. Before joining the ITSO three years ago, Laurent worked in the french Risc System/6000 Technical Center in Paris, where he conducted benchmarks and presentations for the AIX and RS/6000 solutions. Ronald van der Knaap is a Senior I/T Specialist in the Netherlands. He has 11 years of experience in the Unix/AIX field. His areas of expertise include a wide range of system and network management products, AIX related products, HACMP, performance and tuning, and RS/6000 SP systems. He has written extensively on LVM performance and journaled file systems. Dugald Foreman is an AIX support specialist in England. He has two years of experience in AIX, both spent working for IBM. His areas of expertise © Copyright IBM Corp. 2000 ix include problem determination in software development and the AIX base operating system. He has written extensively on LVM recovery procedures. Keigo Matsubara is an Advisory I/T Specialist in Japan. He has seven years of experience in the AIX filed. His areas of expertise include a wide range of AIX related products, particularly RS/6000 SP, and high-end storage systems. He has written extensively on mirroring, striping, and concurrent access volume groups. This is his second redbook. Antony Steel is an Advisory IT Specialist in Australia. He has eight years of experience in the field of Unix. He holds a degree in Theoretical Chemistry from the University of Sydney. His areas of expertise include system performance and customization, scripting, and high availability. Thanks to the following people for their invaluable contributions to this project: Gerald McBrearty LVM developer Ram Pandiri LVM developer Johnny Shieh LVM developer Mathew Accapadi AIX performance engineer Mike Wortman AIX file system developer Comments welcome Your comments are important to us! We want our Redbooks to be as helpful as possible. Please send us your comments about this or other Redbooks in one of the following ways: • Fax the evaluation form found in “IBM Redbooks review” on page 415 to the fax number shown on the form. • Use the online evaluation form found at http://www.redbooks.ibm.com/ • Send your comments in an Internet note to redbook@us.ibm.com x AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Chapter 1. LVM commands This chapter covers common tasks used in administering volume groups and the commands that are used. This chapter will cover areas, such as how to create, list, and modify volume groups, logical volumes, and file systems. To use the commands effectively requires an understanding of the concepts covered in the redbook AIX Logical Volume Manager from A to Z, Introduction and Concepts, SG24-5432. The details of the command line options are contained in Appendix A, “High-level LVM commands” on page 199. Most of the commands can be accessed from the command line or the SMIT panels. These panel are located under the System Storage Management tree as shown in the following screen: Figure 1 on page 2 shows the layout of the system storage management SMIT panels. System Management Move cursor to desired item and press Enter. Software Installation and Maintenance Software License Management Devices System Storage Management (Physical & Logical Storage) Security & Users Communications Applications and Services Print Spooling Problem Determination Performance & Resource Scheduling System Environments Processes & Subsystems Applications Using SMIT (information only) F1=Help F2=Refresh F3=Cancel F8=Image F9=Shell F10=Exit Enter=Do © Copyright IBM Corp. 2000 1 . Figure 1. SMIT system storage management menu 1.1 Volume group related commands The commands in this section relate to creating and modifying volume groups. These commands can be run from the command line or from the SMIT System Storage management -> Logical Volume Manager -> Volume Groups menu (See Figure 2). SMIT - System Storage Management Logical Volume Manager File Systems Removable Disk Management System Backup Manager Files & Directories Logical Volume Manager Volume Groups Logical Volumes Physical Volumes Paging Space File Systems List All File Systems List All Mounted File Systems Add / Change / Show / Delete File Systems Mount a File System Mount a Group of File Systems Unmount a File System Unmount a Group of File Systems Verify a File System Backup a File System Restore a File System List Contents of a Backup Files & Directories Backup a File or Directory Restore a File or Directory List Contents of a Backup Removable Disk Management List All Mounted File Systems on a Disk Unmount File Systems on a Disk Remove a Disk form the Operating System Remove a Disk Open Door System Backup Manager Backup Up the System List Files in a System Image Restore Files in a System Image 2 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Figure 2. SMIT volume group options 1.1.1 Add a volume group A volume group is created by using the mkvg command. The mkvg command creates a new volume group using the physical volume names supplied. Since AIX Version 4.1, this command also varies on the volume group using the varyonvg command. The exception to this is when the volume group is created as concurrent capable. By default this command creates a volume group that is capable of handling up to 255 logical volumes on 32 physical volumes. These limits can be extended to 512 logical volumes and 128 disks, and the design allows space for 1024 physical volumes. The mkvg script checks each physical volume to verify that it is not already part of another volume group. If a physical volume is part of a varied on volume group, then mkvgexits. If it is part of a non-varied on volume group, the user is warned that data will be lost and is given a chance to back out. The script also checks that the selected partition size will not violate the 1016 partition limit. In this case, either the partition factor can be set, or the partition size increased. For the command line options, see mkvg in Appendix A.21, “The mkvg command” on page 259, or use the SMIT fastpath: smit mkvg Volume Groups List All Volume Groups Add a Volume Group Set Characteristics of a Volume Group List Contents of a Volume Group Remove a Volume Group Activate a Volume Group Deactivate a Volume Group Import a Volume Group Export a Volume Group Mirror a Volume Group Unmirror a Volume Group Synchronize LVM Mirrors Back Up a Volume Group Remake a Volume Group List Files in a Volume Group Backup Restore Files in a Volume Group Backup Change a Volume Group Add a Physical Volume to a Volume Group Remove a Physical Volume from a Volume Group Reorganize a Volume Group Chapter 1. LVM commands 3 SMIT provides the following fields: Volume group name A system-wide unique 1-15 character name that will be assigned to the volume group. Physical Partition size The physical partition size for the volume group from 1 to 1024 (in powers of 2). Physical volume names The name(s) of the physical volume(s) that will make up the volume group. These physical volumes cannot be part of another volume group. Other physical volumes can be added at a later date. Activate volume group automatically at system restart Some administrators may not want to automatically start some volume groups (particularly in HACMP setups). Volume Group major number The system will assign the next available major number if left blank. Concurrent Capable/Concurrent Mode Used only for concurrent volume groups and requires further software installed. (See the concurrent access volume group description in AIX Logical Volume Manager from A to Z Introduction and Concepts, SG24-5432). 4 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands SMIT mkvg 1.1.2 Activate a volume group The varyonvg command activates the volume group (specified by the VolumeGroup parameter) and all associated logical volumes. A volume group that is activated is available for use. When a volume group is activated, physical partitions are synchronized if they are not current. A list of all physical volumes with their status is displayed to standard output whenever there is a discrepancy between the Device Configuration Database and the information stored in the Logical Volume Manager. As a result, the volume group may or may not be varied on. The list must be examined and proper action taken to preserve the system integrity. With quorum on, and if the volume group cannot be varied on due to a loss of the majority of physical volumes, a list of all physical volumes with their status is displayed. This is also true if quorum is off and not all physical volumes are available. For the command line options, see varyonvg in Appendix A.39, “The varyonvg command” on page 280, or use the SMIT fastpath: smit varyonvg SMIT provides the following fields: Volume group name The name of volume group to be activated ([F4] for list). Add a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] VOLUME GROUP name [keovg] Physical partition SIZE in megabytes 16 * PHYSICAL VOLUME names [hdisk11] Activate volume group AUTOMATICALLY yes at system restart? Volume Group MAJOR NUMBER [] Create VG Concurrent Capable? no Auto-varyon in Concurrent Mode? no F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Image Esc+9=Shell Esc+0=Exit Enter=Do Chapter 1. LVM commands 5 Resynchronize stale partitions The resynchronization of any stale mirror copies can be done during the vary on process. Activate into system management mode Logical volumes can be operated on, but not opened, for input/output. Force activation This will force the vary on process even if some physical volumes are missing. Warning: Data integrity is not guaranteed. Vary on VG in Concurrent Mode Used for concurrent access. smit varyonvg 1.1.3 Deactivate a volume group The varyoffvg command deactivates the volume group specified by the VolumeGroup parameter along with its associated logical volumes. The logical volumes must first be closed. For example, if the logical volume contains a file system, it must be unmounted. Activate a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [] RESYNCHRONIZE stale physical partitions? yes Activate volume group in SYSTEM no MANAGEMENT mode? FORCE activation of the volume group? no Warning--this may cause loss of data integrity. Varyon VG in Concurrent Mode? no F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 6 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands For the command line options, see varyoffvg in Appendix A.38, “The varyoffvg command” on page 280, or use the SMIT fastpath: smit varyoffvg SMIT provides the following fields: Volume group name The name of the volume group to be de-activated ([F4] for list). Put volume group into system management mode This will allow logical volume to be operated on but not opened for input/output. smit varyoffvg A volume group that has a paging space volume on it cannot be varied off while the paging space is active. Before de-activating a volume group with an active paging space volume, ensure that the paging space is not activated automatically at system initialization and then reboot the system. Note Deactivate a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [] Put volume group in SYSTEM no MANAGEMENT mode? F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 7 1.1.4 Remove a physical volume from a volume group The reducevg command removes one or more physical volumes from the volume group. When you remove all physical volumes in a volume group, the volume group is also removed. The volume group must be varied on (that is, active) before it can be reduced. All logical volumes residing on the physical volumes being removed must have been removed before starting the reducevg command. For the command line options, see reducevg in Appendix A.25, “The reducevg command” on page 263, or use the SMIT fastpath: smit reducevg SMIT provides the following fields: Physical volume names The names of the physical volumes to be removed from the volume group ([F4] for list). Force deallocation of all partitions This will force the de-allocation of any logical partitions on this physical volume. This will destroy those logical volumes, and the user will be asked to confirm. 8 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit reducevg - After entering volume group name. 1.1.5 Remove a volume group A volume group can be removed from the system by removing all physical volumes from the volume group and then deleting it. The reducevg command executed with each physical volume will remove all logical volume information from each physical volume, then remove the physical volume from the volume group. When the last physical volume is removed For the command line options, see reducevg in Appendix A.25, “The reducevg command” on page 263, or use the SMIT fastpath: smit reducevg2 SMIT provides the following fields: Volume group name The name of the volume group to be removed ([F4] for list). Remove a Physical Volume from a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Field * VOLUME GROUP name park_vg * PHYSICAL VOLUME names [] FORCE deallocation of all partitions on no this physical volume? F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 9 smit reducevg2 1.1.6 Bring a volume group into the system The importvg command makes the previously exported volume group known to the system. Only one physical volume is needed to identify the volume group; any remaining physical volumes (those belonging to the same volume group) are found by the importvg command and are included in the import. An imported volume group is automatically varied on unless the volume group is Concurrent Capable. You must use the varyonvg command to activate Concurrent Capable volume groups before you access them. When a volume group with file systems is imported, the /etc/filesystems file is updated with values for the new logical volumes and mount points. After importing the volume group and activating it with the varyonvg command, you must run the fsck command before the file systems can be mounted. The importvg command changes the name of a logical volume if the name already exists in the system. It prints a message and the new name to standard error and updates the /etc/filesystems file to include the new logical volume name. Remove a Volume Group Type or select a value for the entry field. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [park_vg] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 10 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands For the command line options, see importvg in Appendix A.8, “The importvg command” on page 216, or use the SMIT fastpath: smit importvg SMIT provides the following fields: Volume group name The system-wide unique name to be assigned to the volume group when imported into the system. Physical volume name The name (hdiskn) of any of the physical volumes in the volume group. The remaining physical volumes will be accessed using the VGDA information on the given physical volume. Volume group major number The next available will be allocated, or one can be chosen. Concurrent options Only used if the volume group is concurrent and the appropriate software installed. You may import an AIX Version 3.2 created volume group into an AIX Version 4 system, and you may import an AIX Version 4 volume group into an AIX Version 3.2 system, provided striping has not been applied. Once striping is put onto a disk, its importation into version 3.2 is prevented. When you issue the importvg command to a previously defined volume group, the QUORUM and AUTO ON values will be reset to volume group default values. You should verify the parameters of the newly imported volume group with the lsvg command and change any values with the chvg command. A volume group with a mirrored striped logical volume cannot be back ported into a version of AIX older than 4.3.3. Note Chapter 1. LVM commands 11 smit importvg 1.1.7 Add physical volume to an existing volume group The physical volume is checked to verify that it is not already in another volume group. If the system believes the physical volume belongs to a volume group that is varied on, it exits. But, if the system detects a description area from a volume group that is not varied on, it prompts the user for confirmation in continuing with the command. The previous contents of the physical volume will be lost; so, the user must be cautious when using the override function. For the command line options, see extendvg in Appendix A.7, “The extendvg command” on page 215, or use the SMIT fastpath: smit extendvg SMIT provides the following fields: Volume group name The unique name of the volume group to be extended ([F4] for list). Physical volume name(s) The name(s) of the physical volume(s) to be added to the volume group ([F4] for list). Import a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] VOLUME GROUP name [] * PHYSICAL VOLUME name [] Volume Group MAJOR NUMBER [] Make this VG Concurrent Capable? no Make default varyon of VG Concurrent? no F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 12 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit extendvg 1.1.8 Change name of volume group To change the name of a volume group, more than one step is required, and familiarity with some of the commands used previously is needed. To change the name of a volume group, the volume group must first have all its logical volumes closed (that is, if they contain file systems, then they must be unmounted). The volume group must then be de-activated, then exported. The volume group is then imported with the new name, reactivated, and any file systems remounted. The only command not dealt with above is the command to export the volume group: exportvg For the command line options, see exportvg in Appendix A.5, “The exportvg command” on page 211, or use the SMIT fastpath: smit exportvg SMIT provides the following fields: Volume group name The unique name of the volume group to be exported ([F4] for list). Add a Physical Volume to a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [] * PHYSICAL VOLUME names [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 13 smit exportvg 1.1.9 Reorganize a volume group The reorgvg command reorganizes the placement of allocated physical partitions within the volume group according to the allocation characteristics of each logical volume. Specific logical volumes can also be reorganized within the volume group. In the reorganization, the order of priority goes in the order to the logical volumes listed by lsvg -l Volume_Group. If a list of logical volumes is provided, the highest priority goes to the first logical volume in the list down to the last logical volume with the lowest priority. The volume group must be varied on and must have free partitions before use of the reorgvg command. The relocatable flag of each logical volume must be set to y with the chlv -r command (or smit chlv) for the reorganization to take effect; otherwise, the logical volume is ignored. Export a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 14 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands For the command line options, see reorgvg in Appendix A.26, “The reorgvg command” on page 265, or use the SMIT fastpath: smit reorgvg SMIT provides the following fields: Volume group name Name of the volume group to be reorganized ([F4] for list). Logical volume names The names of the logical volumes to be included if only these ones are to be reorganized. The order of priority will be in the order in which they are listed ([F4] for list). The reorgvg command does not reorganize the placement of allocated physical partitions for any striped logical volumes. At least one free physical partition must exist on the specified volume group for the reorgvg command to run successfully. In AIX Version 4.2 or later, if you enter the reorgvg command with the volume group name and no other arguments, the entire volume group is reorganized. For lower levels of AIX, if you enter the reorgvg command with the volume group name and no other arguments, it will only reorganize the first logical volume in the volume group. The first logical volume is the one listed by the lsvg -l VolumeName command. This command is not allowed if the volume group is varied on in concurrent mode. Note Chapter 1. LVM commands 15 smit reorgvg 1.1.10 Listing the volume groups on the system The lsvg command displays information about volume groups. If you use no parameters, a list of the names of all defined volume groups is displayed. For the command line options, see lsvg in Appendix A.11, “The lsvg command” on page 229, or use the SMIT fastpath: smit lsvg Reorganize a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name park_vg LOGICAL VOLUME names [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 16 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit lsvg SMIT provides the following field: List only the active volume groups. The default is to list all volume groups. smit lsvg output List Volume Groups Move cursor to desired item and press Enter. List All Volume Groups List Contents of a Volume Group List All Logical Volumes by Volume Group F1=Help F2=Refresh F3=Cancel F8=Image F9=Shell F10=Exit Enter=Do COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. rootvg asgard_vg software F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 17 1.1.11 Listing the configuration of a volume group The lsvg command also displays more detailed information about volume groups. When information from the Device Configuration Database is unavailable, some of the fields will contain a question mark (?) in place of the missing data. The lsvg command attempts to obtain as much information as possible from the description area when the command is given a logical volume identifier. For the command line options, see lsvg in Appendix A.11, “The lsvg command” on page 229, or use the SMIT fastpath: smit lsvg SMIT provides the following field: List option status - volume group configuration logical volumes - logical volume details physical volumes - physical volume usage smit lsvg - List contents of a volume group List Contents of a Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * VOLUME GROUP name [park_vg] List OPTION status F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 18 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit lsvg - Volume group configuration Explanation of the fields displayed: Volume group Name of the volume group. Volume group state State of the volume group. If the volume group is activated with the varyonvg command, the state is either active/complete (indicating all physical volumes are active) or active/partial (indicating some physical volumes are not active). If the volume group is not activated with the varyonvg command, the state is inactive. Permission Access permission: read-only or read-write. Max LVs Maximum number of logical volumes allowed in the volume group. LVs Number of logical volumes currently in the volume group. Open LVs Number of logical volumes within the volume group that are currently open. Total PVs Total number of physical volumes within the volume group. COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. VOLUME GROUP: asgard_vg VG IDENTIFIER: 00017d378edf7c9d VG STATE: active PP SIZE: 4 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 1611 (6444 megabytes) MAX LVs: 256 FREE PPs: 1546 (6184 megabytes) LVs: 5 USED PPs: 65 (260 megabytes) OPEN LVs: 0 QUORUM: 2 TOTAL PVs: 3 VG DESCRIPTORS: 3 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 3 AUTO ON: yes MAX PPs per PV: 1016 MAX PVs: 32 F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 19 Active PVs Number of physical volumes that are currently active. VG identifier The volume group identifier. PP size Size of each physical partition. Total PPs Total number of physical partitions within the volume group. Free PPs Total number of physical partitions not allocated. Alloc PPs Number of physical partitions currently allocated to logical volumes. Quorum Number of physical volumes needed for a majority. VGDS Number of volume group descriptor areas within the volume group. Auto-on Automatic activation at IPL (yes or no). Concurrent1 States whether or not the volume group is Concurrent Capable or Non-Concurrent Capable. Applies to AIX Version 4.2 or later. Auto-Concurrent1 States whether you should autovary the Concurrent Capable volume group in concurrent or non-concurrent mode. For volume groups that are Non-Concurrent Capable, this value defaults to Disabled. Applies to AIX Version 4.2 or later. VG Mode1 The vary on mode of the volume group: Concurrent or Non-Concurrent. Applies to AIX Version 4.2 or later. Node ID1 Node ID of this node if volume group is varied on in concurrent node. Active Nodes1 Node IDs of other concurrent nodes that have this volume group varied on. Max PPs Per PV Maximum number of physical partitions per physical volume allowed for this volume group. Max PVs Maximum number of physical volumes allowed in this volume group. 1 Only displayed if volume group is concurrent capable 20 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.1.12 List contents of a volume group The lsvg command will also display information about the logical volumes or physical volumes in the volume group. As seen in the previous section, either logical volume or physical volume information can be specified in the list option. smit lsvg - Logical volume list option Explanation of the fields displayed: LV Name Name of the logical volume. Type The logical volume type, for example, jfs (journaled file system), jfslog (jfs log), boot, paging, or dump. LPs The number of logical partitions currently in the logical volume. PPs The number of physical partitions currently in the logical volume. PVs The number of physical volumes that the logical volume is spread over. LV State The logical volume state. open - active closed - inactive syncd - mirror copies synchronized stale - mirror copies not in sync COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. asgard_vg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT odin_lv jfs 12 12 1 closed/syncd /home/odin thor_lv jfs 12 12 1 closed/syncd /home/thor loglv00 jfslog 1 1 1 closed/syncd N/A loki_lv jfs 10 20 1 closed/syncd N/A F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 21 Mount point The mount point of the associated file system. smit lsvg - Physical volume list option Explanation of the fields displayed: PV Name Name of the physical volume. PV State The physical volume state. active - in use missing - physical volume missing removed - for a removable physical volume varied off - volume group varied off Total PPs The total number of physical partitions on the physical volume. Free PPs The number of physical partitions currently not allocated to a logical volume. Free distribution The number of physical partitions in each region. Regions are shown from right to left as outer edge, outer-middle, center, inner-middle, and inner edge. 1.2 Logical volume related commands The commands in this section relate to creating and modifying logical volumes. These commands can be run from the command line or from the SMIT System Storage management -> Logical Volume Manager ->Logical Volumes menu (See Figure 3). COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. asgard_vg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk11 active 537 492 108..62..107..107..108 hdisk9 active 537 517 108..87..107..107..108 hdisk10 active 537 537 108..107..107..107..108 F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next 22 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Figure 3. SMIT logical volume options 1.2.1 Add a logical volume The mklv command creates a new logical volume within the given volume group. Physical partitions can be allocated to the logical volume from one physical volume or many. Allocation policies can also be used to determine which physical partitions should be used to make up the logical volume (if there are enough free partitions in the volume group to allow choice). When the logical volume is created, it can be created with extra copies as a mirrored logical volume, or additional copies can be added later on. For the command line options, see mklv in Appendix A.17, “The mklv command” on page 243, or use the SMIT fastpath: smit mklv SMIT provides the following fields: Logical volume name A system wide unique one to 15 character name. Logical Volumes List All Logical Volumes by Volume Group Add a Logical Volume Set Characteristic of a Logical Volume Show Characteristics of a Logical Volume Remove a Logical Volume Copy a Logical Volume Change a Logical Volume Rename a Logical Volume Increase the Size of a Logical Volume Add a Copy to a Logical Volume Remove a Copy from a Logical Volume AIX Version 4.3.3 supports logical volumes that are both striped and mirrored. These logical volumes cannot be used on systems with lower versions of AIX. Note Chapter 1. LVM commands 23 Number of logical partitions The number of logical partitions to allocate to the logical volume. Physical volume names The physical volumes to use to allocate physical partitions. If none are specified, AIX will use physical volumes that best meet the specified allocation policies. Logical volume type The type of logical volume - jfs - journaled file system jfslog - log logical volume for a jfs boot - contains AIX boot image paging - system paging logical volume Position on physical volume Specifies the intra-physical volume allocation policy. SMIT uses the different terms to describe the regions on physical volume. Range of physical volumes Specifies the inter-physical volume allocation policy minimum - tries to use minimum number of disks (depending on number of mirror copies.) maximum - will spread the logical volume over the available physical volumes. Max number of physical volumes used Sets the number of physical volumes to be used in allocation. Must be between one and the number of physical volumes in the volume group. Number of copies Specifies the number of physical partitions to be allocated for each logical partition. Must be between one (no mirroring) and three. Mirror write consistency Whether mirror write consistency is turned on. Allocate each logical partition copy on a separate physical volume Sets the strictness policy. For availability, one usually wants to allocate each copy of a logical volume on different physical volumes. 24 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Relocate the logical volume during reorganization Sets whether a reorganization of the volume group will affect this logical volume. Logical volume label A one to 127 character label for the logical volume. If a jfs is using this logical volume, then the mount point will be stored here. Max number of partitions Sets the maximum number of logical partitions that can be allocated to this logical volume. The default is 512. Note the logical volume may never have this many logical partitions. Enable bad block relocation Specifies whether the logical volume manager bad block relocation will be used for this logical volume. Scheduling policy Sets how mirror reads/writes are done: parallel - writes to logical volume copies performed at once, reads from the most accessible copy. sequential - writes to logical volume copies performed sequentially and waits for completion before proceeding to the next. Reads are from the primary copy. Enable write verify Sets if each write is verified by a read. File containing allocation map Specifies the name of the file that contains the allocation map for the logical volume. Stripe size The stripe width (4,16,32,64,128 KB, or none) Chapter 1. LVM commands 25 smit mklv 1.2.2 Copy a logical volume to a new logical volume A new logical volume will be created with the same attributes as the source logical volume. The user can chose to define the name for the new logical volume, or let the system assign the name, with the user just specifying the prefix. Add a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] Logical volume NAME [] * VOLUME GROUP name asgard_vg * Number of LOGICAL PARTITIONS [] PHYSICAL VOLUME names [] Logical volume TYPE [] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [] to use for allocation Number of COPIES of each logical 1 partition Mirror Write Consistency? yes Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] Enable BAD BLOCK relocation? yes SCHEDULING POLICY for reading/writing parallel logical partition copies Enable WRITE VERIFY? no File containing ALLOCATION MAP [] Stripe Size? [Not Striped] [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 26 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands For the command line options, see cplv in Appendix A.4, “The cplv command” on page 209, or use the SMIT fastpath: smit cplv SMIT provides the following fields: Source logical volume name The name or logical volume ID of the source logical volume ([F4] for list). Destination logical volume The name of the new logical volume. Destination volume group The name of the volume group in which the destination logical volume will reside. smit cplv - Copy to a user created logical volume 1.2.3 Copy a logical volume to same sized or bigger logical volume This example is similar to the previous example, except that the logical volume will be copied to an already existing logical volume. The type field in the destination logical volume must be set to copy before this command will work. If you are copying a striped logical volume and the destination logical volume does not exist, an identical copy, including the striped block size and striping width of the source logical volume, is created, and then the data is copied Note Copy to a user created logical volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * SOURCE logical volume name [] * DESTINATION logical volume to create [] * Destination VOLUME GROUP name [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 27 For the command line options, see cplv in Appendix A.4, “The cplv command” on page 209, or use the SMIT fastpath: smit cplv SMIT provides the following fields: Source logical volume name The name of the logical volume to be copied ([F4] for list). Destination logical volume The name of an existing logical volume, to which the source logical volume will be copied. smit cplv - Copy over an existing logical volume 1.2.4 Copy a logical volume to a smaller logical volume This cannot be performed by simply copying the logical volume. The smit cplv command will allow this, but will result in a corrupted file system. To do this properly, the user must create the new logical volume at the required size, create a file system on the logical volume, and mount it. The information can then be copied using cp -r or cpio -p (for details on the cpio command see Appendix D.4, “The cpio command” on page 331). The destination logical volume must be the same size or larger than the source logical volume, as not all file system data will be copied. This will lead to corruption of the destination file system. Note Copy over an existing logical volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * SOURCE logical volume name [] * DESTINATION logical volume [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 28 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.2.5 Add a mirrored copy to a logical volume The mklvcopy command increases the number of copies of each logical partition in the logical volume. This is accomplished by increasing the total number of physical partitions for each logical partition to the number represented by Copies. You can request that the physical partitions for the new copies be allocated on specific physical volumes (within the volume group); otherwise, all the physical volumes within the volume group are available for allocation. The logical volume modified with this command uses the copies parameter as its new copy characteristic. The data in the new copies will not be synchronized until one of the following occurs: • The -k option is used. • The volume group is activated by the varyonvg command. • The volume group or logical volume is synchronized explicitly by the syncvg command. Individual logical partitions are always updated as they are written to. For the command line options, see mklvcopy in Appendix A.18, “The mklvcopy command” on page 250, or use the SMIT fastpath: smit mklvcopy SMIT provides the following fields: Logical volume name The name of the logical volume to add the copy to ([F4] for list). New total number of logical partition copies The new total number of copies for each logical partition after this copy has been added. Physical volume names The names of the physical volumes that will be used to create the new copies. If not specified, physical volumes in the volume group will be used that best meet the allocation policies of the logical volume ([F4] for list). To create a copy of a striped logical volume, all systems that access the volume group must be at least at AIX Version 4.3.3. Note Chapter 1. LVM commands 29 Position on physical volumes Set the intra-physical volume allocation policy for this copy/copies. Range of physical volumes Set the inter-physical volume allocation policy for this copy/copies. Allocate each copy on a separate physical volume Set the strictness policy for this copy/copies. File containing the allocation map Use a map file for allocating the new logical partitions. Synchronize the data in the new logical partition copies This will force the synchronization of the data between the existing logical partitions and the new logical partitions. smit mklvcopy 1.2.6 Set allocation policy for a logical volume The allocation policy can be changed for a logical volume, but it will not affect the allocation of existing physical partitions. It will only affect the allocation of Add Copies to a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * LOGICAL VOLUME name loki_lv * NEW TOTAL number of logical partition 1 copies PHYSICAL VOLUME names [] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? File containing ALLOCATION MAP [] SYNCHRONIZE the data in the new no logical partition copies? F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 30 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands new partitions, or if the logical volume is reorganized, using the reorgvg command. For the command line options, see chlv in Appendix A.1, “The chlv command” on page 199, or use the SMIT fastpath: smit chlv SMIT provides the following fields: Logical volume name The name of the logical volume that will have its allocation policy changed ([F4] for list). Position on physical volume Sets the intra-physical volume allocation policy. Range of physical volumes Sets the inter-physical volume allocation policy. smit chlv Change a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Logical volume NAME odin_lv Logical volume TYPE [jfs] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [/home/odin] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] SCHEDULING POLICY for reading/writing parallel logical partition copies PERMISSIONS read/write Enable BAD BLOCK relocation? yes Enable WRITE VERIFY? no Mirror Write Consistency? yes [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 31 1.2.7 Set strictness for a logical volume The strictness policy can be changed for a logical volume, but it will not affect the existing physical partitions. It will only affect the allocation of new partitions, or if the logical volume is reorganized, using the reorgvg command. For the command line options, see chlv in Appendix A.1, “The chlv command” on page 199, or use the SMIT fastpath: smit chlv SMIT provides the following fields: Logical volume name The name of the logical volume that will have its strictness changed ([F4] for list). Maximum number of physical volumes to use for allocation This physical volume upper bound is used with super strictness to determine how many physical volumes each mirror will span. Allocate each logical partition copy on a separate physical volume Sets the strictness for the logical volume to yes - Sets a strict allocation policy so that copies of a logical partition cannot share the same physical volume (default). no - Does not set a strict allocation policy. 32 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit chlv 1.2.8 Set write verify for a logical volume The write verify can be changed for a logical volume, and it will take effect immediately. Setting the write verify for a logical volume will mean that each write will be followed by a read to verify the data written. This obviously has performance implications. For the command line options, see chlv in Appendix A.1, “The chlv command” on page 199, or use the SMIT fastpath: smit chlv SMIT provides the following fields: Logical volume name The name of the logical volume that will have its write verify flag changed ([F4] for list). Enable write verify Set write verify on or off for the logical volume. Change a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Logical volume NAME odin_lv Logical volume TYPE [jfs] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [/home/odin] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] SCHEDULING POLICY for reading/writing parallel logical partition copies PERMISSIONS read/write Enable BAD BLOCK relocation? yes Enable WRITE VERIFY? no Mirror Write Consistency? yes [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 33 smit chlv 1.2.9 Set schedule policy The scheduling policy can be changed for a logical volume and will take effect immediately. For the command line options, see chlv in Appendix A.1, “The chlv command” on page 199, or use the SMIT fastpath: smit chlv SMIT provides the following fields: Logical volume name The name of the logical volume that will have its scheduling policy changed ([F4] for list). Scheduling policy for reading/writing logical partition copies There are two options for the scheduling policy: Parallel - Writes to logical volume copies Change a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Logical volume NAME odin_lv Logical volume TYPE [jfs] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [/home/odin] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] SCHEDULING POLICY for reading/writing parallel logical partition copies PERMISSIONS read/write Enable BAD BLOCK relocation? yes Enable WRITE VERIFY? no Mirror Write Consistency? yes [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 34 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands performed at once, reads from the most accessible copy. Sequential - Writes to logical volume copies performed sequentially and wait for completion before proceeding to the next. Reads are from the primary copy. smit chlv 1.2.10 Increase the maximum size of a logical volume The maximum size stops users increasing the size of logical volumes beyond a pre-determined size. While users can still increase the size of logical volumes by first changing the maximum size, it serves as a warning. The maximum size may be set as: Change a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Logical volume NAME odin_lv Logical volume TYPE [jfs] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [/home/odin] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] SCHEDULING POLICY for reading/writing parallel logical partition copies PERMISSIONS read/write Enable BAD BLOCK relocation? yes Enable WRITE VERIFY? no Mirror Write Consistency? yes [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 35 • Performance of the logical volume would deteriorate if allocation went beyond a given size. • Other parts of an organization may need to be aware if logical volumes are increased. For the command line options, see chlv in Appendix A.1, “The chlv command” on page 199, or use the SMIT fastpath: smit chlv SMIT provides the following fields: Logical volume name The name of the logical volume that will have its maximum size changed ([F4] for list). Maximum number of logical partitions This sets the maximum size (in logical partitions) that a logical volume can be. The default is 512. smit chlv Change a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Logical volume NAME odin_lv Logical volume TYPE [jfs] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? RELOCATE the logical volume during yes reorganization? Logical volume LABEL [/home/odin] MAXIMUM NUMBER of LOGICAL PARTITIONS [512] SCHEDULING POLICY for reading/writing parallel logical partition copies PERMISSIONS read/write Enable BAD BLOCK relocation? yes Enable WRITE VERIFY? no Mirror Write Consistency? yes [BOTTOM] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 36 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.2.11 Increase the size of a logical volume The extendlv command increases the number of logical partitions allocated to the logical volume by allocating an additional number of logical partitions. This can be limited to specific physical volumes, or all physical volumes can be considered to be available. By default, the logical volume is expanded using the existing characteristics. These can be temporarily overridden by specifying different allocation policies. However, the characteristics of the logical volume do not change. For the command line options, see extendlv in Appendix A.6, “The extendlv command” on page 212, or use the SMIT fastpath: smit extendlv SMIT provides the following fields: Logical volume name The name of the logical volume to be extended ([F4] for list). Number of additional logical partitions The number of logical partitions to add to the logical volume. Physical volume names This is used to specify which physical volumes will be used, else all physical volumes will be considered to be available. Position on physical volume Sets the intra-physical volume allocation policy for this allocation alone. The policy of the logical volume is not changed. Range of physical volumes Sets the inter-physical volume allocation policy for this allocation alone. Again, the policy of the logical volume is not changed. Maximum number of physical volumes to use for the allocation Sets the upper bound for this allocation. Allocate each logical partition on a separate physical volume Sets the strictness policy for this allocation. The -e, -m, -s, and -u flags are not valid with a striped logical volume. Note Chapter 1. LVM commands 37 File containing the allocation map A map file can be used to specify which physical partitions are to be used. smit extendlv 1.2.12 List the configuration of a logical volume The lslv command displays information about the logical volume. Used without any arguments, it returns the configuration of the logical volume. Other flags can return information about the physical partition usage or logical partition mapping. For the command line options, see lsvg in Appendix A.11, “The lsvg command” on page 229, or use the SMIT fastpath: smit lslv SMIT provides the following fields: Logical volume name The name of the logical volume to report ([F4] for list). List options Status - The configuration of the logical volume. Physical volume map - Usage of physical partitions by physical volume and region. Increase the Size of a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * LOGICAL VOLUME name grom_lv * Number of ADDITIONAL logical partitions [] PHYSICAL VOLUME names [] POSITION on physical volume middle RANGE of physical volumes minimum MAXIMUM NUMBER of PHYSICAL VOLUMES [32] to use for allocation Allocate each logical partition copy yes on a SEPARATE physical volume? File containing ALLOCATION MAP [] F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 38 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Logical partition map - The physical partition to logical partition mapping. smit lslv - Show the characteristics of a logical volume smit lslv can also be used to list the configuration of a logical volume. Show Characteristics of a Logical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * LOGICAL VOLUME name [odin_lv] List OPTION status F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. LOGICAL VOLUME: odin_lv VOLUME GROUP: asgard_vg LV IDENTIFIER: 00017d378edf7c9d.1 PERMISSION: read/write VG STATE: active/complete LV STATE: closed/syncd TYPE: jfs WRITE VERIFY: off MAX LPs: 512 PP SIZE: 4 megabyte(s) COPIES: 1 SCHED POLICY: parallel LPs: 12 PPs: 12 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: minimum RELOCATABLE: yes INTRA-POLICY: middle UPPER BOUND: 32 MOUNT POINT: /home/odin LABEL: /home/odin MIRROR WRITE CONSISTENCY: on EACH LP COPY ON A SEPARATE PV ?: yes STRIPE WIDTH 3 STRIPE SIZE 8K F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 39 Explanation of the fields displayed: Logical volume Name of the logical volume. Volume group Name of the volume group. Logical volume identifier Identifier of the logical volume. Permission Access permission, read-only or read-write. Volume group state State of the volume group. If the volume group is activated with the varyonvg command, the state is either active/complete (indicating all physical volumes are active) or active/partial (indicating all physical volumes are not active). If the volume group is not activated with the varyonvg command, the state is inactive. Logical volume state State of the logical volume. The Opened/stale status indicates the logical volume is open but contains physical partitions that are not current. Opened/syncd indicates the logical volume is open and synchronized. Closed indicates the logical volume has not been opened. Type Logical volume type. Write verify Write verify state (on or off). Mirror write consistency Mirror write consistency state (yes or no). Max LPs Maximum number of logical partitions the logical volume can hold. PP size Size of each physical partition. Copies Number of physical partitions created for each logical partition when allocating. Schedule policy Sequential or parallel scheduling policy. LPs Number of logical partitions currently in the logical volume. PPs Number of physical partitions currently in the logical volume. 40 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Stale partitions Number of physical partitions in the logical volume that are not current. BB policy Bad block relocation policy. Inter-policy Inter-physical allocation policy. Relocatable Indicates whether the partitions can be relocated if a reorganization of partition allocation takes place. Intra-policy Intra-physical allocation policy. Upper bound If the logical volume is super strict, upper bound is the maximum number of disks in a mirror copy. Mount point File system mount point for the logical volume, if applicable. Label Specifies the label field for the logical volume. Each LP copy on separate PV Current state of allocation, strict, nonstrict, or superstrict. Striping width1 The number of physical volumes being striped across. Strip size1 The number of bytes per stripe. 1 Only displayed if the logical volume is striped. 1.2.13 List a logical volumes detailed mapping The lslv command will also display information about the logical volume’s physical partition usage by region and physical volume or the actual logical to physical partition mapping. As seen in the previous section, the physical volume map or the logical partition map can be selected. Chapter 1. LVM commands 41 smit lslv - Showing the physical volume map Explanation of the fields displayed: PV The physical volume name. Copies The number of physical partitions used for each mirrored copy. Shows if a logical volume is mirrored on the same physical volume. In band The percentage of physical partitions on the physical volume belonging to the logical volume that have met their intra-physical volume allocation policy. Distribution The number of physical partitions laying in each region on the physical volume (shown from outer edge to inner edge). COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. grom_lv:/home/odin PV COPIES IN BAND DISTRIBUTION hdisk11 012:000:000 100% 000:012:000:000:000 F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next 42 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit lslv - Showing the logical partition map Explanation of the fields displayed: LP The logical partition number. PP1-3 Physical partition number for copy 1 to 3. PV1-3 Physical volume that the physical partition resides on for copy 1through 3. 1.3 Physical volume related commands The commands in this section relate to creating and modifying physical volumes. These commands can be run from the command line or from the SMIT System Storage management -> Logical Volume Manager -> Physical Volumes menu (See Figure 4). COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. [TOP] grom_lv:/home/odin LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0109 hdisk11 0002 0110 hdisk11 0003 0111 hdisk11 0004 0112 hdisk11 0005 0113 hdisk11 0006 0114 hdisk11 0007 0115 hdisk11 0008 0116 hdisk11 0009 0117 hdisk11 0010 0118 hdisk11 0011 0119 hdisk11 0012 0120 hdisk11 [BOTTOM] F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 43 Figure 4. SMIT physical volume options 1.3.1 List all physical volumes in system The getlvodm -C command will list all the configured physical volumes in the system. For the command line options, see getlvodm in Appendix B.7, “The getlvodm command” on page 291, or use the SMIT fastpath: smit pv smit pv - List all physical volumes in system List A ll P hysica l V o lum es in S ystem A dd a D isk C hange C harac te ris t ic s o f a P hys ical V o lum e Lis t C ontents o f a P hys ical V o lum e M ove C ontents of a P hys ica l V olum e Phys ica l Volum es COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. hdisk0 hdisk1 hdisk2 hdisk3 hdisk5 hdisk4 hdisk6 hdisk9 hdisk10 hdisk11 hdisk7 F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next 44 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.3.2 List configuration of a physical volume The lspv command displays information about the physical volume. Used without any arguments, it returns the configuration of the physical volume. Other flags can return information about the logical volumes and physical partitions. For the command line options, see lspv in Appendix A.10, “The lspv command” on page 224, or use the SMIT fastpath: smit lspv SMIT provides the following fields: Physical volume name The name of the physical volume to report ([F4] to list). List option Status - The configuration of the physical volume Logical volumes - List the logical volumes on the physical volume, their size, and distribution. Physical partitions - The physical partition usage by logical volume. smit lspv - List contents of a physical volume smit lspv can also be used to show the configuration of a physical volume. List Contents of a Physical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * PHYSICAL VOLUME name [hdisk9] List OPTION status F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 45 Explanation of the fields displayed: Physical volume Name of the physical volume. Volume group Name of volume group. PV Identifier The physical volume identifier for this physical disk. VG Identifier The volume group identifier of the volume group that this physical disk is a member. PVstate State of the physical volume. If the volume group that contains the physical volume is varied on with the varyonvg command, the state is active, missing, or removed. If the physical volume is varied off with the varyoffvg command, the state is varied off. Stale Partitions Number of physical partitions on the physical volume that are not current. PP size Size of physical partitions on the volume. Total PPs Total number of physical partitions on the physical volume. COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. PHYSICAL VOLUME: hdisk9 VOLUME GROUP: park_vg PV IDENTIFIER: 00017d37628265fc VG IDENTIFIER 00017d378edf7c9d PV STATE: active STALE PARTITIONS: 6 ALLOCATABLE: yes PP SIZE: 4 megabyte(s) LOGICAL VOLUMES: 5 TOTAL PPs: 537 (2148 megabytes) VG DESCRIPTORS: 1 FREE PPs: 459 (1836 megabytes) USED PPs: 78 (312 megabytes) FREE DISTRIBUTION: 108..29..107..107..108 USED DISTRIBUTION: 00..78..00..00..00 F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next 46 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Free PPs Number of free physical partitions on the physical volume. Used PPs Number of used physical partitions on the physical volume. Free distribution Number of free partitions available in each intra-physical volume section. Used distribution Number of used partitions in each intra-physical volume section. Allocatable Allocation permission for this physical volume. Logical volumes Number of logical volumes using the physical volume. VG descriptors Number of volume group descriptors on the physical volume. 1.3.3 List contents of a physical volume The lspv command will also display information about the logical volumes on the physical volume and the physical partition usage by region and logical volume. As seen in the previous section, the logical volumes or physical partitions can be selected. Explanation of the fields displayed: LV Name The logical volume name. LPs The number of logical partitions used by the logical volume. PPs The number of physical partitions used by the logical volume. Distribution The number of physical partitions laying in each region on the physical volume (shown from outer edge to inner edge). Mount point The mount point of the file system (if appropriate). Chapter 1. LVM commands 47 smit lspv - Show logical volumes on the physical volume Explanation of the fields displayed: PP range The physical volume name. State The current state of the physical partitions: free, used, stale, or VGDA. If a volume group is converted to a big VG format, it may be necessary to use some data partitions for the volume group descriptor area. These partitions will be marked as VGDA. Region The intra-physical volume region in which the partitions are located. LV ID The name of the logical volume to which the physical partitions are allocated. Type The type of the logical volume to which the partitions are allocated. Mount point The mount point of the file system (if appropriate). COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. hdisk9: LV NAME LPs PPs DISTRIBUTION MOUNT POINT loki_lv 4 4 00..04..00..00..00 /home/loki odin_lv 12 12 00..12..00..00..00 N/A thor_lv 15 30 00..30..00..00..00 /home/thor F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next 48 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands smit lspv - Show physical partition usage for the physical volume 1.3.4 Move data from a physical volume The data in allocated physical partitions can be moved from one physical volume to one or more physical volumes as long as they are in the same volume group. This process can be limited to the physical partitions belonging to one logical volume; otherwise, all physical partitions will be moved. For the command line options, see migratepv in Appendix A.14, “The migratepv command” on page 235, or use the SMIT fastpath: smit migratepv SMIT provides the following fields: Source physical volume The name of the physical volume from which to move the data. Destination physical volumes The destination physical volume or volumes. Move only data belonging to this logical volume If a logical volume is specified, only physical partitions used by this logical COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. hdisk9: PP RANGE STATE REGION LV ID TYPE MOUNT POINT 1-108 free outer edge 129-132 used outer middle loki_lv jfs /home/loki 133-144 used outer middle odin_lv jfs N/A 145-174 used outer middle thor_lv jfs /home/thor 175-180 used outer middle mirror_lv jfs N/A 181-186 stale outer middle mirror_lv jfs N/A 187-215 free outer middle 216-322 free center 323-429 free inner middle 430-537 free inner edge F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 49 volume will be moved, else all physical partitions will be moved. smit migratepv 1.4 Journaled file system related commands The commands in this section relate to creating and modifying journaled file systems. These commands can be run from the command line or from the SMIT System Storage Management -> File Systems menu (See Figure 5). Figure 5. SMIT file systems options Move Contents of a Physical Volume Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * SOURCE physical volume name hdisk9 * DESTINATION physical volumes [] Move only data belonging to this [] LOGICAL VOLUME? F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do File Systems List All File Systems List All Mounted File Systems Add / Change / Show / Delete File Systems Mount a File System Mount a Group of File Systems Unmount a File System Unmount a Group of File Systems Verify a File System Backup a File System Restore a File System List Contents of a Backup File Systems Journaled File Systems CDROM File Systems Network File Systems (NFS) Cache FS Add a Journaled File System Add a Journaled File System on a Previously Defined Logical Volume Change/ Show Characteristics of a Journaled File System Defragment a Journaled File System 50 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.4.1 Add a JFS to a previously defined logical volume menu The crfs command is used to create a file system on an already created logical volume, or a new one can be created using the -d flag. The file system will not be mounted once it is created. The file system can be: Standard Standard journaled file system. Compressed All data is compressed using the Lempev Zed compression algorithm Large file enabled Provides support for files greater than 2 GB For the command line options, see crfs in Appendix D.5, “The crfs command” on page 335, or use the SMIT fastpath: smit crfs SMIT provides the following fields: Logical Volume Name Name of the logical volume to use. Mount Point The mount point for the file system (will become the logical volume label). Mount Automatically at system restart Mount the file system automatically when system starts. Permissions Set the permissions for the file system - read/write or read only. Mount Options Set the security related mount options nosuid - prevents setuid and setgid from programs in this file system nodev - no open system calls of devices from this mount. Start disk accounting Turn on accounting for this file system Fragment size Fragment size can be 512, 1024, 2048, and 4096. Sizes below 4096 allow partial blocks to be written Number of bytes per inode Specifies the ration of the file system size to the number of inodes. Allocation group size Determines the range of allowable nbpi (number of bytes per i-node). Chapter 1. LVM commands 51 smit crfs More information about fragment size, nbpi, and allocation group size can be found in the redbook AIX Logical Volume Manager from A to Z, Introduction and Concepts, SG24-5432. 1.4.2 Change/show details of a file system The chfs command is used to change the attributes of a file system. The new mount point, automatic mounts, permissions, and file system size can be set or changed. Some file system attributes are set at the time the file system is created and cannot be changed. For the journaled file system these attributes include the fragment size, block size, number of bytes per i-node, compression, and the minimum file system size. For the command line options, see chfs in Appendix D.2, “The chfs command” on page 327, or use the SMIT fastpath: smit chjfs SMIT provides the following fields: File system name The current mount point of the file system. New mount point The new mount point for the file system. Add a Standard Journaled File System Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * LOGICAL VOLUME name * MOUNT POINT [] Mount AUTOMATICALLY at system restart? no PERMISSIONS read/write Mount OPTIONS [] Start Disk Accounting? no Fragment Size (bytes) 4096 Number of bytes per inode 4096 Allocation Group Size (MBytes) 8 F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 52 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands Size of file system in 512-byte blocks The new size of the file system. It will be rounded up to the nearest physical partition. Mount Group File system can be the member of a mount group - File systems that can be mounted as a group. Mount automatically at system restart Change the automount option. Permissions Set permissions (read/write or read only). Mount Options Set the mount options (nosuid or nodev). Start Disk Accounting Turn on or off accounting for this file system. smit chjfs The other fields cannot be changed and are just for information. Note Change / Show Characteristics of a Journaled File System Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] File system name /usr NEW mount point [/usr] SIZE of file system (in 512-byte blocks) [933888] Mount GROUP [bootfs] Mount AUTOMATICALLY at system restart? yes PERMISSIONS read/write Mount OPTIONS [] Start Disk Accounting? no Fragment Size (bytes) 4096 Number of bytes per inode 4096 Compression algorithm no Large File Enabled false Allocation Group Size (MBytes) 8 F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do Chapter 1. LVM commands 53 1.4.3 Defrag a file system The amount of contiguous free space in a file system can be increased by reorganizing allocations to be contiguous rather than scattered across the disk. For the command line options, see defragfs in Appendix D.6, “The defragfs command” on page 338, or use the SMIT fastpath: smit dejfs SMIT provides the following fields: File system name Mount point of the file system to defrag. Perform, Query, or report Select the option Perform - Run the defragmentation of the file system. Query - Report the current fragmentation state of the file system. Report - Produce a report as if the defrag had been run. smit dejfs The smit dejfs can be used to obtain a report. Defragment a Journaled File System Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] File System Name / Perform, Query, or Report ? perform F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 54 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands 1.4.4 Mount a file system Mounting a file system makes the file system available for use at its defined mount point. The mount point becomes the root directory of the newly mounted file system. For the command line options, see mount in Appendix D.23, “The mount command” on page 362, or use the SMIT fastpath: smit mountfs SMIT provides the following fields: File system name The current defined mount point. Directory over which to mount If you wish to mount the file system over another directory. Type of file system Can be cdrfs, jfs, nfs, sfs, nfs3, cachefs, or autofs. COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. [TOP] statistics before running defragfs: number of free fragments 364911 number of allocated fragments 11921 number of free spaces shorter than a block 0 number of free fragments in short free spaces 0 statistics after running defragfs: number of free spaces shorter than a block 0 number of free fragments in short free spaces 0 other statistics: number of fragments moved 0 number of logical blocks moved 0 number of allocation attempts 0 number of exact matches 0 [BOTTOM] F1=Help F2=Refresh F3=Cancel F6=Command F8=Image F9=Shell F10=Exit /=Find n=Find Next Chapter 1. LVM commands 55 Force the mount Requests a forced mount during system initialization to enable mounting over the root file system. Remote node containing the file system to mount If the file system exists on a remote system. Mount as a removable file system Treat the file system as a removable file system. While files are open, it will be treated the same as a normal file system; however, once all files are closed, the system will not return errors if it is removed. Mount as read-only Set permissions to read-only, not read/write Disallow device access via this mount Set the nodev security option. Disallow execution of setuid and setgid programmes in this system Set the nosuid security option. smit mountfs Mount a File System Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] FILE SYSTEM name [] DIRECTORY over which to mount [] TYPE of file system FORCE the mount? no REMOTE NODE containing the file system [] to mount Mount as a REMOVABLE file system? no Mount as a READ-ONLY system? no Disallow DEVICE access via this mount? no Disallow execution of SUID and sgid programs no in this file system? F1=Help F2=Refresh F3=Cancel F4=List Esc+5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do 56 AIX Logical Volume Manager from A to Z: Troubleshooting and Commands