Wednesday, June 28, 2017

Browser - Chrome restore session before the crash


While I was searching and reading some links content, my chrome browser crashed. When I restarted, I didn't see the restore last sessions like on firefox. Here is a way to fix it.


perform following tasks to restore your session on your browser

1. Click the Chrome Menu in the upper right corner with three dots lined up.
2. Click on settings
3. Click on main menu on left top corner
4. On drop down menu, click on on startup
5. select a radio button, "continue where you left off"

To test,
1. Open couple of tab and open some web pages
2. kill the crom process or close the browser
3. Open your browser and you should be restore your session.

Tuesday, June 27, 2017

Solaris 10 - zone creation


1. Login to control Domain,

login as: root
Using keyboard-interactive authentication.
Password:
Last login: Sun Jun 25 08:36:43 2017
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
# bash
bash-3.2# df -h
Filesystem             size   used  avail capacity  Mounted on
rpool/ROOT/s10x_u11wos_24a    12G   4.4G   5.3G    46%    /

bash-3.2# echo | format
Searching for disks...
Inquiry failed for this logical diskdone


AVAILABLE DISK SELECTIONS:
       0. c0d0 <▒x▒▒▒▒▒▒▒▒▒@▒▒▒ cyl 1565 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
Specify disk (enter its number): Specify disk (enter its number):
bash-3.2# zpool list
NAME    SIZE  ALLOC   FREE  CAP  HEALTH  ALTROOT
rpool  11.9G  6.39G  5.55G  53%  ONLINE  -
bash-3.2# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool                       6.45G  5.30G  42.5K  /rpool
rpool/ROOT                  4.39G  5.30G    31K  legacy
rpool/ROOT/s10x_u11wos_24a  4.39G  5.30G  4.39G  /
rpool/dump                  1.00G  5.30G  1.00G  -
rpool/export                  76K  5.30G    32K  /export
rpool/export/home             44K  5.30G    44K  /export/home
rpool/swap                  1.06G  5.36G  1.00G  -
bash-3.2# ping 192.168.10.135
192.168.10.135 is alive
bash-3.2# ssh 192.168.10.135
^C
bash-3.2# pwd
/
bash-3.2# mkdir /export/home/bishal-zone
bash-3.2# zonecfg -z bishal
bishal: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:bishal> create
zonecfg:bishal> set zonepath=/export/home/bishal-zone
zonecfg:bishal> set autoboot=true
zonecfg:bishal> add net
zonecfg:bishal:net> set physical=e1000g0
zonecfg:bishal:net> set address=192.168.10.221
zonecfg:bishal:net> end
zonecfg:bishal> add attr
zonecfg:bishal:attr> set name=comment
zonecfg:bishal:attr> set type=string
zonecfg:bishal:attr> set value="Bishals zone"
zonecfg:bishal:attr> end
zonecfg:bishal> verify
zonecfg:bishal> commit
zonecfg:bishal> info
zonename: bishal
zonepath: /export/home/bishal-zone
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
net:
        address: 192.168.10.221
        physical: e1000g0
        defrouter not specified
attr:
        name: comment
        type: string
        value: "Bishals zone"
zonecfg:bishal> exit
bash-3.2# zonecfg -z bishal export | more
create -b
set zonepath=/export/home/bishal-zone
set autoboot=true
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add net
set address=192.168.10.221
set physical=e1000g0
end
add attr
set name=comment
set type=string
set value="Bishals zone"
end
bash-3.2#  zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   - bishal           configured /export/home/bishal-zone       native   shared
bash-3.2# zoneadm -z bishal install
/export/home/bishal-zone must not be group readable.
/export/home/bishal-zone must not be group executable.
/export/home/bishal-zone must not be world readable.
/export/home/bishal-zone must not be world executable.
could not verify zonepath /export/home/bishal-zone because of the above errors.
zoneadm: zone bishal failed to verify
bash-3.2# ls -ld /export/home/bishal-zone
drwxr-xr-x   2 root     root           2 Jun 25 11:56 /export/home/bishal-zone
bash-3.2# chmod 700 /export/home/bishal-zone
bash-3.2# zoneadm -z bishal install
A ZFS file system has been created for this zone.
Preparing to install zone <bishal>.
Creating list of files to copy from the global zone.
Copying <2711> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1244> packages on the zone.
Initialized <1244> packages on zone.
Zone <bishal> is initialized.
The file </export/home/bishal-zone/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   - bishal           installed  /export/home/bishal-zone       native   shared
bash-3.2# cd /export/home/bishal-zone/
bash-3.2# ls
root
bash-3.2# cd root
bash-3.2# ls
bin       etc       home      lib       opt       proc      system    usr
dev       export    kernel    mnt       platform  sbin      tmp       var
bash-3.2# df -h .
Filesystem             size   used  avail capacity  Mounted on
rpool/export/home/bishal-zone
                        12G    76M   5.2G     2%    /export/home/bishal-zone
bash-3.2# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 192.168.10.20 netmask ffffff00 broadcast 192.168.10.255
        ether 0:c:29:e:4a:65
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   - bishal           installed  /export/home/bishal-zone       native   shared
bash-3.2# zoneadm -z bishal boot
zoneadm: zone 'bishal': WARNING: e1000g0:1: no matching subnet found in netmasks(4) for 192.168.10.221; using default of 255.255.255.0.
bash-3.2# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        zone bishal
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 192.168.10.20 netmask ffffff00 broadcast 192.168.10.255
        ether 0:c:29:e:4a:65
e1000g0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        zone bishal
        inet 192.168.10.221 netmask ffffff00 broadcast 192.168.10.255
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   1 bishal           running    /export/home/bishal-zone       native   shared
bash-3.2# zoneadm -z bishal reboot
zoneadm: zone 'bishal': WARNING: e1000g0:1: no matching subnet found in netmasks(4) for 192.168.10.221; using default of 255.255.255.0.
bash-3.2# zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   2 bishal           running    /export/home/bishal-zone       native   shared
bash-3.2# zlogin -C bishal
[Connected to zone 'bishal' console]


Select a Language

  0. English
  1. es
  2. fr

Please make a choice (0 - 2), or press h or ? for help: 0


Select a Locale

  0. English (C - 7-bit ASCII)
  1. Canada (English) (UTF-8)
  2. Canada-English (ISO8859-1)
  3. U.S.A. (UTF-8)
  4. U.S.A. (en_US.ISO8859-1)
  5. U.S.A. (en_US.ISO8859-15)
  6. Go Back to Previous Screen

Please make a choice (0 - 6), or press h or ? for help: 0


What type of terminal are you using?
 1) ANSI Standard CRT
 2) DEC VT52
 3) DEC VT100
 4) Heathkit 19
 5) Lear Siegler ADM31
 6) PC Console
 7) Sun Command Tool
 8) Sun Workstation
 9) Televideo 910
 10) Televideo 925
 11) Wyse Model 50
 12) X Terminal Emulator (xterms)
 13) CDE Terminal Emulator (dtterm)
 14) Other
Type the number of your choice and press Return: 12
Creating new rsa public/private host key pair
Creating new dsa public/private host key pair
Configuring network interface addresses: e1000g0.
q Host Name for e1000g0:1 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  Enter the host name which identifies this system on the network.  The name
  must be unique within your domain; creating a duplicate host name will cause
  problems on the network after you install Solaris.

  A host name must have at least one character; it can contain letters,
  digits, and minus signs (-).


             Host name for e1000g0:1 bishal
                                     bishal



qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Confirm Information for e1000g0:1 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.


                          Host name: bishal




qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  Just a moment... F4_Change    F6_Help
q Configure Security Policy: qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  Specify Yes if the system will use the Kerberos security mechanism.

  Specify No if this system will use standard UNIX security.

      Configure Kerberos Security
      qqqqqqqqqqqqqqqqqqqqqqqqqqq
      [ ] Yes
      [X] No





qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.


        Configure Kerberos Security: No




qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  Please wait...   F4_Change    F6_Help
q Name Service qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  On this screen you must provide name service information.  Select the name
  service that will be used by this system, or None if your system will either
  not use a name service at all, or if it will use a name service not listed
  here.

  > To make a selection, use the arrow keys to highlight the option
    and press Return to mark it [X].


      Name service
      qqqqqqqqqqqq
      [X] NIS+
      [ ] NIS
      [ ] DNS
      [ ] LDAP
      [ ] None
        ]
       X]


qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.


                       Name service: None




qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  Just a moment... F4_Change    F6_Help
q NFSv4 Domain Name qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  NFS version 4 uses a domain name that is automatically derived from the
  system's naming services. The derived domain name is sufficient for most
  configurations. In a few cases, mounts that cross domain boundaries might
  cause files to appear to be owned by "nobody" due to the lack of a common
  domain name.

  The current NFSv4 default domain is: ""


      NFSv4 Domain Configuration
      qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
      [X] Use the NFSv4 domain derived by the system
      [ ] Specify a different NFSv4 domain



qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Confirm Information for NFSv4 Domain qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.


                 NFSv4 Domain Name:  << Value to be derived dynamically >>



qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F4_Change    F6_Help
q Time Zone qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  On this screen you must specify your default time zone.  You can specify a
  time zone in three ways:  select one of the continents or oceans from the
  list, select other - offset from GMT, or other - specify time zone file.

  > To make a selection, use the arrow keys to highlight the option and
    press Return to mark it [X].


      Continents and Oceans
      qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  -   [ ] Africa
  x   [ ] Americas
  x   [ ] Antarctica
  x   [X] Arctic Ocean
  x   [ ] Asia
  x   [ ] Atlantic Ocean
  x   [ ] Australia
  x   [ ] Europe
  v   [ ] Indian Ocean

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Country or Region qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > To make a selection, use the arrow keys to highlight the option and
    press Return to mark it [X].


      Countries and Regions
      qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  -   [ ] United States
  x   [ ] Anguilla
  x   [X] Antigua & Barbuda
  x   [ ] Argentina
  x   [ ] Aruba
  x   [ ] Bahamas
  x   [ ] Barbados
  x   [ ] Belize
  x   [ ] Bolivia
  x   [ ] Bonaire Sint Eustatius & Saba
  x   [ ] Brazil
  x   [ ] Canada
  v   [ ] Cayman Islands

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Time Zone qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > To make a selection, use the arrow keys to highlight the option and
    press Return to mark it [X].


      Time zones
      qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  -   [ ] Eastern Time
  x   [ ] Eastern Time - Michigan - most locations
  x   [X] Eastern Time - Kentucky - Louisville area
  x   [ ] Eastern Time - Kentucky - Wayne County
  x   [ ] Eastern Time - Indiana - most locations
  x   [ ] Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties
  x   [ ] Eastern Time - Indiana - Pulaski County
  x   [ ] Eastern Time - Indiana - Crawford County
  x   [ ] Eastern Time - Indiana - Pike County
  x   [ ] Eastern Time - Indiana - Switzerland County
  x   [ ] Central Time
  x   [ ] Central Time - Indiana - Perry County
  v   [ ] Central Time - Indiana - Starke County

qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help
q Confirm Information qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  > Confirm the following information.  If it is correct, press F2;
    to change any information, press F4.


                          Time zone: Eastern Time
                                     (US/Eastern)




qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
  Please wait...   F4_Change    F6_Help
q Root Password qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq

  Please enter the root password for this system.

  The root password may contain alphanumeric and special characters.  For
  security, the password will not be displayed on the screen as you type it.

  > If you do not want a root password, leave both entries blank.


                     Root password:
                     Root password:  ********
                                     ********




qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
    F2_Continue    F6_Help




rebooting system due to change(s) in /etc/default/init


[NOTICE: Zone rebooting]


SunOS Release 5.10 Version Generic_147148-26 64-bit
Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
Hostname: bishal

bishal console login: Jun 25 12:15:37 bishal sendmail[7176]: My unqualified host name (bishal) unknown; sleeping for retry
Jun 25 12:15:37 bishal sendmail[7182]: My unqualified host name (bishal) unknown; sleeping for retry
root
Password:
Jun 25 12:15:55 bishal login: ROOT LOGIN /dev/console
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
# bash
bash-3.2# useradd -d /export/home/bishal -m -c "Bishal" -s /bin/bash bishal
UX: useradd: ERROR: Unable to create the home directory: No such file or directory.
bash-3.2# ls -ld /export/hom
bash-3.2# mkdir Jun 25 12:16:37 bishal sendmail[7176]: unable to qualify my own domain name (bishal) -- using short name
Jun 25 12:16:37 bishal sendmail[7176]: [ID 702911 mail.alert] unable to qualify my own domain name (bishal) -- using short name
Jun 25 12:16:37 bishal sendmail[7182]: unable to qualify my own domain name (bishal) -- using short name
Jun 25 12:16:37 bishal sendmail[7182]: [ID 702911 mail.alert] unable to qualify my own domain name (bishal) -- using short name
/export/home
bash-3.2# useradd -d /export/home/bishal -m -c "Bishal" -s /bin/bash bishal
bash-3.2# passwd bishal
New Password:
passwd: The password must contain at least 1 numeric or special character(s).

Please try again
New Password:

bash-3.2# grep root /etc/passwd
root:x:0:0:Super-User:/:/sbin/sh
bash-3.2# grep root /etc/shadow
root:l5u2cH9PhmZI6:6445::::::
bash-3.2# vi /etc/ssh/sshd_config
"/etc/ssh/sshd_config" 155 lines, 4997 characters
#
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
#
# ident "@(#)sshd_config        1.10    10/10/19 SMI"
#
# Configuration file for sshd(1m)

# Protocol versions supported
#
# The sshd shipped in this release of Solaris has support for major versions
# 1 and 2.  It is recommended due to security weaknesses in the v1 protocol
# that sites run only v2 if possible. Support for v1 is provided to help sites
# with existing ssh v1 clients/servers to transition.
# Support for v1 may not be available in a future release of Solaris.
#
# To enable support for v1 an RSA1 key must be created with ssh-keygen(1).
# RSA and DSA keys for protocol v2 are created by /etc/init.d/sshd if they
# do not already exist, RSA1 keys for protocol v1 are not automatically created.

# Uncomment ONLY ONE of the following Protocol statements.

# Only v2 (recommended)
/PermitR
# Depending on the setup of pam.conf(4) this may allow tunneled clear text
# passwords even when PasswordAuthentication is set to no. This is dependent
# on what the individual modules request and is out of the control of sshd
# or the protocol.
PAMAuthenticationViaKBDInt yes

# Are root logins permitted using sshd.
# Note that sshd uses pam_authenticate(3PAM) so the root (or any other) user
# maybe denied access by a PAM module regardless of this setting.
# Valid options are yes, without-password, no.
#PermitRootLogin no
PermitRootLogin yes

# sftp subsystem
Subsystem       sftp    internal-sftp


# SSH protocol v1 specific options
#
# The following options only apply to the v1 protocol and provide
# some form of backwards compatibility with the very weak security
"/etc/ssh/sshd_config" 156 lines, 5018 characters nd the functionality
bash-3.2# svcs -a | grep ssh
online         12:15:37 svc:/network/ssh:default
bash-3.2# svcadm restart ssh
bash-3.2# Jun 25 12:18:59 bishal su: 'su root' succeeded for bishal on /dev/pts/8

bash-3.2#
bash-3.2# hostname
bishal
bash-3.2# ifconfig -a
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.10.221 netmask ffffff00 broadcast 192.168.10.255
bash-3.2# exit
# ^D

bishal console login: Jun 25 12:30:17 bishal su: 'su root' succeeded for bishal on /dev/pts/9

Solaris 10 - Fixing missing home directory issue

If your environment has autofs, this solution does not work. Check autofs related config file, your share and try to mount manually. On isolated environment, or LAB environment, if you forget to use -m option, home directory will not be created. To fix the issue, follow the steps below.

Missing home directory issue

When you login, you will see following error,

Could not chdir to home directory /export/home/bishal: No such file or directory

# mkdir /export/home/bishal
# id -a bishal
uid=100(bishal) gid=1(other) groups=1(other)
# cp -r /etc/skel/* /export/home/bishal/
# chown -R bishal:1 /export/home/bishal
# chmod 700 /export/home/bishal
#

Login as a root user directory on solaris 10

# vi /etc/ssh/sshd_conf
PermitRootLogin yes

# svcs -a | grep ssh
online          8:19:33 svc:/network/ssh:default
# svcadm restart  svc:/network/ssh:default
#

Relogin to your server

login as: root
Password:
#

Solaris10 - Installing solaris 10 on Sun T-series server

Login to console on SUN t5120

1. Login to console
$ ssh <IP Addr>

2. Power on the system
-> start /SYS

3. Start the console
-> start /SP/console

{0} ok

4. To exit off the console type #.

5. To login to console
-> start /SP/console

6. Once you are on OK prompt, insert the OS CD and boot the system to Install the operating system
{0} ok boot cdrom


Select following options at the prompt
7. Language selection:
Please make a choice (0 - 10), or press h or ? for help: 0
0 for english

8. What type of terminal are you using?  [ we will be using 6) PC Console ]

Type the number of your choice and press Return: 6


9. Press f2 to continue [ Esc-2_Continue ]

10. On Identify This System  windows, press Esc-2_continue

11. on ' Network Connectivity' select the box next to Networked [x]

12. on  Configure Multiple Network Interfaces, select the first instance of the interface since we plug the network cable on that port
Note: to select, go to partucular port and press space bar to select.

13. on DHCP for e1000g0 screen, Use DHCP for e1000g0, select No option

specify the ip address on next screen.

14. on  Subnet for e1000g0 screen, select yes and continue

15. on Netmask for e1000g0  screen, specify your subnet: 255.255.255.0

on IPv6, just select no and continue

16.  on Set the Default Route for e1000g0 screen, just select [X] Detect one upon reboot or you can specify one. for our case 192.168.10.1

17, on ' Confirm Information for e1000g0 ' screen, verify the information and make sure they are correct

18. Esc+2 to continue

19. on ' Configure Security Policy' windows, just select No and ocntinue

20. on  Confirm Information screen, verify the info and continue

21. on ' Name Service' screen, select the one, based on your environment. In our case, we are not using any name service so we will select None. and continue

22. Confirm the info and continue.

23. on  NFSv4 Domain Name - select Use the NFSv4 domain derived by the system and continue

24. On ' Time Zone ' windows, specify the time zone.
    - in our case, select second box, press Esc+2 to continue
    - select the first option: United States and continue
    - Select first option Eastern time and continue
    - next screen on 'Date and Time' windows, just press Esc+2 to continue
    - Next page on 'Confirm Information' page, you verify the info. if you find wrong info, press Esc+4 to change.

25. On ' Root Password' window, specify your root password. and continue by pressing Esc +2

26. on 'Enabling remote services' windows, select no, and continue

27. on 'Provide Oracle Configuration Manager Registration Information' windows, press Esc+2 to continue.

28. Press Esc+2 to continue again.

until now, System identification is completed.

Installation process beginds now.

29. On 'Solaris Interactive Installation' windows, press F2_Standard for standrd installation, and F4_Flash for flash archive installation (from Gold Image). We will select standard installation

30. on 'iSCSI Installation' window, select  Install on non-iSCSI target


eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
Listening on LPF/eth0/00:21:28:24:41:ed
Sending on   LPF/eth0/00:21:28:24:41:ed
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
eth0: status: link up.
eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation complete.
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.10.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.10.1
bound to 192.168.10.36 -- renewal in 43004 seconds.
done.


Solaris 10 software installation succeeded

Customizing system files
        - Mount points table (/etc/vfstab)
        - Network host addresses (/etc/hosts)
        - Environment variables (/etc/default/init)

Cleaning devices

Customizing system devices
        - Physical devices (/devices)
        - Logical devices (/dev)

Installing boot information
        - Installing boot blocks (c1t0d0s0)
        - Installing boot blocks (/dev/rdsk/c1t0d0s0)
        - Updating system firmware for automatic rebooting
        - Given Disk (/dev/dsk/c1t0d0s0) is not a iSCSI Disk



Installation log location
        - /a/var/sadm/system/logs/install_log (before reboot)
        - /var/sadm/system/logs/install_log (after reboot)

Installation complete
Executing SolStart postinstall phase...
Executing finish script "patch_finish"...


Finish script patch_finish execution completed.
Executing JumpStart postinstall phase...

The begin script log 'begin.log'
is located in /var/sadm/system/logs after reboot.

The finish script log 'finish.log'
is located in /var/sadm/system/logs after reboot.


Launching installer. Please Wait...



Installing Additional Software
|-1%--------------25%-----------------50%-----------------75%--------------100%|

   Pausing for 30 seconds at the "Summary" screen. The wizard will continue to
   the next step unless you select "Pause". Enter 'p' to pause. Enter 'c' to
   continue. [c]


Installing Additional Software
|-1%--------------25%-----------------50%-----------------75%--------------100%|

   Pausing for 30 seconds at the "Summary" screen. The wizard will continue to
   the next step unless you select "Pause". Enter 'p' to pause. Enter 'c' to
   continue. [c] c


   Pausing for 90 seconds at the "Reboot" screen. The wizard will continue to
   the next step unless you select "Pause". Enter 'p' to pause. Enter 'c' to
   continue. [c]

Creating boot_archive for /a
updating /a/platform/sun4v/boot_archive


syncing file systems... done
rebooting...
Resetting...
ChassisSerialNumber BEL0902U3E


SPARC Enterprise T5120, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.33.6.f, 32640 MB memory available, Serial #86262244.
Ethernet address 0:21:28:24:41:e4, Host ID: 852441e4.

Friday, June 23, 2017

Linux - Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting

Increase A VMware Disk Size (VMDK) Formatted As Linux LVM without rebooting

To increase the size of your VMware Virtual Machine, you need
1. Increase the disk's size in your vSphere Client or through the CLI. to increase the "hardware" disk
2. Then, use  partition option to extend it.


Increase from 3GB to 10 Gb

1) Checking if you can extend the current disk or need to add a new one

Note: If disk is already partitioned in 4 primary partitions, you can not extend it. Check with fdisk -l command


# fdisk -l

/dev/sda1   *           1          25      200781   83  Linux
/dev/sda2              26        2636    20972857+  8e  Linux LVM

we saw two partitions, you can extent current disk in a virtual machine.
if you have 4 parititon, you have to add new virtual disk to your system.


2) The "hardware" part, "physically" adding diskspace to your VM

- login to your VMware, go to edit setting of VM
- Highlight the disk you want to expand and change the size.
- If the size section is greyed out, shutdown your VM.
Note: you have snapshot taken of that VM, remove it.
- Reboot  your system, if you have complated without reboot, you have to rescan the scsi device.
# ls -l /sys/class/scsi_device


you should have a disk with update disk geometry.



Source - online
















Solaris 11 - Migration of Solaris 10 LDOM oracle database server to Solaris11

Solaris 11 - Migration of Solaris 10 LDOM oracle database server to Solaris11


Prerequisites tasks

For Oracle database on Solaris 11 gold server, install following packages.

# pkg publisher
# pkginfo -l SUNWcsl
# pkg info -r motif
# pkg list | grep -i motif
# pkg install library/motif
# pkg list | grep -i xwplt
# pkg info -r xwplt
# pkg info -r SUNWxwplt
# pkg install compatibility/packages/SUNWxwplt
# pkg install compatibility/ucb


Build LDOM

1. Create domain
# ldm add-domain my_ldm-v01
# ldm list

2. Add CPU/Memory/Network info
a. Add CPU/Mem
# ldm add-vcpu 2 my_ldm-v01
# ldm add-memory 2g my_ldm-v01
# ldm list | grep sol11
b. Add network info. since its IPMP, you need to add two NIC,
Get source LDOM network info, and match it to destination
# ldm list-bindings my_ldm-v01
    vnet0            primary-vsw2@primary 
    vnet1            primary-vsw3@primary 

# ldm add-vnet link-prop=phys-state vnet0 primary-vsw0 <ldom>
# ldm add-vnet linkprop=phys-state vnet0 primary-vsw0 my_ldm-v01
# ldm add-vnet linkprop=phys-state vnet1 primary-vsw1 my_ldm-v01
# ldm list-bindings my_ldm-v01
# ldm list | more

3. Assign Disk space

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note from storage team:

From Solaris 11 Goldsrv  SOL-MG-P01 (VM: sol-11-goldsrv    LUN 35/ID:  31D)    present to     
SOL-MG-P02 (VM:  my_ldm_v02-sol_11) LUN 48/ID: 035e



1.  From Compellant Control Center, under SOL-MG-P02, create the following VM Folders:
       my_ldm_v03-sol_11
       my_ldm_v02-sol_11

2.  Create the following LUN COPY (not Replay):
      From Solaris 11 Goldsrv  SOL-MG-P01 (VM: sol-11-goldsrv    LUN 35/ID:  31D)    present to      SOL-MG-P02 (VM:  my_ldm_v03-sol_11)  LUN

47/ID:035d
      From Solaris 11 Goldsrv  SOL-MG-P01 (VM: sol-11-goldsrv    LUN 35/ID:  31D)    present to      SOL-MG-P02 (VM:  my_ldm_v02-sol_11) LUN

48/ID: 035e

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


a. Scan the LUNS
# cfgadm -al
# cfgadm -al -o show_FCP_dev
b. Find LUN Number
# luxadm display /dev/rdsk/c3t6000D310006D640000000000000001FFd0s2
Look under    
Device Address              5000d310006d6431,1c
here, for eg, 1c is the hex number, you have to conver it to DEC, use programmer calculator to change.
to convert 1c to dec it is 28.

# echo | format | egrep "0356|0357"
# ldm add-vdsdev /dev/dsk/c0t6000D310006D64000000000000000356d0s2 DL42@primary-vds0
# ldm add-vdsdev /dev/dsk/c0t6000D310006D64000000000000000357d0s2 DL43@primary-vds0
# ldm add-vdisk VDL42 DL42@primary-vds0 my_ldm_v04_sol11
# ldm add-vdisk VDL43 DL43@primary-vds0 my_ldm-v01
# ldm list-bindings my_ldm_v04_sol11
# ldm list-bindings my_ldm-v01
# ldm list-bindings my_ldm_v04_sol11
# ldm list

4. Set auto boot to false so that system does not boot upon power on.
# ldm set-variable auto-boot\?=false my_ldm-v01
# ldm set-variable auto-boot\?=false my_ldm_v04_sol11

5. Bind and start LDOM
# ldm list
# ldm bind my_ldm_v04_sol11
# ldm start my_ldm_v04_sol11
LDom my_ldm_v04_sol11 started
# ldm start my_ldm-v01


6. List detail about Solaris 11 LDOM
# ldm list-bindings my_ldm-v01 | more

7. List detail about SOlaris 10 server LDOM
# ldm list-bindings my_ldm_v05 | more

8. Connect to the console
# telnet 0 5013
{0} ok boot -s

Enter user name for system maintenance (control-d to bypass):

root@sol-11-goldsrv:~# ifconfig -a
ipmp0: flags=10c001000842<BROADCAST,RUNNING,MULTICAST,IPv4,DUPLICATE,IPMP,PHYSRUNNING> mtu 1500 index 2
        inet 192.168.10.66 netmask ffffff80 broadcast 192.168.10.127
        groupname ipmp0
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 3
net1: flags=100061000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,STANDBY,INACTIVE,PHYSRUNNING> mtu 1500 index 4


9. change the following info based on your new env for initial set up of ip/hostname and run it
root@sol-11-goldsrv:/var/tmp/initial-setup# vi setup.sh

ENCLAVE=<dev>
HOSTNAME=<sol-11-goldsrv>
DOMAIN=<expanor.dev>
IP_ADDRESS=<192.168.10.69>

root@sol-11-goldsrv:/var/tmp/initial-setup# export EDITOR=vi
root@sol-11-goldsrv:/var/tmp/initial-setup# export TERM=vt100
root@sol-11-goldsrv:/var/tmp/initial-setup# sh setup.sh


root@sol-11-goldsrv:/var/tmp/initial-setup# svcs -a | grep network/physical
online          9:53:04 svc:/network/physical:upgrade
online          9:54:13 svc:/network/physical:default


root@sol-11-goldsrv:/var/tmp/CAC# ifconfig -a

ipmp0: flags=108001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP,PHYSRUNNING> mtu 1500 index 2
        inet 192.168.10.69 netmask ffffff80 broadcast 192.168.10.127
        groupname ipmp0
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 3
net1: flags=100061000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,STANDBY,INACTIVE,PHYSRUNNING> mtu 1500 index 4

Verify hostname/ipaddress of the output.
root@sol-11-goldsrv:/var/tmp/CAC/DEV# svcprop identity:node | more


10. Change role into user.

root@sol-11-goldsrv:/var/tmp/CAC/DEV# usermod -R "" jay
root@sol-11-goldsrv:/var/tmp/CAC/DEV# usermod -R "" sam
root@sol-11-goldsrv:/var/tmp/CAC/DEV# rolemod -K type=normal root


11. Now, reboot the machine and login to server using new IP and set up LDAP-CAC
my_ldm_v04 console login:
root@sol-11-goldsrv:/var/tmp/CAC/DEV# reboot
root@sol-11-goldsrv:/# cd /var/tmp/CACDEV/
root@sol-11-goldsrv:/var/tmp/CAC/DEV# sh ldap_inst_dev.sh



12. Go to source server, review cat /etc/ passwd, shadow and group and copy all the user entry related to database/application account.

# egrep "gridmon|iascan|oinstall|oracle" /etc/passwd
# egrep "gridmon|iascan|oinstall|oracle" /etc/shadow
# for i in gridmon iascan oinstall oracle;  do id -a $i; done
# egrep "102|501|503" /etc/group


13. Copy the content of /export/home directory and also /var/opt/oracle
a. Enable direct root login to destination host
# vi /usr/local/ssh6.6p1/etc/sshd_config
PermitRootLogin Yes

b. And restart the service
# /etc/init.d/ssh stop/start



14. Copy important files/directories (/home dir /var/opt/oracle) from source, and update to destination server.
A. Copy from source server
a. Copy directly (use tar and scp without saving on source host

# cd /var/opt
# tar cfE - oracle | ssh root@192.168.10.69 "( cd /var/opt; tar xfBp - )"
# cd /export/home
# tar cfE - gridmon oradev oinstall | ssh root@192.168.10.69 "( cd /export/home; tar xfBp - )"


b. Tar the content at /var/tmp and use scp to copy
# cd /export/home/; du -sh gridmon iascan oinstall oracle
# tar -cvf /var/tmp/home_dir.tar gridmon iascan oinstall oracle
# cd /var/opt;# du -sh *
# tar -cvf /var/tmp/var_opt_oracle.tar oracle
# ls -lh /var/tmp/var_opt_oracle.tar /var/tmp/home_dir.tar
# cd /var/tmp; scp var_opt_oracle.tar home_dir.tar sam@192.168.10.69:/var/tmp


B. Update destination server if needed

root@my_ldm_v04:~# vi /etc/passwd
root@my_ldm_v04:~# vi /etc/passwd
root@my_ldm_v04:~# vi /etc/shadow
root@my_ldm_v04:~#
root@my_ldm_v04:~# vi /etc/group
root@my_ldm_v04:~#

# tar -tvf /var/tmp/home_dir.tar | more
# cd /export/home/; tar -xvf /var/tmp/home_dir.tar
# cd /var/opt; tar -xvf /var/tmp/var_opt_oracle.tar
# cd oracle; ls
# df -h

verify user env,
# su - oinstall
[oinstall@my_ldm_v04]>env


15. Update sudoers file
# visudo

make sure you verify source/destination file content.


16. Update vfstab, system, and projects file
# vi /etc/vfstab
make sure you verify source/destination file content.



root@my_ldm_v04:~# cat /etc/system

Review/change your zfs arc size.

set zfs:zfs_arc_max=2147483648
set zfs:zfs_arc_min=67108864
* Setting max file descriptors
set rlim_fd_max=65536
set rlim_fd_cur=1024
* To prevent buffer overflow
* set noexec_user_stack = 1
* set noexec_user_stack_log = 1
* Enable BSM Auditing
set c2audit:audit_load = 1
* Monitor for unauthorized connections of mobile devices
exclude: scsa2usb


Review oracle sga size and update your project file. (GB in size?)
# projects -l

user.oinstall
        projid : 101
        comment: ""
        users  : oinstall
        groups : oinstall
                 dba
        attribs: process.max-sem-nsems=(priv,810,deny)
                 project.max-sem-ids=(priv,512,deny)
                 project.max-shm-ids=(priv,512,deny)
                 project.max-shm-memory=(priv,4294967296,deny)
oracle
        projid : 220
        comment: ""
        users  : oinstall
                 oracle
        groups : oinstall
                 dba
        attribs: process.max-sem-nsems=(priv,256,deny)
                 project.max-sem-ids=(priv,100,deny)
                 project.max-shm-ids=(priv,100,deny)
                 project.max-shm-memory=(priv,4294967296,deny)
root@my_ldm_v04:~#



17. refresh nfs/client
# svcadm enable -r nfs/client


18. Now, time to shutdown source system. stop the source LDOM.
Login to console on destination host and change the IP address info

root@SOL-MG-P02 # ldm stop my_ldm_v05
root@SOL-MG-P02 # ldm stop my_ldm_v04
root@SOL-MG-P02 # ldm unbind my_ldm_v05
root@SOL-MG-P02 # ldm unbind my_ldm_v04

# telnet 0 5014
a. Review existing IP/host info
# ifconfig -a | more
ipmp0: flags=108001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,IPMP,PHYSRUNNING> mtu 1500 index 2
        inet 192.168.10.69 netmask ffffff80 broadcast 192.168.10.127
        groupname ipmp0
net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 3
net1: flags=100061000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,STANDBY,INACTIVE,PHYSRUNNING> mtu 1500 index 4

# ipadm show-addr
b. Remove old IPMP setting
# ipadm delete-addr ipmp0/v4

c. Assign new IP
# ipadm create-addr -T static -a  192.168.10.33 ipmp0
# svccfg -s identity:node setprop private_data/mapped_addresses=192.168.10.33
# svcadm refresh identity:node
# svcadm restart identity:node
# svcprop identity:node | more

19. Login to control domain and set CPU/MEM
Note: change CPU/Mem while on multi user mode or on power off state.

a. Change CPU/Mem info
root@SOL-MG-P02 # ldm set-vcpu 16 my_ldm_v04_sol11
root@SOL-MG-P02 # ldm set-mem 10G my_ldm_v04_sol11

root@SOL-MG-P02 # ldm set-mem 8G my_ldm-v01
root@SOL-MG-P02 # ldm set-vcpu 16 my_ldm-v01

b. if you are at OK prompt, stop the LDOM and allocate resources.
root@SOL-MG-P02 # ldm stop my_ldm-v01
root@SOL-MG-P02 # ldm set-mem 8G my_ldm-v01


root@SOL-MG-P02 # ldm set-mem 8G my_ldm-v01
root@SOL-MG-P02 # ldm set-vcpu 16 my_ldm-v01
root@SOL-MG-P02 #



20. If you are on multiuser mode, reboot your system.
# init 5 or reboot

or

if your VM is powered off, Power on your VM and boot the system and login to console

root@SOL-MG-P02 # ldm start my_ldm-v01
root@SOL-MG-P02 # ldm start my_ldm-v01

Login to console
# telnet 0 5014

{0} ok boot


Once you login, check logs, filesystem and login using CAC

root@SOL-MG-P02 # ldm list
NAME             STATE      FLAGS   CONS    VCPU  MEMORY   UTIL  UPTIME
primary          active     -n-cv-  UART    8     8G       1.2%  48d 23h 24m
my_ldm-v01        bound      ------  5013    16    8G
my_ldm_v04_sol11   active     -n----  5014    16    10G      0.1%  1d 7h 3m
my_ldm_v02       active     -n----  5010    32    16G      0.2%  48d 23h 19m
my_ldm_v03       active     -n----  5001    16    8G       1.7%  48d 23h 19m
my_ldm_v05       inactive   ------          16    8G
my_ldm_v04       inactive   ------          16    10


To change IP Address:

# Delete OLD IP Address
echo "Deleting old IP Address" && sleep 1; IPADDROBJ=`ipadm show-addr | sed -n '/^ipmp*/p' | awk '{print $1}'` ipadm delete-addr "$IPADDROBJ"

# Assigning NEW IP Address
echo "Assigning New IP Address" && sleep 1; ipadm create-addr -T static -a "$IP_ADDRESS" ipmp0

Update IP Address in SMF:
svccfg -s identity:node setprop private_data/mapped_addresses=192.168.10.41
svcadm refresh identity:node
svcadm restart identity:node

**don't forget to copy over /var/opt/oracle

**don't forget NFS entries
SOL-MG-P01:/repository - /repository nfs - yes rw,soft 192.168.10.16:/backup - /BACKUP nfs - yes

hard,rw,rsize=32768,wsize=32768,suid,proto=tcp,vers=3

** don't forget to update /etc/hosts,  add #repo entry as well # Repo
192.168.10.11   SOL-MG-P01.expanor.dev    SOL-MG-P01




root@my_ldm_v04:/data#  svcs -a | grep rad
disabled       20:11:26 svc:/system/device/mpxio-upgrade:default
disabled       20:11:29 svc:/network/inetd-upgrade:default
disabled       20:11:29 svc:/system/device/policy-upgrade:default
disabled       20:11:36 svc:/system/rad:remote
online         20:11:30 svc:/network/connectx/unified-driver-post-upgrade:default
online         20:11:31 svc:/system/name-service/upgrade:default
online         20:11:36 svc:/network/eoib/eoib-post-upgrade:default
online         20:11:44 svc:/system/logadm-upgrade:default
online         20:11:45 svc:/system/rad:local
online         20:11:45 svc:/system/rad:local-http
online         20:11:46 svc:/network/physical:upgrade
online         20:11:46 svc:/network/location:upgrade
root@my_ldm_v04:/data# svcadm disable svc:/system/rad:local
root@my_ldm_v04:/data# svcadm disable svc:/system/rad:local-http
root@my_ldm_v04:/data#


root@my_ldm_v04:~#  svcs -a | grep -i rad
disabled       Jun_19   svc:/system/device/mpxio-upgrade:default
disabled       Jun_19   svc:/network/inetd-upgrade:default
disabled       Jun_19   svc:/system/device/policy-upgrade:default
disabled       Jun_19   svc:/system/rad:remote
online         Jun_19   svc:/network/connectx/unified-driver-post-upgrade:default
online         Jun_19   svc:/system/name-service/upgrade:default
online         Jun_19   svc:/network/eoib/eoib-post-upgrade:default
online         Jun_19   svc:/system/rad:local-http
online         Jun_19   svc:/system/rad:local
online         Jun_19   svc:/system/logadm-upgrade:default
online         Jun_19   svc:/network/physical:upgrade
online         Jun_19   svc:/network/location:upgrade
root@my_ldm_v04:~#



#  passwd root
#  passwd sam
#  chmod 700 /export/home/*
#  for i in `ls /export/home/*/.bash_history`; do ls -l $i; done
#  for i in `ls /export/home/*/.bash_history`; do cat /dev/null > $i; done
#  for i in `ls /export/home/*/.bash_history`; do ls -l $i; done
#  for i in `ls /export/home/*/.profile /export/home/*/.bash_profile`; do echo "export HISTCONTROL=ignorespace" >> $i; done
#  for i in `ls /export/home/*/.profile /export/home/*/.bash_profile`; do grep HISTCONTROL $i; done
#  ls -ld /export/home/*
#  svcs -a | grep -i mile
#  uname -a

Sunday, June 11, 2017

Solaris 10 - Installing OS on Sun SPARC T5120 server

Login to console on SUN t5120

1. Login to console
$ ssh <IP Addr>

2. Power on the system
-> start /SYS

3. Start the console
-> start /SP/console

{0} ok

4. To exit off the console type #.

5. To login to console
-> start /SP/console

6. Once you are on OK prompt, insert the OS CD and boot the system to Install the operating system
{0} ok boot cdrom


Select following options at the prompt
7. Language selection:
Please make a choice (0 - 10), or press h or ? for help: 0
0 for english

8. What type of terminal are you using?  [ we will be using 6) PC Console ]

Type the number of your choice and press Return: 6


9. Press f2 to continue [ Esc-2_Continue ]

10. On Identify This System  windows, press Esc-2_continue

11. on ' Network Connectivity' select the box next to Networked [x]

12. on  Configure Multiple Network Interfaces, select the first instance of the interface since we plug the network cable on that port
Note: to select, go to partucular port and press space bar to select.

13. on DHCP for e1000g0 screen, Use DHCP for e1000g0, select No option

specify the ip address on next screen.

14. on  Subnet for e1000g0 screen, select yes and continue

15. on Netmask for e1000g0  screen, specify your subnet: 255.255.255.0

on IPv6, just select no and continue

16.  on Set the Default Route for e1000g0 screen, just select [X] Detect one upon reboot or you can specify one. for our case 192.168.10.1

17, on ' Confirm Information for e1000g0 ' screen, verify the information and make sure they are correct

18. Esc+2 to continue

19. on ' Configure Security Policy' windows, just select No and ocntinue

20. on  Confirm Information screen, verify the info and continue

21. on ' Name Service' screen, select the one, based on your environment. In our case, we are not using any name service so we will select None. and continue

22. Confirm the info and continue.

23. on  NFSv4 Domain Name - select Use the NFSv4 domain derived by the system and continue

24. On ' Time Zone ' windows, specify the time zone.
    - in our case, select second box, press Esc+2 to continue
    - select the first option: United States and continue
    - Select first option Eastern time and continue
    - next screen on 'Date and Time' windows, just press Esc+2 to continue
    - Next page on 'Confirm Information' page, you verify the info. if you find wrong info, press Esc+4 to change.

25. On ' Root Password' window, specify your root password. and continue by pressing Esc +2

26. on 'Enabling remote services' windows, select no, and continue

27. on 'Provide Oracle Configuration Manager Registration Information' windows, press Esc+2 to continue.

28. Press Esc+2 to continue again.

until now, System identification is completed.

Installation process beginds now.

29. On 'Solaris Interactive Installation' windows, press F2_Standard for standrd installation, and F4_Flash for flash archive installation (from Gold Image). We will select standard installation

30. on 'iSCSI Installation' window, select  Install on non-iSCSI target




^^^^^^^^^^^^^^^^^^^^^^^^^




The output of console while login through serial console.

eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
Listening on LPF/eth0/00:21:28:24:41:ed
Sending on   LPF/eth0/00:21:28:24:41:ed
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
eth0: status: link up.
eth0: status: link up, 100 Mbps Full Duplex, auto-negotiation complete.
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.10.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.10.1
bound to 192.168.10.36 -- renewal in 43004 seconds.
done.





Friday, June 9, 2017

Solaris 10 - changing role to user - login issue




sudo_solaris_install_user_cant sudo_after changing to normal user



remove the user id from file

root@sol-11-goldsrv:/etc/sudoers.d# pwd
/etc/sudoers.d
root@sol-11-goldsrv:/etc/sudoers.d# ls -l
total 1
-r--r-----   1 root     root           0 Dec  6 11:16 svc-system-config-user
root@sol-11-goldsrv:/etc/sudoers.d#


Solaris 10 - Rename hostname of LDOM

Solaris 10 - Rename hostname of LDOM

Solaris 10 - Steps to create LDOM

Steps to create LDOM

1. Create Domain

# ldm add-domain spup-lx-v01
# ldm add-vcpu 16 spup-lx-v01
# ldm add-mem 8g spup-lx-v01
# ldm list


Note: Record /etc/resolv.conf, /etc/netmasks, /etc/inet/ntp.conf file entry from same server environment.
You will need this info to set up this VM.

2. List some ldom related info
# ldm list
# ldm list-services
# ldm list-bindings
# ldm list-bindings spup-lx-v01

3. Add vnet to LDOM
# ldm add-vnet vnet0 primary-vsw2 spup-lx-v01
# ldm add-vnet vnet1 primary-vsw3 spup-lx-v01

We are configuring multi-pathing
# ldm set-vnet linkprop=phys-state vnet0 spup-lx-v01
# ldm set-vnet linkprop=phys-state vnet1 spup-lx-v01

4. Add Disk

# ldm list
# echo | format | grep -i <LUN>

# ldm add-vdsdev /dev/dsk/c0t6000D310006D6400000000000000023Cd0s2 DL30@primary-vds0
# ldm add-vdisk VDL30 DL30@primary-vds0 spup-lx-v01

Set boot device variables
# ldm set-var boot-device=vdl30 spup-lx-v01
# ldm set-variable auto-boot\?=false spup-lx-v01

# ldm list-bindings spup-lx-v01

5. Bind and start the LDOM

# ldm bind spup-lx-v01
# ldm list spup-lx-v01
# ldm start spup-lx-v01
# ldm list spup-lx-v01

6. Login to console
# telnet 0 5008

{0} ok boot -s

7. Once you login, perform the following tasks.

a. Remove /etc/path_to_inst (rebuilding device tree).
# mv /etc/path_to_inst /var/tmp/222._etc_path_to_inst
# rm /etc/path_to_inst*

b. Network and hostname configuration
Add hosts entry with correct IP/HOST
# vi /etc/hosts
192.168.10.60   spup-lx-v01.sces.dev    spup-lx-v01     loghost

# vi /etc/netmasks

192.168.1128  255.255.255.128
192.168.10.0    255.255.255.128


# cat >/etc/hostname.vnet0
spup-lx-v01 netmask + broadcast + group ipmp up

# cat >/etc/hostname.vnet1
group ipmp up

# ifconfig vnet1 up

dns client set up
# vi /etc/resolv.conf

domain  sces.dev
search  sces.dev
nameserver  192.168.10.24
nameserver  192.168.10.29

- Set up default router
# cat /etc/defaultrouter
192.168.1129

# cat >/etc/nodename
spup-lx-v01

# cat /etc/nodename

# hostname

# vi /etc/inet/ntp.conf
server 192.168.10.24

# ls -l /var/ntp/ntp.drift

# more /etc/hosts.allow
rpcbind: 192.168.10. 192.168.1. 192.168.5.
sshd: ALL
sendmail: localhost 127.0.0.1

# more /etc/nsswitch.conf

# ls -ltr /etc | grep path_to

# reboot -- -r


spup-lx-v01 console login:


# more /etc/resolv.conf
domain sces.dev
nameserver 192.168.10.24
nameserver 192.168.10.29


#  cat /etc/netmasks
192.168.10.0    255.255.255.128

# cat /etc/inet/ntp.conf

server 192.168.10.14

# ldm list-spconfig
# ldm add-spconfig cfg07012015


Record /etc/resolv.conf, /etc/netmasks, /etc/inet/ntp.conf file entry


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  474  ldm list
  475  ldm list-devices vcpu | wc -l
  476  ldm list-devices vcpu | grep 100 | wc -l
  477  ldm list-devices memory
  478  ldm list
  479  ldm add-domain serp-db-v06_sol11
  480  ldm list
  481  ldm add-vcpu 8 serp-db-v06_sol11
  482  ldm list
  483  ldm add-memory 2G serp-db-v06_sol11
  484  ldm list
  485  ldm list
  486  ldm list-bindings serp-db-v06_sol11
  487  ldm list-bindings serp-db-v06
  488  ldm list
  489  df -k
  490  exit
  491  echo | format | grep 0351
  492  ldm list-services | grep -i 0351
  493  ldm list
  494  ldm help | more
  495  ldm-- help | more
  496  ldm --help | more
  497  ldm list-devices -o cpu | more
  498  ldm list-devices -a cpu | more
  499   ldm --help | more
  500  man mpathadm
  501  history >/var/tmp/cmd-list
  502  clear
  503  history #

Thursday, June 8, 2017

Redhat 7 - Puppet installation

Client installation

1. Update hosts file with puppet server if DNS is not working
# vi /etc/hosts
214.38.138.239  spup-lx-v02     spup-lx-v02.expanor.local

wq
# ping spup-lx-v02.expanor.local

2. Update PATH variable
# vi /root/.profile
PATH=/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:$PATH:/opt/puppetlabs/puppet/bin
export PATH

wq!

# . /root/.profile

3. Use curn to download and install the agent package

# curl
-bash: curl: command not found

# ls -l /usr/ucb/curl
/usr/ucb/curl: No such file or directory

# cd /usr/local/bin/curl
-rwxr-xr-x   1 root     root      171528 Jan  6  2014 curl



# ./curl -k https://214.38.138.239:8140/packages/current/install.bash | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) Unknown SSL protocol error in connection to 214.38.138.239:8140
# telnet 214.38.138.239:8140
214.38.138.239:8140: node name or service name not known


Verify you can connect to port 8140
# telnet 214.38.138.239 8140
Trying 214.38.138.239...
Connected to 214.38.138.239.
Escape character is '^]'.
^]
telnet> q
Connection to 214.38.138.239 closed.

4. Downloading from puppet server failed. Now, download the puppet client from puppet.com and upload to each client. Extract the file and install.

# gunzip puppet-agent-1.10.1-1.sparc.pkg.gz


# pkgadd -d  puppet-agent-1.10.1-1.sparc.pkg

The following packages are available:
  1  puppet-agent     puppet-agent - https://www.puppetlabs.com
                      (sparc) 1.10.1-1

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance <puppet-agent> from </var/tmp/puppet-agent-1.10.1-1.sparc.pkg>

Installation of <puppet-agent> was successful.


# puppet agent --test --server spup-lx-v02.expanor.local
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for sinf-mw-v20.sces.dsca.mil
Info: Applying configuration version '1496760334'
Notice: Applied catalog in 1.49 seconds
#


# svcs -a | grep pup
disabled       10:41:06 svc:/network/puppet:default
# svcadm enable svc:/network/puppet:default
# svcs -a | grep pup
online         11:30:47 svc:/network/puppet:default
#






error / troubleshooting


Received error : - Exiting; no certificate found and waitforcert is disabled

# puppet agent --test --server spup-lx-v02.expanor.local
Exiting; no certificate found and waitforcert is disabled

# telnet spup-lx-v02.expanor.local 8140
Trying 214.38.138.239...
Connected to spup-lx-v02.
Escape character is '^]'.
^]
telnet> q
Connection to spup-lx-v02 closed.


When puppet client try to make a connection to pupper server first time, it generate a certificate and pass it to puppet server to sign in. The certificate need to signed manually at the server side.


To resolve this issue,
Go to puppet master server and perform the following command to list all certificates that are waiting for sign.

# puppet cert --list | more
  "sidm-mw-v18.expanor.local" (SHA256) 7D:0D:3A:0E:B7:14:9E:72:E5:6D:75:10:70:C1:1E:5A:CD:03:B2:5C:55:88:E8:86:2D:43:AE:C3:C6:E3:EA:B0

Now, we can see the certificate from client waiting for signing.
Run the following command below to sign the certificate.

[root@spup-lx-v02 ~]# puppet cert sign sidm-mw-v18.expanor.local
Signing Certificate Request for:
  "sidm-mw-v18.expanor.local" (SHA256) 7D:0D:3A:0E:B7:14:9E:72:E5:6D:75:10:70:C1:1E:5A:CD:03:B2:5C:55:88:E8:86:2D:43:AE:C3:C6:E3:EA:B0
Notice: Signed certificate request for sidm-mw-v18.expanor.local
Notice: Removing file Puppet::SSL::CertificateRequest sidm-mw-v18.expanor.local at '/etc/puppetlabs/puppet/ssl/ca/requests/sidm-mw-v18.expanor.local.pem'
[root@spup-lx-v02 ~]#


if you want to sign all certificates, run the command below,
# puppet cert sign --all




 you get this error.



Any Puppet agent connecting to a Puppet master server for a first time will generate a certificate and give it to a Puppet master server to sign. Depending on your puppet configuration, a default behavior is that the certificate must by signed manually and thus puppet agent exits with an error:


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Puppet Implementation


Prerequisites
- Root Access
- Server with 2 cores, 6 GB RAM
- 20 GB of free space available under /opt
- Ensure port 3000 is open.

Puppet Enterprise Installation

1. Download Tar ball version ending in  -el-<version arch>.tar.gz.
2. Run the following command to unpack the tarball:
   # tar –xzf <tarball>
3. To set up the installer, Run
   # sudo ./puppet-enterprise-installer
4. When prompted, choose the “Guilded” installation option.
5. The PE installer will start a web server at
   https://<hostname>:3000
6. Log onto PE Console and create password for admin user and fill the remaining info and continue.


Puppet Agent Installation

1. In the console, click Nodes > Classification.  On the Classes tab, select the class that matches your client.
2. Click Add Class and commit changes.
3. From the command line on Puppet Master, run puppet agent –t.
4. SSH into your agent node and run:
   # Curl –k https://<master_server>:8140/packages/current/install.bash | sudo bash
5. The installer installs and configures the Puppet Enterprise Agent.
6. After installation is complete, approve the certificate request from the Request Console from the puppet server.





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Enterprise Puppet Master is only supported on a Linux based Platform.  Redhat Enterprise Linux is selected because it’s DOD Common Criteria (CC) certified.  Puppet will be used for system baseline and configuration management.

For Puppet Enterprise Server to communicate with clients on TEST & DEV Enclaves, the following firewall changes needs to be implemented:

Source:  TEST  214.38.139.128/25
                DEV   10.222.102.0/25

Target:  spup-lx-v02.expanor.local (214.38.138.239)
Ports:
   8140 --  Puppet Master Inbound Port
   61613 – Mcollective Port
   4433 – Classifier/Console Services API Port
   8081 – PuppetDB Port
   8142 – Orchestrator Port
   8143 – Orchestrator/PCP Broker Port


Puppet will be used to deploy system security baseline and configuration managements.


RedHat Enterprise Linux 7.0 (Puppet Master)
Solaris 10/11  (Puppet Agents Only)



Detailed Description Of Proposed Change
1.  Build a VM running Redhat Enterprise Linux 7.x
2.  Install Enterprise Puppet on Redhat VM.
3.  Deploy Puppet Agents to Solaris systems.
4.  Test communication and deployment pushes between Puppet Master & Client Agents.



Test Documentation

Create a sample Class for NTP under /opt/puppet/classes/ntp.mod

class { '::ntp':
  servers   => ['dev-ad1.sces.dev', 'dev-ad2.sces.dev'],
  restrict  => [
    'default ignore',
    '-6 default ignore',
    '127.0.0.1',
    '-6 ::1',
    'ntp1.corp.com nomodify notrap nopeer noquery',
    'ntp2.corp.com nomodify notrap nopeer noquery'
  ],
}

To test if sample ntp file gets push, Run:
Sudo puppet apply --test


Verify sample test modules created from PE Consoles gets successfully pushed out to Puppet Clients.



Back-out Plan

1. Shutdown Puppet services from Master server.
2. Disabled Puppet Agents on clients.





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Installation error log

Transaction test succeeded
Running transaction
^Z
[1]+  Stopped                 ./puppet-enterprise-installer
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# jobs
[1]+  Stopped                 ./puppet-enterprise-installer
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# bg
[1]+ ./puppet-enterprise-installer &
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# jobs
[1]+  Running                 ./puppet-enterprise-installer &
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]#
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# jobs
[1]+  Running                 ./puppet-enterprise-installer &
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# jobs
[1]+  Running                 ./puppet-enterprise-installer &
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# fg
./puppet-enterprise-installer
  Installing : puppet-agent-1.10.1-1.el7.x86_64                             1/3
Using username "kbhusal".
You are accessing a U.S. Government (USG) Information System (IS) that is
provided for USG-authorized use only. By using this IS (




 The other application is: yum
    Memory :  85 M RSS (429 MB VSZ)
    Started: Mon Jun  5 19:22:06 2017 - 1:02:21 ago
    State  : Uninterruptible, pid: 9221
Cleaning repos: puppet_enterprise
Cleaning up everything
grep: : No such file or directory
2017-06-05 20:24:29,974 Running command: yum install -y puppet-agent-1.10.1 pe-installer pe-modules
BDB2053 Freeing read locks for locker 0x12a: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x12c: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x13b: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x13d: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x13e: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x13f: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x140: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x141: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x142: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x143: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x144: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x145: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x146: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x147: 9221/140345866499904
BDB2053 Freeing read locks for locker 0x148: 9221/140345866499904
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package puppet-agent-1.10.1-1.el7.x86_64 already installed and latest version
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only"                                                        and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package                                                       -cleanup can help).
--> Running transaction check
---> Package pe-installer.x86_64 0:2017.2.0.rc0.20.g20fe238-1.el7 will be installed
---> Package pe-modules.x86_64 0:2017.2.0.rc0.68.g48b0405-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package       Arch    Version                         Repository          Size
================================================================================
Installing:
 pe-installer  x86_64  2017.2.0.rc0.20.g20fe238-1.el7  puppet_enterprise  7.4 M
 pe-modules    x86_64  2017.2.0.rc0.68.g48b0405-1.el7  puppet_enterprise  1.6 M

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 8.9 M
Installed size: 31 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              177 MB/s | 8.9 MB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.


  Installing : pe-modules-2017.2.0.rc0.68.g48b0405-1.el7.x86_64             1/2


Installed:
  pe-installer.x86_64 0:2017.2.0.rc0.20.g20fe238-1.el7
  pe-modules.x86_64 0:2017.2.0.rc0.68.g48b0405-1.el7

Complete!

## We're preparing the Web Installer...

2017-06-05 21:04:06,314 Running command: mkdir -p /opt/puppetlabs/puppet/share/installer/installer
2017-06-05 21:04:06,329 Running command: cp -pR /opt/puppet-enterprise-2017.2.1-el-7-x86_64/* /opt/puppetlabs/puppet/share/installer/installer

## Go to https://spup-lx-v02.expanor.local:3000 in your browser to continue installation.


## Be sure to use 'https://' and that port 3000 is reachable through the firewall.

2017-06-05 21:04:09,293 Running command: RACK_ENV=production /opt/puppetlabs/puppet/share/installer/vendor/bundler/bin/thin start --debug -p 3

----------------------------------


[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# yum history
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     8 | Kamal Bhusal <kbhusal>   | 2017-06-05 20:24 | Install        |    2
     7 | Kamal Bhusal <kbhusal>   | 2017-06-05 19:22 | Install        |    3 **
     6 | Kamal Bhusal <kbhusal>   | 2017-06-05 17:58 | Install        |    3 **
     5 | Jay Kancho <jkancho>    | 2017-05-31 11:05 | I, U           |  163 EE
     4 | Kamal Bhusal <kbhusal>   | 2017-05-30 10:39 | Install        |    1  <
     3 | Kamal Bhusal <kbhusal>   | 2017-04-20 11:06 | Install        |    1 >
     2 | Kamal Bhusal <kbhusal>   | 2017-04-20 09:48 | Install        |    1
     1 | System <unset>           | 2017-04-19 11:43 | Install        | 1286
history list
[root@spup-lx-v02 puppet-enterprise-2017.2.1-el-7-x86_64]# yum history redo last



Solaris - SPARC T7 Console login

SPARC T7 Console login
1. Plug  the power cords from the AC power source to the rear of the server.

2. Connect a device to the SER MGT port.

3. Connect a terminal or a terminal emulator (PC or workstation) to the server SER MGT port.

4. Configure a terminal or terminal emulator with these settings:

9600 baud
8 bits
No parity
1 Stop bit
No handshake

Note:  null modem configuration is needed, meaning the transmit and receive signals are reversed
(crossed over) for DTE to DTE communications. You can use the supplied RJ-45 crossover
adapters with a standard RJ-45 cable to achieve the null modem configuration.


5. Connect an Ethernet cable between the server's NET MGT port and
the network to which future connections to the SP and host will be made.

6. Connect an Ethernet cable between one of the server's NET ports and the
network to which the server will communicate.

7. Power on the System for the First Time

8. At the terminal device, log in to the SP.

login: root
Password: changeme

->


ILO default user name and password:-  root/changeme
[ -> is ILOM prompt ]

9. Power on the server using the command below
-> start /SYSTEM

If you want to stop the power on process, type #. (hash+DOT keys) and at the ILO prompt type
-> stop /SYS

10. To redirect host output to display on serial terminal device type
-> start /HOST/console



Some parameter change

From ILOM, set the OpenBoot auto-boot? parameter to false.
-> set /HOST/bootmode script="setenv auto-boot? false"

to reset the system from the ILO prompt
-> reset /SYS
-> start /HOST/console

At ok prompt
{0} ok help boot


Assign a Static IP Address to the NET MGT Port

1. Connect to the ILOM on the SP using the SER MGT port.
-> set /SP/network pendingipdiscovery=static
-> set /SP/network pendingipaddress=service-processor-IPaddr
-> set /SP/network pendingipgateway=gateway-IPaddr
-> set /SP/network pendingipnetmask=255.255.255.0

Verify the parameters if set correctly.
-> show /SP/network -display properties

save the change
-> set /SP/network commitpending=true





^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SPARC M7 server console login info

Log In to the Active SP

While both terminals display ILOM login prompts, the terminal connected to the Active SP displays system

status messages while the ILOM firmware initializes.

login: root
Password: changeme


Confirm that you are connected to the Active SP.
-> show /SP/redundancy status

status = Active
If the command displays status = Standby, you are logged in to the Standby SP.


Sunday, June 4, 2017

Solaris 10 - autofs set up


autofs


On nfs server perform the following tasks

1. Add entry to dfshare
# vi /etc/dfs/dfstab
share -F nfs /data/mydb/test/myshare

2. Share your directory
# shareall

3. Verify your share
# share
-               /data/mydb/test/myshare   rw   ""

4. List the directories under the share
# ls -R /data/mydb/test/myshare
/data/mydb/test/myshare:
test

/data/mydb/test/myshare/test:
best

/data/mydb/test/myshare/test/best:
bishal

/data/mydb/test/myshare/test/best/bishal:


Now, go to your client system

1. Add entry to auto_master file for direct map
# vi /etc/auto_master
/-      auto_data       -browse

2. Add entry for direct map on auto_data file
# vi /etc/auto_data
/dbdata/OS_Image1       192.168.10.21:/data/mydb/test/myshare

3. Run automunt command to update the share to be managed by automount
# automount -v

4. Restart autofs
# svcs -a | grep autofs
online         10:20:06 svc:/system/filesystem/autofs:default
# svcadm restart autofs

# cd /dbdata/
# ls
OS_Image1
# cd OS_Image1/
# ls
test
# cd test/
# ls
best
# cd best/bishal/


ls -R /dbdata/OS_Image1
/dbdata/OS_Image1:
test

/dbdata/OS_Image1/test:
best

/dbdata/OS_Image1/test/best:
bishal

/dbdata/OS_Image1/test/best/bishal:


# df -h .
Filesystem             size   used  avail capacity  Mounted on
192.168.10.21:/data/mydb/test/myshare     872M   453M   419M    52%    /dbdata/OS_Image1

Solaris 10 - working with nfs server and client

Nfs share

1. Create the directory you want to share
# mkdir /data/mydb/test/myshare

2. Share your directory
# share -F nfs /data/mydb/test/myshare
# share
-               /data/mydb/test/myshare   rw   ""


Now, go to the client and mount


On client system
1. Check if your system has access to the share

# showmount -e 192.168.10.21
export list for 192.168.10.21:
/data/mydb/test/myshare (everyone)

2. Mount the share
# mount 192.168.10.21:/data/mydb/test/myshare /mnt

3. Verify the share
# df -h /mnt
Filesystem             size   used  avail capacity  Mounted on
192.168.10.21:/data/mydb/test/myshare  872M   453M   419M    52%    /mnt
#


Now on your server, check what/which clients are using your share.
# cat /etc/rmtab
# cat /etc/rm
rmmount.conf  rmt           rmtab
# cat /etc/rmtab
# cat /etc/rmtab
# cat /etc/rmtab
# vi /etc/dfs/dfstab
"/etc/dfs/dfstab" 12 lines, 397 characters

#       Place share(1M) commands here for automatic execution
#       on entering init state 3.
#
#       Issue the command 'svcadm enable network/nfs/server' to
#       run the NFS daemon processes and the share commands, after adding
"/etc/dfs/dfstab" 12 lines, 397 characters
#       .e.g,
#       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2
share -F nfs /data/mydb/test/myshare
~
~
~
"/etc/dfs/dfstab" 12 lines, 433 characters
# share
-               /data/mydb/test/myshare   rw   ""
# shareall
# share
-               /data/mydb/test/myshare   rw   ""
#

Solaris 10 - Adding swap device ufs partition, zfs volume and ufs file as swap device

A. Adding UFS partition as a Swap device

1. Create partitions

# format c1t0d0

# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344

2. Add partition as a swap device

# swap -a /dev/dsk/c1t0d0s1
# swap -a /dev/dsk/c1t0d0s3
# swap -a /dev/dsk/c1t0d0s4
# swap -a /dev/dsk/c1t0d0s5

3. List swap device
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/dsk/c1t0d0s1   33,65      8 409592 409592
/dev/dsk/c1t0d0s3   33,67      8 409592 409592
/dev/dsk/c1t0d0s4   33,68      8 204792 204792
/dev/dsk/c1t0d0s5   33,69      8 204792 204792

4. Remove swap device
# for i in /dev/dsk/c1t0d0s1 /dev/dsk/c1t0d0s3 /dev/dsk/c1t0d0s4 /dev/dsk/c1t0d0s5
> do
> swap -d $i
> done
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344


B. Adding zfs volume as a swap volume


Create zfs mirror and create swap device using zfs filesystem

1. Remove the sub mirror from the pool
# zpool detach datapool c1t2d0
# zpool status datapool
  pool: datapool
 state: ONLINE
 scan: resilvered 454M in 0h0m with 0 errors on Sun Jun  4 09:00:42 2017
config:

        NAME        STATE     READ WRITE CKSUM
        datapool    ONLINE       0     0     0
          c1t0d0    ONLINE       0     0     0

errors: No known data errors

2. Mirror the disk
# zpool help attach
usage:
        attach [-f] <pool> <device> <new-device>
#  zpool attach datapool c1t0d0 c1t2d0


3. Create a swap volume
# zfs help
The following commands are supported:
allow       clone       create      destroy     diff        get
groupspace  help        hold        holds       inherit     list
mount       promote     receive     release     rename      rollback
send        set         share       snapshot    unallow     unmount
unshare     upgrade     userspace
For more info, run: zfs help <command>
# zfs help create
usage:
        create [-p] [-o property=value] ... <filesystem>
        create [-ps] [-b blocksize] [-o property=value] ... -V <size> <volume>
# zfs create -V 100m datapool/myswap

4. Locate your swap volume
# ls -l /dev/zvol/dsk/datapool/myswap
lrwxrwxrwx   1 root     root          35 Jun  4 09:09 /dev/zvol/dsk/datapool/myswap -> ../../../../devices/pseudo/zfs@0:1c
# zfs list
NAME                      USED  AVAIL  REFER  MOUNTPOINT
datapool                  557M   419M    32K  none
datapool/mydb             454M   419M   453M  /data/mydb
datapool/mydb/test         31K   419M    31K  /data/mydb/test
datapool/myswap           103M   522M    16K  -
mypool                    142K  1.95G    31K  none
mypool/opt_os              31K  1.95G    31K  /opt/os
yourpool                  189K  19.6G    31K  none
yourpool/FS_opt-OS_Image   31K  19.6G    31K  /opt/OS_Image
yourpool/fs-opt-os         31K  19.6G    31K  /opt/os


5. Add swap
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
# swap -s
total: 273784k bytes allocated + 91588k reserved = 365372k used, 1264948k available
# swap -a /dev/zvol/dsk/datapool/myswap
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/zvol/dsk/datapool/myswap 181,1       8 204792 204792
# swap -s
total: 273868k bytes allocated + 91572k reserved = 365440k used, 1366508k available
#

c. Adding file as a swap device

1. Create 100 MB of swap device
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/zvol/dsk/datapool/myswap 181,1       8 204792 204792

# mkfile 100m /data/mydb/myswap

2. List current swap devices that are on use
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/zvol/dsk/datapool/myswap 181,1       8 204792 204792

# swap -s
total: 273868k bytes allocated + 91572k reserved = 365440k used, 1267308k available

3. Add swap file as swap device
# swap -a /data/mydb/myswap
"/data/mydb/myswap" may contain holes - can't swap on it.

Since this is zfs filesystem, you can create number of swap volume.


lets try ufs filesystem

1. Create 100MB of file
# df -h /
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d1s0        8.1G   4.0G   4.0G    51%    /

# mkfile 100m /myswapfile

2. List currently used swap devices
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/zvol/dsk/datapool/myswap 181,1       8 204792 204792
# swap -s
total: 273868k bytes allocated + 91572k reserved = 365440k used, 1263380k available

3. Add swap device
# swap -a /myswapfile
# swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,1       8 1076344 1076344
/dev/zvol/dsk/datapool/myswap 181,1       8 204792 204792
/myswapfile           -        8 204792 204792
# swap -s
total: 273868k bytes allocated + 91572k reserved = 365440k used, 1365776k available
#