send snap to IBM

snap -r
snap -gGfkftLikc
cd /tmp/ibmsupt
mv snap.pax.Z CASE_NUMBER

ftp testcase.software.ibm.com
login: ftp
>cd /toibm/aix
>bin
>hash
>put CASE_NUMBER

Alternate disk install AIX

Its possible to install AIX onto another disk on the same system. This is not partitioning, its just a second install of the BOS, on another disk.

You need to have “bos.alt_disk_install.rte” fileset installed. This fileset ships the “alt_disk_install” command,
which allows cloning of the rootvg and installing an AIX mksysb to an alternate disk.

“bos.alt_disk_install.boot_images” fileset installed. This fileset shipts the boot images, which is required to install mksysb images to an alternate disk.

Once you have installed these filesets, the alternate disk installation functions are available to you.

You can use the “smitty alt_install” or “smitty alt_clone” or “smitty alt_mksysb” fastpath:

# smitty alt_install

———————————————–

Alternate Disk Installation

Move cursor to desired item and press Enter.

Install mksysb on an Alternate Disk
Clone the rootvg to an Alternate Disk

F1=Help  F2=Refresh   etc..
———————————————–

So, the Alternate Disk Installation can be used in one of two ways:
– Cloning the current rootvg to an alternate disk.
– Installing a mksysb image on another disk.

# smitty alt_mksysb

———————————————–
Install mksysb on an Alternate Disk

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

Target Disk(s) to install          []
Device or image name               []
Phase to execute                    all
image.data file                    []
Customization script               []
Set bootlist to boot from this disk
on next reboot?                     yes
Reboot when complete                no
Verbose output?                     no
Debug output?                       no
resolv.conv file                   []

———————————————–

You can also use the “alt_disk_install” command to clone the rootvg to another disk.
The command creates an “altinst_rootvg” volumegroup on the destination disk and prepares
the same logical volumes as in the rootvg, except the names are prepended with “alt_”,
for example, alt_hd1. Similar are the filesystems renamed to “/alt_inst/filesystemname”
and the original data (mksysb or rootvg) is copied.

After this first fase, a second fase begins where an optional configuration action
can be performed, either a custom script or update of software, when cloning rootvg.

The third fase unmounts the /alt_inst/filesystems and renames the filesystems and logical volumes
by removing the alt names. Then the bootlist is altered to boot from the new disk.
After the system is rebooted, the original rootvg is renamed to old_rootvg.

Example:

# lspv
hdisk0      00fa7377474    rootvg
hdisk1      00hdgfh6374    None

# alt_disk_install -BC hdisk1

performs cloning hdisk0 to hdisk1 where hdisk1 will be the new rootvg.

Installing a second AIX52 partition using alt_disk_install:
———————————————————–

You can use the alt_disk_install command to clone a system image to another disk, and you may use
the -O option to remove references in the object data manager (ODM) and device (/dev) entries
to the existing system. The -O flag tells the alt_disk_install command to call the devreset command,
which resets the device database. The cloned disk can now be booted as if it were a new system.

An example of this scenario is as follows:

Boot the managed system as a Full System Partition so you have access to all the disks in the managed system.
Configure the system and install the necessary applications.
Run the alt_disk_install command to begin cloning the rootvg on hdisk0 to hdisk1, as follows:

# /usr/sbin/alt_disk_install -O -B -C hdisk1

The cloned disk (hdisk1) will be named altinst_rootvg by default.
Rename the cloned disk (hdisk1) to alt1, so you can repeat the operation with another disk.
# /usr/sbin/alt_disk_install -v alt1 hdisk1

Run the alt_disk_install command again to clone to another disk and rename the cloned disk, as follows:
# /usr/sbin/alt_disk_install -O -B -C hdisk2
# /usr/sbin/alt_disk_install -v alt2 hdisk2

Repeat steps 3 through 5 for all of the disks that you want to clone.
Use the HMC to partition the managed system with the newly cloned disks.
Each partition you create will now have a rootvg with a boot image.
Boot the partition into SMS mode. Use the SMS MultiBoot menu to configure the
first boot device to be the newly installed disk. Exit the SMS menus and boot the system.

Recovery from AIX operating system failure

Recover from AIX OS failure:
———————————

Recover from OS failure.

Contents:
1. How to view the bootlist:
2. How to change the bootlist:
3. How to make a device bootable:
4. How to make a backup of the OS:
5. Shutdown a pSeries AIX system in the most secure way:
6. How to restore specific files from a mksysb tape:
7. Recovery of rootvg

1. How to view the bootlist:

At boottime, once the POST is completed, the system will search the boot list for a
bootable image. The system will attempt to boot from the first entry in the bootlist.
Its always a good idea to see what the OS thinks are the bootable devices and the order of what the OS
thinks it should use. Use the bootlist command to view the order:

# bootlist -m normal -o

As the first item returned, you will see hdisk0, the bootable harddisk.

If you need to check the bootlist in “service mode”, for example if you want to boot from tape to restore the rootvg, use

# bootlist -m service -o

2. How to change the bootlist:

The bootlist, in normal operations, can be changed using the same command as used in section 1, for example

# bootlist -m normal hdisk0 cd0

This command makes sure the hdisk0 is the first device used to boot the system.

If you want to change the bootlist for the system in service mode, you can change the list in order to use rmt0
if you need to restore the rootvg.

# bootlist -m service rmt0

3. How to make a device bootable:

To make a device bootable, use the bosboot command:

# bosboot -ad /dev/ipldevice

So, if hdisk0 must be bootable, or you want to be sure its bootable, use

# bosboot -ad /dev/hdisk0

4. How to make a backup of the OS:

The mksysb command creates an installable image of the rootvg. This is synonym to say that mksysb creates
a backup of the operating system (that is, the root volume group).

You can use this backup to reinstall a system to its original state after it has been corrupted.
If you create the backup on tape, the tape is bootable and includes the installation programs
needed to install from the backup.

To generate a system backup and create an /image.data file (generated by the mkszfile command) to a tape device
named /dev/rmt0, type:

# mksysb -i /dev/rmt0

If a backup tape was created with the -e switch, like in:

# mksysb -i -e /dev/rmt0

then a number of directories are NOT included in the backup. These exclusions are listed in the “/etc/exclude.rootvg” file.

The mksysb command should be used regularly. It must certainly be done after installing apps or devices.
In normal conditions, the OS does not change, and a bootable tape should be created at some frequency.

5. Shutdown a pSeries AIX system in the most secure way:

1. Shut down all applications in a controlled way.
2. Make sure no users are on the system.
3. Use the shutdown command:

shutdown -r        to reboot the system
shutdown -m        to reboot in maintenance mode

6. How to restore specific files from a mksysb tape:

$ tctl fsf 3
$ restore -xvf /dev/rmt0.1 ./your/file/name

For example, if you need to get the vi command back, put the mksysb tape in the tape drive (in this case, /dev/rmt0)
and do the following:

cd /                         # get to the root directory
tctl -f /dev/rmt0 rewind     # rewind the tape
tctl -f /dev/rmt0.1 fsf 3    # move the tape to the third file, no rewind
restore -xqf /dev/rmt0.1 -s 1 ./usr/bin/vi    # extract the vi binary, no rewind

Further explanation why you must use the fsf 3 (fast forward skip file 3):
The format of the tape is as follows:
1. A BOS boot image
2. A BOS install image
3. A dummy Table Of Contents
4. The system backup of the rootvg

So if you just need to restore some files, first forward the tape pointer to position 3, counting from 0.

7. Recovery of rootvg

7.1 Check if the system can boot from tape:
# bootinfo -e

If a 1 is returned, the system can boot from tape, if a 0 is returned a boot from tape is not supported.

7.2 Recover the rootvg:

One possible method is the following:
1. Check whether the tape is in front of the disk with the bootlist command:
# bootlist -m normal -o
2. Insert the mksysb tape
3. Power on the machine. The system will boot from the tape.
4. The Installation and Maintenance Menu will be displayed.

Welcome to Base Operating System
Installation and Maintenance

Type the number of your choice and press Enter.  Choice is indicated by >>>.

>>> 1 Start Install Now with Default Settings

2 Change/Show Installation Settings and Install

3 Start Maintenance Mode for System Recovery

Type 3 and press enter to start maintenance mode.
The next screen you should see is :-

Maintenance

Type the number of your choice and press Enter.

>>> 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]:

Type 4 and press enter to install from a system backup.
The next screen you should see is :-

Choose Tape Drive

Type the number of the tape drive containing the system backup to be
installed and press Enter.

Tape Drive                     Path Name

>>> 1 tape/scsi/ost                  /dev/rmt0

>>> Choice [1]:

Type the number that corresponds to the tape drive that the mysysb tape
is in and press enter.
The next screen you should see is :-

Welcome to Base Operating System
Installation and Maintenance

Type the number of your choice and press Enter.  Choice is indicated by >>>.

>>> 1 Start Install Now with Default Settings

2 Change/Show Installation Settings and Install

3 Start Maintenance Mode for System Recovery

+—————————————————–
88  Help ?         |Select 1 or 2 to install from tape device /dev/rmt0
99  Previous Menu  |
|
>>> Choice [1]:

You can now follow your normal mksysb restore procedures.

AIX Print service

ssrc -s qdaemon (if it is not active ) then

startsrc -s qdaemon

lssrc -s qdaemon ( check for verification)

lp abc ( submit job)

qcan -X ( cancel all job being submitted by user)

cancel jobno ( cancel individual job by specifying job no).

Restore mksysb on source machine

Installing a system backup on the source machine

You can use Web-based System Manager or command line to restore an operating system onto the same machine from which you created the backup.

 

For either interface, the following conditions must be met before beginning the procedure:

All hardware must already be installed, including external devices, such as tape and CD/DVD-ROM drives.

Obtain your system backup image from one of the following sources:

CD or DVD BOS CDs, created in one of the following ways:

Using the Web-based System Manager Backup and Restore application. Select System backup to writable CD.

Using the SMIT Back Up This System to CD menu.

From the command line, using the mkcd or mkdvd command.

 

Tape BOS tapes, created in one of the following ways:

Using the Web-based System Manager Backup and Restore application. Select Back up the system.

Using the SMIT Back Up the System to Tape/File menu.

From the command line, using the mksysb -i Target command.

Note: If devices were removed from or replaced on the system after the backup was created, their information will be restored when you install a backup. The system shows these devices in a defined state because the ODM from the system at the time of backup is restored instead of rebuilt.

Network The path to your backup image file. For information about installing a backup across a network, refer to Using a mksysb image to install the base operating system on a NIM Client. 

 

Note: Before you begin, select the tape or CD/DVD-ROM drive as the primary boot device. For additional information, refer to the section in your hardware documentation that discusses system management services.

Due to enhancements in the mksysb command, you can control how devices are recovered when you install a system backup on the source machine. This behavior is determined by the RECOVER_DEVICES variable in the bosinst.data file. This variable can be set to default, yes, or no. The following list shows the resulting behaviors for each value:

default

ODM is restored

yes

ODM is restored

no

No recovery of devices

Note: You can override the default value of RECOVER_DEVICES by selecting yes or no in the Backup Restore menu or by editing the value of the attribute in the bosinst.data file.

To use Web-based System Manager:

 

Start the Web-based System Manager by typing wsm on the command line as root user.

Expand Software in the Navigation Area, select Overview and Tasks, then select Reinstall Operating System.

Choose the installation device:

Network

If you choose this option, your machine must either be a configured NIM client, or have access to a NIM environment. If your machine is not a NIM client, the Reinstall Base Operating System wizard leads you through the process. For more information on setting up a NIM environment, see Using installation images to install the base operating system on a NIM client.

 

Tape or CD/DVD-ROM

Choose Install a system backup image (mksysb) as the installation type.

Follow the wizard prompts to complete the procedure.

To use the command line:

You can use the bootlist command to display or change the primary boot device.

To display the primary boot device:

bootlist -m normal -o

To change the primary boot device:

bootlist -m normal rmt0

bootlist -m normal cd0

Power off your machine by following these steps:

Log in as the root user.

Enter the following command:

shutdown -F

If your system does not automatically power off, place the power switch in the Off (0) position.

Attention: Do not turn on the system unit until Step 6.

Turn on all attached external devices. These include:

Terminals

CD or DVD drives

Tape drives

Monitors

External disk drives

Turning on the external devices first is necessary so that the system unit can identify them during the startup (boot) process.

 

Insert the installation media into the tape or CD or DVD drive.

You might find that on certain tape drive units, the tape drive door does not open while the system is turned off. If you have this problem, use the following procedure:

 

Turn on the system unit.

Insert the boot installation tape (insert Volume 1 if you received more than one volume).

Turn off the system unit and wait for 30 seconds.

If you are not using an ASCII terminal, skip to Step 6. If you are using an ASCII terminal, use the following criteria to set the communications, keyboard, and display options.

Note: If your terminal is an IBM® 3151, 3161, or 3164, press the Ctrl+Setup keys to display the Setup Menu and follow the on-screen instructions to set these options. If you are using some other ASCII terminal, refer to the appropriate documents for information about how to set these options. Some terminals have different option names and settings than those listed here.

Communication Options

Option Setting

Line Speed (baud rate) 9600

Word Length (bits per character) 8

Parity no (none)

Number of Stop Bits 1

Interface RS-232C (or RS-422A)

Line Control IPRTS

 

Keyboard and Display Options

Option Setting

Screen normal

Row and Column 24×80

Scroll jump

Auto LF (line feed) off

Line Wrap on

Forcing Insert line (or both)

Tab field

Operating Mode echo

Turnaround Character CR

Enter return

Return new line

New Line CR

Send page

Insert Character space

 

Turn the system unit power switch from Off (0) to On (|). The system begins booting from the backup media. If your system is booting from tape, it is normal for the tape to move back and forth. If your system has an LED display, the three-digit LED should display c31.

Note: You can boot from production media (tape or CD) if your backup media fails to boot. The initial Welcome screen includes an option to enter a maintenance mode in which you can continue the installation from your backup media. Refer to Troubleshooting an installation from a system backup for more information.

If you have more than one console, each terminal and directly attached display device (or console) might display a screen that directs you to press a key to identify your system console. A different key is specified for each terminal displaying this screen. If this screen is displayed, then press the specified key only on the device to be used as the system console. (The system console is the keyboard and display device used for installation and system administration.) Press a key on only one console.

 

Note: If the bosinst.data file lists a valid display device for the CONSOLE variable, you do not manually choose a system console. Read Customizing your installation for more information about the bosinst.data file.

The type of installation that begins is determined by the settings of the PROMPT field in the control_flow stanza of the bosinst.data file. Use the following criteria to determine the type of installation you will be using:

PROMPT = no Nonprompted Installation. This installation method is used if the backup image is configured to install automatically, without having to respond to the installation program. Go to step 8.

PROMPT = yes Prompted Installation. This installation method is used if you need to use menu prompts to install the backup image. Also, use this installation method if a nonprompted installation halts and the Welcome to Base Operating System Installation and Maintenance screen displays. Go to step 9.

 

A successful nonprompted installation requires no further instructions because the installation is automatic.

Note: If the backup image holds source system-configuration information that is incompatible with the target system, the nonprompted installation stops and a prompted installation begins.

The Installing Base Operating System screen displays before the installation starts. The nonprompted installation pauses for approximately five seconds before beginning. After this time, the non-prompted installation continues to completion.

 

However, if you decide to interrupt the automatic installation and start a prompted session, type 000 (three zeros) at the terminal and follow the remaining steps in this procedure.

 

The Welcome to the Base Operating System Installation and Maintenance screen displays.

Note: You can view Help information at each screen of this installation process by typing 88.

Choose the Change/Show Installation Settings and Install option.

 

The System Backup Installation and Settings displays. This screen shows current settings for the system. An ellipsis follows the disk listed in the first line if there is more than one disk selected.

Either accept the settings or change them. For more information on using map files, see Creating system backups.

To accept the settings and begin the installation, skip to step 16.

 

To change the settings, continue with step 12.

 

Type 1 in the System Backup Installation and Settings screen to specify disks where you want to install the backup image. The Change Disk(s) Where You Want to Install screen displays. This screen lists all available disks on which you can install the system backup image. Three greater-than signs (>>>) mark each selected disk.

Type the number and press Enter for each disk you choose. Type the number of a selected disk to deselect it. You can select more than one disk.

 

Note: You can also specify a supplemental disk by typing 66 and pressing the Enter key for the Disks not known to Base Operating System Installation option. This option opens a new menu that prompts for a device support media for the supplemental disk. BOS installation configures the system for the disk and then returns to the Change Disk(s) Where You Want to Install screen.

After you have finished selecting disks, press the Enter key.

The screen that displays after you press the Enter key is dependent on the availability of map files for all of the selected disks. The criteria for this is as follows:

 

If one or more selected disks have no maps, BOS installation returns directly to the System Backup Installation and Settings screen. Skip to step 15.

If all selected disks have maps, the Change Use Maps Status screen displays, where you choose whether to use maps for installation. Continue with step 14.

To preserve the placement of logical volumes during a future restoration of the backup, you can create map files before backing up a system. Map files, stored in the /tmp/vgdata/rootvg directory, match the physical partitions on a drive to its logical partitions. Create map files either with the SMIT Backup the System menu, using Web-based System Manager, or using the -m option when you run the mksysb command.

 

For more information about map files, see Using Map Files for Precise Allocation in Operating system and device management.

 

Type either 1 or 2 in the Change Use Maps Status screen to specify whether the installation program is to use maps.

When you complete this choice, BOS installation returns to the System Backup Installation and Settings screen.

 

Decide whether BOS installation is to shrink file systems on the disks where you install the system. When you choose this option, the logical volumes and file systems within a volume group are re-created to the minimum size required to contain the data. This reduces wasted free space in a file system.

File systems on your backup image might be larger than required for the installed files. Press the 2 key to toggle the Shrink File Systems option between Yes and No in the System Backup Installation and Settings screen. The default setting is No.

 

Note: Shrinking the file system disables the use of maps.

Type 0 to accept the settings in the System Backup Installation and Settings screen.

The Installing Base Operating System screen displays the rate of completion and duration.

 

If you specified a supplemental disk in step 12, an untitled screen temporarily replaces the Installing Base Operating System screen. When this screen displays, it prompts you to place the device-support media in the drive and press the Enter key. BOS installation reconfigures the supplemental disk, then returns to the Installing Base Operating System screen.

 

The system reboots automatically when the installation completes.

mksysb testing for standalone system

First do Data Verification
 # tctl -f /dev/rmt0 rewind
 # restore -s4 -Tqvf /dev/rmt0.1 > /tmp/mksysb.log

And then do  boot Verification

Shut down system and boot from the mksysb tape.  Do not restore any of the data from the tape.  Make sure the PROMPT field in the bosinst.data file is set to YES otherwise it will automagically start the restore.

UNIX: Korn Shell Cheatsheet

—————————————————————–
Matching Patterns
<!–[if !supportEmptyParas]–> <!–[endif]–>
pattern:    example:      matches:                    not matched:

——————————————————————
*           boo*          boot,boo,booth
?           boo?          boot                        booth
[…]       [aeiou]*      ark                         bark

[!…]      boo[!st]      boor                        boot

*(cc|cc)    boo*(ze|r)    boo,boor,booze,boozer       boot

+(cc|cc)    boo+(ze|r)    boor,booze,boozer           boo

?(cc|cc)    boo?(ze|r)    boo,boor,booze              boozer

@(cc|cc)    boo@(ze|r)    booze,booth                 boo

!(cc|cc)    boo!(ze|r)    booth,boo,boot              booze,boor

{c,c,c}     a{b,c,d}e     abe,ace,ade                 axe

<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
<!–[if !supportEmptyParas]–> <!–[endif]–>
Conditional Statements
<!–[if !supportEmptyParas]–> <!–[endif]–>
format                           “true” if:
—————————————————
(( _num1_ == _num2_ ))           numbers equal
(( _num1_ != _num2_ ))           numbers not equal
(( _num1_ < _num2_ ))            num1 < num2
(( _num1_ > _num2_ ))            num1 > num2
(( _num1_ <= _num2_ ))           num1 <= num2
(( _num1_ >= _num2_ ))           num1 >= num2
<!–[if !supportEmptyParas]–> <!–[endif]–>
[[ _str1_ == _str2_ ]]           strings equal
[[ _str1_ != _str2_ ]]           strings not equal
[[ _str1_ < _str2_ ]]            str1 precedes str2
[[ _str1_ > _str2_ ]]            str1 follow str2
[[ _str1_ = _pattern_ ]]         str1 = pattern
[[ _str1_ != _pattern_ ]]        str1 != pattern
[[ -z _str_ ]]                   str is null
[[ -n _str_ ]]                   str is not null
<!–[if !supportEmptyParas]–> <!–[endif]–>
[ x=y -o k=j ]                   or in expression
[ x=y -a k=j ]                   and in expression
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–

<!–[if !supportEmptyParas]–> <!–[endif]–>
Test Objects (Files, Directories, etc.)

<!–[if !supportEmptyParas]–> <!–[endif]–>
test “true” if:                 ksh
———————————–
object exist                    -a
readable                        -r
writable                        -w
executable                      -x
non-zero length                 -s
zero length
<!–[if !supportEmptyParas]–> <!–[endif]–>
directory                       -d
plain file                      -f
symbolic link                   -h
named pipe                      -p
block special file              -b

character special file          -c
soft link                       -L
socket                          -S
<!–[if !supportEmptyParas]–> <!–[endif]–>
owned by me                     -O
owned by my group              not
<!–[if !supportEmptyParas]–> <!–[endif]–>
“sticky” bit set                -k
set-group-ID bit set            -g
set-user-id bit set             -u
<!–[if !supportEmptyParas]–> <!–[endif]–>
opened on a terminal           not
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
Format of flow control functions
<!–[if !supportEmptyParas]–> <!–[endif]–>
“if-then”               if _expr_ then
_cmd(s)_

elif _expr_
_cmd(s)_

else

_cmd(s)_

fi

<!–[if !supportEmptyParas]–> <!–[endif]–>
“case”                  case _word_ in
_pattern1_)   _cmd(s)_

_pattern2_)   _cmd(s)_
*)            break ;;

esac

<!–[if !supportEmptyParas]–> <!–[endif]–>
“while”                 while _expr_ do
_cmd(s)_

done

<!–[if !supportEmptyParas]–> <!–[endif]–>
“for”                   for _variable_ in _list_
_cmd(s)_

done

<!–[if !supportEmptyParas]–> <!–[endif]–>
“until”                 until _expr_
do

_cmd(s)_

done

<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
POSITIONAL PARAMETER
<!–[if !supportEmptyParas]–> <!–[endif]–>
program, function or shell                         $0
argument 1 through 9                               $1 .. $9
nth argument                                       ${n}
number of positional parameters                    $#
every positional parameter                         $@, $*
decimal value returned by last executed cmd        $?
pid of shell                                       $$
pid of last backgrounded command                   $!
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
REDIRECTIONS
<!–[if !supportEmptyParas]–> <!–[endif]–>
0             stdin
1             stdout
2             stderr
<!–[if !supportEmptyParas]–> <!–[endif]–>
<&-           close stdin

>&-           close stdout

<>filename    open filename for read-write

2>&1          open 2 for write and dup as 1

<!–[if !supportEmptyParas]–> <!–[endif]–>
Examples:
cmd 2>/dev/null
cmd >/dev/null 2>&1

exec 1<&-           # close descriptor 1

exec 2<&-           # close descriptor 2

exec 1< /dev/null   # open descriptor 1

exec 2< /dev/null   # open descriptor 2

<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–

<!–[if !supportEmptyParas]–> <!–[endif]–>
OTHER FUNCTIONALITIES
<!–[if !supportEmptyParas]–> <!–[endif]–>
cmd1 || cmd2    exec cmd2 if cmd1 fail

cmd1 && cmd2    exec cmd2 if cmd1 is OK

<!–[if !supportEmptyParas]–> <!–[endif]–>
V1=${V2:=V3}    Set V1 with the value of V2 if this is set else set the

variable V1 with value of V3 (V3 could be a number).

sh replacement:  if [ $V2 ] ; then
V1=$V2

else
V1=$V3

Example: DisplaySize=${LINES:24} ; Command=${Command:”cat”}

<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
${V1:?word}     if V1 set  & V1!=null   ret $V1 else print word and exit

: ${V1:?”variable V1 not set on null”}

${V1:=word}     if V1 !set | V1==null   set V1=$word
${V1:-word}     if V1 set  & V1!=null   ret $V1 else ret word

${V1:+word}     if V1 set  & V1!=null   ret word else ret nothing

${V1##patt}
${V1#patt}      if patt are found at the begin of V1 return V1 whitout the patt

else return V1
V1=”lspwd” ; ${V1#”ls”}  # exec pwd
${V1%%patt}
${V1%patt}      if patt are found at the end of V1 return V1 whitout the patt

else return V1
V1=”lspwd” ; ${V1%”pwd”}  # exec ls

<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
<!–[if !supportEmptyParas]–> <!–[endif]–>
EXAMPLES
<!–[if !supportEmptyParas]–> <!–[endif]–>
– Explode a command for use parameters counter
set `who -r` ; [ “$8” != “0” ] && exit

<!–[if !supportEmptyParas]–> <!–[endif]–>
– declare a variable for only uppercase/lovercase chars
typeset -u VAR ; VAR=”lower” ; echo $VAR   -> LOWER

typeset -l VAR ; VAR=”UPPER” ; echo $VAR   -> upper

<!–[if !supportEmptyParas]–> <!–[endif]–>
– exec
<!–[if !supportEmptyParas]–> <!–[endif]–>
– eval – esegue il comando dato come argomento
<!–[if !supportEmptyParas]–> <!–[endif]–>
– let – esegue le operazioni matematiche che passate come argomento

let “x = x * 5”

((x = x * 5))         .. altra forma di let

<!–[if !supportEmptyParas]–> <!–[endif]–>
<!–[if !supportEmptyParas]–> <!–[endif]–>
—————————————————————–
<!–[if !supportEmptyParas]–> <!–[endif]–>

What RAID level is best for my application?

Redundant Array of Independent Disks (RAID) describes a storage solution in which part of the storage capacity stores redundant information about user data stored on the remainder of the storage capacity. The redundant information enables regeneration of user data if one of the disk drives in the array  failes.

RAID relies on a series of configurations, called levels, to determine how user and redundancy

data is written and retrieved from the drives. RAID levels 1, 3, and 5 write redundancy data to the drive media for fault tolerance. The redundancy data might be a copy of the data (mirrored) or an error-correcting code derived from the data. If a drive fails, the redundancy data can be used to quickly reconstruct information on a replacement drive.

RAID Level Performance and Data Protection Summary

RAID Level and Data Protection Available
5
RAID level 5 is best for multiuser environments, such as database or file system storage, where typical I/O size is small, and there is a high proportion of read activity. RAID 5 is the most cost-effective RAID level that provides redundancy protection.
If a single drive fails in a RAID 5 array, all associated      become degraded but the redundant information enables the data to be accessed. If two or more drives fail in a RAID 5 array, all associated logical drives fail, and all data will be lost.
3
RAID level 3 is best for large data transfers in applications such as multimedia or medical imaging that write and read large sequential chunks of data. This RAID level offers redundancy protection, but any two drive failure in the same array results in data loss.
If a single drive fails in a RAID 3 array, all associated logical drives become degraded, but the redundant information enables the data to be accessed. If two or more drives fail in a RAID 3 array, all associated logical drives fail, and all data is lost.
1
RAID level 1 offers high performance and maintains identical copies of data on drive pairs, also known as mirrored pairs. Half of the drives are available for storing user data. Drive pair failure causes data loss. The strength of this RAID level is high safety and data availability. Loss of a mirrored pair of drives results in data loss.
If a single drive fails in a      array, all associated logical drives become degraded, but the mirror drive allows the data to be accessed. RAID 1 can survive multiple drive failures as long as no more than one failure exists per mirrored pair.
If a drive-pair fails in a RAID 1 array, then all associated logical drives fail, and all data is lost.
0
RAID level 0 offers high performance, but it does not provide any data redundancy.
If a single drive fails in a RAID 0 array, then all associated logical drives fail, and all data is lost.

NIM client define and OS install

  1. Define the new client (smitty nim à Nim admin tasks à manage machines à Define a machine
  2. Change the cable type to N/A
  3. F3 to go back on menu.
  4. Select Manage Network Install Resource Allocation à Allocate resources à select the new client à   Select the  resources (SPOT, lpp_source, mksysb, bosinst_data)
  5. After completion, F3 twice to the Manage Machine menu.  Select perform operations on machines à Select the new client à Select bos_inst 

 For NIM client

  1. Boot the client partition into SMS mode from WebSM/ HMC,
  2. Right click on the partition à Activate
  3. Select 2) Remote IPL Settings –>Select the Ethernet adapter–>Select IP Parameters–> Verify Adapter Settings
  4. Under adapter in the virtual world, there is not much we can do.  With a real adapter, set the speed and duplex to match the network switch
  5. Turn Spanning tree off
  6. Run the Ping test to ensure communications with the server
  7. Go back to the Main Menu, Go to Option 5, boot options
  8. Select option 1 Install Device
  9. >>>Select the virtual Ethernet adapter –> normal boot–>seletc 1 for sure
  10. 1 and Enter for the console
  11. 1 and enter for English
  12. Always check the setting, select #2 –>change/show installation settings and install–> Check the disk settings in option 1
  13. If all looks good, use “0” to continue 
  14. Done!!

 

VIOS build

1) Place the VIO Server CD in the CD-ROM
2) Activate the VIO Server in SMS
3) Select boot options –> Install –>IDE (built in dvd) –>Select the device –> Normal boot
4) Follow the prompts to do the install
2) Change Show default settings
1) Check the disk
5) After the LPAR reboots, log in as padmin
Change password
6)  The first time in, accept the license with “license –accept”
7) Create a virtual Ethernet adapter
For dual port NICS, create an Etherchannel Device
Lsdev –Cc adapter <–find out adapters
smitty devices –>Communications –>EtherChannel –>Add
–> Select both physical network cards –> Enter on the SMIT Screen
This creates ent3, the etherchannel device
As padmin
mkvdev –sea ent3 –vadapter ent2 – default ent2 –defaultid 1
This creates the bridge device en4
This creates shared device ent3.  Configure TCP/IP on the shared interface
mktcpip –interface en4 –inetaddr 63.168.157.xxx –hostname viosrvrx –gateway 62.169.157.129 –netmask 255.255.255.128
8) Enter root with “oem_setup_env”
9) Create /home/vio directory.
10) cd into /home/vio
11) ftp the files over from server/IBM
12) run “inutoc .  “  to build a table of contents
13) exit root
14) update the VIOS with “updateios –dev /home/vio”
15) Reboot
At this point you sre ready to create LVs for the rootvgs for the LPARs.