Showing posts with label Solaris10. Show all posts
Showing posts with label Solaris10. Show all posts

Thursday, March 4, 2010

Booting the Failsafe Archive on a SPARC Based System

Booting the Failsafe Archive on a SPARC Based SystemBooting a system from a root (/) file system image that is a boot archive, and then remounting this file system on the actual root device can sometimes result in a boot archive and root file system that do not match, or are inconsistent. Under these conditions, the proper operation and integrity of the system is compromised. After the root (/) file system is mounted, and before relinquishing the in-memory file system, the system performs a consistency verification against the two files systems. If an inconsistency is detected, the normal boot sequence is suspended and the system reverts to failsafe mode.
Also, if a system failure, a power failure, or a kernel panic occurs immediately following a kernel file update, the boot archives and the root (/) file system might not be synchronized. Although the system might still boot with the inconsistent boot archives, it is recommended that you boot the failsafe archive to update the boot archives. You can also use the bootadm command to manually update the boot archives. For more information, see Using the bootadm Command to Manage the Boot Archives.
The failsafe archive can be booted for recovery purposes or to update the boot archive on both the SPARC and x86 platforms.
On the SPARC platform the failsafe archive is:
/platform/`uname -m`/failsafe
You would boot the failsafe archive by using the following syntax:

ok boot -F failsafe


Failsafe booting is also supported on systems that are booted from ZFS. When booting from a ZFS-rooted BE, each BE has its own failsafe archive. The failsafe archive is located where the root (/) file system is located, as is the case with a UFS-rooted BE. The default failsafe archive is the archive that is in the default bootable file system. The default bootable file system (dataset) is indicated by the value of the pool's bootfs property.

For information about booting an x86 based failsafe archive, see Booting the Failsafe Archive on an x86 Based System.

Another method that can be used to update the boot archives is to clear the boot-archive service. However, the preferred methods for updating the boot archives are to boot the failsafe archive or use the bootadm command. For more information, see How to Update an Inconsistent Boot Archive by Clearing the boot-archive Service.

How to Boot the Failsafe Archive on a SPARC Based SystemUse this procedure to boot the failsafe archive on a SPARC based system. If the system does not boot after the boot archive is updated, you might need to boot the system in single-user mode. For more information, see SPARC: How to Boot a System to Run Level S (Single-User Level).

--------------------------------------------------------------------------------
Note – This procedures also includes instructions for booting the failsafe archive for a specific ZFS dataset.
--------------------------------------------------------------------------------

Become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Bring the system to the ok prompt:

# init 0

Boot the failsafe archive.
To boot the default failsafe archive, type:

ok boot -F failsafe

To boot the failsafe archive of a specific ZFS dataset:

ok boot -F failsafe -Z dataset

For example:

ok boot -F failsafe -Z rpool/ROOT/zfsBE2
--------------------------------------------------------------------------------
Note – To determine the name of the dataset to boot, first use the boot -L command to display a list of the available BEs on the system. For more information, see SPARC: How to List Available Bootable Datasets Within a ZFS Root Pool.
--------------------------------------------------------------------------------
If an inconsistent boot archive is detected a message is displayed.
To update the boot archive, type y and press Return.

An out of sync boot archive was detected on rpool.The boot archive is a cache of files used during bootand should be kept in sync to ensure proper system operation.
Do you wish to automatically update this boot archive? [y,n,?] y
If the archive was updated successfully, a message is displayed:

The boot archive on rpool was updated successfully.
--------------------------------------------------------------------------------
Example 12–7 SPARC: Booting the Failsafe Archive
This example shows how to boot the failsafe archive on a SPARC based system. If no device is specified, the failsafe archive for the default boot device is booted.

ok boot -F failsafeResetting ...screen not found.Can't open input device. Keyboard not present. Using ttya for input and output.
Sun Enterprise 220R (2 X UltraSPARC-II 450MHz), No KeyboardOpenBoot 3.23, 1024 MB memory installed, Serial #13116682.Ethernet address 8:0:20:c8:25:a, Host ID: 80c8250a.
Rebooting with command: boot -F failsafeBoot device: /pci@1f,4000/scsi@3/disk@1,0:a File and args: -F failsafeSunOS Release 5.10tCopyright 1983-2007 Sun Microsystems, Inc. All rights reserved.Use is subject to license terms.Configuring /dev Searching for installed OS instances...
An out of sync boot archive was detected on /dev/dsk/c0t1d0s0.The boot archive is a cache of files used during boot andshould be kept in syncto ensure proper system operation.
Do you wish to automatically update this boot archive? [y,n,?] y Updating boot archive on /dev/dsk/c0t1d0s0.The boot archive on /dev/dsk/c0t1d0s0 was updated successfully.
Solaris 5.10 was found on /dev/dsk/c0t1d0s0.Do you wish to have it mounted read-write on /a? [y,n,?] nStarting shell.#
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Example 12–8 SPARC: Booting the Failsafe Archive for a Specified ZFS Dataset
This example shows how to boot the failsafe archive of a ZFS dataset. Note that the boot -L command is first used to display a list of available boot environments. This command must be run at the ok prompt.

ok boot -LRebooting with command: boot -L Boot device: /pci@1f,4000/scsi@3/disk@1,0 File and args: -L1 zfsBE2Select environment to boot: [ 1 - 1 ]: 1
To boot the selected entry, invoke:boot [] -Z rpool/ROOT/zfsBE2
Program terminated{0} ok


Resetting ...
screen not found.Can't open input device.Keyboard not present. Using ttya for input and output.
Sun Enterprise 220R (2 X UltraSPARC-II 450MHz), No KeyboardOpenBoot 3.23, 1024 MB memory installed, Serial #13116682.Ethernet address 8:0:20:c8:25:a, Host ID: 80c8250a.

{0} ok boot -F failsafe -Z rpool/ROOT/zfsBE2Boot device: /pci@1f,4000/scsi@3/disk@1,0 File and args: -F failsafe -Z rpool/ROOT/zfsBE2SunOS Release 5.10Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.Use is subject to license terms.Configuring /devSearching for installed OS instances...
ROOT/zfsBE2 was found on rpool.Do you wish to have it mounted read-write on /a? [y,n,?] ymounting rpool on /a
Starting shell.# # # # zpool listNAME SIZE USED AVAIL CAP HEALTH ALTROOTrpool 16.8G 6.26G 10.5G 37% ONLINE /a# # zpool status pool: rpool state: ONLINE scrub: none requestedconfig:
NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c0t1d0s0 ONLINE 0 0 0
errors: No known data errors# # df -hFilesystem size used avail capacity Mounted on/ramdisk-root:a 163M 153M 0K 100% //devices 0K 0K 0K 0% /devices/dev 0K 0K 0K 0% /devctfs 0K 0K 0K 0% /system/contractproc 0K 0K 0K 0% /procmnttab 0K 0K 0K 0% /etc/mnttabswap 601M 344K 601M 1% /etc/svc/volatileobjfs 0K 0K 0K 0% /system/objectsharefs 0K 0K 0K 0% /etc/dfs/sharetabswap 602M 1.4M 601M 1% /tmp/tmp/root/etc 602M 1.4M 601M 1% /.tmp_proto/root/etcfd 0K 0K 0K 0% /dev/fdrpool/ROOT/zfsBE2 16G 5.7G 9.8G 37% /arpool/export 16G 20K 9.8G 1% /a/exportrpool/export/home 16G 18K 9.8G 1% /a/export/homerpool

Thursday, January 28, 2010

Solaris 10 - Increasing Number of Processes Per User

The below example is given for increasing the number of processes on Solaris 10 system on PER UID. The hardware used here is UltraSPARC T2 based system with Solaris 10 and 32 GB RAM.
We needed to increase the number of processesper user to more than current setting of 30000

bash-3.00# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
open files (-n) 260000
pipe size (512 bytes, -p) 10
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 29995
virtual memory (kbytes, -v) unlimited

Trying to increase the "max user processes" would fail with the following error:

bash-3.00# ulimit -u 50000
bash: ulimit: max user processes: cannot modify limit: Invalid argument
bash-3.00#

After going through the Solaris 10 Tunable Guide for Process sizing learned that there are 5 related parameters related to process sizing.

maxusers - The maximum number of processes on the system, The number of quota structures held in the system. The size of the directory name look-up cache (DNLC)
reserved_procs - Specifies the number of system process slots to be reserved in the process table for processes with a UID of root
pidmax - Specifies the value of the largest possible process ID. Specifies the value of the largest possible process ID. Valid for Solaris 8 and later releases.
max_nprocs - Specifies the maximum number of processes that can be created on a system. Includes system processes and user processes. Any value specified in /etc/system is used in the computation of maxuprc.
maxuprc - Specifies the maximum number of processes that can be created on a system by any one user

Looked at the current values for these parameter:

bash-3.00# echo reserved_procs/D | mdb -k
reserved_procs:
reserved_procs: 5

bash-3.00# echo pidmax/D| mdb -k
pidmax:
pidmax: 30000

bash-3.00# echo maxusers/D | mdb -k
maxusers:
maxusers: 2048
bash-3.00#

bash-3.00# echo max_nprocs/D | mdb -k
max_nprocs:
max_nprocs: 30000
bash-3.00#

bash-3.00# echo maxuprc/D| mdb -k
maxuprc:
maxuprc: 29995

So, in order to set the max per user processes in this scenario, we were required to make the changes to "pidmax" (upper cap), maxusers, max_nprocs & maxuprc
Sample entries in /etc/system & reboot


set pidmax=60000
set maxusers = 4096
set maxuprc = 50000
set max_nprocs = 50000

After making the above entries, we were able to increase the max user processes to 50000.

bash-3.00# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
open files (-n) 260000
pipe size (512 bytes, -p) 10
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 49995
virtual memory (kbytes, -v) unlimited
bash-3.00#

bash-3.00# echo reserved_procs/D |mdb -k
reserved_procs:
reserved_procs: 5
bash-3.00# echo pidmax/D |mdb -k
pidmax:
pidmax: 60000
bash-3.00# echo max_nprocs/D |mdb -k
max_nprocs:
max_nprocs: 50000
bash-3.00# echo maxuprc/D | mdb -k
maxuprc:
maxuprc: 50000
bash-3.00#

Note: If you are operating within the 30000 limit (default pidmax setting) the blog entry referred above seems to work fine. If you are looking at increasing the processes beyond 30000, it we need to make adjustment to other dependent parameters stated in this blog entry.