0% found this document useful (0 votes)
73 views344 pages

AIX Training Slides

AIX 5L can be installed via CD-ROM. The installation process involves answering system specific questions and configuring settings such as installation method, disks, and language. The Configuration Assistant is then used by the system administrator to further customize the system by configuring storage, networking, date/time, and other options.

Uploaded by

Sumit Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views344 pages

AIX Training Slides

AIX 5L can be installed via CD-ROM. The installation process involves answering system specific questions and configuring settings such as installation method, disks, and language. The Configuration Assistant is then used by the system administrator to further customize the system by configuring storage, networking, date/time, and other options.

Uploaded by

Sumit Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 344

AIX

Installation and
Initial Configuration

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
List the different installation and media options available
List the steps necessary to install the AIX 5L base
operating system
Identify the tasks that can be carried out using the
Configuration Assistant
Installation Methods
CD-ROM
Tape (earlier versions)
• 4 mm
• 8 mm
Pre-installation Option (for a new system order)
Network Install Manager (NIM)
• Token Ring
• Ethernet
• FDDI
Installation Process – from CD
Insert CD in CD-ROM drive

Power on peripheral SCSI devices

Power on system

Press F5
Console and Language Definition
Select your console

****Please define the system Console


****

Type the F1 key and press Enter to use


this display as the System Console

Next:
Select the
Language
Installation and Maintenance Menu
At the Installation and Maintenance menu check all the
Installation settings
Installation Settings
Method of Installation
Change Method of Installation
Type the number of your choice and press Enter

1.New and Complete Overwrite


Overwrites EVERYTHING on the disk select for the installation

2. Preservation Install
Preserves SOME of the existing data on the disk selected for the
installation

3.Migration Install
Upgrades the BOS to current release. Other (application) files and
configuration data will be spared

88 Help ?
99 Previous Menu

>>> Choice [2]: 1


Installation Disks
Primary Language Environment
Advanced Options
Begin Installation
Builds AIX directory structure
Restores BOS, locale and filesets from installation media
from installation media only.
Installs software for connected and powered on devices
Installation Flow Chart – All Systems
Start the system

Select the console

Select the language

Begin
With default
settings

no
Verify default install
Change:
Method and settings Installation Method
yes Destination disks
Language
Default yes Desktop
Settings need to be
Changed?
TCB
64-bit kernel
no
Install from media

Perform customization
Configuration Assistant Menu
After the initial installation the configuration
assistant will start with the following option
Set or verify the system date and time
Set password for the administrator (root user)
Manage systems storage and paging space
Configure network communications (TCP/IP)
Configure a web server to run web based
system manager in a browser
Configure online documentation library services
Exit the configuration assistant
Exercise
Install the BOS
Configure storage and paging space
Configure TCPIP
Configure date and time
Familiarize yourself with other options
Use install_assist or configassist
Checkpoint

1. AIX 5L can be installed which of the following:


(select all that are correct)
1. 8 mm tape
2. CD-ROM
3. Diskette
4. 4 mm tape
2. True or false? A `Preservation Install` will
preserve all data on the disks.
3. What is the console used for during the
installation process?
Summary
AIX 5L is only distributed on CD-ROM
In order to install the base operating system,
system specific questions have to be answered
before the process can begin
The Configuration Assistant is used by the system
administrator to further customize the system
System Management
Tools and
Documentation

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives

Outline the benefits of the system management tools


available with AIX 5L
Define the functionality of SMIT
Define how SMIT activity is logged
Define the use of the web based system manager
Setup and use AIX web based documentation
Early/Traditional System Administration
print mount
backup
passwd COMMANDS errpt
installp penable Kill

System
Flat Files Management
adduser
/etc/profile
/etc/qconfig
/etc/filesystems Front End Menus
/etc/rc
minidisks
/etc/passwd devices
AIX administration
Web-based
SMIT System
Manager

High-Level Commands

Low-Level Intermediate-Level
Commands Commands

System Object
System Kernel ASCII
Resource Data
Calls Services Files
Controller Manager
SMIT Log and Script Files
$HOME/smit.log
contains the every screen
(menu/selector/dialog) visited, the AIX commands
executed and the output from these commands
$HOME/smit.script
contains the commands executed by SMIT
(preceded by date and time of execution). This file
can be used directly as the shell script to perform
tasks multiple times
smit command
Smit [-options] [fastpath]
Invoke ASCII version
# smitty
Run no high level commands
# smit –x ( This will just log the entries but wont
run actual command)
Redirect the log file
# smit –s /home/team01/smit.script
Configuring the AIX V5L Documentation
Document Server contains
AIX softcopy documentation
Documentation Library Service
Web Server Software
Web browser software
Document Client
Web browser software
Configuring AIX V5L Online
Documentation

Configure TCP/IP
Install the Web server software
Configure and start the Web server software
Install the Web browser software
Install or mount the AIX documentation
Configure the Documentation Library Service
Install sysmgt.websm.framework
Run smit web_configure
Internet and Documentation Services

Internet and Documentation Services

Move cursor to desired item and press Enter

Change / Show Default Browser


Show Documentation and Search Server
Change documentation and Search Server
Change / Show Default Documentation Language
Web based System Manager

F1=Help F2=Refresh F3=Cancel F9=Image


F9=Shell F10=Exit Enter=Do
Change /Show Default Browser

Backup root Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Default browser [Netscape] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Change Documentation and Search
Server

From smit web_configure select the location of the


Documentation Search server
Select the web server software (IBM HTTP Web
Server)
Local web server cgi-bin directory
/usr/HTTPServer/cgi-bin
Local web server HTML document Directory
/usr/HTTPServer/htdocs
Local webserver PORT number 80
AIX V5L Documentation
Point your web browser to
http://<hostname>/cgi-bin/ds_form
Exercise
Configure Web based Documentation
Access the web based documentation
Run docsearch.
Web Based System Manager
Simplification of AIX administration by a single
interface
Enable AIX systems to be administered from almost
any client platform
Enable AIX systems to be administered remotely.
Provides a system administration environment that
provides a similar look and feel to thewindows 95/NT
and AIX CDE environments
Accessing the Web based System
Manager
Run # wsm on the standalone server
Client-Server
with browser http://<hostname>/wsm.html
From AIX client:
# wsm –host <hostname>
Configuring Client/Server WebSM
Install the Web Server
Test the Web Server
Install WebSM (usually done by default with the base)
Define the Web server document directory.
# /usr/websm/bin/wsmappletcfg –docdir
/usr/HTTPServer/htdocs
The same can be configured using
# smit web_based_system_manager
Enable WebSM server
# /usr/websm/bin/wsmserver -enable
Summary
There are number of system management tools that
can be used by the system administrator, such as
SMIT, and the web based System Manager
SMIT provides graphics or ASCII support for most
system administration
The web-based system manager supports system
administration tasks in a standalone or client server
environment
Use a Web browser to access soft copy
documentation with AIX
Devices

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives

Describe the difference between logical and physical


devices
Describe the purpose of the predefined and
customized databases
Describe different states of a device
Describe the format of device location codes
Use SMIT to Add/Show/Change/Delete devices
Device Terminology
Physical Devices – Actual Hardware
Ports – The physical connectors or the device access
point
Device Drivers – Software in the kernel that controls
the activity on a port
Logical Device – Software interfaces tht present the
means of accessing a physical device to users and
application programs
/dev – The directory which contains all the logical
devices
Listing of a /dev directory
# ls –l /dev
brw-rw---- 1 root system 13,0 Jan 24 02:25 fd0
brw-rw---- 1 root system 13,64 Jan 24 02:25 fd1
crw-rw---- 1 root system 13,0 Jan 24 02:25 rfd0
crw-rw---- 1 root system 13,64 Jan 24 02:25 rfd0
:
:
crwxr-xr-x 1 root system 20,0 Jan 24 02:25 rmt0
crwxr-xr-x 1 root system 20,1 Jan 24 02:25 rmt0.1
crwxr-xr-x 1 root system 20,2 Jan 24 02:25 rmt0.2
crwxr-xr-x 1 root system 20,3 Jan 24 02:25 rmt0.3

rmt0

rmt1
Device Configuration Database
Predefined Configuration Database
Customized Configuration Database
The attributes are managed by ODM
Run lsdev –P –H to see Predefined Devices
For example # lsdev –Pc tape
List all supported Devices “ lsdev –P” “smit devices > List
Devices > List All Supported Devices
List All defined Devices
CuDv (Customized Devices)
# lsdev –C –H
# lsattr –EH –l sys0
# lsattr -E –l sys0 –a realmem
Device States
Undefined – the device is supported device but is not
configured. It does not reside in the customized database
Defined – The device hash been added to the customized
database and is allocated a logical device. It is unavailable for
use
Available – The device resides in the customized database
To move defined tape device to an available state
# mkdev –l rmt0
To move an available device to defined state
# rmdev –l rmt0
To permanently remove an avaialble or defined tape device
# rmdev –dl rmt0
Self Configuring Devices
cfgmgr is a program that runs during the boot to
configure the device automatically.
The same command can be run any time when the
system is up to reconfigure the device configuration
database
Run smit devices to configure various hardware under
AIX
Device Addressing
Locations codes are used for device addressing
The location code for a device is a path from the
adapter in the CPU drawer or system unit, through
the signal cables and the asynchronous distribution
box (if there is one) to the device
Location codes consist of up to four fields of
information depending on the type of device
Location codes differ based on model type
Location Code Format for PCI Devices
AB-CD-EF-GH
AB 00 Resource attached to the processor
01 Resources attached to the ISA Bus
04 Resource attached to the PCI Bus

CD 01-99 For pluggable adapters/cards


A-Z,0 The connector ID

EF The connector ID
GH Port identifier, address, memory modules
device, FRU for the device
Location Code Example: Non SCSI
128-Port Asynchronous Controller

RAN with 16 port each


04-05-11-01
04-05-11-07

1
128-Port
Adapter
04-05-22-04
1
2

04-05 1 2

04-05-21-10
Location Code Format for SCSI Devices
AB-CD-EF-G,H

AB-CD Identifies the Bus and the Adapter location


same as with non-SCSI devices

EF For a single SCIS bus – 00


For a dual SCSI bus:
Internal bus – 00
External Bus - 01

G,H G – SCSI address of the device


H – Logical unit number of the device
Location Code Example for SCSI
Devices
SCSI Devices (Disk, Tape, CDROM)
04-01-00-4,0

SCSI 04-01-00-6,0
Adapter
04-01
6

0
SCSI ID
Documenting Hardware Configuration
lsdev –CH
Provides name, status, location and
description of devices
lscfg –v
Provides details of all devices including
manufacturer, type and model number and part
numbers
lsattr –El sys0
Provides attributes for the name device (for
example sys0) Run command for all devices
Exercise: Devices
Configure tty device in the system
Observe location codes for all the devices in the system
Practice commands
Checkpoint
Is it possible to use SCSI ID 7 for a new tape device?
Find out the location code for the root disk and describe?
Summary
A physical device is the actual hardware attached to the
system. Alogical device is the software interface used by
programs and users to access a physical device
Device information is stored in the ODM in two databases:
customized and predefined
Devices can exist in a number of different states: unavailable,
defined, available and stopped
Location codes are used to describe exactly where a device is
connected into the system
Device attributes can be modified through SMIT
To create, modify or remve device definitions, it is sometimes
necessary to use commands such mkdev, chdev and rmdev
The
Object
Data Manager

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objective
Define the structure of the ODM
Examine ODM command line interface
Describe the role of ODM in device configuration
Define the meaning of the most important ODM files
ODM components

Example PdAt – Predefined Database Attributes

uniquetype attribute deflt values

Tape/scsi/4mm4gb Block_size 1024 0-16777215

Disk/scsi/1000mb pvid None

Tty/rs232/tty login Disable Enable,disable


ODM Commands
Object class: odmcreate, odmdrop

Descriptors: odmshow

uniquetype attribute deflt values

Tape/scsi/4mm4gb Block_size 1024 0-16777215

Disk/scsi/1000mb pvid None

Tty/rs232/tty login Disable Enable,disable

Objects: odmadd, odmchange, odmdelete, odmget


Changing Attributes Values
# odmget –q :uniquetype=tape/scsi8mm and attribute=block_size” PdAt > file
# vi file
PdAt:
uniquetype = “tape/scsi/8mm”
attribute = “block_size”
deflt = “1024”
values = “0-245760,1”
width = “”
type = “R”
generic = “DU”
rep = “nr”
nls_index = 6
Modify default value to 1024
# odmdelete –o PdAt –q”uniquetype=tape/scsi/8mm and attribute=block_size”

# odmadd file
Changing Attributes Values Using
odmchange
# odmget –q :uniquetype=tape/scsi8mm and attribute=block_size” PdAt > file
# vi file
PdAt:
uniquetype = “tape/scsi/8mm”
attribute = “block_size”
deflt = “1024”
values = “0-245760,1”
width = “”
type = “R”
generic = “DU”
rep = “nr”
nls_index = 6
Modify default value to 1024
# odmchange –o PdAt –q”uniquetype=tape/scsi/8mm and attribute=block_size” file
Data Managed by the ODM

Devices Software

System SMIT
Resource ODM Menus
Controller

TCP/IP NIM
Error Log,
configuration
Dump
The ODM Managed Data
Device Configuration data
Software Vital Product Data
System Resource Controller Data
TCP/IP Configuration Data
Error Log and Dump information
NIM Information
SMIT Menus and commands
Data not managed by the ODM
Filesystem information
User/Security Information
Printer Queues and Queue devices
ODM Database Files
Predefined device PdDv, PdAt, PdCn
information
Customized device CuDV, CuAt, CuDep, CuDvDr,
information CuVPD, Config_Rules

Software vital product data history, inventory, lpp, product

SMIT menus Sm_menu_opt, sm_name_hdr,


sm_cmd_hdr, sm_cmd_opt
Error log, alog and dump SWservAt
information
System Resource Controller SRCsubsys, SRCsubsvr

NIM Nim_attr, nim_object, nim_pdattr


Location and Contents of ODM
Repositories
CuDv
CuAt
CuDep
CuDvDr
CuVPD
Config_Rules PdDv
PdAt
history PdCn
inventory
lpp history
product inventory history
lpp inventory
nim_* product
SWservAt lpp
SRC* product
sm_*

/etc/objrepos /usr/lib/objrepos /usr/share/lib/objrepos


Device Configuration and the ODM -
review

1. Which command configures devices in an AIX


system? (This is not an ODM command)
2. Which ODM class contains all device that your
system supports?
3. Which ODM class contains all devices that are
configured your system?
4. Which programs are loaded into the AIX kernel
to control access to the devices?
5. If you have configured a tape drive rmt1, which
special file do applications access to work with
this device?
ODM
Database
Files

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Software Vital Product Data
lpp: product:
name = “bos.rte.printers” lpp_name = “bos.rte.printer”
state = 5 comp_id = “5765-C3403”
ver = 5 state = 5
rel = 1 ver = 5
mod = 0 rel = 1
fix = 0 mod = 0
description = “Front End Printer Support” fix = 0
lpp_id = 38 ptf = “”
prereq = “*coreq bos.rte 5.1.0.0”
description = “”
supersedes = “”

inventory: history:
lpp_id = 38 lpp_id = 38
ver = 5
file_type = 0 rel = 1
format = 1 mod = 0
loc0 = “/etc/qconfig” fix = 0
loc1 = “” ptf = “”
state = 1
loc2 = “” time = 988820040
size = 0 comment = “”
Software States You Should Know About
Applied •Only possible for PTF or Updates
•Previous version stored stored in
/usr/lpp/pkg_name
•Rejecting update recovers to saved session
•Committing updates deletes previous version
Committed •Removing committed software is possible
•No return to previous version
Applying If installation was not successful:
Committed a) installp –C
Rejecting b) smit maintain_software
Deinstallin
g
Broken Cleanup failed
Remove software and reinstall
Predefined Devices
PdDv:
type = “8mm”
class = “tape”
subclass = “scsi”
prefix = “rmt”

base = 0

detectable = 1

led = 2418
setno = 54
msgno = 2
catalog = “devices.cat”
DvDr = “tape:”
Define = “/etc/methods/define”
Configure = “/etc/methods/cfgsctape”
Change = “ /etc/methods/chggen”
Unconfigure = “/etc/methods/ucfgdevice”
Undefine = “/etc/methods/undefine”
Start = “”
Stop = “”
uniquetype = “tape/scsi/8mm”
Predefined Attributes (PdAt)
PdAt:
Uniquetype = “tape/scsi/8mm”
attribute = “block_size”
deflt = “1024”
valures = “0-245760,1”
PdAt:
Uniquetype = “disk/scsi/1000mb”
attribute = “pvid”
deflt = “none”
valures = “”
PdAt:
Uniquetype = “tty/rs232/tty”
attribute = “term”
deflt = “dumb”
valures = “”
Customized Devices
CuDv:
name = “rmt0
status = 1
chgstatus = 2
ddins = “tape”
location = “04-C0-00-1,0”
parent = “scsi0”
connwhere = “1,0”
PdDvLn = “tape/scsi/8mm”
CuDv:
name= “tty0”
status = 1
chgstatus = 1
ddins =“”
location = “01-C0-00-00”
parent = “sa0
connwhere = “S1”
PdDvLn = “tty/rs232tty”
Customized Attributes (CuAt)

CuAt:
name = “tty0”
attribute = “login”
value = “enable’
CuAt:
name= “hdisk0”
attributes = “pvid”
value = “0016203392072a540000000000000000”
How ODM Classes Act Together
PdDv: CuDv:
type = “tty” Name = “tty”
class = “tty” Status = 1
subclass = “rs232” Chgstatus = 1
# mkdev –c tty –t tty –s rs232
perfix = “tty” Location = “01-C0-00-00”
Define = “/etc/methods/define” Parent =“sa0”
Configure = “/etc/methods/cfgtty” Connwhere = “s1”
Uniquetype = “tty/rs232/tty” PdDvLn = “tty/rs232/tty”

PdAt:
uniquetype = “tty/rs232/tty” CuAt:
name = “tty0”
attribute = “login” attribute = “login”
Deflt = “disable” value = “enable’
Values = “enable, disable”
# chdev –l tty0 –a login=enable CuAt:
PdAt:
name= “tty0”
uniquetype = “tty/rs232/tty” attribute = “term”
# chdev –l tty0 –a term=ibm3151
attribute = “login” value “ibm3151”
Deflt = “disable” type = “R”
Values = “enable, disable”
Additional Device Object Classes
PdCn: CuDvDr:
uniquetype = “adapter/pci/sym875” Resource = “devno”
Value1 = “22”
Connkey = “scsi” Value2 = “0”
Connwhere = “1,0” Value3 = “rmt0”
PdCn: CuDvDr:
uniquetype = “adapter/pci/sym875” Resource = “devno”
Value1 = “22”
Connkey = “scsi” Value2 = “1”
Connwhere = “2,0” Value3 = “rmt0.1”

CuVPD:
Name = “rmt”
CuDep: Vpd = “MFEXABYTE
Name = “rootvg” PN21F8842”
Dependency = “hd6”
CuDep:
Name = “datavg”
Dependency = “lv01”
Device Configuration Summary
Predefined Databases PdDv

PdCn PdAt

Customized Databases

CuDep CuDv CuAt

CuDvDr CuVPD

Config_Rules

Configuration Manager
(cfgmgr)
Exercise: The ODM
Define the meaning of the most important ODM files
Work with the ODM command line interface
Describe how ODM classes are used from device
configuration commands
Checkpoint
1. In which ODM class do you find the physical ID’s of
your disks?
2. What is the difference between state defined and
available
Summary
The ODM is made from object classes, which are broken
into individual objects and descriptors
AIX offers a command line interface to work with ODM
files
The device information is held in the customized and the
predefined database (Cu*, Pd*)
Boot Process

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
77
Objective
Describe the boot process up to loading of the
boot logical volume
Describe the contents of the boot logical volume
Interpret LED Codes displayed during boot and
system halt
Re-create the boot logical volume on a system
which is failing to boot
How Does An AIX System Boot?
Loading of a Boot Image

Firmware
Boot Bootstrap
Devices code
(1) Diskette
(2) CD-ROM
(3) Internal disk RAM
RAM

hdisk0

Boot
Controller
Boot
Logical
Volume
Content of Boot Logical Volume
(hd5)

AIX Kernel rc.boot

“Reduced”
Boot Commands
ODM
How to Fix a Corrupted BLV
Select Volume Group
That contains hd5

Boot from
Maintenance
CD, tape or
NIM
1. Access a Root Volume Group

# bosboot –ad /dev/hdisk0

# shutdown –Fr
Working with bootlist
# bootlist –m normal hdisk0 hdisk1 No “Service” Mode
# bootlist –m normal –o
on some models
hdisk0
hdisk1
e.g. model 140
# bootlist –m service cd0 rmt0 hdisk0

# bootlist –m service –o Model 150 support


fd0 “service” boot list
cd0
hdisk0
ent0

# diag

TASK Selection List


SCSI Bus Analyzer
Download Microcode
Display or Change Bootlist
Periodic Dignostics
Working with Boot Lists - SMS
1. Reboot or power on the system
2. Press F1 when the tone is heard
3. Select Boot (or MultiBoot)
System Management Services
System Management Services
New List of Boot Devices
- [1] Diskette
1 [2] SCSI CD-ROM id=3 (slot=1)
3 [3] SCSI 2168 MB Hard Disk id=5 (slot=1)
2 [4] Ethernet (Integrated)

1 2 3

Save Default
Service Processors and Boot Failures
Boot failures!

553
Modem
Automatic transmittal of
Boot failure information

Modem
Service Processor
(BUMP) Remote
System
CMS Support
Let’s Review
Enter the command to list boot devices
T/F: You must have installed the bootlist to use SMS
AIX is loaded in hdisk0 but the boot list is set to boot
from hdisk1. Fix the problem?
What command is used to fix the BLV?
What scripts control the boot sequence
Accessing a SystemThat Will Not Boot

Press F5 to goto SMS Boot the System from


The BOS CD-ROM, tape
F5 Or
Network device (NIM)

Select maintenance mode


Maintenance

1 Acces a Root VolumeGroup


2 Copy System Dump toMedia
3 Acces Advaced Maintenance Perform Corrective Actions
4 Install from System Backup Recover Data
Booting in maintenance Mode
Define the System Welcome to Base Operating system
Console Installation and Maintenance

>>> 1 Start Install Now with Default Settings


2 Change/Show installation settings and Install
3 Start Maintenance Mode for System Recovery

Choice [1[: 3

Maintenance

>>> 1 Access a Root Volume Group


2 Copy a System dump to Removable Media
3 Access Advanced Maintenance Functions
4 install from a System Backup

Choice [1]: 1
Working in Maintenance Mode
Access a root Volume Group

1) Volume Group 001620336e1bc8a3 contains these disks:


hdisk0 2063 04-C0-00-4,0
2) Volume Group 001620333c9b1b8e contains these disks:
hdisk1 2063 04-C0-00-5,0

Choice: 1

Volume Group Information

Volume Group ID 001620336e1bc8a3 includes the following typical volumes:


hd6 hd5 hd8 hd4 hd2 hd9var hd3
1) Access this Volume Group and start shell
2) Access this Volume Goup and start a shell before mounting file systems
99) Previous Menu

Choice [99]:
Boot Problem Reference
AIX Message Guide and Contains:
Reference •Microchannel boot codes
•AIX boot codes

AIX Problem Solving Guide Contains:


and Reference •Problem Solving Procedures
•Problem Summary Form

RS/6000 and Pseries Service Contains:


Guides •PCI firmware checkpoints
•PCI error codes
Firmware Checkpoints and Error Codes

LED/LCD
Monitor display
F22
21A00001

“SCSI hardware Error” “No Memory found”


Flashing 888
Flashing
888

103
102 Reset Or
105

Reset twice
Reset for for SRN
Crash code yyy-zzz

Reset for Reset once


Optional For FRU
Dump code
Codes for
Hardware
Failure Reset 8 times
For location code
Understanding the103 Message
888 103 104 101 100 204 313 400 500 600 702 800
c01
Location Code

# Of FRU sequence (1st defect part)


SRN Identifying the FRU (104-101)
Type of READ-OUT (103)
00=0 09=9 19=I 28=R
01=1 11=A 20=J 29=S
02=2 12=B 21=K 30=T
03=3 13=C 22=L 31=U
04=4 14=D 23=M 32=V
05=5 15=E 24=N 33=W
06=6 16=F 25=O 34=X
07=7 17=G 26=P 35=Y
08=8 18=H 27=Q 36=Z

FRU = Field Replaceable Unit SRN = Service Request Number


Exercise
1. During the AIX boot process, the AIX kernel
is loaded from the root files system. True or
False?
2. Which RS/6000 models do not have a
bootlist for the service mode
3. How do you boot an AIX machine in
maintenance mode?
4. Your machine keeps rebooting and
repeating the POST. What can be the
reason for this?
Summary
During the boot process a boot logical volume is
loaded into memory
Boot devices and sequences can be updated via
the bootlist and diag command
The boot logical volume contains an AIX kernel,
an ODM and boot script rc.boot that controls
the AIX boot process.
The boot logical volume can be re-created using
the bosboot command.
LED codes produced during the boot process
can be used to diagnose the boot problems.
PCIs additionally use visual boot signals.
System Software initialization - Overview
Boot logical volume
Load Kernel and pass control hd5
/

Create RAM file system etc dev mnt usr

Configure base
Start init-process from BLV rc.boot 1 devices

rc.boot 2 Activate rootvg

Start “real” init process


Configure remaining
(from rootvg) rc.boot 3 devices
/etc/inittab
rc.boot 1
Failure LED
Process 1 – rootvg is not active!
299 init F05
c06

rc.boot 1
ODM in hd5

restbase
548 510 RAM file system
le s ODM
Ru
g _
cfgmgr -f o nfi se=1
C ha
P

Devices to activate
bootinfo -b
511 rootvg are configured!
rc.boot 2 (Part1)
Failure LED
551 rc.boot 2

552 554
517 ipl_varyon
556 hd4: hd2:rootvg
hd9var: hd6
555 fsck –f /dev/hd4 / /usr /var
557 mount /usr
Copycore:
fsck –f /dev/hd2 If
dump,copy /
518 mount /usr var/adm/ras

dev etc mn usr var


fsck –f /dev/hd9var t
518 mount /var
copycore /
umount/var RAM File system

Swapon /dev/hd6
rc.boot 2 (Part 2)
Copy RAMFS/dev to disk rootvg
hd4: hd2: hd9var: hd6
Copy RAMFS ODM to disk / /usr /var

mergdev
Umount /usr & /dev/hd4 dev etc
ODM

mount -f / & mount /usr /var


dev etc mn usr var
ODM t
Copy boot messages
To alog /
RAM File system

Kernel removes RAMFS


rc.boot 3 (Part 1)
Process 1 – /etc/inittab:
553
init /sbin/rc.boot 3

fsck –f /dev/hd3
mount /tmp
Here we work
With rootvg!
syncvg rootvg &

Config_Rules
Normal: cfgmgr –p2 /etc/objrepos:
Phase=2
Service: cfgmgr –p3 Phase=3 ODM

c31 cfgcon c32


c33 rc.dt boot c34
hd5:
savebase ODM
rc.boot 3 (Part2)
savebase /etc/objrepos:
ODM
syncd 60
errdaemon

Turn off LED’s hd5:


ODM

rm /etc/nologin A device that was previously detected could


es not be found. Run “diag –a”.
Y
chgstatus=3 System initialization completed.
CuDv ?

Execute next line in


/etc/inittab
rc.boot Summary
Where From Action Phase
Config_Rules

rc.boot 1 /dev/ram0 restbase 1


cfgmgr –f

rc.boot 2 /dev/ram0 ipl-varyon rootvg


merge /dev
merge ODM
rc.boot 3 rootvg cfgmgr –p2 2 – normal
cfgmgr –p3 3 – service
Savebase
Configuration Manager
“Plug and Play”
Predefined

PdDv
PdAt Config_Rules
PdCn
cfgmgr
Customized Methods

Define
CuDv
Configure
CuAt Device load
Driver Change
CuDep
Unconfigur
CuDvDr unload e
Undefine
CuVPD
Config_Rules Object Class
Phase Seq Boot rule
1 1 0 /etc/methods/defsys
cfgmgr -f
1 2 0 /usr/lib/methods/deflvm

2 10 0 /etc/methods/defsys
2 10 0 /usr/lib/methods/deflvm cfgmgr –p2
2 15 0 /etc/methods/ptynode (Normal boot)
2 20 0 /etc/methods/startlift

3 10 0 /etc/methods/defsys
3 10 0 /usr/lib/methods/deflvm
cfgmgr –p3
3 15 0 /etc/methods/ptynode (Service boot)
3 20 0 /etc/methods/startlift
3 25 0 /etc/methods/starttty
Output of cfgmgr in the Boot alog
# alog –t boot –o
-------------------------------------------------------------
Attempting to configure device ‘sys0’
Invoking /usr/lib/methods/cfgsys_rspc –l sy0
Return code = 0
******* stdout *******
Bus0
*******no stderr *****
------------------------------------------------------------
Attempting to configure device ‘bus0’
Invoking /usr/lib/methods/cfgbus_pci bus0
Return code = 0
****** stdout *******
Bus1, scsi0
******* no stderr ****
-------------------------------------------------------------
Attempting to configure device ‘bus1’
Invoking /usr/lib/methods/cfgbus_isa bus1
Return code = 0
****** stdout *******
Fda0, ppa0, sa0, sioka0, kbd0
******* no stderr ****
/etc/inittab file
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot
powerfail::powerfail:/etc/rc.powerfail 2>&1 | alog -tboot > /dev/console
rc:2:wait:/etc/rc 2>&1 | alog -tboot > /dev/console # Multi-User checks
fbcheck:2:wait:/usr/sbin/fbcheck 2>&1 | alog -tboot > /dev/console # run /etc/firstboot
srcmstr:2:respawn:/usr/sbin/srcmstr # System Resource Controller
rctcpip:2:wait:/etc/rc,tcpip > /dev/console 2>&1 # Start TCP/IP daemons
rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
cron:2:respawn:/usr/sbin/cron
piobe:2:wait:/usr/lib/lpd/pio/etc/pioinit >/dev/null 2>&1 # pb cleanup
qdaemon:2:wait:/usr/bin/startsrc -sqdaemon
writesrv:2:wait:/usr/bin/startsrc -swritesrv
uprintfd:2:respawn:/usr/sbin/uprintfd
logsymp:2:once:/usr/lib/ras/logsymptom # for system dumps
pmd:2:wait:/usr/bin/pmd > /dev/console 2>&1 # Start PM daemon
diagd:2:once:/usr/lpp/diagnostics/bin/diagd >/dev/console 2>&1
dt:2:wait:/etc/rc.dt
cons:0123456789:respawn:/usr/sbin/getty /dev/console
System Hang Detection
System hangs
- High priority process
- Other
What does shdaemon do
- Monitors system’s ability to run processes
- Takes specified action if threshold is crossed
Actions
- Log Error in the Error Logging
- Display a warning message on the console
- Launch recovery login on a console
- Launch a command
- Automatically REBOOT system
Configuring shdaemon
# shconf –E –l prio
sh_pp enable Enable Process Priority Problem
pp_errlog enable Log Error in the Error Logging
pp_eto 2 Detection Time-out
pp_eprio 60 Process Priority

pp_warning enable Display a warning message on a console


pp_wto 2 Detection Time-out
pp_wprio 60 Process Priority
pp_wterm /dev/console Terminal Device

pp_login disable Launch a recovering login on a console


pp_lto 2 Detection Time-out
pp_lprio 100 Process Priority
pp_lterm /dev/console Terminal Device

pp_cmd enable Launch a command


pp_cto 5 Detection Time-out
pp_cprio 60 Process Priority
pp_cpath /home/unhang Script

pp_reboot disable Automatically REBOOT system


pp_rto 5 Detection Time-out
pp_rprio 39 Process Priority
/etc/inittab: Entries you should know
about
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3
rc:2:wait:/etc/rc
fbcheck:2:/wait:/usr/sbin/fbcheck
srcmstr:2:respawn:/usr/sbin/srcmstr
cron:2:respawn:/usr/sbin/cron
rctcpip:2:wait:/etc/rc.tcpip
rcnfs:2:wait:/etc/rc.nfs

dt:2:wait:/etc/rc.dt
qdaemon:2:wait::/usr/bin/startsrc –sqdaemon
tty0:2:off:/usr/sbin/getty /dev/tty1
myid:2:once:/usr/local/bin/errlog.check
Review Questions
1. Which process isstarted by init process only one time? The init
process does not wait for the initialization of this process.
2. Which process is involved in print activities on an AIX system?
3. Which line is ignored by init process?
4. Which line determines that multiuser mode is the initial run
level of the system?
5. Where is the System Resource Controller started?
6. Which line controls network process?
7. Which component allows the execution of programs at a
certain date or time?
8. Which line executes a file /etc/firstboot if it exists?
9. Which script controls starting of the CDE deskop?
10. Which line is executed in all run levels
11. Which line takes care of varying on the volume groups,
activating paging spaces and mounting file systems that are to
be activated during boot?
Boot Problem Management
Check: LED: User Action:

File system full ? 553 Access the rootvg. Issue “df –k”.
Check if /tmp, /usr or / are full.
/etc/inittab? 553 Access the rootvg. Check /etc/inittab (empty, missing,
/etc/environment? or corrupt?). Check /etc/environment.
BLV corrupt ? 551, 555, Access the rootvg. Re-create the BLV:
557 # bosboot –ad /dev/hdiskx

JFS log corrupt ? 551, 552, Access rootvg before mounting the rootvg file systems.
554, 555, Re-create the JFS log:
556,557 # logform /dev/hd8
Run fsck afterwards.
Superblock corrupt? 552, 554, Run fsck against all rootvg filesystems, if fsck indicates
556 errors (not an AIX file system), repair the superblock.
rootvg locked 551 Access rootvg and unlock the rootvg:
# chvg –u rootvg
ODM files missing ? 523 - 534 ODM files are missing or inaccessible. Restore the
missing files from a system backup
Mount of /usr or /var failed 518 Check /etc/filesystem, Check network (remote mount),
file systems (fsck) and hardware
Summary
After the BLV is loaded into RAM, the rc.boot script is
executed three times to configure the system
During rc.boot 1 devices to varyon the rootvg are
configured
During rc.boot 2 rootvg is varied on
In rc.boot 3 the remaining devices are configured.
Process defined in /etc/inittab file are initiated by the
init process
System
Startup
and Shutdown

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
Describe the system startup process
Describe how to shutdown the system
Describe the contents of the /etc/inittab file
Manage the system environment
Startup Modes
Normal Mode
•Login prompt
•All processes running
•Multi-user mode

System Management Services


•NotAIX
•Runs from FIRMWARE
•Sets boot list

Maintenance Menu
•Maintenance menu
•Recover root pasword
•Fix machine that won’t boot

Diagnostics

•AIX Diagnostics
Starting System Management Services
Power on the system
Press F1 when icons appear and tones sound
System Management Services
PCI RS/6000 Start Up Process Overview
PowerOn

POST

Locate OS Bootstrap Image

Find AIX Boot Image

Load AIX Boot Image


RAMDISK created

Configuration Manager Phase 1

INIT
Normal IPL
AIX Startup

ROS Hardware
Initialization

SMS / bootlist Low Level


Configuration

•ROS / SOFTROS Load boot


•BLV image

AIX
initialization
alog
User Boot Install
NIM
Applications Process Process

alog program

/var/adm/ras/bootlog
Use alog /var/adm/ras/BosMenu.log
Command /var/adm/ras/bosinst.data
To view .
logs
.
/var/adm/ras/errlog
•To view the boot log:
# alog –o –t boot
/etc/inittab
init:2:initdefault:
brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot
powerfail::powerfail:/etc/rc.powerfail 2>&1 | alog -tboot > /dev/console
rc:2:wait:/etc/rc 2>&1 | alog -tboot > /dev/console # Multi-User checks
fbcheck:2:wait:/usr/sbin/fbcheck 2>&1 | alog -tboot > /dev/console # run /etc/firstboot
srcmstr:2:respawn:/usr/sbin/srcmstr # System Resource Controller
rctcpip:2:wait:/etc/rc,tcpip > /dev/console 2>&1 # Start TCP/IP daemons
rcnfs:2:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons
cron:2:respawn:/usr/sbin/cron
piobe:2:wait:/usr/lib/lpd/pio/etc/pioinit >/dev/null 2>&1 # pb cleanup
qdaemon:2:wait:/usr/bin/startsrc -sqdaemon
writesrv:2:wait:/usr/bin/startsrc -swritesrv
uprintfd:2:respawn:/usr/sbin/uprintfd
logsymp:2:once:/usr/lib/ras/logsymptom # for system dumps
pmd:2:wait:/usr/bin/pmd > /dev/console 2>&1 # Start PM daemon
diagd:2:once:/usr/lpp/diagnostics/bin/diagd >/dev/console 2>&1
dt:2:wait:/etc/rc.dt
cons:0123456789:respawn:/usr/sbin/getty /dev/console
System Resource Controller
•Providesa single interface to control subsystems
•Controls individual or groups of subsystems

Subsystem group spooler

Subsystem qdaemon writesrv lpd

Subserver qdemon writesrv lpd


System Resource Controller Syntax
List SRC status
# lssrc –g spooler
Subsystem Group PID Status
Qdaemon spooler 8022 active
Writesrv spooler 9558 active
Lpd spooler inoperative
Start a subsystem
# startsrc –s lpd
0513-059 The lpd subsystem has been started. Subsystem PID is 12472

Refresh a Subsystem
# refresh –s lpd
0513-095 The request forsubsystem refresh was completed successfully.

Stop a Subsystem
#stopsrc –s lpd
0513-044 The lpd subsystem was requested to stop.
Stopping Processes
# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 May04 - 0:11 /etc/init
root 2626 1 0 May04 - 1:17 /usr/sbin/syncd 60
root 4136 1 0 May04 - 0:00 /usr/sbin/srcmstr
root 4964 4136 0 May04 - 0:00 /usr/sbin/inetd
root 6734 1 0 May04 - 0:02 /usr/sbin/cron
root 8022 4136 0 May04 - 0:00 /usr/sbin/qdaemon
root 9036 1 0 May04 - 0:00 /usr/sbin/uprintfd
root 9345 1 0 May04 - 0:02 /usr/bin/program

For process not started by srcmstr


# kill 9345

For Process started by SRC


# stopsrc –s qdaemon
System shutdown
Shutdown command
Gracefully stops all ctivity on the system and advises all logged on
users.
Warns users of impending shutdown

# shutdown +2 The system will be down until 3am

Broadcast message from root@localhost (tty) at 1:30:20…

The system will be down until 3AM

Shutdown: PLEASE LOG OFF NOW!!!


ALL processes will be killed in 2 minutes
Manage the System Environment
# smit system
System Environments

Move cursor to desired item and press Enter.


Stop the system
Assign the Console
Change / Show Date and Time
Manage Language Environment
Change / Show Characteristics of Operating System
Change / Show Number of Licensed Users
Manage AIX Floating Users Licenses for this Server
Broadcast Message to all Users
Manage System Logs
Change / Show Characteristics of System Dump
Internet and Documentation Services
Change System Users Interface
Review Questions
1. What is the first process that is created on the
system and which file does it reference to initiate
all the other processes that have to be started?
2. Which AIX feature can be used to stop and start
groups of daemons or programs?
3. True or False? You can only execute the
shutdown command from the console.
Summary
When the system boots up it first runs through a
number of hardware checks before starting the
processes definedin the /etc/inittab file
The LED codes produced during the boot process can
be used to identify problems. Alternatively, the boot log
file can be accessed to obtain the system messages
produced during the boot phase
Once the system is up, it can be shutdown by an
authorized user from any terminal
SMIT can be used to change common system settings
such as the language used, and the date and time
used bythe system
AIX Software
Installation
and Maintenance

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objective
Define the package definitions and naming conventions
Identify how software products and updates are installed
and managed
AIX Product Offerings

AIX

•Expansion Pack

•Bonus Pack

•LPP’s

•AIX Documentaion

•AIX Toolbox for Linux


Packaging Definitions
LPP: •Collection of Packages
bos
•Complete Product

Package: Package: Collection of Filesets


bos.INed bos.adt

Fileset: Fileset: Fileset: Smallest Unit


Specific Function
Bos.INed bos.adt bos.adt.prof
Fileset Naming

LPP Package Fileset Suffix

bos.terminfo.print.data

Message Conventions:

LPP.msg[.lang].package.fileset
Bundles
A Bundle is a collection of packages and filesets suited for
a particular environment
Predefined system bundles in AIX 5.1 include:
- App-Dev
- CDE
- GNOME
- KDE
- Media-defined
- Netscape
- devices
- wsm_remote
Software Updates
# oslevel

5.1.0.0

Version Release Modification Fix

Migration smit update_all


Software States
Applied:

Install Filesets
5.1.0.0
4.3.3.0 Commit
4.3.3.0 Applied
Or
Filesets
5.1.0.0 Reject
4.3.3.0
Committed

Install Committed
5.1.0.0
5.1.0.0
Software Installation and Maintenance

Software installation and Maintenance

Move Cursor to desired item and press Enter

Install and Update Software


List Software and Related Information
Software Maintenance and Utilities
Network Installationand Management
System Backup Manager

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Installation and Update Software
Software installation and Maintenance

Move Cursor to desired item and press Enter

Install Software
Update Installed Software to Latest Level (Update
All)
Install Software Bundle
Update Software by Fix (APAR)
Install andUpdate from ALL available Software

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Install Software
Software Inventory

List Installed Software and and Related Information

Move Cursor to desired item and press Enter

Install Software
Update Installed Software to Latest Level (Update All)
Install Software Bundle
Update Software by Fix (APAR)
Install andUpdate from ALL available Software

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do

lslpp command
-L lists the installed software
-h shows the history of a software product
List Installed Software
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
IMNSearch.bld.DBCS 2.3.1.0 COMMITTED NetQuestion DBCS Buildtime
Modules
IMNSearch.bld.SBCS 2.3.1.0 COMMITTED NetQuestion SBCS Buildtime Modules
IMNSearch.msg.en_US.rte.com 2.3.1.0 COMMITTED Text Search Messages - U.S. English
IMNSearch.rte.DBCS 2.3.1.0 COMMITTED NetQuestion DBCS Search Engine
IMNSearch.rte.SBCS 2.3.1.0 COMMITTED NetQuestion SBCS Search Engine
IMNSearch.rte.client 2.3.1.0 COMMITTED Text Search Client
IMNSearch.rte.com 2.3.1.0 COMMITTED Text Search Client/Server
Shared Files
IMNSearch.rte.httpdlite 2.0.0.2 COMMITTED Lite NetQuestion Local Web
Server
IMNSearch.rte.server 2.3.1.0 COMMITTED Text Search Server
Software Maintenance Utilities
Software installation and Maintenance

Move Cursor to desired item and press Enter

Commit Applied Software Updates (Remove Saved Files)


Reject Applied Software Updates (Use Previous Version)
Remove Installed Software
Copy Software to Hard Disk for future insallation
Check Software File Sizes After Installation
Verify Software Installation and reqiosites
Clean Up After Failed or interrupted Installation

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
instfix Command
•Installs a fix

# instfix –k IX38794 –d /dev/rmt0.1

•Searches for a fix

# instfix –ik IX38794


All filesets for IX38794 were found

•Searches for a fix by keyword

# instfix –s SCSI –d /dev/rmt0.1


Review Questions
1. Which of the following states can your software be in, in order for
you to be able to use? (select all that apply)
a. Applied state
b. Removed state
c. Install state
d. Commit state

2. What command is used to list all installed software on your system?

3. Which of the following can you install as an entity?( select all that
apply)
a. Fileset
b. LPP
c. Package
d. Bundle

4. What is the difference between the SMIT menus: Install Software


and Update Installed Software to Latest Level (Update All)?
System
Storage
overview

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
Describe the terminology and concepts associated
with:
• Physical Volumes
• Volume Groups
• Logical Volumes
• Physical Partitions
• Logical Partitions
Describe how file systems and logical volumes are
related.
Components of AIX Storage
Files
Directories
File Systems
Logical Storage
Physical Storage
Logical Volume Manager
Traditional UNIX Disk Storage

Partition 1 Partition 3

Partition 2
Free Size
Free Size

PROBLEMS:
Fixed Partitions
Expanding size of the partition
Limitation on size of a file system and a file
Contiguous data requirement
Time and effort required in planning ahead
Benefits of the LVM

Logical volumes solve non-contiguous space


problems
Logical volumes can span disks
Dynamically increase logical volume size
Logical volumes can be mirrored
Hard disks easily added to a system
Logical volumes can be relocated
Volume group and logical volume statistics can
be collected
These tasks can be performed dynamically!
Physical Storage
Volume
Group A PV1

Volume
Group B PV2 PV3 PV4 PV5

Physical Volume
/dev/hdiskn
Physical PP1
Partitions PP2
4 MB is PP3
default size
PP4
1016 max
PP5
per PV
PPn
Volume Groups

PV1 PV2 PV3

PV4
New PVs:
•Add to existing
•Create new VG

Why create new volume groups?


•Separate user data from operating system files.
•Disaster recovery
•Data portability
•Data integrity and security
Volume Group Descriptor Area
Two Disk VG Three or more disk VG
One Disk VG

VGDA VGDA VGDA VGDA VGDA


VGDA VGDA

VGDA VGDA

Max Size
Normal VG – 32 PVs
Big VG – 128 PVs
Volume Group Limits
•Normal Volume Groups (mkvg)
Number of disks: Max. Number of partitions/disk:
1 32512
2 16256
4 8128
8 4064
16 2032
32 1016

•Big Volume Groups (mkvg -B) # mkvg -t


Number of disks: Max. number of partitions/disk:
1 133048
2 65024
4 32512
8 16256
16 8128
32 4064
64 2032
128 1016
Logical Storage
Physical Volumes

1 4 1 4
2 3 2 3
5 6 8 5 6 8
9 7 12 9 7 12
10 11 10 11
13 16 13
14 15 14 15
17 20 17 20
18 19 18 19

Logical Volume Manager

1 2 3 4 5 6 7 8 9 . . . . . n

Logical Logical Logical


Volume Volume Partition
s
Uses of Logical Volumes
A logical volumes may contain one of the following, and
only one at a time:
Journaled or Enhanced journaled filesystem (for
example: /dev/hd4)
Paging space (/dev/hd6)x
Journal log (/dev/hd8)
Boot Logical Volume (/dev/hd5)
No FS (raw device)
What is a File System
A file system is:
- Method of storing data
- Hierarchy of directories
Four types supported:
- Journaled File System (jfs)
- Enhanced Journaled File System (jfs2)
- CD-ROM File System (cdrfs)
- Network File System (nfs)
Different file systems are connected together via
directories to form the view of files users see.
Why Have File Systems?
Can strategically place it on disk for improved performance
Some tasks are performed more efficiently on a file system
than on each directory within the file system, for example,
backup, move, secure an entire file system
Can limit disk usage of users by file system (quotas)
Maintain integrity of the entire file system structure, for
example, if one of the file system is corrupted, the other
are not affected
Special security situations
Organize data and programs into groups for ease of file
management and better performance
Standard File Systems in AIX
hd4

/ (root)

home sbin lib lpp usr bin dev tftpboot var mnt etc tmp

hd1 hd2 hd9var hd3

/ / / /

bin lib lpp share sbin


spool adm tmp

NOTE: The drawing depicts logical not physical devices


/etc/filesystems
/:
dev = /dev/hd4
vol = root
mount = automatic
Check = false
vfs = jfs
log = /dev/hd8
type = bootfs

/home:
dev = /dev/hd1
vol = “/home”
mount = true
check = true
vfs = jfs2
log = /dev/hd8
Mount
Mount: the glue that logically connects file systems to the
directory hierarchy.
File systems are associated with with devices represented
by special files /dev/ - the logical volume.
When a file system is mounted, the logical volume and its
contents are connected to a directory in the hierarchical tree
structure

# mount /dev/lv00 /home/patsie

What to Where to
mount mount
Mounting file system
Mounting over an empty directory
Mounting over files and subdirectories
Listing File Systems
# lsfs

Name Nodename Mount Pt VFS Size Options Auto

/dev/hd4----- / jfs 16384 ------ yes


/dev/hd1----- /home jfs2 90112 ------ yes
/dev/hd2----- /usr jfs 1277952------ yes
/dev/hd9var ----- /var jfs 8192 ------ yes
/dev/hd3----- /tmp jfs 24576 ------ yes
/dev/cd0 ----- /infocd cdrfs r/o yes
/dev/lv00 ----- /home/cms jfs2 8192 r/w yes
Listing Logical Volume Information
# lsvg –l rootvg
Checkpoint 1
1. How many different PP sizes can be set within a single VG>
2. What is default size of PP?
3. How many VGs can a PV belong to?
a. Depends on what you specify throu SMIT
b. Only one
c. As many VGs as exist on the system
4. T/F. All VGDA information on your system is identical, regardless of
how many VGs exist
Using the o/p list the f/s shown below, answer the following questions
#lsfs
Name Nodename Mount Pt VFS Size Options Auto
/dev/hd4----- / jfs 16384 ------ yes
/dev/hd1----- /home jfs2 90112 ------ yes
/dev/hd2----- /usr jfs 1277952------ yes
/dev/hd9var ----- /var jfs 8192 ------ yes
/dev/hd3----- /tmp jfs 24576 ------ yes
/dev/cd0 ----- /infocd cdrfs r/o yes
/dev/lv00 ----- /home/cms jfs2 8192 r/w yes
Checkpoint 2
5. With which logical volume is the /home file system
associated?
6. What type of file systems are being displayed
7. What is the mount point for the file system located on the
/dev/lv00 logical volume?
8. Which are the system supplied logical volumes and the
associated file systems?
9. Which file system is used primarily to hold user data and home
directories?
Checkpoint 3
10. Which of the logical volumes below are examples of logical
volumes with journaled file system on them?
Summary
The LVM is organized as follows:
• A VG consists of one or more PVs
• Each PV is divided into PPs
• A LV is made up of LPs
• LPs are mapped to PPs
Logical Volumes are used to contain:
• JFS or JFS2
• Paging Spaces
• Dump Space
• Journal Log
• Boot Logical Volume
• Raw Space
The most common use of logical volumes is to contain
JFS or JFS2
Working with the
Logical Volume
Manager

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
Add/Change/Delete Volume Groups
Add/Change/Delete Logical Volumes
Add/Change/Delete Physical Volumes
Describe mirroring
Describe striping
Logical Volume Manager

Logical Volume Manager

Move Cursor to desired item and press Enter

Volume Groups
Logical Volumes
Physical Volumes
Paging Space

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Volume Groups
Volume Group

PV PV

•PhysicalVolume hard disk


•Volume Group (VG) Collection of related
disks (PVs)
SMIT Volume Groups Menu
# smit vg
Volume Groups
Move Cursor to desired item and press Enter
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
Backup a Volume Group
Remake a Volume Group
List files in a Volume Group Backup
Restore Files in a Volume Group Backup
F1=Help F2=Refresh F3=Cancel F8=Image
F9=Shell F10=Exit Enter=Do
Listing Volume Group Information
List All VGs and active VGs

# lsvg

rootvg
payrollvg

#lsvg –o

rootvg
Listing Volume Group Information
List Contents of a Volume Group
Listing Volume Group Information
Physical Volumes
Listing Volume Group Information
Logical Volumes
Adding Volume Groups
# smit mkvg
Removing a volume Group
# smit reducevg

Remove a Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Volume Groups [] +

F1=Help F2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Set Characteristics of a Volume Group
# smit vgsc

Logical Volume Manager

Move Cursor to desired item and press Enter

Change a Volume Group


Add a Physical Volume to Volume Group
Remove a Physical Volume from a VolumeGroup
Reorganize a VolumeGroup

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Change a Volume Group
# smit chvg
Remove a Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]

* Volume Group Name [] +


* Activate Volume group Automatically yes +
at system restart?
* A QUORUM of disks required to keep the yes +
Volume group on-line?
Convert this VG toConcurrent Capable no +
• Autovaryon VG in Concurrent Mode? no +
LTG Size in kbtes 128 +
Set hostspare characteristics n +
Set synchronization characteristics n +
of stale partitions
Logical Track Group Size (LTG)

Flexible LTG size for better performance

The LTG size can be set be as 128..256..512..or..1024

•Find the maximum LTG size:

# /usr/sbin/lquerypv –M hdisk0
256

•Set the LTG size per volume group using mkvg or


chvg
Hot Spare

1st copy 2nd copy


1st copy 2 copy
nd

Of data2 Of data2
Of data1 Of data1
LV LV
LV LV

•Spares are allocated and used by volume Group


Hot Spare •Logical volumes must be mirrored
•All logical partitions on hot spare disks must be unallocated
Activate/Deactivate a Volume Group

Activate a Volume Group (make it available for use)


varyonvg [-f] <volumegroup>

# varyonvg datavg

Deactivate a Volume Group (make it unavailable for


use)
#varyoffvg <volumegroup>
varyoffvg datavg
Import/Export a Volume Group
# smit importvg

Remove 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 ofVG Concurrrent? no +

F1=Help F2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Exercise: Volume Groups
1. Log in as and switch to the root user account
2. Check, if you have disk available to create a new VG. What is the
name of the available disk?
3. Add the free disk to the rootvg
4. Check to see whether the disk is now associated with rootvg
5. Take the same disk, out of rootvg. Make sure you remove correct
disk.
6. Verify that the disk is no longer associated with rootvg
7. Using the free disk create a new VG called newvg
8. Verify that the new VG was created. What are the maximum number
of PVs that can be added to this VG?
9. Convert newvg into a Big VG
10. What is the maximum number of PV’s that can be added to the
converted newvg
11. Remove newvg
12. Verify that hdiskn is not associated with any volume group.
Logical Storage
Physical Volumes

1 4 1 4
2 3 2 3
5 6 8 5 6 8
9 7 12 9 7 12
10 11 10 11
13 16 13
14 15 14 15
17 20 17 20
18 19 18 19

Logical Volume Manager

1 2 3 4 5 6 7 8 9 . . . . . n

Logical Logical Logical


Volume Volume Partition
s
Mirroring
hdisk0 lv00
First Copy
PP1
PP2 LP1
LP2
hdisk1
Second Copy
PP1
PP2

Third Copy hdisk2


PP1
PP2
•Mirroring is when a logical partition maps to more than one physical partition
of the Same volume group
•Scheduling Policy:
Parallel PPs written simultaneously
Sequential PPs written in sequence
Mirror write Consistency
Read
Request

Copy 1 Copy 2 Copy 3

Forced Synchronization

Synchronize the Read Partitions

In AIX 5.1, there are now two ways of handling MWC:


•Active, he existing method
•Passive, the new method
Striping
•Normal flow of data blocks when a logical volume is spread across physical volumes .

1 2 3 4 5 6 13 14 15 16 17 18 25 26 27 28 29 30
7 8 9 10 11 12 19 20 21 22 23 24 31 32 33 34 35 36

•The layout of stripe units when logical volume is setup to stripe

1 4 7 10 13 16 2 5 8 11 14 17 3 6 9 12 15 18
19 22 25 28 31 34 20 23 26 29 32 35 21 24 27 30 33 36

•Consecutive
stripe units are created on different physical volumes
•Striping increases read/write sequential throughput by evenly distributing partitions
among disks
•Stripe unit size is specified at creation time
Logical Volume Policies
Intra-physical volume allocation policy:

E M C M E

Inner Edge
Inner Middle
Center
Outer Middle
Outer Edge
Inter-physical volume allocation policy:
•Maximum number of PVs to use
•Range of PVs to use
SMIT Logical Volumes Menu
# smit lv
Logical Volumes

Move Cursor to desired item and press Enter

List all logical volumes by Volume Group


Add a Logical Volume
Set Characteristics of a Logical Volume
Show Characteristics of a Logical Volume
Remove a Logical Volume
Copy a Logical Volume

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Show Logical Volume Characteristics
•Show Characteristics of a Logical Volume:
Physical Volume map:
# lslv –l lv00
lv00:/home/john
PV COPIES IN BAND DISTRIBUTION
hdisk0 010:000:000 70% 000:000:007:003:000

Logical Partition map:

# lslv –m lv00
Lv00:/home/john
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0134 hdisk0
0002 0135 hdisk0
0003 0136 hdisk0
Add a Logical Volume
# smit mklv
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 rootvg
* Number of LOGICAL Partitions []
PHYSICAL VOLUME names []
Logical Volume TYPE []
POSITION on physical volume []
to use for allocation
Number of COPIES of each logical 1
partition
Mirror Write Consistency yes
Allocate each logical partition copy on yes
a SEPARATE physical volume?
[MORE..10]
Remove a Logical Volume
# smit rmlv

Remove a Logical Volume

Type or select values in entry fields.


Press Enter AFTER making all desired changes
[Entry Fields]
LOGICALVOLUME name [] +

F1=Help F2=Refresh F3=Cancel F4=List


F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Set Characteristics of a Logical Volume
# smit lvsc

Set Characteristics of a Logical Volume

Move Cursor to desired item and press Enter

Change a logical volume


Rename a Logical Volume
Increase a size of a Logical Volume
Add a Copy to a Logical Volume
Remove a copy from a Logical Volume

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Showing LV Characteristics 1
List all Logical Volumes by Volume Group

# lsvg –o | lsvg –i –l
LVNAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd6 paging 8 8 1 open/syncd N/A
hd5 boot 1 1 1 closed/sync N/A
hd8 jfslog 1 1 1 open/syncd N/A
hd9var jfs 1 1 1 open/syncd /var
Showing LV Characteristics 2
Show Characteristics of a Logical Volume
# lslv logvol01
LOGICAL VOLUME: logvol01 VOLUME GROUP: volg01
LV IDENTIFIER: 000bc6fdca261bbf.1
PERMISSION: read/write
VG STATE: active/complete
LV STATE: closed/syncd
TYPE: jfs WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 16 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 2 PPs: 2
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: center UPPER BOUND: 2
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on
EACH LP COPY ON A SEPARATE PV ?: yes
Add/Remove a Logical Volume Copy
# smit mklvcopy
Add a Logical Volume
Type or select values in entry fields.
Press Enter AFTER making all desired changes
[TOP] [Entry Fields]
Logical Volume NAME [lv00]
* Volume GROUP name rootvg
* NEW Total number of logical partition [2] +
copies
PHYSICAL VOLUME names [] +
POSITION on physical volume [] +
MAXIMUM NUMBER of PHYSICAL [32] #
Volumes to use for allocation
Allocate each logical partition copy on yes +
a SEPARATE physical volume?
File containing ALLOCATION MAP []
SYNCHRONIZE the data in the new no +
logical partition copies
Reorganize a Volume Group
# smit reorgvg

Reorganizing a Volume Group

Type or select values in entry fields.


Press Enter AFTER making all desired changes
[Entry Fields]
VOLUME Group name [vg3] +
LOGICAL Volume names [lv04 lv07]
+

F1=Help F2=Refresh F3=Cancel F4=List


F5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Physical Volumes
Volume Group

1 4 1 4
2 3 2 3
5 6 8 5 6 8
9 7 12 9 7 12
10 11 10 11
13 13
14 15 14 15
17 20 17 20
18 19 18 19

Physical Partitios

•Physical Volume (PV) hard disk


•Physical Partition (PP) smallest assignable unit of
allocation on a physical disk
SMIT Physical Volumes Menu
# smit pv

Physical Volume

Move Cursor to desired item and press Enter

List all Physical volumes in system


Add a Disk
Change a characteristics of a physical Volume
List Contents of a Physical Volume
Move Contents of a Physical Volume

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Listing Physical Volume Information 1
•List all Physical Volumes in System:
#lspv
hdisk0 00615147ce54a7ee rootvg
hdisk1 00615147a877976a rootvg

•List contents of a Physical Volumes:


Listing Physical Volume Information 2

•Logical volumes

# lspv –l hdisk0

hdisk0:
LV NAME LPs PPs DISTRIBUTION MNT PT
hd1 12 12 00..00.00..12..00 /home
hd3 3 3 00..03..00..00..00 /tmp
hd2 29 29 00..00..17..12..00 /usr
hd4 13 13 00..00..13..00..00 /
hd8 1 1 00..00..01..00..00 N/A
hd6 8 8 00..00..00..08..00 N/A
hd5 1 1 01..00..00..00..00 N/A
Listing Physical Volume Information 3
Physical Partition Map
# lspv -p hdisk0
Add/Move contents of Physical Volumes
Add a disk:
The device caneither be added through SMIT or
it can be configured through configuration manager
when the system boots up
Move the contents of a Physical Volume:
migratepv [-l lvname ] sourcePV targetPV ..

# migratepv –l lv02 hdisk0 hdisk6


Working with lvmstat
# lvmstat –e –v rootvg
# lvmstat –v rootvg
Logical Volume iocnt Kb_read Kb_wrtn Kbps
hd3 1873 240 8480 8720
hd8 1763 0 7056 7056
hd4 1675 20 8464 8484
hd9var 1412 81 7387 7468
hd2 893 628 3544 4172
hd10opt 31 89 32 121
hd6 20 0 80 80
hd1 1 4 0 4
hd5 0 0 0 0.00
Migrating Physical Partitions

I/O

Less Busy
Busy
Disk
Disk

Move Physical Partitions

# migratelp hd3/1 hdisk1/109


Documenting the disk Storage Setup
List of the disks on the system (PVID and VG)
lspv
List the VGs
lsvg
List what LVs are contained in each VG
lsvg –l vgname
List LVs on each disk
lspv –l pvname
Checkpoint
1. True or false? An LV can span more than one physical
volume.
2. True or false? An LV can span more than one volume
group.
3. True or false? The contents of a PV can be divided
between twoVGs.
4. True or false? If mirroring LVs, it is not necessary to
perform a backup.
5. True or false? SMIT can be used to easily increase or
decrease the size of a logical volume.
6. True or false? Striping is done at a logical partition
level
Summary

SMIT or high-level commands can be used to


Add/Change/delete volume groups, physical volumes
and logical volumes
Mirroring is a way to have two or three copies of a
logical volume for high availability requirements
Disk Striping is used to provide high performance in
large, sequentially accessed file systems
Working
with
File Systems

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Structure of a Journaled File System
Superblock

inodes

Data Blocks Indirect


Blocks

•Superblock
•File system size and identification
•Free list, Fragment size, nbp
•Inodes
•File size, ownership,permissions,times
•Pointers to data blocks
•Blocks
•Data blocks – contain data
•Indirect blocks – contain pointers to data blocks
Structure of an Inode
•Contents of an inode Permissions
No. of links
Type offile
User ID
Group ID
File size
Address of blocks
Inode for file 1 Time modified
Time accessed
Time changed
Access control info.
Reserved other
•This information can be seen with ls -l

$ ls –li /home/team01
2132 drwxr-xr-x 2 team01 staff 512 May 2 14:33 c
2136 drwxr-xr-x 2 team01 staff 512 May 2 14:33 doc
2141 -rw-r--r-- 1 team01 staff 28 May 16 10:11 Manuals
File System Fragmentation
4096 bytes
No Fragmentation
2000 bytes
File Size = 2000 bytes

This free space cannot


Be used by another file.

4096 bytes

Fragment Enabled
2000 bytes
File size = 2000 bytes 1024 1024 1024 1024
Fragment = 1024 bytes

These free fragments can


Be used by other files
Variable Number of Inodes
With the default nbpi = 4096 an inode will be created
For every 4096 bytes of file system.

File system

INODES 4096 4096 4096


1
128 bytes 2

Using the value nbpi = 1024 an inode will be created for


Every 1024 bytes of file system

File system
INODES 4096
1
4096 4096
128 bytes 2
3 4*1024
4
5
6
Allocation Group Size
Disk blocks
inodes

16 MB
16 MB
16 MB
Grouping of related agsize
Inodes and disk blocks 16 MB

Disk blocks
inodes

64 MB
64 MB
Grouping of related 64 MB
agsize
Inodes and disk blocks 64 MB
JFS versus JFS2 File Systems
JFS JFS2
Maximum File Size 64 GB / 64 GB 4 Petabytes / 1 TB
Architectural/Tested
Maximum File System 1 TB / 1 TB 4 Petabytes / 1 TB
Size Architectural/Tested
Inode size 128 Bytes 512 Bytes

Number of Inodes Fixed, Set at creation Dynamic

Fragments/Block Size 512 / 4096 512 / 4096

Online defragmentation Yes Yes

Available on POWER Yes,default Yes

JFS2 uses extent based allocation for high performance and large size
File and File System Sizes
•Maximum Individual File Size Limits

•AIX Version 4.1 (JFS) 2 GB


•AIX Version 4.2 and later (JFS)64 GB
•AIX Version 5: (JFS2) 1 TB

•JFS File System Lmit Calculation

•Maximum file system size limit in bytes = fragment size * 2 ^28

OR

•Maximum file systemsize limit in bytes =nbpi * 2^24


Compressed File Systems
Compression = LZ (yes)
Fragment = 1024

4096 4096 4096 4096


Large File Enabled File Systems
File = 132 MB

1024 * 4 KB blocks) + (1024 * 128 KB blocks) = 132 MB


4 MB + 128MB = 132 MB

1025
1 1 Block 1026 32 Blocks
2 4 KB 1027 128 KB
3 :
4 :
:
1055
1023 1056
1024
1057
128 KB 1058
File 1059 32 Blocks
132MB 1060 128 KB
:
:
:
Exercise: Inodes and NBPI
1. If you are creating a JFS file system to store files that are
smaller than 512 bytes in size, what would you choose for the
following values
Fragment Size__________NBPI______________
Regular or Large-File enabled ______________
2. If you are creating a JFS file system intended to store files
intended to store files about 8K in size, what would you
choose for the following
Fragment Size ___________NBPI____________
Regular or Large-file enabled ___________
3. If you are creating a JFS F/S intended to store files about 2
MB in size, what would you choose for the following values?
Fragment Size ___________NBPI____________
Regular or Large-file enabled ___________
4. When should you use large file-enabled filesystems?
5. When should you use compressed file systems?
Journal Log
1
Write data

fsync ()
1) Inodes changes to log
3 2) COMMIT to log
3) Update inode 2
4) Sync log

INODES 4
Data
block

JFS LOG

No journaling of dta blocks – only journals inode


File Systems
# smit fs

File Systems
Move Cursor to desired item and press Enter
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

F1=Help F2=Refresh F3=Cancel F8=Image


F9=Shell F10=Exit Enter=Do
Listing File Systems
# lsfs

Name Nodename Mount Pt. VFS Size Options Auto


/dev/hd4 - / jfs 16384 ---- yes
/dev/hd1 - /home jfs2 90112 ---- yes
/dev/hd2 - /usr jfs2 1277952---- yes
/dev/hd9var - /var jfs 8192 ---- yes
/dev/hd3 - /tmp jfs 24576 ---- yes
/proc - /proc procfs ro yes
/dev/hd10opt - /opt jfs 129555 ---- yes
/budget sys4 /reports nfs ---- bg,hard,intr
List All Mounted File systems

# mount

Node Name Mount Pt.VFS date Options


/dev/hd4 / jfs Jan 11 20:14 rw,log=/dev/hd8
/dev/hd1 /home jfs2 Jan 11 20:14 rw,log=/dev/hd8
/dev/hd2 /usr jfs2 Jan 11 20:15 rw,log=/dev/hd8
/dev/hd9var /var jfs Jan 11 20:15 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Jan 11 20:15 rw,log=/dev/lv02
sys4 /budget /reports nfs Jan 11 20:16 bg,hard,intr
Working with journaled file systems in SMIT
File Systems
Move Cursor to desired item and press Enter
Add a Journaled File Systems
Add a Journaled File System on previously defined LV
Change/Show Characteristics of a Journaled File Systems
Remove a Journaled a File System
Defragment a Journaled File Systems

Add a Journaled File System on previously defined Logical Volume


Move Cursor to desired item and press Enter
Add a Standard Journaled File Systems
Add a Compressed Journaled File Systems
Add a Large Fie Enabled Journaled File Systems
Add a Standard Journaled File system on
a Previously Defined Logical Volume

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=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Add a Standard Journaled File System
Add a Standard Journaled File System

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
Volume Group Name [rootvg] +
*Size of the file system (in 512-byte blocks) []
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=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Add a JFS2 File System on a Previously
Defined Logical Volume
Add a Enhanced 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 [] +
Block Size (bytes) 4096 +
Inline Log? no +
Inline Log Size(Mbytes) [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Add a Enhanced Journaled File System

Add a Enhanced Journaled File System

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
Volume Group Name [rootvg] +
*Size of file system (in 512-)byte blocks [] #
*Mount Point []
Mount automatically at system restart? No +
PERMISSIONS read/write +
Mount Options [] +
Block Size (bytes) 4096 +
Inline Log? no +
Inline Log Size(Mbytes) [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Mount a File system
Add a Enhanced Journaled 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 file system no +
Disallow DEVICE access via this mount no +
Disallow execution of SUID and sgid
programs in this file system no +
Inline Log Size(Mbytes) [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Change/Show characteristics of a
Journaled File System

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 [/var] +
NEW mount point [/var] +
*Size of the file system (in 512-byte blocks) [8192]
MOUNT GROUP []
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) 4 +
Change/Show Characteristics of an
Enhanced Journaled File System

Change/Show Characteristics of an Enhanced Journaled File System

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
File system Name [/var] +
NEW mount point [/var] +
*Size of the file system (in 512-byte blocks) [8192]
MOUNT GROUP []
Mount automatically at system restart? Yes +
PERMISSIONS read/write +
Mount Options [] +
Block Size (bytes) 4096 +
Inline Log? No +
Inline Log Size(Mbytes) 4 +
Remove a Journaled File System

Remove a Journaled File System

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
File system Name [] +
Remove mount point no +
Checkpoint
1. Will the size of the file system change when the
size of the logical volume it is on is increased?
2. If a file system is the same size as the logical
volume on which it sits, will the sie of the logical
will increase when the size of the file system that
is sitting on it increases?
3. If you remove a logical volume, will the file
system that is sitting on it be removed as well?
Summary
The components of an AIX file system are the
superblock, inodes, data blocks and indirect locks
Important issues to consider when creating a
jurnaled file system are: fragment size, NBPI,
allocation group size, compression and whether it
should be large file enabled
JFS2 supports large files, large file systems and
improves performance
File systems can be added and removed from
system and their characteristics can be also be
changed, all through SMIT
Managing
File Systems

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
Manage file system growth and control growing files
Manage file system disk space usage
Implement basic file system integrity checks
Space Management
File systems expand upon notice
To keep from running into problems:
• Monitor file system growth
• Determine causes
• Control growing files
• Manage file system space usage
• Control user disk usage
• Defragment file system
Listing Free Disk Space
•The df command displays information about total space
and available space on a file syste

# df -k

# df -k
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 16384 8656 48% 1281 16% /
/dev/hd2 7045120 6170764 13% 31736 2% /usr
/dev/hd9var 16384 14416 13% 399 10% /var
/dev/hd3 16384 15792 4% 28 1% /tmp
/dev/hd1 16384 15764 4% 41 2% /home
/dev/lv00 655360 61168 91% 4528 3% /u

# df –I shows space used


# df reports free space in 512 bytes blocks
Control Growing Files
/var/adm/wtmp
/var/spool/*/*
$HOME/smit.log
$HOME/smit.script
$HOME/websm.log
$HOME/websm.script
/etc/security/failedlogin
/var/adm/sulog
skulker
The skulker command cleans up file systems by
removing unwanted or obsolete files
Candidate files include (can use file again as criteria):
• a.out file
• core files
• ed.hup files
The skulker is normally invoked daily by the cron
command as part of the root’s crontab file
Modify the skulker shell script to suit local needs for
the removal of files
Defragmenting a File System
The defragfs command increases a file system’s
contiguous free space
The file system must be mounted

/usr/sbin/defragfs [-q | -r] <filesystem>

Options:

-q Reports the current state of the file system


-r Reports the current state of the file system and
the state that would result if the defragfs
command is run without either –q or -r
Listing Disk Usage

The du command can be used to list the number of


blocks used by a file or a directory
# du /home | sort –r -n
624 /home
625 /home/fred
626 /home/tom
627 /home/mary
628 /home/liz
629 /home/suzy
630 /home/guest
1 /home/steve

•To view individual file sizes, use the ls –l command


Fragmentation Considerations
No Fragmentation 2000 bytes
File Size = 2000 bytes

This free space cannot


Be used by another file.

Fragment Enabled 4096 bytes


File size = 2000 bytes
Fragment = 1024 bytes 2000 bytes
1024 1024 1024 1024
Considerations to be made:
•Disk space allocation
•Disk space utilization
These free fragments can
•I/O activity
Be used by other files
•Free space fragmentation
•Fragment allocation map
Verify a File System

•Command syntax:
# fsck [-p | -y | -n] [-f] < file-system>

•Checks Journal LogChecks inodes, indirect blocks, data blocks, free lists
•Ifno file system name is specified, the fsck command will check all file
systems which have the check=true attribute set in the /etc/filesystems
•Orphan files are placed in the lost+found directory
Documenting File System Setup

Run the lsfs command


Get the contents of the /etc/filesystems file
Run the df command to check free space
Check all the mounted file systems by running the mount
command
Checkpoint
1. What command can be used to determine if a file
system is full?
2. What two commands can be used to find the files
and users that are taking the most disk space?
3. True/False. It is good practice torun fsck –y on all file
systems, even if they are mounted.
Summary
File system management does not just happen on the
system. File systems need to be monitored to ensure
that they do not run out of space
To ensure the integrity of file systems, checks have to be
carried whenever file system corruption is suspected
Paging
Space

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objective
Define why paging space is required in AIX
List and monitor the paging space utilization of the
system
Manage paging space scenarios
What is Paging Space?
RAM = 256 MB

O/S Database TCP/IP 8MB free

Current usage = 248 MB

O/S Database TCP/IP Appln

4 KB 4 KB
Needs more
Than 8MB
Paging Space
Paging Space
Is a secondary storage area for over-committed memory
Holds inactive 4K “pages” on disk
Is not a substitute for a real memory
Sizing Paging Space
Created at installation up to twice the size of real
memory
Amount needed is dependent on applications
Monitor paging space : lsps –a
Running low on paging space is bad

#
ksh: cannot fork, no swap space
Paging Space Placement
Only one paging space per disk
Use disks with the least activity
Paging spaces roughly the same size
Do not extend the paging space to multiple PVs
Use multiple disk controllers

hd6 paging00 paging01


Paging Space
List Paging Activity

Total RAM

# lsattr –El sys0 –a relamem


Realmem 262144 Amount of usable physical memory in KB
Paging Space activated at startup

# cat /etc/swapspaces
hd6:
dev = /dev/hd6
paging00:
dev = /dev/paging00
Adding Paging Space
# smit mkps

Add another paging space

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
Volume Group Name [rootvg]
+
Size of paging space (in logical partitions) [4]
PHYSICAL VOLUME name [hdisk2]
Start using this paging space NOW? Yes +
Use this paging space time system is
RESTARTED? Yes +

F1=Help F2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Changing Paging Space
# smit chps

Add another paging space

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
Paging Space Name Paging00
Volume Group Name [rootvg]
+
PHYSICAL VOLUME name [hdisk2]
NUMBER of additional logical partitions []
Number of logical partitions to remove []
Use this paging space time system is
RESTARTED? Yes +

F1=Help F2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Remove Paging Space
In order to remove an active paging space:

Make inactive
# swapoff /dev/paging00

Remove inactive paging space


# rmps paging00

NOTE: /dev/hd6 cannot be removed using this process


Problems with Paging Space
Paging space too small:
Dynamically increase the sizeby allocating
more partitions
Paging space too large ( only for user created paging
space)
Decrease paging space
# chps –d Logical partitions PagingSpace
Example
# chps –d 2 paging00
Documenting Paging Space Setup
Run the lsps command
Have a hardcopy of /etc/swapspaces file
Checkpoint
1. What problems can you conclude from the
following listing?

Page Space Physical Volume Volume Group/size %used Active Auto Type
hd6 hdisk0 rootvg/64 MB 43% yes yes lv
paging00 hdisk1 rootvg/64 MB 07% yes yes lv
paging01 hdisk1 rootvg/16 MB 89% yes yes lv

2. The size of paging00 ( in the above example) can be


Dynamically decreased. True or False? Why
Summary
Paging space is requirement in AIX for the system to
boot up. The default paging space is /dev/hd6.
The percent utilization of all the paging spaces should
be regularly monitored to ensure that the system has
the correct amount of page space defined. The lsps
command can be used to do this.
Paging space can be inactivated and the size can be
increased or decreased dynamically.
Disk
Management
Theory

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
• Describe where LVM information is kept
• Resolve ODM-related LVM problems
• Describe and configure Mirroring
• Explain the Quorum Mechanism
• Describe Physical Volume States
LVM Terms

Physical Logical
Partitions Partitions

Physical Logical
Volume Volume

Volume
Group
Volume Group Limits
•Normal Volume Groups (mkvg)
Number of disks: Max. Number of partitions/disk:
1 32512
2 16256
4 8128
8 4064
16 2032
32 1016

•Big Volume Groups (mkvg -B) # mkvg -t


Number of disks: Max. number of partitions/disk:
1 133048
2 65024
4 32512
8 16256
16 8128
32 4064
64 2032
128 1016
Mirroring

Physical Logical
Partitions Partitions

Write data

Mirrored
Logical Application
Volume
LVM identifier

Goal: Unique worldwide identifiers for


•Hard disks
•Volume Groups (including logical volumes)

# lsvg rootvg
VOLUME GROUP:rootvg VG identifier:00008371c98a229d4c0000000000000e

# lspv
hdisk0 000083771b5969c35 rootvg
(32 bytes long)
# lslv hd4
LOGICAL VOLUME: hd4 VOLUME GROUP: rootvg
LV IDENTIFIER: 00008371c98a229d4c0000000000000e.4

# uname –m
000083714600
LVM Data on disk Control Blocks
Volume Group Descriptor Area (VGDA)
• Most important data structure of LVM
• Global to the volume group (same on each disk)
• One or two copies per disk

Volume Group Status Area


Tracks the status of the mirrored copies
One or two copies per disk

Logical Volume Control Blocks (LVCB)


First 512 bytes of each logical volume
Contains LV attributes (Policies, Number of copies
Should not be overwritten by application using raw devices!
LVM Data in the Operating Sysem
Object Data Manager (ODM)
• Physical volumes, volume groups and logical volumes are represented
as devices (Customized devices)
• CuDv, CuAt, CuDvDr, CuDep

AIX Files
• /etc/vg/vgVGID Handle to the VGDA copy in memory
• /dev/hdiskX Special file for a disk
• /dev/VGname Special file for administrative access to a VG
• /dev/LVname Special for a logical volume
• /etc/filesystems Used by the mount command to associate LV
name, JFS log and mount point
Striping
LP1
1 4 7
1
2
3
Stripe
Units 4
5
2 5 8
LP2 6 Striped
7 Logical
8
Volume
9

3 6 9
LP3 Stream of
data
RAID Levels
RAID Implementatio Explaination
Level n
0 Striping Data is split into blocks. These blocks are
written to or read from a series of disks in
parallel. No data redundancy
1 Mirroring Data is split into blocks and duplicate
copies are kept on separate disks. If any
disk in the array fails, the mirrored data
can be used.
5 Striping with Data is split into blocks that are striped
distributed across the disks. For each block parity
parity information is written that allows the
reconstruction in case of a disk failure
Exercise: Basic LVM tasks
1. Using smit mklv, create mirrred LV with name mirrorlv. Make it
2 LPs
2. Use lslv –m to identify the PPs that have been assigned
3. Remove the mirrored LV
4. Create a unmirrored LV lvtmp1 and using smit chlv mirror
them.
5. Reorganize rootvg using reorgvg command
6. Use lspv –p check where the lvtmp1 resides now
7. Remove the lvtmp1
8. What is the maximum number of disks in a VG that would be
created by the following command?
# mkvg –B –t 4 hdisk11 hdisk99 homevg
Contents of the VGDA
Header Time Stamp •Updated when VG is changed

Physical Volume List •PVIDs only (no PV names)


•VGDA count and PV state

Logical Volume List •LVIDs and LV names


•Number of copies

Physical Partition •Maps LPs to PPs


Map

Trailer Time Stamp •Must contain same value as header


time stamp
ODM related commands
• # lqueryvg –p hdisk1 –At
shows the extract of the VGDA
• # getlvcb –AT hd2
shows the LVCB for logical volume hd2
How LVM interacts with ODM and VGDA

importvg
VGDA ODM
LVCB /etc/filesystems
Change, using Match IDs
Low-level By name
commands

mkvg
extendvg
mklv
crfs Update exportvg
chfs
rmlv
reducevg

ODM Entries for Physical Volumes
# odmget –q “name like hdisk?” CuDv
CuDv:
name = “hdisk0”
status = 1
chgstatus = 2
ddins = “scdisk”
location = “04-C0-00-2,0”
parent = “scsi0”
connwhere = “2,0”
PdDvLn = “disk/scsi/osdisk”

CuDv:
name = “hdisk1”
status = 1
chgstatus = 2
ddins = “scdisk”
location = “04-C0-00-2,0”
parent = “scsi0”
connwhere = “2,0”
PdDvLn = “disk/scsi/osdisk”
ODM Entries for Physical Volumes (Cont)

# odmget –q “name=hdisk0 and attribute=pvid” CuAt


CuAt:
name = “hdisk0”
attribute = “pvid”
value = “250000010700040b000c0d0000000000”
type = “R”
generic = “D”
rep = “s”
nls_index = 2
ODM Entries for Physical Volumes (cont)
# odmget –q “value3 like hdisk?” CuDvDr
CuDvDr
resource = “devno”
value1 = “12”
value2 = “1”
value3 = “hdisk0”
CuDvDr
resource = “devno”
value1 = “12”
value2 = “2”
value3 = “hdisk1”

# ls –l /dev/hdisk*
brw------- 1 root system 12,1 08 Jan 06:56 /dev/hdisk0
brw------- 1 root system 12,2 08 Jan 06:56 /dev/hdisk1
ODM Entries for Volume Groups
# odmget –q “name=rootvg” CuDv
CuDv:
name = “rootvg
status = 0
chgstatus = 1
ddins = “”
location = “”
parent = “”
connwhere = “”
PdDvLn = “logical_volume/vgsubclass/vgtype”
#odmget –q “name=rootvg” CuAt
CuAt:
name=“rootvg”
attribute = “vgserial_id”
value = “0009301300004c00000000e63a42b585”
type = “R”
generic = “D”
rep = “s”
nls_index = 2
(continued on next slide)
ODM Entries for Volume Groups (Cont)
#odmget –q “name=rootvg” CuAt

CuAt:
name = “rootvg”
attribute = “pv”
value = “00008371d667a44b0000000000000000”
type = “R”
generic = “D”
rep = “s”
nls_index = 2
CuAt:
name = “rootvg”
attribute = “pv”
value = “00008371d1122667000000000000000”
type = “R”
generic = “D”
rep = “s”
nls_index = 2
ODM Entries for Logical Volumes
# odmget –q “name=hd2” CuDv
CuDv:
name = “hd2”
status = 0
chgstatus = 1
ddins = “”
location = “”
parent = “rootvg”
connwhere = “”
PdDvLn = “logical_volume/vsubclass/lvtype”
# odmget –q “name=hd2” CuAt
CuAt:
name = “hd2”
attribute = “lvserial_id”
value = “0009301300004c00000000e63a42b585.5”
type = “R”
generic = “D”
rep =“n”
nls_index = 648
ODM Entries for Logical Volumes (Cont)

# odmget –q “value3=hd2” CuDvDr


CuDvDr:
resource = “devno”
value1 = “10”
value2 = “5”
value3 = “hd2”

# ls –l /dev/hd2
brw------- 1 root system 10,5 08 Jan 06:56 /dev/hd2

# odmget –q “dependency=hd2” CuDep


CuDep:
name = “rootvg”
dependency = “hd2”
ODM Related LVM Problems
What can cause problems ?
•# kill –9, shutdown and system crash
•Improper use of low level commands
•Hardware changes without or with wrong software actions
Fixing ODM Problems

If the ODM problem is not in the rootvg, for example in


Volume group homevg, do the following

# varyoffvg homevg
Remove complete volume
# exportvg homevg Group from ODM
# importvg –y homevg hdiskX

Import Volume group by


Creating new ODM objects
Fixing ODM Problems (Cont)
If the ODM problem is in the rootvg, use rvgrecover:
PV=hdisk0
VG=rootvg
cp /etc/objrepos/CuAt /etc/objrepos/CuAt.$$
cp /etc/objrepos/CuDep /etc/objrepos/CuDep.$$
cp /etc/objrepos/CuDv /etc/objrepos/CuDv.$$
cp /etc/objrepos/CuDvDr /etc/objrepos/CuDvDr.$$
lqueryvg –Lp $PV| awk `{print $2}` | while read Lvname;
do
odmdelete –q “name=$LVname” –o CuAt
odmdelete –q “name=$LVname” –o CuDv
odmdelete –q “value3=$Lvname” –o CuDvDr
done
odmdelete –q “name=$VG” –o CuAt
odmdelete –q “parent=$VG” –o CuDv
odmdelete –q “name=$VG” –o CuDv
odmdelete –q “name=$VG” –o CuDep
odmdelete –q “dependency=$VG” –o CuDep
odmdelete –q “value1=10” –o CuDvDr
odmdelete –q “value3=$VG” –o CuDvDr
importvg –y $VG $PV
varyonvg $VG
Mirroring

hdisk0
Mirrored
Logical
Partitions
hdisk1

hdisk2

LP: PP1: PP2: PP3:


VGSA
5 hdisk0,5 hdisk1,8 hdisk2,9
Stale Partitions

hdisk0
Mirrored
Logical
Partitions
hdisk1

hdisk2

After repair of hdisk2:


•Varyonvg VGName (calls syncvg –v VGName)
•Only stale partitions are updated
Mirroring rootvg
1. extendvg rootvg hdisk1
2. chvg –Qn rootvg
3. mklvcopy ( use mirrorvg –s rootvg)
4. syncvg –v rootvg
5. bosboot –a –d /dev/hdisk1
6. bootlist –m normal hdisk0 hdisk1
7. shutdown –Fr
• Make a copy of all rootvg LVs via mklvcopy
and place copies on the second disk
• Execute bosboot and change your bootlist
Checkpoint
Answer True/False?
• All LVM information is stored in the ODM
• You detect that a physical volume hdisk1 that is
contained in your rootvg is missing in the ODM.
This problem can be fixed by exporting and
importing the rootvg.
• The LVM supports RAID-5 without separate
hardware
Summary
• The LVM information is held in a number of different
places on the disk, including the ODM and the VGDA
• ODM related problems can be solved by:
• Exportvg/importvg (non rootvg VGs)
• Rvgrecover (rootvg)
• Mirroring improved the availability of a system or a
logical volume
• Striping improves the performace of a logical volume
• Quorum means that more than 50% of VGDAs must
be available
Disk
Management
Procedures

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
• Replace a disk under different circumstances
• Recover from a total volume group failure
• Resolve problems caused by incorrect actions that
have been taken to change disks
• Export and import Volume Groups
Disk Replacement: Starting Point
A disk must be replaced

Yes
Disk Mirrored? Procedure 1

Yes
Disk still
Working? Procedure 2

No
Volume Group Procedure 3
Lost?
g No n ro
rootv otvg
Yes
Procedure 4 Procedure 5
Procedure 1: Disk Mirrored

1. Remove all copies from disk:


# rmlvcopy lv_xx 1 hdiskX
2. Remove disk from volume group:
# reducevg vg_name hdiskX
3. Remove disk from ODM:
# rmdev –l hdiskX –d
4. Connect new disk to system:
# reboot
5. Add new disk to volume group:
# extendvg vg_name hdiskY
6. Create new copies:
# mklvcopy lv_xx 2 hdiskY
# syncvg –v vg_name
Procedure 2: Disk Still working
1. Connect new disk to system
2. Add new disk to VG:
# extendvg vg_name hdiskY
3. Migrate old disk to new disk:
# migratepv hdiskX hdiskY
4. Remove old disk from VG:
# reducevg vg_name hdiskX
5. Remove old disk from ODM:
# rmdev –l hdiskX -d
Procedure 2: Special steps for rootvg
1. Connect new disk to the system
2. Add new disk to VG
3. Disk contains hd5?
# migratepv –l hd5 hdiskX hdiskY
# bosboot –ad /dev/hiskY
# chpv –c /dev/hdiskY
# bootpv……
4. Remove old disk from VG
5. Remove old disk from ODM
Procedure 3: Total Disk Failure
1. Identify all LVs and File systems o n failing disk:
# lspv –l hdiskY
2. Unmount all file systems on failing disk?
# unmount /dev/lv_xx
3. Remove all the file systems and LVs from failing disk:
# smit rmfs # rmlv lv_xx
4. Remove disk from VG:
# reducevg vg_name hdiskY
5. Remove disk from system:
# rmdev –l hdiskY –d
6. Add new disk to VG:
# extendvg vg_name hdiskZ
7. Re-create all LVs and file systems on new disk:
# mklv –y lv_xx # smit crfs
8. Restore file systems from backup
# restore –rvqf /dev/rmt0
Procedure 4: Total rootvg Failure
1. Replace bad disk
2. Boot in maintenance mode
3. Restore from a mksysb tape
4. Import each volume group into new ODM (importvg)
if needed.
Procedure 5: Total non-rootvg failure
1. Export the VG from the system
# exportvg vg_name
2. Check /etc/filesystems
3. Remove bad disk from ODM
# rmdev –l hdiskX –d
4. Connect new disk
5. If VG backup available (savevg)
# restvg –f /dev/rmt0 hdiskY
6. IF no VG available: Recreate
- VG (mkvg)
- LV and F/S (mklv, crfs)
- Restore data from a backup
# restore –rqvf /dev/rmt0
Common disk replacement Errors 1
Boot problems after migration:
• Firmware LED codes cycle

Fix:
Check bootlist (bootlist)
Re-create boot logical volume (bosboot)
Common disk replacement Errors 2
A disk is removed from ODM and from system, bur not
from the VG
# rmdev –l hdisk5 –d

This could create a problem for quorum


Exercise
• Migrate rootvg to new disk
• Migrate any other VG to new disk
Exporting a Volume Group
To export a volume group:
1. Unmount all file systems:
# umount /dev/lv10
# umount /dev/lv11
2. Vary off the Volume group:
# varyoffvg myvg
3. Export volume group:
# exportvg myvg
The complete volume group is removed from the
ODM
Importing a Volume Group
To import a volume group:
1. Configure the disk(s)
2. Import the volume group:
# importvg –y myvg hdisk3
3. Mount the file systems:
# mount /dev/lv10
# mount /dev/lv11
The complete volume group is added to ODM
Exercise
• Try export/import of VG’s
Checkpoint
1. Although everything seems to be working fine,
you detect error log entries for disk hdisk0 in
your rootvg. The disk is not mirrored to
another disk. Ou decide to replace this disk.
Which procedure would you use to migrate
this disk?
2. You detect an unrecoverable disk failure in the
Vg datavg. This VG consists of tow disks that
are completely mirrored. Because of the disk
failure you are not able to vary on datavg. How
do you recover from this situation?
3. After disk replacement you recognize that a
disk has been removed from the system but
not from the VG. How do you fix this problem?
Summary
• Different procedures are available that can be used
to fix disk problems under any circumstance:
• Procedure 1: Mirrored Disk
• Procedure 2: Disk still working (rootvg)
• Procedure 3: Total disk failure
• Procedure 4: Total rootvg failure
• Procedure 5: Total non-rootvg failure
• Exportvg and importvg can be used to easily
transfer VG’s between systems
Backup
and
Restore

© 2005 Hewlett-Packard Development Company, L.P.


The information contained herein is subject to change without notice
Objectives
• Identify issues which have to be considered
when deciding which backup policies to
implement:
• Media to beused
• Frequency of the backup
• Type of backup
• List different backup methods supported
through SMIT and on command line
• Create a customized installable system backup
image
• Execute other useful commands to manipulate
the backed up data on the media
Why backup
• Data is very important
• Expensive to recreate
• Can it be recreated?
• Disaster recovery:
• Hardware failure
• Damage due to installation/repair
• Accidental deletion
• Transfer of data between systems
• Reorganizing file systems
• Defragmentation to improve performance
• System image for installation
• Checkpoint (before/after upgrade)
• Long term archive
Why Restore?

• Recover files
“ I have just deleted file by mistake”
• Compare versions of files
“This problem was not there in old version”
• Recover system after disaster
• Restore archived data
• Shrink a file system
Type of Backup - AIX
• System Backup
Records image backup of the operating system
• Full
Preserves all user data and configuration files
• Incremental
Records changes since previous backups
Must be used carefully
Very quick
Backup Strategy

System Backup

Full Backup

Incremental Backup

Incremental Backup
Backup Devices - Tape
4 mm DAT 8 mm DAT ½ inch cartridgeDLT
SDLT LTO STK 9840/9940

Device Density # Retension on Rewind on


open close

/dev/rmtx 1 No Yes
/dev/rmtx.1 1 No No
/dev/rmtx.2 1 Yes Yes
/dev/rmtx.3 1 Yes No
/dev/rmtx.4 2 No Yes
/dev/rmtx.5 2 No No
/dev/rmtx.6 2 Yes Yes
/dev/rmtx.7 2 Yes no
Backup Device – Read/Write Optical Drive
• Use with CD-ROM file system for read only operations
• Use with journal file systems for read/write operations
rootvg backup process - mksysb
• Backs up rootvg only
• Unmounted file systems are not backed up
• Bootable tape is created in backup format
• Provides facilities for a non-interactive
installations
• Saves system-created paging space definitions
• Saves logical volume policies
• There should be minimal user and application
activity
/image.data file for rootvg
image.data:
IMAGE_TYPE=bff
DATE_TIME=Wed Jan 9 15:07: IST 2004
UNAME_INFO=AIX sys2 1 5 000930134C00
PRODUCT_TAPE=no
USERVG_LIST=
OSLEVEL=4.3.3.0
logical_volume_policy:
SHRINK=no
EXACT_FIT=no
ils_data:
LANG=C
#Command used for source_disk_data:/usr/sbin/bootinfo
source_disk_data:(stanza is repeated for each disk in rootvg)
LOCATION=(disk location)
SIZE_MB=(size of disk in megabytes)
HDISKNAME=(disk name)
#Command used for lv_data: /usr/sbin/lslv
lv_data:(stanza for each logical volume in rootvg)
.
.
fs_data:(stanza for each MOUNTED filesystem in rootvg)
/bosinst.data. File for rootvg
control_flow:
CONSOLE =
INSTALL_METHOD = overwrite
PROMPT = yes
EXISTING_SYSTEM_OVERWRITE = no
INSTALL_X_IF_ADAPTER = yes
RUN_STARTUP = yes
RM_INST_ROOTS = no
ERROR_EXIT =
CUSTOMIZATION_FILE =
TCB = no
INSTALL_TYPE =
BUNDLES =
RECOVER_DEVICES = no
BOSINST_DEBUG = no
ACCEPT_LICNESES =
INSTALL_64BIT_KERNEL = no
INSTALL_CONFIGURATION = Default
DESKTOP = CDE
target_disk_data
LOCATION =
SIZE_MB =
HDISKNAME =
locale:
BOSINST_LANG =
CULTURAL_CONVENTION =
MESSAGES =
KEYBOARD =
rootvg Image Backup
Backup root Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Backup DEVICE or FILE [] +
Create MAP files? No +
EXCLUDE files? No +
List files as they are backed up? No +
Generate new /image.data file yes +
EXPAND /tmp if needed? No +
Disable software packing of backup no +

Number of BLOCKS to write in a single o/p [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
mksysb Image

Blocksize=512 Blocksize=512 Blocksize=512 Tape Drive


Block Size

BOS Boot mkinsttape Dummy .to rootvg data


image image c

Kernel ./image.data Dummy TOC Backup


DeviceDrivers ./bosinst.data By name
./tapeblksz
Non-rootvg Backup
Backup a Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Backup DEVICE or FILE [] +
*Volume GROUP to backup [] +
Create MAP files? No +
EXCLUDE files? No +
List files as they are backed up? No +
Generate new /vg.data file yes +
EXPAND /tmp if needed? No +
Disable software packing of backup no +

Number of BLOCKS to write in a single o/p [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Restoring a mksysb 1
•Boot the system in install/maintenance mode:
Welcome to Base Operating System
Installation and maintenance
1 Start Install Now With Default Settings
2 Change/Show Installation Settings and Install
3 Start Maintenance Mode for System Recovery

Maintenance
1 Access A Root Volume Group
2 Copy a System Dump to Removable Media
3 Access Advanced Maintenance Functions
4 Install from a System Backup

Choose Tape Drive


1 Tape/scsi/4mm/2GB /dev/rmt0
Restoring a mksysb 2
•Boot the system in install/maintenance mode:
Welcome to Base Operating System
Installation and maintenance
1 Start Install Now With Default Settings
2 Change/Show Installation Settings and Install
3 Start Maintenance Mode for System Recovery

System Backup Installation and settings


1 Disk where you want to install hdisk0
2 Use Maps No
3 Shrink Filesystem No
0 Install with the settings list above
Restoring a non-rootvg Volume Group
Remove a Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Restore DEVICE or FILE [/dev/rmt0] +
Shrink the filesystems no +
Physical Volume names []
Uses existing MAP files? yes +
Physical partition size in megabytes []
+
Number of BLOCKS to write in a single o/p [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Exercise: savevg

1. Create a filesystem /home/savevg in rootvg and mount it


2. Backup the datavg VG to /home/savevg/bkup
3. Remove the datavg
4. Recover the VG from backup
5. Verify the VG isback
6. Examine the contents of the file /tmp/vgdata/datavg/datavg.data
Backup by file name
Backup –i [-q] [-p] [-v] [-f device]

-q media is ready
-p compress files which are less than 2GB
-v verbose – display filenames during backup

Filenames are read from standard input

# cat listfile
/home/roy/file1
/home/roy/file1
/home/roy/file1
# backup –iqvf /dev/rmt0 <
listfile
# find /home/roy | backup –iqvf /dev/rmt0
Backup a File or a Directory
# smit backfile
Backup a File or Directory

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Backup DEVICE or FILE [/dev/rmt0] +
*FILE or DIRECTORY to backup [.] +
Current working DIRECTORY [] +
backup LOCAL files only? yes +
VERBOSE output? No +
PACK files? no +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Backup a FILE System by Inode
Syntax:

# backup [-u] [-level] [-f device] file system

Levels provide incremental backups:


-0 Full File System backup
-1, 02, … backup changes since level –1
/etc/dumpdates contains backup history
-u updates /etc/dumpdates

# backup –u 1 –f /dev/rmt0 /home


Backup a File System by Inode
# smit backfilesys
Backup a Filesystem

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*FILESYSTEM to backup []
*Backup DEVICE or FILE [/dev/rmt0] +
Backup LEVEL (0 for a full backup) [0] +
RECORD backup in /etc/dumpdates No +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
restore command
• List files on media (Verify backup)
restore –R [-q] [-v] [-f device]
$ restore –Tvf /dev/rmt0
• Restore individual files.
restore –x [-q] [-v] [-f device] [file1 file2]
# restore –xvf /dev/rmt0 /home/cms/ch-1
• Restore complete file system
restore –r [-q] [-v] [-f device]
# restore –rqvf /dev/rmt0
• Restore backups in order, that is, -0 then –1 and so forth
Restore a File or a Directory
# smit restfile

Remove a Volume Group

Type or select values in entry fields


Press Enter AFTER making all desired changes.
[Entry Fields]
*Restore DEVICE or FILE [/dev/rmt0] +
*Target Directory [.] +
FILE or DIRECTORY to restore []
VERBOSE output? yes +
Number of BLOCKS to write in a single o/p [] +

F1=HelpF2=Refresh F3=Cancel F4=List


F7=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
Exercise
• Perform backup and restore on testvg
Other UNIX backup Commands
• tar (tape archive
• Widely available
• Good for transfer of data between platforms
• Has no support for extended inode (ACLs)
• cpio (copy input to output)
• Widely available
• Difficulties can occur with many symbolic links
• Has no support for extended inode (ACLs)
• dd (device to device)
• Makes backup copies that are an exact image
• Can also be used for conversions (e.g. ASCII to EBCDIC)
Tar command
• Generate a tar backup
• # tar –cvf /dev/rmt0.3 /home
• Restore a file from a tar image
• # tar –xvf /dev/rmt0 /home/teamm01/mydir
• List (verify) content of a tar file
• # tar –tvf /dev/rmt0
cpio command
• Generate a cpio backup
• # find /home | cpio –ov> /dev/rmt0
• Restore from a cpio image
• Restore –idv < /dev/rmt0
• List (verify) contents of a cpio image
• # cpio –itv < /dev/rmt0
dd command
• To copy a file to diskette
• # dd if=/etc/inittab of=/dev/fd0
• To convert a file from ASCII to EBCDIC
• # dd if=text.ascii of=text.ebcdic conv=ebcdic
• To convert dat to uppercase characters
• # cat lcase.data | dd conv=ucase
• To copy 31st data block to corrupted 1st block
• # dd count=1 bs=4k skip=31 seek=1 if=/dev/hd4
of=/dev/hd4
Controlling tape
rewind - rewinds a tape
# tctl fsf - fast forwards a tape
offline - ejects a tape
rewoffl - rewinds and ejects a tape
# tctl –f /dev/rmt0 rewind
# tctl –f /dev/rmt0.1 fsf 3
# tctl –f /dev/rmt0 rewoffl

# restore -s
# restore –s 4 –xvf /dev/rmt0.1 ./etc/inittanb

Tcopy command can be used for tape to tape copying


It needs two backup devices
Good backup practices
• Verify your backups
• Check the tape device
• Keep old backups
• Offsite secure storage
• Label tape
• Test recovery procedure and document the same
• Use tapechk command to check the drive
(#tapechk 2)
Exercise: Using tar and cpio
• Use tar and cpio and try backup and restore
Checkpoint
1. What is the difference between A and B
A. find /home/fred| backup –ivf /dev/rmt0
B. cd /home/fred; find .| backup –ivf /dev/rmt0
2. On a mksysb tape if you entered tctl rewind and
tctl –f /dev/rmt0.1 fsfs 3 which element on the
tape could you look at? Which command could
you use to restore these files?
3. True or false? SMIT mksysb will backup all file
systems, provided they are mountd
Summary
• In order to perform successful backups, consideration
must be given to the frequency of the backup, the
media to be used and the type of the backup
• Backups can be initiated on a single file, a file system
or an entire volume group, all of which are supported
through SMIT
• By modifying the bosinst.data and the image.data files,
a customized system image backup can be created.
• There are many other UNIX backup commands which
can be used, however their limitations must be fully
understood. The commands include: tar, cpio and dd
• Other useful commands also exist to manipulate the
data on the backup media such as tctl

You might also like