Monthly Archives January 2012

Transferring Files | Windows and AIX

If you’re one of the unlucky ones and find yourself unable to run a Linux workstation at work, and you administer AIX or any UNIX/Linux boxes, I’m sure you have had issues transferring files back and forth.
You can always use ftp and the plethora of programs that handle that connection, but myself I prefer Win SCP.

Win SCP is by far the best file transfer program I have found to bounce files back and forth from my workstation to my lpars.

Simply open the program, enter in your login information, and you can browse between the local and remote folders.  Browse to the source and destination, click and drag… everything is easy peasy and super quick

If you have any input on the matter I’d be happy to hear it!

Read More

AIX Technology Level (TL) | Maintenance Level Update

Current OS level 

oslevel -s

oslevel -r
Download technology or maintenance level from fix central

IBM Support: Fix Central

AIX -> Version -> FIX PACKS -> wait…

Select the fix pack you would like (with Service Pack)

Start download. Once download is complete, FTP, scp or winscp (Windows) files to the LPAR or the NIM server

To initiate install, use the following commands:
pwd

inutoc .

smitty update_all > directory .

If you don’t want to keep old version:

Make Commit -> Yes

If you want to keep old version as backout plan

Make Commit -> No
Accept License -> YES (otherwise you will have to accept each one manually…its a pain)

The install can take anywhere over an hour so patient…

Reboot LPAR

shutdown -r

Verify the upgrade

oslevel -s

oslevel -r

Read More

Korn Shell (KSH) Command | if Test Parameters

if/Test Statement

test -e file
[ -e file ]
[[ -e file ]]

x=2
test $x -eq 1
[ $x -eq 2 ]
[[ $x -eq 3 ]]

File Test Operators

File status can be examined using several operators.

Parameter:     Meaning
-s file     size greater than zero
-r file      exists and is readable
-w file      exists and is writable
-x file      exists and is executable
-u file      exists and has the SUID bit set
-g file       exists and has the SGID bit set
-k file      exists and has the SVTX sticky bit set
-e file       exists
-f file      exists and is an ordinary file
-d file      exists and is a directory
-c file      exists as a character special file
-b file      exists and is a named pipe file
-p file      exists and is a named pipe file
-L file    ...

Read More

Common FTP Commands

Here are some common commands that we all use to move files around using FTP

? -> to request help or information about the FTP commands
ascii -> to set the mode of file transfer to ASCII (this is the default and transmits seven bits per character)
binary -> to set the mode of file transfer to binary (the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files)
bye -> to exit the FTP environment (same as quit)
cd -> to change directory on the remote machine
close -> to terminate a connection with another computer
close brubeck -> closes the current FTP connection with brubeck, but still leaves you within the FTP environment.
delete -> to delete (remove) a file in the current remote...

Read More

FTP Script | AIX to Windows Share

Often times you may want to create a script to copy, move or grab files from your AIX machine to a Windows (or other) box.  In some cases, there may a shared Windows drive created office wide and you would like to dump system information or reporting here.  If ssh is not supported on the other end, you will need to use FTP.

General FTP Commands

Here is a quick script to move files from your AIX box to your Windows share.

ftpmove(){

ftp -n <<-EOF
open fully_qualified_server_name
user username password
cd path/to/file
put file_to_copy_to_windows

get file_to_copy_to_aix

EOF
}

ftpmove

Read More

Easiest Way to Build a New Virtualized LPAR in the DMZ

Having a fully virtualized server environment is great, but with the constant push towards public services, there has been an increase in DMZ servers for many companies.

In my opinion, I think the simplest way to do this is to create the LPAR with the normal virtual ethernet adapter, and the simply switch the adapters once set up is complete.  This allows you to complete all functions through the NIM and you don’t have to worry about firewall interference until after most of the tedious parts are complete.  No CDs to mount, no files to manually copy over.  Every body wins!

When creating an LPAR, follow the steps here for help, and add these simple tweaks to make your life easier when building an LPAR in the DMZ

  1. Before creating the LPAR, ensure that you have all of the details and netwo...
Read More

Understand AIX Storage | AIX Certification

This is an in-depth explanation for use with the AIX Basics Certification Guide. (Continued from here)

  1. Understand the difference between physical volumes, volume groups, logical volumes and filesystems → Physical (disks), volume group (disk allocation), logical volume (how volume group is divided), filesystem(where files reside)
  2. Determine which file systems are currently mounted → lsvg -l rootvg, mount
  3. List system disks → lspv
  4. Determine the used and available space of filesystems (lsfs, df, etc)
  5. Determine the space available in a volume group → lsvg
  6. Determine which file systems are in a volume group → lsvg
  7. List available paging space → lsps -a
  8. Mount filesystems, CD, and tape devices → mount

Understand the difference between physical volumes, volume groups, logical volumes a...

Read More

AIX Command | Exporting NFS: exportfs vs mknfsexp

Every once in awhile you will find a quaint little reminder that AIX is not UNIX.  I worked in a shop where we used third party software connecting our servers to the vendor’s servers through an NFS mount.  The unfortunate thing was that when we rebooted the server, for some unknown reason some of the exports were not persistent.  This created a whirlwind of problems, resulting in making customer service support tickets and waiting for the vendor to reissue their mount.
If you have been working with AIX for more than a couple days, you know that there are multiple ways to complete any one task.  You may also know that AIX still incorporates many UNIX commands, and also has (seemingly redundant) AIX proprietary commands.  This example is a great explanation of why this is.

One of the t...

Read More

Understand & Manipulate AIX file systems | AIX Certification

This is an in-depth explanation for use with the AIX Basics Certification Guide.

  1. Determine current working directory → pwd
  2. Change between directories → cd
  3. List the contents of a directory → ls [-l][-a]
  4. Understand absolute and relative paths → /etc/passwd ./passwd ~/files
  5. Determine file system type → lsvg -l rootvg, lsfs -v jfs,
  6. Rename, copy, move and delete files → mv, cp, rm
  7. Create, rename and delete directories → mkdir, mv -r, cp -r, rm -r
  8. Locate files and directories (find command) find [directory] -name [name]
  9. Change permissions associated with a file or directory → chown, chmod
  10. Understand symbolic and hard links → ln (hard), ln -s (soft).  Hard: only files and updates upon moves, Soft: between FS and can link directories.  If source moved link broken
  11. Show the cont...
Read More

Favourite IBM Redbooks: Free resources

rb170x32

Here is a list of IBM Redbooks that I have found useful for my day to day operations.  Enjoy

Hardware Management Console V7 Handbook

AIX 5L Practical Performance Tools and Tuning Guide

IBM System p Advanced POWER Virtualization (PowerVM) Best Practices

NIM from A to Z in AIX 5L

IBM PowerVM Live Partition Mobility

Hope they help you like they have helped me

Read More