Monday, April 21, 2014

Sun Storage Solaris Multipathing Software

MPxIO

Configuration files

For Solaris 10 and earlier
/kernel/drv/fp.confFiber channel port configuration file (For Fiber Channel Devices)
/kernel/drv/mpt.confmpt scsi/SAS HBA controller driver configuration file (For SAS Devices)
/kernel/drv/scsi_vhci.confMPXIO operation configuration file (Used to define loadbalancing and failback modes and configure 3rd party devices)
/kernel/drv/iscsi_confiSCSI MPxIO configuration file (For iSCSI devices)
For Solaris 11

In case of Solaris 11, files in the directory /kernel/drv/ and /etc/driver/drv are the sample default configuration files delivered with OS (not used by MPxIO). Do not edit these files. The location of the configuration files is /etc/driver/drv/. The 4 configuration files used in case of Solaris 11 are the same, performing the same task. Although the syntax may be different.

/etc/driver/drv/fp.conf
/etc/driver/drv/mpt.conf
/etc/driver/drv/scsi_vhci.conf
/etc/driver/drv/iscsi_conf
 
It is best practice to edit these files using the stmsboot utility, rather than editing them manually.

Enabling/Disabling MPxIO

The syntax of the command stmsboot used to enable/disable MPxIO is :
stmsboot [-D fp|mpt] [-d | -e | -u | -L | -l controller_number]

where:
-D fp|mpt -> to select the protocol where you want to enable/disable mpxio
-e -> to enable STMS on all HBA
-d -> to disable STMS on all HBA
-u -> to update vfstable and dump config after manual file configuration
-l or -L unchanged - see the manpage of stms for a full description.
Few examples of using stmsboot command are :
# stmsboot -eTo enable MPxIO or all devices (globally)
# stmsboot -D fp -eTo enable MPxIO for fiber channel devices
# stmsboot -dTo disable MPxIO for all devices (globally)

How to confirm MPxIO is enabled

To make sure that MPxIO is enabled for a LUN, simply run the format command and check for the /scsi_vhci in the logical path of the LUN.

# format
4. c6t60060E800561CF00000061CF00000002d0 
          /scsi_vhci/ssd@g60060e800561cf00000061cf00000002
Another way is to check the “mpxio-disable” parameter in the configuration files :

Solaris 7,8,9
# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/scsi_vhci.conf:mpxio-disable="no";
 
Solaris 10
# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/fp.conf:mpxio-disable="no";
 
Solaris 11
# egrep "^mpxio-disable=" /etc/driver/drv/*.conf
/etc/driver/drv/fp.conf:mpxio-disable="no";
For Solaris 10 and 11, MPxIO is enabled by default on X86 platforms.

Verifying that the scsi_vhci module is loaded

scsi_vhci is the virtual host controller interconnect driver used to manage path of storage LUN. If you find that the scsi_vhci module is not loaded, then most likely MPxIO is not enabled.
Solaris[TM] 7,8,9,10,11
# modinfo -c |grep scsi_vhci
 21          1 scsi_vhci                        LOADED/INSTALLED

Verifying Health of paths

We can check the multiple paths to the storage array LUNs by using mpathadm or luxadm command. The various states for the paths are :

ONLINE/primary
ONLINE/secondary
STANDBY/secondary
OFFLINE/*
UNAVAILABLE/*
 
mpathadm (supported for FC/SAS/iSCSI) [Works on Solaris 10, 11]
luxadm (supported on FC only) [Works on Solaris 7,8,9,10,11]

# mpathadm list LU
        /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
                Total Path Count: 2 
                Operational Path Count: 2
To check the health of the paths using mpathadm :
# mpathadm show LU  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2

Logical Unit:  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
        mpath-support:  libmpscsi_vhci.so
        Vendor:  SUN     
        Product:  LCSM100_F
        Revision:  0777
        Name Type:  unknown type
        Name:  60080e50001c0300000006464d8c9044
        Asymmetric:  yes
        Current Load Balance:  round-robin
        Logical Unit Group ID:  NA
        Auto Failback:  on
        Auto Probing:  NA

        Paths:  
                Initiator Port Name:  210000e08b07922c
                Target Port Name:  203d0080e51c2cc4
                Override Path:  NA
                Path State:  OK
                Disabled:  no

                Initiator Port Name:  210000e08b07f32c
                Target Port Name:  203e0080e51c2cc4
                Override Path:  NA
                Path State:  OK
                Disabled:  no
.........
To check health of paths using luxadm :
# luxadm probe
                Found Fibre Channel device(s):
                  ......
                Logical Path:/dev/rdsk/c6t60060E800561CF00000061CF00000002d0s2
                Node WWN:203e0080e51c2cc4  Device Type:Disk device
                   ......
# luxadm display 203e0080e51c2cc4
DEVICE PROPERTIES for disk: 203e0080e51c2cc4
  Vendor:               SUN     
  Product ID:           LCSM100_F ------------> this is a 2540 or 2540-M2 array
  Revision:             0777
  Serial Num:           SV04720931      
  Unformatted capacity: 5120.000 MBytes
  Write Cache:          Enabled
  Read Cache:           Enabled
    Minimum prefetch:   0x3
    Maximum prefetch:   0x0
  Device Type:          Disk device
  Path(s):

  /dev/rdsk/c9t60080E50001C0300000006464D8C9044d0s2
  /devices/scsi_vhci/ssd@g60080e50001c0300000006464d8c9044:c,raw
   Controller           /devices/pci@1d,700000/SUNW,qlc@1/fp@0,0
    Device Address              203d0080e51c2cc4,0
    Host controller port WWN    210000e08b07922c
    Class                       primary
    State                       ONLINE
   Controller           /devices/pci@1c,600000/SUNW,qlc@1/fp@0,0
    Device Address              203e0080e51c2cc4,0
    Host controller port WWN    210000e08b07f32c
    Class                       secondary
    State                       ONLINE

Load Balancing policies

MPxIO also provides the load balancing capability to the I/O. There are basically 3 options to configure load balancing :
Round RobinSelects all paths in a round robin way.
Logical BlockI/Os within the range specified by range_size parameter would go on the same path. Improves performance on some storage arrays which have per path caching of data.
NoneNo load balancing – only one path is used.
The load balancing policy can be set in the configuration file /kernel/drv/scsi_vhci.conf for solaris 10 and earlier or in the /etc/driver/drv/scsi_vhci.conf file for solaris 11.
load-balance="round-robin";

Auto-failback policy

Auto-failback policy enables the re-enable the failed path after it has recovered from the failure. By default the auto-failback is enabled. There are 2 ways to enable the auto-failback :
Non-persistent way
By this method, the auto-failback option does not persist across reboots.
# mpathadm modify mpath-support --autofailback on libmpscsi_vhci.so
# mpathadm modify mpath-support -a on libmpscsi_vhci.so
Persistent way
For the changes to persist across reboots set the auto-failback parameter in the configuration file /kernel/drv/scsi_vhci.conf for solaris 10 and earlier or in the /etc/driver/drv/scsi_vhci.conf file for solaris 11. This requires a reconfiguration reboot.
auto-failback="enable";
Verifying auto-failback
To confirm that the auto-failback is enabled use :
# mpathadm show mpath-support libmpscsi_vhci.so | grep -i failback
           Supported Auto Failback Config:  1
           Auto Failback:  on  <--- 0="" current="" failback="" max="" polling="" pre="" rate="">


========================================================


bash-3.2# egrep "^mpxio-disable=" /kernel/drv/*.conf
/kernel/drv/fp.conf:mpxio-disable="yes"; => change to no/kernel/drv/iscsi.conf:mpxio-disable="no";
/kernel/drv/mpt.conf:mpxio-disable="yes"; => change to no
/kernel/drv/mpt_sas.conf:mpxio-disable="no";

bash-3.2# mpathadm list lu
        /dev/rdsk/c6t20000018620E6681d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E42AFd0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E400Bd0s2
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t20000018620E4155d0s2
                Total Path Count: 1
                Operational Path Count: 1
        /scsi_vhci/ses@g5080020000284028
                Total Path Count: 1
                Operational Path Count: 1
        /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
                Total Path Count: 2
                Operational Path Count: 2
        /dev/rdsk/c6t600A0B800018B3CA000052EF534DB005d0s2
                Total Path Count: 2
                Operational Path Count: 2

           

bash-3.2# fcinfo hba-port
HBA Port WWN: 210000144f415c2a
        OS Device Name: /dev/cfg/c1
        Manufacturer: QLogic Corp.
        Model: 2200
        Firmware Version: 02.01.145
        FCode/BIOS Version: ISP2200 FC-AL Host Adapter Driver: 1.15 04/03/22
        Serial Number: not available
        Driver Name: qlc
        Driver Version: 20120717-4.01
        Type: L-port
        State: online
        Supported Speeds: 1Gb
        Current Speed: 1Gb
        Node WWN: 200000144f415c2a
HBA Port WWN: 10000000c9c25df0
        OS Device Name: /dev/cfg/c4
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000JC2
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25df0
HBA Port WWN: 10000000c9c25d6f
        OS Device Name: /dev/cfg/c5
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000J8Z
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25d6f
       
       
       
bash-3.2# mpathadm list mpath-support
mpath-support:  libmpscsi_vhci.so


bash-3.2# mpathadm list initiator-port
Initiator Port:  210000144f415c2a
Initiator Port:  10000000c9c25df0
Initiator Port:  10000000c9c25d6f
Initiator Port:  iqn.1986-03.com.sun:01:00144f415c2a.5354dd03,4000002a00ff




bash-3.2# mpathadm show initiator-port 10000000c9c25df0
Initiator Port:  10000000c9c25df0
        Transport Type:  Fibre Channel
        OS Device File:  /devices/pci@9,600000/SUNW,emlxs@1/fp@0,0
bash-3.2# mpathadm show initiator-port 10000000c9c25d6f
Initiator Port:  10000000c9c25d6f
        Transport Type:  Fibre Channel
        OS Device File:  /devices/pci@9,600000/SUNW,emlxs@2/fp@0,0
       
       
bash-3.2# mpathadm show lu /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
Logical Unit:  /dev/rdsk/c6t600A0B800018B3CA000052F6534DB0C5d0s2
        mpath-support:  libmpscsi_vhci.so
        Vendor:  SUN    
        Product:  CSM100_R_FC    
        Revision:  0660
        Name Type:  unknown type
        Name:  600a0b800018b3ca000052f6534db0c5
        Asymmetric:  yes
        Current Load Balance:  round-robin
        Logical Unit Group ID:  NA
        Auto Failback:  on
        Auto Probing:  NA

        Paths: 
                Initiator Port Name:  10000000c9c25df0
                Target Port Name:  200400a0b81ffbef
                Override Path:  NA
                Path State:  OK
                Disabled:  no

                Initiator Port Name:  10000000c9c25d6f
                Target Port Name:  200500a0b81ffbef
                Override Path:  NA
                Path State:  OK
                Disabled:  no

        Target Port Groups: 
                ID:  6
                Explicit Failover:  yes
                Access State:  standby
                Target Ports:
                        Name:  200400a0b81ffbef
                        Relative ID:  0

                ID:  7
                Explicit Failover:  yes
                Access State:  active
                Target Ports:
                        Name:  200500a0b81ffbef
                        Relative ID:  0
                     
=================================
Test multipath

bash-3.2# fcinfo hba-port

HBA Port WWN: 10000000c9c25df0
        OS Device Name: /dev/cfg/c4
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000JC2
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25df0
HBA Port WWN: 10000000c9c25d6f
        OS Device Name: /dev/cfg/c5
        Manufacturer: Emulex
        Model: LP11000-S
        Firmware Version: 2.82a4 (B3D2.82A4)
        FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
        Serial Number: 0999BT0-1121000J8Z
        Driver Name: emlxs
        Driver Version: 2.80.8.0 (2012.09.17.15.45)
        Type: L-port
        State: online
        Supported Speeds: 1Gb 2Gb 4Gb
        Current Speed: 2Gb
        Node WWN: 20000000c9c25d6f

bash-3.2# luxadm -e forcelip /dev/cfg/c4


$ luxadm -e forcelip /dev/cfg/c4

bash-3.2# tail -f /var/adm/messages

[ID 349649 kern.info] [ 5.06C6]emlxs1: NOTICE: 730: Link reset. (Resetting link...)
[ID 349649 kern.info] [ 5.03DD]emlxs1: NOTICE: 710: Link down.
[ID 349649 kern.info] [ 5.0715]emlxs1: NOTICE: 730: Link reset.
[ID 349649 kern.info] [ 5.061B]emlxs1: NOTICE: 720: Link up. (2Gb, loop, initiator)


[ID 349649 kern.info] [ 5.06C6]emlxs0: NOTICE: 730: Link reset. (Resetting link...)
[ID 349649 kern.info] [ 5.03DD]emlxs0: NOTICE: 710: Link down.
[ID 349649 kern.info] [ 5.0715]emlxs0: NOTICE: 730: Link reset.
[ID 349649 kern.info] [ 5.061B]emlxs0: NOTICE: 720: Link up. (2Gb, loop, initiator)




Thursday, April 17, 2014

Mac OS enable X11 Forwarding with SSH

Installation of the third-party software XQuartz.

$ if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi
$ ssh -X -Y oracle@10.151.100.247
$ ssh -X -Y oracle@10.151.100.247

Sun Sparc Install solaris with DHCP on Mac OS

Step 1:  Prepare File System

$ hdiutil create -size 1g -type SPARSE -fs HFSX -volname "install" install
$ hdiutil attach install.sparseimage -mountpoint /install


Step 2: Open file ISO

$ open sol-10-u8-ga-x86-dvd.iso

$ df -h
/dev/disk3     2.1Gi  2.1Gi    0Bi   100%        0        0  100%   /Volumes/SOL_10_811_SPARC

Step 3: NFS config

$ sudo vi /etc/exports

/install                  -alldirs -maproot=root
/Volumes/SOL_10_811_X86  -alldirs -maproot=root


Start NFS 
$ sudo nfsd checkexports && sudo nfsd disable
$ sudo nfsd checkexports && sudo nfsd enable


Check export 

$ showmount -e
Exports list on localhost:
/Volumes/SOL_10_811_SPARC             Everyone
/install                            Everyone

Step 4, TFTP

$ sudo vi /System/Library/LaunchDaemons/tftp.plist


[...]
    ProgramArguments
    
        /usr/libexec/tftpd
        -i
        -s
        /install/tftpboot
    
[...]


$ mkdir /install/tftpboot
$ sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist

Test tftp
echo "testing" >/install/tftpboot/testfile
printf "verbose\ntrace\nget testfile\n" | tftp localhost
rm /install/tftpboot/testfile


Step 5 rsync

$ rsync -av /Volumes/SOL_10_811_SPARC/Solaris_10/Tools/Boot/platform
/install/tftpboot/boot_sparc/



View file  
 
TRUNGs-MacBook-Pro:tam lptrung$ cd
/install/tftpboot/boot_sparc/platform/
TRUNGs-MacBook-Pro:platform lptrung$ ls
sun4u    sun4us    sun4v
TRUNGs-MacBook-Pro:platform lptrung$ cd sun4u
TRUNGs-MacBook-Pro:sun4u lptrung$ ls -ltr
total 2584
-rw-r--r--  1 root  wheel  1092272 Aug 23  2011 wanboot
-rw-r--r--  1 root  wheel   221584 Aug 23  2011 inetboot
lrwxrwxrwx  1 root  wheel       34 Aug 23  2011 boot_archive -> ../../../../../boot/sparc.miniroot


Step 6 Config network server

$ ifconfig -a

en1: flags=8863 mtu 1500
    ether 4c:8d:79:e0:59:ac
    inet6 fe80::4e8d:79ff:fee0:59ac%en1 prefixlen 64 scopeid 0x4
    inet 192.168.100.1 netmask 0xffffff00 broadcast 192.168.100.255
    media: autoselect
    status: active
 

Step 7, DHCP with ISC DHCP

$ cat /etc/dhcpd.conf
option domain-name "example.com";
option domain-name-servers 192.168.100.1;
option subnet-mask 255.255.255.0;

ddns-update-style none;
authoritative;
default-lease-time 43200;
max-lease-time 86400;
server-name "servername";

###########SOLARIS SPARC 10 ######################

subnet 192.168.100.0 netmask 255.255.255.0 {
  pool {range 192.168.100.5 192.168.100.254;}
  option routers 192.168.100.1;
}


option space SUNW;
option SUNW.root-mount-options code 1 = text;
option SUNW.root-server-ip-address code 2 = ip-address;
option SUNW.root-server-hostname code 3 = text;
option SUNW.root-path-name code 4 = text;
option SUNW.swap-server-ip-address code 5 = ip-address;
option SUNW.swap-file-path code 6 = text;
option SUNW.boot-file-path code 7 = text;
option SUNW.posix-timezone-string code 8 = text;
option SUNW.boot-read-size code 9 = unsigned integer 16;
option SUNW.install-server-ip-address code 10 = ip-address;
option SUNW.install-server-hostname code 11 = text;
option SUNW.install-path code 12 = text;
option SUNW.sysid-config-file-server code 13 = text;
option SUNW.JumpStart-server code 14 = text;
option SUNW.terminal-name code 15 = text;
option SUNW.root-mount-options "rsize=32768";

group {

        filename "/boot_sparc/platform/sun4u/inetboot";

        vendor-option-space SUNW;

        next-server 192.168.100.1;

        option SUNW.JumpStart-server "191.168.100.1:/Volumes/SOL_10_811_SPARC/Solaris_10/";
        option SUNW.install-server-hostname "191.168.100.1";
        option SUNW.install-server-ip-address 191.168.100.1;
        option SUNW.install-path "/Volumes/SOL_10_811_SPARC";
        option SUNW.root-server-hostname "191.168.100.1";
        option SUNW.root-server-ip-address 191.168.100.1;
        option SUNW.root-path-name "/Volumes/SOL_10_811_SPARC/Solaris_10/Tools/Boot/";

        host v445 {
                hardware ethernet  00:14:4f:a0:c0:dc;
                fixed-address 192.168.100.10;
                option host-name "TT4-V445-A";
                option SUNW.sysid-config-file-server "191.168.100.1:/install/jumpstart";
        }

}


#########END SOLARIS SPARC 10 ################################

subnet 192.168.2.0 netmask 255.255.255.0 {
        option broadcast-address 192.168.2.255;
        option subnet-mask 255.255.255.0;
        option routers 192.168.2.1;
        pool { range 192.168.2.116 192.168.2.254; }
}

host client3 {
  filename "/boot/grub/pxegrub";
  server-name "servername";
  next-server 192.168.2.166;
  hardware ethernet 00:1C:42:C4:CF:1D;
  fixed-address 192.168.2.100;
}
----------------------------------------------------------------------------------------------------

 Test DHCP
$ sudo dhcpd
Listening on BPF/en1/4c:8d:79:e0:59:ac/192.168.100.0/24
Sending on   BPF/en1/4c:8d:79:e0:59:ac/192.168.100.0/24

$sudo /opt/local/sbin/dhcpd -q -f$ ps -ef |grep dhcp
    0   187     1   0  2:25PM ??         0:00.56 /opt/local/sbin/dhcpd -q -f
  501  1815   990   0 10:03AM ttys001    0:00.00 grep dhcp

Note: if dhcpd not start, You can kill -9 ID DHCP and start it

Step 8: Boot Server V890 and boot net dhcp
Testing /pci@8,600000/network@1
Testing /pci@8,600000/SUNW,qlc@2
Testing /pci@9,700000/ebus@1/i2c@1,2e
Testing /pci@9,700000/ebus@1/i2c@1,30
Testing /pci@9,700000/ebus@1/i2c@1,50002e 
  


- Send break load ok mode
  
ok show-nets
ok cd /pci@8,600000/network@1
ok .properties  => find search mac address
ok device-end
ok boot /pci@........:dhcp

Step 9: After install config network ipmp
$ dladm show-dev

$ vi /etc/hostname.bge0
10.151.100.240 netmask + broadcast + group ipmp0 up

$ vi /etc/hostname.bge1
group ipmp0 standby up

$vi /etc/netmasks
10.151.100.192  255.255.255.192

$vi /etc/defaultrouter
10.151.100.193

$ svcadm restart network/physical

After ping test network, if not run please reboot and test ipmp


Step 10: Enable SSH for root
$ vi /etc/ssh/sshd_config
You can change PermitRootLogin yes

$svcadm restart svc:/network/ssh:default

Step 11: Map disk from SAN to server and scan device create ZFS

$echo | format

Use the command to find the newly created drive and load its drivers.
$devfsadm

Check port
luxadm -e port
prtconf -vp | grep wwn
fcinfo hba-port


Install oracle 11g silent

Copy from Oracle sample file: /database/response/db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/OraInventory
ORACLE_HOME=/oracle/product/11.2.0/template
ORACLE_BASE=/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true

2) Silent installation
./runInstaller -silent -noconfig -responseFile /u01/download/db11ginstall.rsp


Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 22753 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3817 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-06-17_09-02-07PM. Please wait ..
$ You can find the log of this install session at:
 /oracle/OraInventory/logs/installActions2011-06-17_09-02-07PM.log
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run

/oracle/product/11.2.0/template/root.sh
To execute the configuration scripts:
         1. Open a terminal window
         2. Log in as "root"
         3. Run the scripts
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.
 
 
 
 
Example:
 
####################################################################
## Copyright(c) Oracle Corporation 1998,2011. All rights reserved.##
##                                                                ##
## Specify values for the variables listed below to customize     ##
## your installation.                                             ##
##                                                                ##
## Each variable is associated with a comment. The comment        ##
## can help to populate the variables with the appropriate        ##
## values.         ##
##                                                                ##
## IMPORTANT NOTE: This file contains plain text passwords and    ##
## should be secured to have read permission only by oracle user  ##
## or db administrator who owns this installation.                ##
##                                                                ##
####################################################################

#------------------------------------------------------------------------------
# Do not change the following system generated value. 
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# 1. INSTALL_DB_SWONLY
# 2. INSTALL_DB_AND_CONFIG
# 3. UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames 
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=TT4-V890-B

#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.  
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/u01/app/oraInventory

#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.             
# 
# en   : English                  ja   : Japanese                  
# fr   : French                   ko   : Korean                    
# ar   : Arabic                   es   : Latin American Spanish    
# bn   : Bengali                  lv   : Latvian                   
# pt_BR: Brazilian Portuguese     lt   : Lithuanian                
# bg   : Bulgarian                ms   : Malay                     
# fr_CA: Canadian French          es_MX: Mexican Spanish           
# ca   : Catalan                  no   : Norwegian                 
# hr   : Croatian                 pl   : Polish                    
# cs   : Czech                    pt   : Portuguese                
# da   : Danish                   ro   : Romanian                  
# nl   : Dutch                    ru   : Russian                   
# ar_EG: Egyptian                 zh_CN: Simplified Chinese        
# en_GB: English (Great Britain)  sk   : Slovak                    
# et   : Estonian                 sl   : Slovenian                 
# fi   : Finnish                  es_ES: Spanish                   
# de   : German                   sv   : Swedish                   
# el   : Greek                    th   : Thai                      
# iw   : Hebrew                   zh_TW: Traditional Chinese       
# hu   : Hungarian                tr   : Turkish                   
# is   : Icelandic                uk   : Ukrainian                 
# in   : Indonesian               vi   : Vietnamese                
# it   : Italian                                                   
#
# all_langs   : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs  
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------------
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1

#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base. 
#------------------------------------------------------------------------------
ORACLE_BASE=/u01/app/oracle

#------------------------------------------------------------------------------
# Specify the installation edition of the component.                        
#                                                             
# The value should contain only one of these choices.        
# EE     : Enterprise Edition                                
# SE     : Standard Edition                                  
# SEONE  : Standard Edition One
# PE     : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE

#------------------------------------------------------------------------------
# This variable is used to enable or disable custom install and is considered
# only if InstallEdition is EE.
#
# true  : Components mentioned as part of 'optionalComponents' property
#         are considered for install.
# false : Value for 'optionalComponents' is not considered.
#------------------------------------------------------------------------------
oracle.install.db.EEOptionsSelection=false

#------------------------------------------------------------------------------
# This variable is considered only if 'EEOptionsSelection' is set to true. 
#
# Description: List of Enterprise Edition Options you would like to enable.
#
#              The following choices are available. You may specify any
#              combination of these choices.  The components you choose should
#              be specified in the form "internal-component-name:version"
#              Below is a list of components you may specify to enable.
#        
#              oracle.oraolap:11.2.0.3.0 - Oracle OLAP
#              oracle.rdbms.dm:11.2.0.3.0 - Oracle Data Mining
#              oracle.rdbms.dv:11.2.0.3.0 - Oracle Database Vault
#              oracle.rdbms.lbac:11.2.0.3.0 - Oracle Label Security
#              oracle.rdbms.partitioning:11.2.0.3.0 - Oracle Partitioning
#              oracle.rdbms.rat:11.2.0.3.0 - Oracle Real Application Testing
#------------------------------------------------------------------------------
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0

###############################################################################
#                                                                             #
# PRIVILEGED OPERATING SYSTEM GROUPS                                         #
# ------------------------------------------                                  #
# Provide values for the OS groups to which OSDBA and OSOPER privileges       #
# needs to be granted. If the install is being performed as a member of the   #  
# group "dba", then that will be used unless specified otherwise below.       #
#                                                                             #
# The value to be specified for OSDBA and OSOPER group is only for UNIX based #
# Operating System.                                                           #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=dba

#------------------------------------------------------------------------------
# Specify the cluster node names selected during the installation.
# Example : oracle.install.db.CLUSTER_NODES=node1,node2
#------------------------------------------------------------------------------
oracle.install.db.CLUSTER_NODES=

#------------------------------------------------------------------------------
# This variable is used to enable or disable RAC One Node install.
#
# true  : Value of RAC One Node service name is used.
# false : Value of RAC One Node service name is not used.
#
# If left blank, it will be assumed to be false
#------------------------------------------------------------------------------
oracle.install.db.isRACOneInstall=false

#------------------------------------------------------------------------------
# Specify the name for RAC One Node Service. 
#------------------------------------------------------------------------------
oracle.install.db.racOneServiceName=

#------------------------------------------------------------------------------
# Specify the type of database to create.
# It can be one of the following:
# - GENERAL_PURPOSE/TRANSACTION_PROCESSING             
# - DATA_WAREHOUSE                                
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#------------------------------------------------------------------------------
# Specify the Starter Database Global Database Name. 
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.globalDBName=utility

#------------------------------------------------------------------------------
# Specify the Starter Database SID.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.SID=utility

#------------------------------------------------------------------------------
# Specify the Starter Database character set.
#                                              
# It can be one of the following:
# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.characterSet=AL32UTF8

#------------------------------------------------------------------------------
# This variable should be set to true if Automatic Memory Management 
# in Database is desired.
# If Automatic Memory Management is not desired, and memory allocation
# is to be done manually, then set it to false.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryOption=true

#------------------------------------------------------------------------------
# Specify the total memory allocation for the database. Value(in MB) should be
# at least 256 MB, and should not exceed the total physical memory available 
# on the system.
# Example: oracle.install.db.config.starterdb.memoryLimit=512
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.memoryLimit=4096

#------------------------------------------------------------------------------
# This variable controls whether to load Example Schemas onto
# the starter database or not.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.installExampleSchemas=false

#------------------------------------------------------------------------------
# This variable includes enabling audit settings, configuring password profiles
# and revoking some grants to public. These settings are provided by default. 
# These settings may also be disabled.    
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.enableSecuritySettings=false

###############################################################################
#                                                                             #
# Passwords can be supplied for the following four schemas in the       #
# starter database:                  #
#   SYS                                                                       #
#   SYSTEM                                                                    #
#   SYSMAN (used by Enterprise Manager)                                       #
#   DBSNMP (used by Enterprise Manager)                                       #
#                                                                             #
# Same password can be used for all accounts (not recommended)         #
# or different passwords for each account can be provided (recommended)       #
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable holds the password that is to be used for all schemas in the
# starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.ALL=sys236

#-------------------------------------------------------------------------------
# Specify the SYS password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYS=

#-------------------------------------------------------------------------------
# Specify the SYSTEM password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSTEM=

#-------------------------------------------------------------------------------
# Specify the SYSMAN password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.SYSMAN=

#-------------------------------------------------------------------------------
# Specify the DBSNMP password for the starter database.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.password.DBSNMP=

#-------------------------------------------------------------------------------
# Specify the management option to be selected for the starter database. 
# It can be one of the following:
# 1. GRID_CONTROL
# 2. DB_CONTROL
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.control=DB_CONTROL

#-------------------------------------------------------------------------------
# Specify the Management Service to use if Grid Control is selected to manage 
# the database.      
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=

###############################################################################
#                                                                             #
# SPECIFY BACKUP AND RECOVERY OPTIONS                                        #
# ------------------------------------                                #
# Out-of-box backup and recovery options for the database can be mentioned    #
# using the entries below.            # 
#                                                                             #
###############################################################################

#------------------------------------------------------------------------------
# This variable is to be set to false if automated backup is not required. Else 
# this can be set to true.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.enable=false

#------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if 
# automated backups are enabled, a job will be scheduled to run daily to backup 
# the database. This job will run as the operating system user that is 
# specified in this variable.
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.osuid=

#-------------------------------------------------------------------------------
# Regardless of the type of storage that is chosen for backup and recovery, if 
# automated backups are enabled, a job will be scheduled to run daily to backup 
# the database. This job will run as the operating system user specified by the 
# above entry. The following entry stores the password for the above operating 
# system user.
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.automatedBackup.ospwd=

#-------------------------------------------------------------------------------
# Specify the type of storage to use for the database.
# It can be one of the following:
# - FILE_SYSTEM_STORAGE
# - ASM_STORAGE
#------------------------------------------------------------------------------
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

#-------------------------------------------------------------------------------
# Specify the database file location which is a directory for datafiles, control
# files, redo logs.         
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/oradata

#-------------------------------------------------------------------------------
# Specify the backup and recovery location.
#
# Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=

#-------------------------------------------------------------------------------
# Specify the existing ASM disk groups to be used for storage.
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.diskGroup=

#-------------------------------------------------------------------------------
# Specify the password for ASMSNMP user of the ASM instance.                  
#
# Applicable only when oracle.install.db.config.starterdb.storage=ASM_STORAGE 
#-------------------------------------------------------------------------------
oracle.install.db.config.asm.ASMSNMPPassword=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username.
#
#  Example   : MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
MYORACLESUPPORT_USERNAME=abc@oracle.com

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password.
#
# Example    : MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
MYORACLESUPPORT_PASSWORD=123

#------------------------------------------------------------------------------
# Specify whether to enable the user to set the password for
# My Oracle Support credentials. The value can be either true or false.
# If left blank it will be assumed to be false.
#
# Example    : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
#------------------------------------------------------------------------------
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#------------------------------------------------------------------------------
# Specify whether user doesn't want to configure Security Updates.
# The value for this variable should be true if you don't want to configure
# Security Updates, false otherwise. 
#
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example    : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true

#------------------------------------------------------------------------------
# Specify the Proxy server name. Length should be greater than zero.
#
# Example    : PROXY_HOST=proxy.domain.com 
#------------------------------------------------------------------------------
PROXY_HOST=

#------------------------------------------------------------------------------
# Specify the proxy port number. Should be Numeric and atleast 2 chars.
#
# Example    : PROXY_PORT=25 
#------------------------------------------------------------------------------
PROXY_PORT=

#------------------------------------------------------------------------------
# Specify the proxy user name. Leave PROXY_USER and PROXY_PWD 
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_USER=username 
#------------------------------------------------------------------------------
PROXY_USER=

#------------------------------------------------------------------------------
# Specify the proxy password. Leave PROXY_USER and PROXY_PWD  
# blank if your proxy server requires no authentication.
#
# Example    : PROXY_PWD=password 
#------------------------------------------------------------------------------
PROXY_PWD=

#------------------------------------------------------------------------------
# Specify the proxy realm. This value is used if auto-updates option is selected.
#
# Example    : PROXY_REALM=metalink 
#------------------------------------------------------------------------------
PROXY_REALM=

#------------------------------------------------------------------------------
# Specify the Oracle Support Hub URL. 
# 
# Example    : COLLECTOR_SUPPORTHUB_URL=https://orasupporthub.company.com:8080/
#------------------------------------------------------------------------------
COLLECTOR_SUPPORTHUB_URL=

#------------------------------------------------------------------------------
# Specify the auto-updates option. It can be one of the following:
# a.MYORACLESUPPORT_DOWNLOAD
# b.OFFLINE_UPDATES
# c.SKIP_UPDATES
#------------------------------------------------------------------------------
oracle.installer.autoupdates.option=SKIP_UPDATES
#------------------------------------------------------------------------------
# In case MYORACLESUPPORT_DOWNLOAD option is chosen, specify the location where
# the updates are to be downloaded.
# In case OFFLINE_UPDATES option is chosen, specify the location where the updates 
# are present.
oracle.installer.autoupdates.downloadUpdatesLoc=
#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username which has the patches download privileges  
# to be used for software updates.
#  Example   : AUTOUPDATES_MYORACLESUPPORT_USERNAME=abc@oracle.com
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_USERNAME=

#------------------------------------------------------------------------------
# Specify the My Oracle Support Account Username password which has the patches download privileges  
# to be used for software updates.
#
# Example    : AUTOUPDATES_MYORACLESUPPORT_PASSWORD=password
#------------------------------------------------------------------------------
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
 
 
 

Monday, April 14, 2014

How to setup Jumpstart from OSX

Step 1, Prepare File System

First off, create a dedicated file system which we can export our jumpstart configuration from. You can probably skip this and just use any existing file system but this way everything is self-contained and we avoid NFS exporting more than we need.

We use HFSX to ensure that the file system is case sensitive, HFS+ can cause problems with pkgadd(1M).

$ hdiutil create -size 1g -type SPARSE -fs HFSX -volname "install" install
$ hdiutil attach install.sparseimage -mountpoint /install

Next up, download and mount sol-10-u10-ga-x86-dvd.iso.

$ open sol-10-u8-ga-x86-dvd.iso

MacBook-Pro:tftpboot$ df -h
Filesystem      Size   Used  Avail Capacity  iused    ifree %iused  Mounted on
/dev/disk1s2   238Gi  209Gi   29Gi    88% 54790142  7514728   88%   /
devfs          195Ki  195Ki    0Bi   100%      674        0  100%   /dev
/dev/disk0s2   299Gi   34Gi  265Gi    12%  8878443 69413608   11%   /Volumes/DATA1
map -hosts       0Bi    0Bi    0Bi   100%        0        0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%        0        0  100%   /home
/dev/disk0s3   399Gi   94Gi  305Gi    24% 24653272 79955649   24%   /Volumes/DATA2
/dev/disk2s1   1.0Gi  113Mi  911Mi    12%    28899   233233   11%   /install
/dev/disk3     2.1Gi  2.1Gi    0Bi   100%        0        0  100%   /Volumes/SOL_10_811_X86
/dev/disk4     2.1Gi  2.1Gi    0Bi   100%        0        0  100%   /Volumes/SOL_10_811_SPARC



Step 2, NFS


Share /install and the DVD via NFS with the correct options. -alldirs allows clients to mount from any point within that file system (which jumpstart requires), and -maproot=root is also required by jumpstart. As this allows root-owned files to be created, make sure you understand the security risks.

$ sudo vi /etc/exports

/install                  -alldirs -maproot=root
/Volumes/SOL_10_811_X86  -alldirs -maproot=root

$ sudo nfsd checkexports && sudo nfsd enable

$ sudo nfsd checkexports && sudo nfsd disable
$ sudo nfsd checkexports && sudo nfsd enable


Check export 

$ showmount -e
Exports list on localhost:
/Volumes/SOL_10_811_X86             Everyone
/install                            Everyone

Step 3, DHCP

$ cat /etc/bootpd.plist


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>dhcp_enabled</key>
    <string>en1</string>
    <key>Subnets</key>
    <array>
        <dict>
            <key>name</key>
            <string>10.151.120</string>
            <key>net_mask</key>
            <string>255.255.255.0</string>
            <key>net_address</key>
            <string>10.151.120.0</string>
            <key>net_range</key>
            <array>
                <string>10.151.120.194</string>
                <string>10.151.120.254</string>
            </array>
            <key>allocate</key>
            <true/>
            <key>dhcp_option_66</key>
            <string>10.151.120.193</string>
            <key>dhcp_option_67</key>
            <data>L2Jvb3QvZ3J1Yi9weGVncnViAA==</data>
        </dict>
    </array>
</dict>
</plist>



Note 10.151.120.193 => IP server (source setup)

  • If the file /etc/bootpd.plist already exists, turn off Internet Sharing in System Preferences > Sharing.  Then the file will be removed, and you can create it as in this step.

    (Make sure to move /etc/bootpd.plist to the Trash and disable the DHCP server before turning Internet Sharing back on.  See "Uninstall steps" below.)

  • If you are using an ethernet port other than en1 (see System Information or System Profiler for the port name), change the value for the dhcp_enabled key to the port you are using.

  • The data for the dhcp_option_67 key is the bootloader filename "pxelinux.0" (see step 9 below), null terminated and encoded into base64.  This can be generated with the free DHCP Option Code Utility, or by entering the following command in Terminal: 
  •  $ printf %s00 `echo -n /boot/grub/pxegrub | xxd -p` | xxd -r -p | openssl base64
    
    
    L2Jvb3QvZ3J1Yi9weGVncnViAA== 
     (See this discussion thread.)

  • The string for the dhcp_option_66 key is the IP address of the tftp server, i.e. the address of the Mac from step 2. 
 Stop and start service DHCP

$ sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist
$ sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist

Most parts of these configurations should be self-explanatory. The /boot/grub/pxegrub entry is important for our next step, and I’d recommend using that exact pathname for reasons explained later.


Step 4, TFTP

Now, enable the TFTP server which comes with OSX. I added the -s option so tftpd would chroot to the tftpboot directory, both for security reasons and also to ensure that paths specified as /path/to/file would work correctly (relative to /install/tftpboot).

I also changed the location of the tftpboot directory so that everything was self-contained within the UFS image. In previous attempts I didn’t do this and ran into problems with GRUB which I think are again caused by case-insensitive file systems.

$ sudo vi /System/Library/LaunchDaemons/tftp.plist

[...]
    <key>ProgramArguments</key>
    <array>
        <string>/usr/libexec/tftpd</string>
        <string>-i</string>
        <string>-s</string>
        <string>/install/tftpboot</string>
    </array>
[...]


$ mkdir /install/tftpboot
$ sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist

Test tftp
You can then create a test file and check that it’s working as you expect, using:

echo "testing" >/install/tftpboot/testfile
printf "verbose\ntrace\nget testfile\n" | tftp localhost
rm /install/tftpboot/testfile


Step 5, GRUB


Next up, configure PXE booting using GRUB. We need to copy the GRUB images and configuration from the Solaris install DVD then modify it for our environment:

$ rsync -av /Volumes/SOL_10_811_X86/boot/grub /install/tftpboot/boot/
$ rsync -av /Volumes/SOL_10_811_X86/boot/multiboot /install/tftpboot/sol10u8x/
$ rsync -av /Volumes/SOL_10_811_X86/boot/x86.miniroot /install/tftpboot/sol10u8x/


As we are copying the boot files from the DVD, they come hardcoded with particular pathnames to e.g. the menu.lst file. While it may be possible to pass extra parameters to pxegrub and load this from a different path, I simply recommend doing as I do and replicating the /boot/grub/ path structure so that everything Just Works.

The menu.lst file includes kernel arguments and allows you to choose which type of install to perform at startup. My file listed below has 3 choices:

    Unattended install using a graphical environment (if available). The “install” keyword after the kernel instructs it to perform an unattended install, so long as it can find the necessary settings from sysidcfg etc.
    As above, but force the use of the console and do not start a graphical environment (using the “nowin” keyword)
    A manual install, so you need to go through the steps of layout out disks, selecting packages, etc.

$ vi /install/tftpboot/boot/grub/menu.lst

default=0
timeout=60

title Solaris PXE Unattended Install
    kernel /sol10u8x/multiboot kernel/unix - install -B \
      install_media=10.151.120.193:/Volumes/SOL_10_811_X86,\
      sysid_config=10.151.120.193:/install/jumpstart,\
      install_config=10.151.120.193:/install/jumpstart
    module /sol10u8x/x86.miniroot

title Solaris PXE Unattended Install (console)
    kernel /sol10u8x/multiboot kernel/unix - install nowin -B \
      install_media=10.151.120.193:/Volumes/SOL_10_811_X86,\
      sysid_config=10.151.120.193:/install/jumpstart,\
      install_config=10.151.120.193:/install/jumpstart
    module /sol10u8x/x86.miniroot

title Solaris PXE Manual Install
    kernel /sol10u8x/multiboot kernel/unix -B \
      install_media=10.151.120.193:/Volumes/SOL_10_811_X86
    module /sol10u8x/x86.miniroot

Anyone used to doing jumpstart but with RARP/bootparams will notice the symmetry between install_config etc in the GRUB configuration and similar options in /etc/bootparams. Make sure that the full kernel arguments are all on one line, and that there are no spaces in between the install_media=..,sysid_config=.. options.

Step 6, Jumpstart

Finally, set up your Jumpstart configuration. Here’s what I personally use, you may want something different:

$ mkdir /install/jumpstart
$ cd /install/jumpstart
$ vi sysidcfg


#password is password
root_password=uHL9FDUAkZpGs
timeserver=localhost
timezone=Europe/London
security_policy=NONE
service_profile=limited_net
system_locale=C
terminal=vt100
keyboard=US-English
name_service=none
network_interface=ce0 { hostname=TT4-V890-A
ip_address=10.151.120.248
protocol_ipv6=no
netmask=255.255.255.192
default_route=10.151.120.193}
nfs4_domain=dynamic

Ordinarily this file is processed using a check script available in the jumpstart_sample directory on the Solaris DVD, however this only works from a Solaris host. To create the rules.ok file, we need to strip out any comments and put entries on one line, then create the checksum (although this isn’t actually necessary).

$ vi rules

hostname host1 - profile -

$ cp rules rules.ok
$ echo "# version=2 checksum=$(cksum -o 2 rules | awk '{print $1}')" >> rules.ok

Machine profile. This gives me a full Solaris install (minus OEM stuff) on mirrored ZFS disks with additional dump/swap space (the defaults made dump a bit too small I found).

$ vi profile

install_type    initial_install
pool            store auto 4g 4g mirror c1t0d0s0 c1t1d0s0
bootenv         installbe bename sol10u8x
cluster         SUNWCall

Step 7 Change IP server

 And check IP status

$ ifconfig -a

en1: flags=8963 mtu 1500
    ether 4c:8d:79:e0:59:ac
    inet6 fe80::4e8d:79ff:fee0:59ac%en1 prefixlen 64 scopeid 0x5
    inet 10.151.120.193 netmask 0xffffff00 broadcast 10.151.120.255
    media: autoselect
    status: active


Step 8, Make A Cup Of Tea

With everything set up you should be able to enable PXE booting in your BIOS and watch it automatically install. One small minor problem you may have if you don’t have a BIOS which allows you to hit F12 or similar and choose PXE booting for one boot only is that it will infinitely cycle through installing, rebooting, installing, rebooting.. until you change your boot options.

Sunday, April 13, 2014

Running Mac OS X's built-in DHCP server

It turns out that Mac OS X comes with a DHCP server built-in. There don't seem to be any good and simple instructions out there on how to use it. Or at least, there weren't any.... until now!
The server is called bootpd and does both DHCP and BOOTP. These instructions just describe using it for DHCP, however.

To start, you need to create a configuration file for the server. The file should be stored in /etc/bootpd.plist. Here's a sample configuration file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>bootp_enabled</key>
    <false/>
    <key>detect_other_dhcp_server</key>
    <integer>1</integer>
    <key>dhcp_enabled</key>
    <array>
        <string>en0</string>
    </array>
    <key>reply_threshold_seconds</key>
    <integer>0</integer>
    <key>Subnets</key>
    <array>
        <dict>
            <key>allocate</key>
            <true/>
            <key>lease_max</key>
            <integer>86400</integer>
            <key>lease_min</key>
            <integer>86400</integer>
            <key>name</key>
            <string>192.168.33</string>
            <key>net_address</key>
            <string>192.168.33.0</string>
            <key>net_mask</key>
            <string>255.255.255.0</string>
            <key>net_range</key>
            <array>
                <string>192.168.33.2</string>
                <string>192.168.33.254</string>
            </array>
        </dict>
    </array>
</dict>
</plist>
 
This file sets up the DHCP server to run on the interface named en0, which is typically the (non-wireless) Ethernet port. It assumes that that port has been configured with the IP address 192.168.33.1, and dishes out addresses from 192.168.33.2 to 192.168.33.254.
To get more information on editing this file, take a look at the bootpd manfile:
 
man bootpd

To start the server, run the following command:
 
sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist

Stopping the server is very similar:
 
sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist

If you want to create static assignments, so that a given device always has the same IP address, you need to create a file called /etc/bootptab. There's a small sample of the file below. For more information, just do man bootptab
 
%%
# machine entries have the following format:
#
# hostname      hwtype  hwaddr              ipaddr          bootfile
client1         1       00:01:02:03:04:05   10.0.0.20
client2         1       00:a0:b2:ef:ff:0a   10.0.0.20
 
Make sure to include the %% at the top of the file. It's safe to leave the bootfile field empty because we're just using bootpd as a DHCP server, not a bootp server.