Posts by Category

Buttons

Pure New Zealand

This site is driven by Blosxom

T
his site was written in vi

SDF is driven by NetBSD

Subscribe to this sites RSS/XML feed

This site has a Tableless Stylesheet

Email me
home :: tech :: unix

May 29, 2007

LINA

Looks interesting - LINA.

With LINA, a single executable written and compiled for Linux can be run with native look and feel on Windows, Mac OS X, and UNIX operating systems.

Check the demo video - its a bit geeky but you get a feel for how it works.

[/tech/unix] | [permalink] | [2007.05.29-06:37.00]

Jan 09, 2007

Solaris ZFS Tips & Tricks

Configure the /devices directory to make physical disks available for use:

# drvconfig

Creates /dev entries for hard disks attached to the system:

# disks

List available disks and format them:

# format

You can activate the ZFS web gui:

# /usr/sbin/smcwebserver start

Access it via your browser:

https://hostname:6789

Create a mirrored disk:

/usr/sbin/zpool create -f testfs mirror c0d1 c1d1

Replace device in mirror:

/usr/sbin/zpool replace -f testfs c1d1

Create the snapshot:

/usr/sbin/zfs snapshot testfs@test_snap

Access a snapshot through the .zfs/snapshot directory at the root of the filesystem.

Excellent ZFS cheat-sheet over at Unix Admin Corner.

A useful step-through for adding disks to Solaris over at KernelTrap.

Great blog with tips on using Zones with ZFS and securing your Solaris system - Clingan.

[/tech/unix/solaris] | [permalink] | [2007.01.09-00:23.00]

Sep 06, 2006

End of the line for IRIX

I guess SGI were going down the drain anyway but its still a shame to see them turn into YALV (Yet Another Linux Vendor) - SGI To Drop MIPS, Irix, Moves to Itanium, Linux.

I guess there problems came as a result of over-pricing their gear, not forseeing the graphics-card revolution on the PC and their doomed foray into NT workstations.

Sigh.

I quite liked IRIX.

And then there were three - Solaris, AIX and HP-UX . . .

[/tech/unix/irix] | [permalink] | [2006.09.06-20:58.00]

May 17, 2006

Shell Bang Commands

Reproduced as a handy reference. Originally the work of Kevin Lyda and posted to the ILUG mailing list.

For the purposes of these tips, every tip will assume these are the last
three commands you ran:
    % which firefox
    % make
    % ./foo -f foo.conf
    % vi foo.c bar.c
Getting stuff from the last command:
    Full line:     % !!            becomes:   % vi foo.c bar.c
    Last arg :     % svn ci !$     becomes:   % svn ci bar.c
    All args :     % svn ci !*     becomes:   % svn ci foo.c bar.c
    First arg:     % svn ci !!:1   becomes:   % svn ci foo.c
Accessing commandlines by pattern:
    Full line:     % !./f          becomes:   % ./foo -f foo.conf
    Full line:     % vi `!whi`     becomes:   % vi `which firefox`
    Last arg :     % vi !./f:$     becomes:   % vi foo.conf
    All args :     % ./bar !./f:*  becomes:   % ./bar -f foo.conf
    First arg:     % svn ci !vi:1  becomes:   % svn ci foo.c

[/tech/unix] | [permalink] | [2006.05.17-02:57.00]

Nov 13, 2005

Useful CVS Links

A good Introduction to CVS

A followup article on CVS Administration

OReilly has compiled some CVS Tips

Nice Feature comparison of Source Control Systems

What is Subversion ?

There is also a Tortoise SVN Client which integrates with Windows Explorer.

[/tech/unix/cvs] | [permalink] | [2005.11.13-04:42.00]

Oct 24, 2005

Solaris OpenBoot Commands

Notes from Sun Certified Solaris 9.0 System and Network Administrator All-in-One Exam Guide:

OpenBoot

View the OpenBoot release information for your firmware, as well as the system configuration:

ok banner SPARCstation 20, Type 5 Keyboard ROM Rev. 2.4, 256 MB memory installed, Serial #456543 Ethernet address 5:2:12:c:ee:5a HostID 456543

The OpenBoot PROM monitor is based on the Forth programming language, and can be used to run Forth programs that perform the following functions:

Booting the system, by using the boot command

Performing diagnostics on hardware devices by using the diag command

Testing network connectivity by using the watch-net command

The OpenBoot monitor has two prompts from which commands can be issued: the ok prompt, and the > prompt. In order to switch from the > prompt to the ok prompt, you simply need to type n:

> n ok

Changing the Default Boot Device To boot from the default boot device (usually the primary hard drive), you would enter the following:

ok boot

However, it is also possible to boot using the CDROM by using this command:

ok boot cdrom

The system may be booted from a host on the network by using this command:

ok boot net

Alternatively, if you have a boot floppy, the following command may be used:

ok boot floppy

Because many early Solaris distributions were made on magnetic tape, itís also possible to boot using a tape drive with the following command:

ok boot tape

Instead of specifying a different boot device each time you want to reboot, it is possible to set an environment variable within the OpenBoot monitor, so that a specific device is booted by default. For example, to set the default boot device to be the primary hard disk, you would use the following command:

ok setenv boot-device disk boot-device = disk

To verify that the boot device has been set correctly to disk, the following command can be used:

ok printenv boot-device boot-device disk

In order to reset the system, to use the new settings, you simply use the reset command:

ok reset

To set the default boot device to be the primary network device, you would use the following command:

ok setenv boot-device net boot-device = net

This configuration is commonly used for diskless clients, such as Sun Rays, which use RARP and NFS to boot across the network. To verify that the boot device has been set correctly to net, the following command can be used:

ok printenv boot-device boot-device net disk

To set the default boot device to be the primary CD-ROM device, you would use the following command:

ok setenv boot-device cdrom boot-device = cdrom

To verify that the boot device has been set correctly to cdrom, the following command can be used:

ok printenv boot-device boot-device cdrom disk

To set the default boot device to be the primary floppy drive, you would use the following command:

ok setenv boot-device floppy boot-device = floppy

To verify that the boot device has been set correctly to floppy, the following command can be used:

ok printenv boot-device boot-device floppy disk

To set the default boot device to be the primary tape drive, you would use the following command:

ok setenv boot-device tape boot-device = tape

To verify that the boot device has been set correctly to tape, the following command can be used:

ok printenv boot-device boot-device tape disk

Testing System Hardware

The test command is used to test specific hardware devices, such as the loopback network device. This device could be tested by using the following command:

ok test net Internal Loopback test - (OK) External Loopback test - (OK)

This indicates that the loopback device is operating correctly. Alternatively, the watch-clock command is used to test the clock device:

ok watch-clock Watching the 'seconds' register of the real time clock chip. It should be ticking once a second. Type any key to stop. 1 2 3 Tip Timing results can be cross-checked against a reliable timing device for accuracy.

If the system is meant to boot across the network, but a boot attempt does not succeed, it is possible to test network connectivity using the watch-net program. This determines whether or not the systemís primary network interface is able to read packets from the network it is connected to. The output from the watch-net program looks like this:

Internal Loopback test - succeeded External Loopback test - succeeded Looking for Ethernet packets. '.' is a good packet. 'X' is a bad packet. Type any key to stop ......X.........XXXX.....Ö.XX............ In this case, a number of packets are marked as bad, even though the system has been connected successfully to the network.

In addition to the watch-net command, the OpenBoot monitor can perform a number of other diagnostic tests. For example, all of the SCSI devices attached to the system can be detected by using the probe-scsi command. The probe-scsi command displays all of the SCSI devices attached to the system. The output of probe-scsi looks like this:

ok probe-scsi Target 1 Unit 0 Disk SUN0104 Copyright (C) 1995 Sun Microsystems All rights reserved Target 1 Unit 0 Disk SUN0207 Copyright (C) 1995 Sun Microsystems All rights reserved Here, we can see that two SCSI disks have been detected. If any other disks or SCSI devices were attached to the chain, they have not been detected, indicating a misconfiguration or hardware error.

Tip If you are using a PCI system, then SCSI devices may or may not appear. Troubleshooting Booting Problems

If a system fails to start correctly in multiuser mode, itís likely that one of the scripts being run in /etc/rc2.d is the cause. In order to prevent the system from going multiuser, it is possible to boot directly into single-user mode from the ok prompt:

ok boot Ės ... INIT: SINGLE USER MODE Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance):

At this point, the root password can be entered, and the user will be given a root shell. However, not all file systems will be mounted, although individual scripts can then be checked individually for misbehaving applications.

If the system will not boot into single-user mode, the solution is more complicated because the default boot device cannot be used. For example, if an invalid entry has been made in the /etc/passwd file for the root user, the system will not boot into single- or multiuser mode. To recover the installed system, the host needs to be booted from the installation CD-ROM into single-user mode. At this point, the default root file system can be mounted on a separate mount point, the /etc/passwd file edited, and the system rebooted with the default boot device. This sequence of steps is shown next, assuming that /etc is located on /dev/dsk/c0t0d0s1:

ok boot cdrom ... INIT: SINGLE USER MODE Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance): # mkdir /temp # mount /dev/dsk/c0t0d0s1 /temp # vi /temp/etc/passwd # sync; init 6

STOP Commands

The STOP commands are executed on the SPARC platform by holding down the special STOP key located on the left-hand side of the keyboard, and another key that specifies the operation to be performed. The following functions are available:

STOP Enters the POST environment. STOP-A Enters the PROM monitor environment. STOP-D Performs diagnostic tests. STOP-F Enters a program in the Forth language. STOP-N Initializes the nonvolatile RAM settings to their factory defaults.

[/tech/unix/solaris] | [permalink] | [2005.10.24-23:47.00]

Jun 02, 2005

Grep and Sed Tips

I'm terrible at this type of thing so I need lots of examples

Simple 'sed' Example

sed '3,10s/REGEXP/replacement' book

Will search the file 'book' and replace 'REGEXP' with 'replacement' on the third and tenth lines only.

Some more simple examples

sed 's/red/green'

Replaces the first occurrence of 'red' in a line with 'green'

sed 's/red/green/4'

Replaces the fourth occurrence of 'red' in a line with 'green'

sed 'car/!s/red/green/g'

Replaces all instances of 'red' with 'green' except in lines containing the word 'car'

Simple 'grep' Example

Find a matching phone number

grep '408.[0-9]\{3\}.[0-9]\{4\}' mail/*

Will search all files in the mail directory for a pattern which will match 408<'.' = any single character><[0-9]\{3\} = three digit number><'.' = any single character><[0-9]\{4\} = four digit number>

Note the use of '\' to escape (ignore) the following special character '{' and '}'

[/tech/unix] | [permalink] | [2005.06.02-03:46.00]

Mar 02, 2005

Switcher Diary (Sort of)

Tim Bray of Ongoing is keeping a Diary of notes relating to his move to Solaris after many years of using a variety of Unix and Linux flavours. He does work for Sun afterall :-)

Some interesting tidbits in there - its really interesting to see even the Sun guys plugging the Blastwave pkg-get system for getting open source apps onto their machines. Pkg-get works just like the Debian apt-get which makes it a very useful addition to a System Admins arsenal.

[/tech/unix/solaris] | [permalink] | [2005.03.02-01:36.00]

Feb 10, 2005

AIX Logical Volume Manager

Allocating disk space on an IBM AIX machine

In this example we'll be increasing the amount of /tmp space available.

You can use a Calculator to fine tune the allocation process (you don't accidentally want to allocate all the remaining space to a file system so start conservatively and increase file system size on request) but this example uses basic approximation.

I'm sure theres a much simpler way to do this for serious AIX types but if you're a 'dabbler' then this process works for me.

Disk Space Before

bash-2.00# df -k /tmp

Filesystem 1024-blocks Free %Used Iused %Iused Mounted on

/dev/hd3 196608 172020 13% 256 1% /tmp

bash-2.00#

1. Login

2. Depending on your terminal emulation you may want to issue a TERM=vt100 (or similar) so SMIT (IBM System Management Utility) works properly in text mode

3. Start smit - the important keys that you will use are F3 to Cancel an Operation and F4 to List Options; arrow keys will allow you to move up and down through menu options - if you find that the function keys don't work, use esc- sequences instead.

4. Select System Storage Management

5. First we need to allocate more LP's (logical partitions) to the /tmp filesystem

a) Logical Volume Manager

b) Set Characteristics of a Logical Volume

c) Increase the Size of a Logical Volume

d) Hit F4 to list the Volumes and select /tmp

e) Bump up the Number of Additional logical partitions

f) Hit Enter to commit and action the changes - you should get a Command: OK

6. Increase the actual partition size

Hit F3 to escape back to the initial System Storage Management screen

a) Select File Systems

b) Select Add / Change / Show / Delete File Systems

c) Select JFS (unless you know the file system has a different format)

d) Change / Show Characteristics of a JFS You should get a pop up list of available file systems; select /tmp

e) Bump up the Size of file system

f) Hit Enter to commit and action the changes; you should see a Command: OK and the new file system size

Disk Space After

bash-2.00# df -k /tmp

Filesystem 1024-blocks Free %Used Iused %Iused Mounted on

/dev/hd3 262144 235496 11% 256 1% /tmp

bash-2.00#

[/tech/unix/aix] | [permalink] | [2005.02.10-04:13.00]

Dec 29, 2004

Unix Package Managers & System Query Tools (Updated 16/12/05 added to Debian section)

Basic guide to getting stuff installed and getting information on various types of Unix and Linux systems

SGI Irix

Use the Software Manager via the Toolchest to add and remove packages or use the 'inst' command

For example to install the Multi-processor libraries for Irix, download the appropr iate package (in this case 6.x_mpt_1.3.tardist), untar it, run the inst command as root, select from and point to the local dirctory containing the untarred files, se lect list to view the items to be installed, select conflicts to check for conflict s or dependencies, select go to install and then quit to exit inst.

You can query the installed packages and their versions using the 'versions' command (eg versions | grep perl)

You can find out about SGI hardware via the 'hinv' command

Compaq Tru64

Use the Graphical System Manager (/usr/bin/sysman) or use the 'setld' command (/usr/sbin/setld -l )

For example to update the Fortran compilers or Tru64, download the appropriate pack age (in this case DFA541.tar contains an updated Fortran compiler), untar it, run /usr/sbin/setld -l ./, select the install options and follow the prompts.

You can query the installed packages and their versions using the 'setld -i' command (eg /usr/sbin/setld -i | grep perl)

RedHat Linux

Use the Graphical Gnorpm package manager or use the 'rpm' command (rpm -i )

For example to install Opera, download the package (opera-static-5.0-1.i385.rpm), become root, use rpm -i opera-static-5.0-1.i386.rpm to install it.

Debian Linux

Use the 'apt-get' to get a package from the network (apt-get install will install from a source listed in /etc/apt/sources.list ) or 'dpkg' for a local file command (dpkg install ). 'dselect' will also give you a front end on package management (but I get lost in there to easily). Theres a fairly definitive guide to apt-get here.

IBM AIX

Use the Graphical or command line version of 'smit'.

On an X interface 'smit' will invoke the motif style GUI version of the tool which will allow you to configure all aspects of the AIX system including the installation of software. Via a telnet or serial console session the ASCII version of the tool is invoked which gives you many of the same options just in text-only mode.

SUN Solaris

Use 'pkgadd' or the Graphical System Manager to install software (/usr/sbin/pkgadd -d ). Note that patches should be applied using patchadd rather than pkgadd

You can find out about SUN hardware using the 'showrev' command which can query hardware and software (eg showrev -a)

[/tech/unix] | [permalink] | [2004.12.29-20:08.00]

Useful Irix Information

Booting from another drive

Boot into PROM monitor, and perform the following commands:

setenv SystemPartition scsi(0)disk(2)rdisk(0)partition(8)

setenv OSLoadPartition scsi(0)disk(2)rdisk(0)partition(0)

setenv root dks0d2s0

Then when you load the miniroot in the install process, you will be pointed to the drive you want(obviously the disk and root must be set to the correct IDs, not necessarily the above).

Also, if you ever need to do a one-time boot off an alternate drive, you can boot the PROM monitor and issue the following command:

boot -f dksc(0,2,8)sash dksc(0,2,0)unix root=dks0d2s0

This is useful if you are installing/configuring multiple systems using a build disk.

 

Disk Clone Script (use with extreme caution it)

This is taken from the google cache (the original page no longer exists).

Information on the script taken from the original web page is here followed by the original script (save to file, chmod +x it and then run it).

The Solution -- SCSI Cloning


The modern SGI models (O2's, OCTANEs, and Origins/Onyx2's) all feature sled-mounted internal SCSI drives that get their ID number from the slot that they are placed in. Better yet, with the exception of the R10K/R12K O2) all the machines have an available internal slot for a second disk (in the high-end O2 the larger CPU takes up the second disk slot).


With a little scripting it's possible to use the second disk slot to build a ``clone'' of the system disk in 10-15 minutes. This cloned disk can be moved to another machine (thus allowing rapid duplication of a ``lab's worth'' of system disks) or kept on hand as a backup in case of disk failure.


One of the many advantages to this is better security. The sysadmin can bring up a single workstation and configure it as necessary (closing the ``deadly 7'' open accounts, installing tcp wrappers and ssh, turning off unnecessary services, etc) before it is placed on the network. Clones of the system then inherit the secure configuration without going through a ``window of vulnerability'' during the network installation/configuration.


The dupit Script


My cloning script is named "dupit'' (the name borrowed from a script with a similar function that was in use internally at SGI). Without options the script makes a copy of the current system disk (drive 1) on drive two (though the destination drive can be specified with the -d flag. The script also:
Repartitions the drive so that the swap partition is 256 MB. The default can be changed by editing the script, or the user can specify any size in MB using the -s flag.
Turns off networking on the new system (so that the admin can reconfigure it once the new workstation is brought up. The -c flag will defeat this and make the cloned disk an exact copy of the current system disk (useful when making a backup system disk).
The script runs correctly in both single-user and multi-user states, though I usually use single user mode to help insure the duplication (most of which is accomplished using xfsdump) goes smoothly. When using it to install lab machines, I usually make a single ``test machine'' with the dupit script installed at /etc/dupit that is left running in the lab for students and faculty to use. Once I'm sure the test machine works as designed, I then use it as a ``master'' to create clone disk(s), which I can install in other workstations. Bringing up a cloan is as simple as booting, login in as root and configuring networking. Since all machines have dupit installed, I can ``rebuild'' a crashed disk from any working machine in the lab.

The Source


#!/bin/sh
# the magical, mystical dupit script
# All new sh version by D. Southard
# comments to dsouth@nd.edu

# Defaults
KLOANDEV=dks0d2s0
SWAPMB=256


#
# Get the options/parameters to the program
#

while getopts cs:d: i
do
case $i in
c) EXACTCOPY="yes"
;;
s) SWAPMB=${OPTARG}
;;
d) KLOANDEV=${OPTARG}
;;
*) echo "the magical, mystical, dupit script"
echo "all new by Dale Southard <dsouth@nd.edu>"
echo "Usage:"
echo " dupit -c [-s <swap in MB>] [-d <cloan's dks?d?s?>]"
exit 1
;;
esac
done


#
# Sanity check the destination drive
#
if ! [ -c /dev/rdsk/${KLOANDEV} ] ; then
echo "The destination device must exist <dks?d?s0>"
exit
elif [ ${KLOANDEV} != ${KLOANDEV%s0}s0 ] ; then
echo "The destinaion device must be lun 0 <dks?d?s0>"
exit
fi
umount /dev/dsk/${KLOANDEV} > /dev/null 2>&1


#
# Create the temporary fx script file
#
FXSCRIPT=/var/tmp/fx.script
rm -rf $FXSCRIPT

echo "${KLOANDEV} standard root" >> $FXSCRIPT
if [ $SWAPMB != "" ] ; then
SWAPBLKS=`expr $SWAPMB \* 2048`
echo "${KLOANDEV%s0}s1 followspart8:${SWAPBLKS} swap" >> $FXSCRIPT
echo "${KLOANDEV} followspart1:remainder xfs" >> $FXSCRIPT
fi


#
# Repartition the drive based on the script
#
/usr/bin/fx -x -s $FXSCRIPT
rm -rf $FXSCRIPT


#
# Create the file system and mount it
#
/sbin/mkfs_xfs /dev/rdsk/${KLOANDEV}
if ! [ -d /mnt ] ;then
mkdir /mnt
fi
mount /dev/dsk/${KLOANDEV} /mnt


#
# Dump the source drive to the destination drive
#
hostname `cat /etc/sys_id`
xfsdump -J -l 0 - / | xfsrestore - /mnt


#
# Copy the volume header files.
#

VOLHDR_FILES=`dvhtool -v list | grep -v File | grep -v Current | grep -v sgilabel | grep -v '^$' | awk '{} {printf "%s ",$1}'`

for VHFILE in $VOLHDR_FILES; do
rm -rf /var/tmp/$VHFILE
dvhtool -v get $VHFILE /var/tmp/$VHFILE /dev/rdsk/dks0d1vh
dvhtool -v create /var/tmp/$VHFILE $VHFILE /dev/rdsk/${KLOANDEV%s0}vh
rm /var/tmp/$VHFILE
done

#
# If we are making an exact clone, skip the rest
#
if ! [ ${EXACTCOPY} = "yes" ]; then

#
# Turn off networking on the new disk
#

echo "off" > /mnt/etc/config/network

# If your site needs anyting else removed/turned off
# (ssh_host_key, AFS/DFS, etc) this would be a
# good place to do it.

fi

#
# Done.
#

echo " "
echo "You're done. shutdown, move the disk and configure networking."
exit 0


Adding / Preparing Disks under IRIX

From http://www.uwsg.iu.edu/usail/peripherals/disks/adding/sgi.html

Adding Disks under IRIX
Once the disk has been physically installed and the machine has been rebooted, the hinv command can be used to check if it is recognized:

# hinv | grep Disk
Disk drive: unit 5 on SCSI controller 0
Disk drive: unit 1 on SCSI controller 0

Under IRIX, device nodes are in the format /dev/[r]dsk/dksSdDsS, where S is the disk controller number, D is the SCSI ID of the disk, and S is the partition number. In our example, we'll be working with the disk on SCSI ID 5, so we will use /dev/[r]dsk/dks0d5s*.
Labeling the Disk The fx command is used to label and partition the disk. It should be invoked in expert mode, using the -x option:

edcert23 2# fx -x
fx version 5.3, Oct 18, 1994
fx: "device-name" = (dksc)
fx: ctlr# = (0)
fx: drive# = (1) 5
...opening dksc(0,5,)
...controller test...OK
Scsi drive type == HP C3724S 5153
fx: Warning: no sgilabel on disk
fx: Warning: can't read sgilabel on disk

creating new sgilabel

----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/
[b]adblock/ [exe]rcise/ [r]epartition/
fx>

Since this is a new disk, fx gives a warning that it is not yet labeled with an SGI disk label. The label submenu is used to put a new label on the disk:

----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/ [a]uto
[b]adblock/ [exe]rcise/ [r]epartition/ [f]ormat
fx> label

----- please choose one (? for help, .. to quit this menu)-----
[sh]ow/ [sy]nc [se]t/ [c]reate/
fx/label> create

----- please choose one (? for help, .. to quit this menu)-----
[p]artitions [s]giinfo [b]ootinfo [d]irectory [a]ll
fx/label/create> all

...creating default bootinfo
...creating default partitions
...creating default sgiinfo
...creating default volume directory

----- please choose one (? for help, .. to quit this menu)-----
[p]artitions [s]giinfo [b]ootinfo [d]irectory [a]ll
fx/label/create> ..

----- please choose one (? for help, .. to quit this menu)-----
[sh]ow/ [sy]nc [se]t/ [c]reate/
fx/label> ..

----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/ [a]uto
[b]adblock/ [exe]rcise/ [r]epartition/ [f]ormat
fx> exit

label info has changed for disk dksc(0,5,). write out changes? (yes) yes

Partitioning the Disk
To partition the disk, the partition submenu is entered:

fx> repartition

----- partitions-----
part type cyls blocks Megabytes (base+size)
0: efs 4 + 73 2800 + 51100 1 + 25
1: raw 77 + 117 53900 + 81900 26 + 40
8: volhdr 0 + 4 0 + 2800 0 + 1
10: volume 0 + 3363 0 + 2354100 0 + 1149

capacity is 2354660 blocks

----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive [o]ptiondrive [e]xpert
[u]srrootdrive [re]size
fx/repartition>

To create new partitions, enter expert mode. In this case, two similar-sized partitions will be created:

fx/repartition> expert

Warning: you will need to re-install all software and restore user data
from backups after changing the partition layout. Changing partitions
will cause all data on the drive to be lost. Be sure you have the drive
backed up if it contains any user data. Continue? yes
Enter .. when done
fx/repartition/expert: change partition = (0) <RETURN>
before: type efs base: 4 cyls, 2800 blks, 1 Mb
len: 73 cyls, 51100 blks, 25 Mb
fx/repartition/expert: partition type = (efs) <RETURN>
fx/repartition/expert: base cyl = (4) <RETURN>
fx/repartition/expert: number of cyls (max 3359) = (73) 1675
after: type efs base: 4 cyls, 2800 blks, 1 Mb
len: 1675 cyls, 1172500 blks, 573 Mb
fx/repartition/expert: change partition = (1) <RETURN>
before: type raw base: 77 cyls, 53900 blks, 26 Mb
len: 117 cyls, 81900 blks, 40 Mb
fx/repartition/expert: partition type = (raw)efs
fx/repartition/expert: base cyl = (77) 1679
fx/repartition/expert: number of cyls (max 1684) = (117) 1684
after: type efs base: 1679 cyls, 1175300 blks, 574 Mb
len: 1684 cyls, 1178800 blks, 576 Mb
fx/repartition/expert: change partition = (6) ..

----- partitions-----
part type cyls blocks Megabytes (base+size)
0: efs 4 + 1675 2800 + 1172500 1 + 573
1: efs 1679 + 1684 1175300 + 1178800 574 + 576
8: volhdr 0 + 4 0 + 2800 0 + 1
10: volume 0 + 3363 0 + 2354100 0 + 1149

capacity is 2354660 blocks

----- please choose one (? for help, .. to quit this menu)-----
[ro]otdrive [o]ptiondrive [e]xpert
[u]srrootdrive [re]size
fx/repartition> ..

----- please choose one (? for help, .. to quit this menu)-----
[exi]t [d]ebug/ [l]abel/ [a]uto
[b]adblock/ [exe]rcise/ [r]epartition/ [f]ormat
fx> exit

label info has changed for disk dksc(0,5,). write out changes? (yes) <RETURN>

The partition table can also be viewed using the prtvtoc command:

edcert23 10# prtvtoc /dev/rdsk/dks0d5s0
* /dev/rdsk/dks0d5s0 (bootfile "/unix")
* 512 bytes/sector
* 140 sectors/track
* 5 tracks/cylinder
* 3363 cylinders
* 4 cylinders occupied by header
* 3359 accessible cylinders
*
* No space unallocated to partitions

Partition Type Fs Start: sec (cyl) Size: sec (cyl) Mount Directory
0 efs 2800 ( 4) 1172500 (1675)
1 efs 1175300 (1679) 1178800 (1684)
8 volhdr 0 ( 0) 2800 ( 4)
10 volume 0 ( 0) 2354100 (3363)

Creating New Filesystems
Once the drive has been partitioned and labeled, mkfs is used to create new filesystems on the partitions, and fsck is used to check the integrity of the new filesystem:

edcert23 11# mkfs /dev/dsk/dks0d5s0
mkfs_efs: /dev/dsk/dks0d5s0: blocks=1172500 inodes=123264
mkfs_efs: /dev/dsk/dks0d5s0: sectors=140 cgfsize=32561
mkfs_efs: /dev/dsk/dks0d5s0: cgalign=1 ialign=1 ncg=36
mkfs_efs: /dev/dsk/dks0d5s0: firstcg=289 cgisize=856
mkfs_efs: /dev/dsk/dks0d5s0: bitmap blocks=287
edcert23 12# fsck -y /dev/rdsk/dks0d5s0

fsck: checking /dev/rdsk/dks0d5s0

** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
FREE INODE COUNT WRONG IN SUPERBLK
FIX? yes

** Phase 5 - Check Free List
2 files 22 blocks 1141358 free
CHECKSUM WRONG IN SUPERBLK
FIX? yes

***** FILE SYSTEM WAS MODIFIED *****

[/tech/unix/irix] | [permalink] | [2004.12.29-20:04.00]

Dec 09, 2004

Tru64, OpenVMS and the Alpha Processor

Some links to one of my favourite Unices (IRIX is probably still my fave in terms of an elegant workstation OS). Nowadays it has to be said the only contenders in the commercial Unix race are Solaris and AIX with various Linux distributions leading the open-source charge.

Personally I've found Tru64 on Alpha hardware to be very very simple to install (for Tru64 v 5.1b its still a single cd install with a footprint less than 400Mb) and configure while being very easy to manage and with outstanding stability. In my time I've had the pleasure of using everything from Alphastation 500's through to quad processor ES45 Alphaservers.

In a high performance environment I have good anecdotal evidence to suggest that the same code running on a dual processor Itanium II machine will run at about 40% the speed of slightly older quad processor Alpha machine. So the Itanium has a lot of potential but the Alpha can still hold its own.

The Alpha hardware is also built to a very high spec and very very solid (I guess its easy to see the DEC influence in the steel chassis) compared to the 'cheap' feel of modern x86 based server cases.

Wikipedia has some excellent (and brief) articles on:

The history of Tru64/Ultrix/OSF/1.

The history of the Dec Alpha processor.

The evolution of OpenVMS.

Excellent Tru64/Alpha resource - Tru64.org.

[/tech/unix/tru64] | [permalink] | [2004.12.09-19:07.00]

Nov 11, 2004

Irix Upgrade Procedure

Irix 6.5 is the current base OS. It is possible to update 6.5 'live' while the system is running and then reboot for changes to take affect. Irix OS installs prior to this will require an offline OS upgrade by booting off an external CD or trying a network boot. Pre-Irix 6 (many old Indigo and Indy machines have 5.3/5.4 installed) the disk will need to be reformated so any data will be lost unless its backed up.

Overlays (like Windows Service Packs and SUS Updates) keep the Irix OS up to date with new features and patches.

At the time of writing Irix 6.5 Overlay 26 is current (often referred to as just 6.5.26).

The most recent updates can be obtained from the SGI support site.

Odd things happen to some of our products when you update beyond 6.5.18 so be very wary of updating beyond this level unless specifically requested. The problems tend to relate to changes in particular Fortran calls in newer overlays - these seemed to have happened between 6.5.18 and 6.5.20 onwards.

Another big change of note specifically to IT is that autofs became a peer service - no need to mess around with amd. Autofs stabilised around 6.5.14 so where possible we should convert machines to using this in place of amd.

What I tend to do is download each CD and uncompress the contents to our IT SGI in vema:/export/sgi_install seperate from the core 6.5 CD's. Where possible I try to keep an older Overlay set around for compatibility reasons (6.5.16 is the old Overlay on vema:/export/sgi_install). If we had enough SGI machines we might automate updates with Roboinst.

There is an installation 'gotcha' - if you get these errors when opening an overlay for installation

WARNING: Invalid filetype "X" at line 172 of x_eoe_6524m.idb

WARNING: Invalid filetype "X" at line 520 of x_eoe_6524m.idb

WARNING: Invalid filetype "X" at line 636 of x_eoe_6524m.idb

WARNING: Invalid filetype "X" at line 1878 of x_eoe_6524m.idb

WARNING: Invalid filetype "X" at line 1879 of x_eoe_6524m.idb

WARNING: Invalid filetype "X" at line 1880 of x_eoe_6524m.idb

You need to install Patch 5086 if you make the jump from a pre 6.5.20 install to a current Irix Overlay (eg installing from 6.5.16 to 6.5.24 -> install the patch first). The patch is in /export/sgi_install/patches on vema.

You need to be root to run 'inst' the Irix software installer - here you can see a) becoming root, b) mounting the sgi_install directory and c) checking its contents d) running inst

bash-2.00$ su

Password:

octagon# bash

# cd /

# ls

CDROM/ debug/ etc/ hw/ lib64/ ns/ proc/ sbin/ tmp/ unix* var/ Desktop/ dev/ export/ lib/ mnt/ oSYSLOG root/ stand/ tmp_mnt/ usr/ web/ bin/ dumpster/ hosts/ lib32/ mnt_tmp/ opt/ s/ t@ u/ v/

# cd /export

# ls

octagon/ temp/

# ls temp

# mount vema:/export/sgi_install temp

# ls temp

6.5.16_Inst_Overlay1/ 6.5_Aug2002_Apps/ 6.5_Found1/ 6520_Inst_Overlay1/ 6524/ FW_Nov2002_Pt4/ 6.5.16_Inst_Overlay2/ 6.5_Dev_Found/ 6.5_Found2/ 6520_Inst_Overlay2/ FW_Nov2002_Pt1/ MIPSpro_7.3/ 6.5.16_Inst_Overlay3/ 6.5_Dev_Found_1.2/ 6.5_NFS/ 6520_Inst_Overlay3/ FW_Nov2002_Pt2/ oracle/ 6.5.16_Inst_Overlay4/ 6.5_Dev_Lib/ 6519_Apps/ 6520_Inst_Overlay4/ FW_Nov2002_Pt3/

# cd temp

# cd 6524

# ls

6524_Apps/ 6524_Comp_Apps/ 6524_Overlay1/ 6524_Overlay2/ 6524_Overlay3/

# inst

The inst installation routine begins

Default distribution to install from: /export/temp/6.5_Found2/dist

For help on inst commands, type "help overview".

Inst 4.1 Main Menu

1. from [source ...] Specify location of software to be installed

2. open [source ...] Specify additional software locations

3. close [source ...] Close a software distribution location

4. list [keywords] [names] Display information about software subsystems

5. go Perform software installation and removal now

6. install [keywords] [names] Select subsystems to be installed

7. remove [keywords] [names] Select subsystems to be removed

8. keep [keywords] [names] Do not install or remove these subsystems

9. step [keywords] [names] Interactive mode for install/remove/keep

10. conflicts [choice ...] List or resolve installation conflicts

11. help [topic] Get help in general or on a specific word

12. view ... Go to the View Commands Menu

13. admin ... Go to the Administrative Commands Menu

14. quit Terminate software installation

Inst>

Select 1 to select the install source - we've copied all the cd's to vema so you'll see this particular machine already has some of the paths listed from previous upgrades.

Be sure to select the Overlay 1 CD first - that way inst knows to expect other CD's

Previous installation sites:

1 /export/temp/6.5_Found2/dist

2 /export/temp/6.5_Found1/dist

3 /export/temp/6.5_NFS/dist/dist6.5

4 /export/temp/6.5_NFS/dist

5 /export/temp/6.5_Dev_Lib/dist

6 /export/temp/6.5_Dev_Found/dist/dist6.5

7 /export/temp/6.5_Dev_Found/dist

8 /export/temp/6.5_Aug2002_Apps/dist

9 /export/temp/6.5.16_Inst_Overlay4/dist

10 /export/temp/6.5.16_Inst_Overlay3/dist

11 none (no distribution, view installed products)

12 quit (no additional distributions, return to inst prompt)

Install software from: [/export/temp/6.5_Found2/dist] /export/temp/6524/6524_Overlay1/cd1

Feed inst the path for all of the other CD's which you'll need - inst will open each one and read its contents and then allow you to give it the path to another CD

Install software from: [/export/temp/6.5_NFS/dist/dist6.5] /export/temp/6.5_Dev_Lib/dist

Reading product descriptions .. 0%

Setting distribution to /export/temp/6.5_Dev_Lib/dist

Reading product descriptions .. 100% Done.

If you plan to install from another distribution, either choose from the list below or enter the name of a different distribution. This will allow you to make selections from two or more distributions before starting the install.

Enter "done" if you are ready to proceed with the installation now.

1 /export/temp/6.5_Dev_Lib/dist

2 /export/temp/6.5_NFS/dist/dist6.5

3 /export/temp/6.5_Found2/dist

4 /export/temp/6.5_Found1/dist

5 /export/temp/6524/6524_Apps/apps

6 /export/temp/6524/6524_Overlay3/cd3

7 /export/temp/6524/6524_Overlay2/cd2

8 /export/temp/6524/6524_Overlay1/cd1

9 /export/temp/6.5_NFS/dist

10 /export/temp/6.5_Dev_Found/dist/dist6.5

11 done (distribution information read, return to inst prompt)

Install software from: [/export/temp/6.5_Dev_Lib/dist] /export/temp/6.5_Dev_Found/dist/dist6.5

Reading product descriptions .. 0%

Setting distribution to /export/temp/6.5_Dev_Found/dist/dist6.5

Reading product descriptions .. 100% Done.

If you plan to install from another distribution, either choose from the list below or enter the name of a different distribution. This will allow you to make selections from two or more distributions before starting the install.

Enter "done" if you are ready to proceed with the installation now.

1 /export/temp/6.5_Dev_Found/dist/dist6.5

2 /export/temp/6.5_Dev_Lib/dist

3 /export/temp/6.5_NFS/dist/dist6.5

4 /export/temp/6.5_Found2/dist

5 /export/temp/6.5_Found1/dist

6 /export/temp/6524/6524_Apps/apps

7 /export/temp/6524/6524_Overlay3/cd3

8 /export/temp/6524/6524_Overlay2/cd2

9 /export/temp/6524/6524_Overlay1/cd1

10 /export/temp/6.5_NFS/dist

11 done (distribution information read, return to inst prompt)

Install software from: [/export/temp/6.5_Dev_Found/dist/dist6.5] done

When you're done (either '11' or 'done' as above) - check for conflicts via 'c' - this will list all conflict - you can use 'c'

Inst> c 1a 2a

inventor_dev.sw.lib cannot be installed because of missing prerequisites:

1a. Do not install inventor_dev.sw.lib (1279134120)

1b. Also install inventor_dev.sw.base (1279134120).

Resolve conflicts by typing "conflicts choice choice ..." or try "help conflicts"

Inst> c 1a

No conflicts

When there are no remaining conflicts hit 'g' for 'go' to actually do the install. If you run into 100's of conflicts that never seem to be fixable (either by supplying the source or opting not to install) then look very carefully at the sources of the install files and check the web - you can easily render a machine unbootable if you fix conflicts by removing everything :-)

The install will proceed as follows - depending on the processor speed this can take anywhere from 30min to an hour to complete

Inst> g

Pre-installation check .. 0% /var/netscape/communicator/mime.types not installed. See smart_config_handling preference for more information.

Pre-installation check .. 3%

Installing new versions of selected mpi.sw subsystems

Installing new versions of selected mpi.sw32 subsystems

Installing new versions of selected mpi.sw64 subsystems

Installing new versions of selected mpt.relnotes subsystems

Upgrading selected nedit.man subsystems

Upgrading selected nedit.sw subsystems

Installing/removing files .. 28%

Upgrading selected netscape.man subsystems

Upgrading selected netscape.plugin subsystems

Upgrading selected outbox.man subsystems

Upgrading selected outbox.sw subsystems

Upgrading selected scsl.hdr subsystems

Upgrading selected scsl.man subsystems

Installing/removing files .. 34%

Upgrading selected scsl.sw32 subsystems

When the upgrade is complete do a 'q' for quit and the system will do a sort of 'brain reset' that can take 30min to an hour

Running exit-commands .. 99%

Software installation has installed new configuration files and/or saved the previous version in some cases. You may need to update or merge old configuration files with the newer versions. See the "Updating Configuration Files" section in the versions(1M) manual page for details. The inst command "admin config changed" will list the affected files.

Checking dependencies .. 100% Done.

Calculating sizes .. 100% Done.

Installations and removals were successful.

You must restart your system to complete the installation.

You may continue with installations or quit now.

Inst> q

WARNING: You must restart your system to complete the installation. Requickstarting ELF files (see rqsall(1)) .. 24%

Then reboot. Fingers crossed and the system should come up again with the new OS (verify revision with a uname -R)

[/tech/unix/irix] | [permalink] | [2004.11.11-19:02.00]

Apr 24, 2004

Interesting Storage Information

Advancements in NFS - version 4 is in development. Read about it here and here.

[/tech/unix] | [permalink] | [2004.04.24-14:23.00]

Mar 29, 2004

Useful Forensic Tool

Australian Defence Department tool called FLAG lets you monitor ports and analyse disk datawhen undertaking forensic examinations of IT equipment. Page includes a link to a bootable Knoppix CD which includes the FLAG toolset.

[/tech/unix] | [permalink] | [2004.03.29-12:07.00]