• No results found

Technical Bible

N/A
N/A
Protected

Academic year: 2021

Share "Technical Bible"

Copied!
63
0
0

Loading.... (view fulltext now)

Full text

(1)

How to redirect stderr of a command to null device? > /dev/null

What does #!/bin/sh in first line of a shell script do? Tells the kernel to run the script with /bin/sh What‘s wrong with this netmask – 255.255.253.0? 253 is not contiguous. That is it has a hole in it. What type of address is the following: 224.0.0.9 multicast

What signal does kill send by default? SIGTERM, TERM, 15, or -15

How do you discover the current run-level? To discover the current runlevel use ―who –r‖. Which scsi id has the highest priority? Highest 7

Which has the lowest? Lowest 0 on old, narrow scsi, 8 on wide scsi

What is the result of ―init 0‖? init 0‖ will bring the server down from the current runlevel to the eeprom level.

What is the result of ―init 5‖? ―init 5‖ will bring the server down from the current runlevel to eeprom and power-off the hardware. What is fastbooting ? A fastboot is a shutdown/reboot without running the shutdown/startup rc.d scripts.

How to prevent a server from booting automatically? {ok} setenv auto-boot? false What is a LOM? What is the key sequence to switch

between console and LOM?

Lights Out Management console enables the control of a system that is not powered on. The key sequence is ―#.‖ and "~." for RSC.

What is the shutdown command in Solaris? #shutdown –i0 –g5 –y (-g – grace period seconds, -i – init level desired, -y yes) What are the reboot commands in Solaris? #reboot -d (force a crash dump)

#reboot -q (quick and ungraceful - without shutting down running processes first) #reboot --dl -- --rv (Passing the -r and -v arguments to boot)

#reboot "disk1 kernel.test/unix" (reboot using a specific disk and kernel - quotes used for more than one argument)

What is the difference between UltraSparc III and

UltraSparc IV chips? UltraSparc III are single core, UltraSparc IV are dual core (2 CPUs on one module). This is NOT the same as Hyper-Threading or Symmetric Multi-Threading. What byte ordering do SPARC use? big-endian

What is the location of scadm and prtdiag? /usr/plaform/`uname –i`/sbin

What does /etc/hosts.equiv do? Determines which set of hosts will not need to provide passwords when using the "r" remote access commands (eg rlogin, rsh, rexec)

What does /etc/inetd.conf (etc/inet/inetd.conf) do? Identifies the services that are started by inetd as well as the manner in which they are started What does /etc/magic do? Database of magic numbers that identify file types for file.

What does /etc/name_to_major do? List of currently configured major device numbers What does /bin contain? It contains symbolic link to binaries in /usr/bin

What does /dev contain? It contains logical device names which are symb links to device files in /device

What does /kernel and /platform contain? /kernel contains platform-independent kernel modules whereas /platform contains platform-dependent kernel modules

Where are pseudo terminal and serial devices kept? /dev/pts - psuedo terminal devices and /dev/term - serial devices Where are current file descriptors kept? /dev/fd

Where are lock and special files for processes kept? /var/run Where do you configure syslog daemon? /etc/syslog.conf

What is the concept of .bash_logout? elonxapdcsu1-508 # cat .bash_logout # ~/.bash_logout

clear

Whatever commands are mentioned in this file, will be executed when exiting. /etc/system is corrupted, how do you get the sys

back?

#boot –as. Use previous /etc/system or specify /dev/null.

What is shared memory segment? It is used for IPC (interprocess communication). It allows different processes to access same memory segment reducing paging/swaping activity. It needs 2 kernel modules - IPC (/kernel/misc) and shmsys (/kernel/sys). These modules are not loaded automatically at boot time. Edit /etc/system to forceload them.

How do you manage IPC? using ipcs utility to manage IPC resources (message queues, shared memory and semaphores) What are programs and files for sudo? /usr/local/bin/sudo & /usr/local/sbin/visudo, config file is /etc/sudoers

How do you check type of file system? elonsapactd7# fstyp /dev/vx/rdsk/dg01/mqmsw ufs

/etc/path_to_install is corrupted, can‘t boot. Remove the file and boot with –a. It should ask to rebuild the file. It is possible, that you can‘t boot the server even after that. Controller numbers might have got changed. Get the new device ctds numbers and update vfstab.

What is the concept of /dev/console? /etc/default/login

CONSOLE=/dev/console - Root can login only from console #CONSOLE=/dev/console - Root can login from anywhere CONSOLE=/dev/ttya - Root can login only from ttya CONSOLE=- - Direct root login disallowed everywhere What are different fields of shadow file? username:password:lastchg:min:max:warn:inactive:expire:flag

Passwd: a 13-character encrypted user password; the string *LK*, which indicates an inaccessible account; or the string NP, which indicates no password for the account.

Lastchg: Indicates the number of days between January 1, 1970, and the last password modification date. Min: Contains the minimum number of days required between password changes.

Max: Contains the maximum number of days the password is valid before the user is prompted to specify a new password.

Inactive: Contains the number of days a user account can be inactive before being locked.

Expire: Contains the absolute date when the user account expires. Past this date, the user cannot log in to the system.

How do you check which command was used to format a file system?

elonsapactd7# mkfs -m /dev/vx/rdsk/dg01/gloss_env mkfs -F ufs -o

nsect=64,ntrack=32,bsize=8192,fragsize=1024,cgsize=49,free=1,rps=120,nbpi=8271,opt=t,apc=0,gap= 0,nrpos=8,maxcontig=128 /dev/vx/rdsk/dg01/gloss_env 28076032

User can‘t login on some machines, why? Check shadow – if not logged for certain duration, the account might‘ve got expired. What is maximum partition size in Solaris 10? 16TB

(2)

How does /etc/services and /etc/inet/inetd.conf files look?

/etc/services

auto_remote_inf 5281/tcp # AutoSys INF Instance /etc/inet/inetd.conf

auto_remote_app stream tcp nowait root /opt/autotree/autosys/bin/auto_remote auto_remote_app

I get /dev/ptmx: No such device when attempting ssh/telnet/rlogin.

Increase the number of pseudo ttys. Edit /etc/system and add set pt_cnt = <num>, halt and boot –r. From Soalris 8 onwards, this number increases dynamically.

How do you boot single user from CD? ok boot cdrom -s

How do you reset the NVRAM to factory defaults? During the boot, press Stop + N.

What is /proc? /proc is a memory image of each process; it‘s a virtual file system that occupies no disk space. /proc is used for programs such as ps and top and all the tools in /usr/proc/bin that can be used to examine process state.

How do you restrict number of processes per user? Set following in /etc/system: set maxuprc = <num> What will you do when /var is full. Df –k shows 100%

but du –k shows a very low value.

This happens when a process has its file opened with a link count of zero (a file with open file descriptor unlinked) and that file has been deleted. The ways to troubleshoot are:

1. Run lsof -a +L1 /var to find out the culprit 2. find /proc/* /fd -links 0 -type f -ls

3. find /proc/* /fd -links 0 -type f -size +2000 -ls

4. find /var -type f | xargs -h | sort -n | tail -n 5 > topfive.txt

Permissions on /tmp are wrong after a reboot? Tmpfs takes on the permissions from underlying mount point. In order to fix /tmp, you need to boot single user and change the permissions as below:

#chmod 1777 /tmp #chown root:sys /tmp

How do you get more than 16 groups per user? Set ngroups_mx=32 (Max can be 32. Can cause problem with NFS bcoz it uses 16)

What is e-cache? External-cache is a secondary cache designed as staging between the CPU‘s primary cache (very small, but lightening fast) and the main RAM.

How would you power cycle a V1280? Using Solaris shutdown command

Sending shutdown/poweroff command from LOM

Sending shutdown/poweroff command from On/Standby switch How do you change the terminal type for

/dev/console?

Change ―-T‖ in /etc/inittab to required <termtype>. –T sun or –T xterm How do you enable/disable dtlogin? It is set using /usr/dt/bin/dtconfig [-pde]

How do you configure dtlogin? The standard CDE configuration files live in /usr/dt/config. DON‘T EDIT THEM THERE. Copy the file you want to edit to /etc/dt/config (create this dir if it doesn‘t exist).

How to change X Server options? The X server is started through /usr/dt/config/Xservers file.

How do you restrict remote access through dtlogin? Copy /usr/dt/config/Xaccess to /etc/dt/config. Comment following lines to fully restrict the access: * CHOOSER BROADCAST #any indirect host can get a chooser

Where is umask value set? /etc/default/init (CMASK=value). Default is 022. This prevents daemons from creating 666 files. How do you change host name? Either by modifying /etc/nodename, /etc/hosts and related files

OR

by running /usr/sbin/sys-unconfig Sometimes when running ‗find‘ under /, it gets stuck in

/proc. Why? /proc contains lots of files. This may cause the problem with some binaries. In such case, find / without proc as below: #find `ls / | egrep –v „(proc|any_nfs_mount)‟` -name core

How do you boot a 32bit kernel when 64 bit kernel is

also installed? Sun hardware released after Solaris 8 no longer supports 32 bit booting. You can only run 64 bit kernels on those. This applies to all Ultra-III systems as well as the Sun Blade 100 and other UltraSPARC-IIe systems.

How do you find the number of open files? #ulimit -a

How do you do patch management? 1. Freeware named ―Patch Check Advanced (pca)‖

2. Traffic Light Patch management (TLP) - Run explorer on the client which needs to be patched. Send the output file to TLP server where a script is run to check for new patches. Once the new patches are identified, the script creates the script. Move that file back to client and apply them using script.

3. Solaris patch manager

4. If you have a software service agreement with Sun, you can use Sun‘s ―SunSolve ONLINE‖ service to obtain patches.

5. Sun recommended patches can be obtained from sun via anonymous ftp to sunsolve1.sun.com. How do you add and remove patch? patchadd and patchrm

How do you see which patches are installed? showrev -p

How do you reconfigure the hardware/device tree? #reboot -- -r. Also check /etc/driver_aliases if entries are missing. Which package includes sccli (to manage storEdge)? 2.3_sw_solaris-sparc.zip under Storedge 300 related software 2.x How do you check the patches/packages installed? /var/sadm/pkg and /var/sadm/patch

devfsadm –c disk, drvconfig doesn‘t detect new LUN. #cfgadm –c configure c3 c4 A new LUN is presented on lpfc HBA. Devfsadm –c

disk, drvconfig doesn‘t detect it.

Edit /kernel/drv/lpfc.conf, /kernel/drv/sd.conf. #update_drv –vf lpfc

#update_drv –vf sd

If needed, reset the HBA adapters using /usr/sbin/lpfc/lputil. What is Sun systems handbook? It lists various drives supported on various models. You can query it at

http://sunsolve.sun.com/handbook_pub/Systems. Is it ok to connect/disconnect scsi drives while

powered on? On older machines without onboard scsi controller, it is never a good idea to do this as it risks blowing a fuse on CPU board or part of scsi hardware. On newer machines, it could be done without problems (halt the machines (sync; L1-A), remove/add the device, then continue. It MAY blow CPU fuse (machine will hang)

(3)

How to enable/disable tagged queueing? Tagged command queueing (TCQ) is an option part of SCSI-2. It permits a drive to accept multiple I/O requests for execution later. Solaris 2.x can be told not to use it by putting following line in /etc/system:

Set scsi_option & ~0x80

The scsi_options kernel variable contains a number of bit flags which are defined in

/usr/include/sys/scsi/conf/autoconf.h. 0x80 corresponds to tagged queueing. However, this turns off TQ for entire machine, not just the problematic drive. TQ is desirable because of significant performance enhancement for busy drives. It can be activated per-controller or per-drive basis by using esp and isp.

A third-party CD-ROMs doesn‘t work with Sun. why? Sun bootprom expects 512 block first sector. When 3rd party CDROM use 1024 or 2048 byte sectors,

it causes the SCSI driver to see a data overrun. This could be amended by setting jumper, cutting a trace, or using a software command.

How do you start/stop floppy/CD daemon? #/etc/init.d/volmgt stop/start

When would you see df and du showing different size? If a process is holding open a file, and that file is removed, the space belonging to the file is not freed until the process either exits or closes the file. This space is counted by df but not by du. It happens in /var/log or /var/adm where syslog holds open a file.

How to increase number of file descriptors per process?

By adding the soft limit and hard limit entries in /etc/system Tell something about system crash. Solaris 2 to 2.6 - /var/crash/hostname#adb –k unix.0 vmcore.0

Solaris 7, 8 – ―crash‖ utility

Solaris 9 onwards – ―mdb‖ module debugger How do you translate inode to file name and vice

versa?

#ls –i filename and #find /etc –inum inodenumber –print What is the structure of rc scripts in Solaris? /etc/rc3 is link to /sbin/rc3.

/etc/rc3.d is a directory containing all the scripts.

/sbin/rc3 (/etc/rc3) is a shell script that runs all the scripts under /etc/rc3.d with stop/start option.

/etc/init.d contains the script for deamon. These are hard linked with scripts under /etc/rc3.d.

For run level 5 and 6, there are only script /sbin/rc5 and /sbin/rc6 (There are no /etc/rc5.d and /etc/rc6.d).

elonsapcore2# ls -ld /etc/rc*

lrwxrwxrwx 1 root root 11 Nov 4 2005 /etc/rc3 -> ../sbin/rc3 drwxr-xr-x 2 root sys 1536 Feb 24 15:45 /etc/rc3.d

elonsapcore2# ls -l /etc/rc3.d total 86

-rwxr--r-- 6 root sys 2124 Apr 6 2002 S13kdc.master -rwxr--r-- 6 root sys 2769 Apr 6 2002 S15nfs.server -rwxr--r-- 6 root sys 621 Apr 6 2002 S34dhcp elonsapcore2# ls -l /etc/init.d | more

total 640

-rwxr- 5 root sys 364 Apr 6 2002 autofs

How would you manage an E10K? Using System Service Processor (SSP)/ Network Virtual Console (netcon)

SSP is a package installed on workstation that enables you to control and monitor the E10K. System boards within E10K may be logically grouped together into separately bootable systems called Dynamic System Domains. Up to eight domains may exist simultaneously on a single E10K. SSP enables you to control and monitor domains, as well as the platform (E10K) itself. Domains can communicate with each other at high speeds using the Inter-Domain Networks (IDN) feature. IDN exposes a normal network interface to the domains that make up the network, but no cabling or other network hardware is required. SSP enables the system administrator to perform the following tasks:

• Boot domains.

• Perform emergency shutdown in an orderly fashion. For example, SSP software automatically shuts down a domain if the temperature of a processor within that domain rises above a pre-set level.

• Dynamically reconfigure a domain so that currently installed system boards can be logically attached to or detached from the operating system while the domain continues running in multiuser mode. This feature is known as Dynamic Reconfiguration. (A system board can easily be physically swapped in and out when it is not attached

to a domain, even while the system continues running in multiuser mode.)

• Create domains by logically grouping system boards together. Domains are able to run their own operating system & handle their own workload.

• Assign paths to different controllers for I/O devices, which enable the system to continue running in the event of certain types of failures. This feature is known as Alternate Pathing

• Monitor and display the temperatures, currents, and voltage levels of one or more system boards or domains • Control fan operations, control power to the components within a platform

Netcon is opened from the SSP and can read and write to the host console. Multiple simultaneous consoles may be opened but only one can have write perms.

What is EEPROM level/OK Prompt ? The firmware FORTH programming language used to control hardware diagnostics, booting, etc. How do you run hardware diagnostics from OK

prompt?

To run Sun hardware diagnostics, perform the following at the ok> prompt: ok> setenv auto-boot? false

ok> setenv diag-switch? true ok> setenv diag-level max

ok> setenv diag-device disk net (if appropriate) ok> reset

(watch results of diagnostic tests)

If devices appear to be missing, you can also run the following tests: ok> probe-scsi-all ok> probe-sbus ok> show-sbus ok> show-disks ok> show-tapes ok> show-nets ok> show-devs

In addition, the following commands can be used to examine the CPUs or switch to another CPU: ok> module-info

ok> processor_number switch-cpu

How to find device from which machine will boot? {ok} printenv boot-device

(4)

How do you list all device aliases?

How do you set a device alias and ensure it persists through reboots?

{ok} devalias

Confirm NVRAMRC is enabled: {ok} printenv use-nvramrc? Edit the contents of nvramrc: {ok} nvedit

Add the devalias alias:

0: devalias mlboot /sbus/whatever/8000,0f@blah:0,0 ^C

Save the contents: {ok} nvstore {ok} reset

How to turn off DHCP at OBP level? sc>setsc netsc_dhcp false

What does the sifting command do? The sifting command acts in a similar fashion to ―man –k‖. It basically greps all known eeprom commands for the string you enter; very useful if you can‘t remember the exact command name. ok> sifting watch-net gives all variations of a cmd and correct syntax

ok> sifting probe

sbus-probe-list probe-all probe-sbus probe-slots probe-slot probe-scsi-all probe-scsi probe probe-virtual probe-fpu lprobe wprobe cprobe

Describe the Solaris boot-up sequence. Boot is divided into 4 phases: 1. Boot PROM

2. Boot Program 3. Kernel Initialization 4. Init

1. Boot PROM

a. PROM displays banner (system identification information) and runs self-test diagnostics to verify hardware and memory. The extent of test is decided by diag-level.

b. Probes all scsi devices and prepares device tree c. OBP loads primary boot program bootblk from boot-device. 2. Boot Program

a. The bootblk program finds and executes secondary boot program, ufsboot, from default boot-device and loads it into memory.

b. ufsboot has drivers to read the UFS file system. It loads the kernel. 3. Kernel Initialization

a. Kernel initializes itself and loads the modules. The kernel files are: For 32 bit kernel

/platform/`arch -k`/kernel/unix /kernel/geunix

For 64 bit kernel

/platform/`arch -k`/kernel/sparcV9/unix

b. Kernel unmaps ufsboot program after it has loaded enough modules to mount root file system by itself. c. Kernel mounts / root file system read-only and starts /sbin/init process.

4. Init

a. /sbin/init reads /etc/inittab and starts services. /sbin/rcS from inittab calls /sbin/rc# scripts to execute scripts in each /etc/rc#.d directory

b. In solaris 10, /sbin/init process starts /lib/svc/bin/svc.startd, which starts system services that do the following:

- Check and mount file systems - Configure network devices

- Start various processes and perform system maintenance tasks c. svc.startd executes the run control (rc) scripts for compatibility.

Where does ufsboot reside? /platform/`arch -k`/ufsboot

Tell something about etc/system file. The following types of customization are available in the /etc/system file: o moddir: Changes path of kernel modules.

o forceload: Forces loading of a kernel module. o exclude: Excludes a particular kernel module.

o rootfs: Specify the system type for the root file system. (ufs is the default.) o rootdev: Specify the physical device path for root.

o set: Set the value of a tuneable system parameter.

What is rsync ? What is it used for? Rsync is an open source utility that provides fast incremental file transfer. rsync is freely available under the GNU and is currently being maintained by Wayne Davison. Version 2.6.8 was released on Apr 22nd, 2006.

What is top ? What is it used for? Top is a program that will give continual reports about the state of the system. Last version is 3. Now it is a sourceforge project and the author is William LeFebvre.

What is the difference between prtdiag and prtconf? prtdiag shows easily readable information regarding system peripherals whereas prtconf shows more of a device tree

How do you monitor the performance of memory? #swap -s & prstat & top #vmstat 5

sr - scan rate (pages scanned by clock algorithm per second). Red Light:

sr -s higher than 200. Major swap area consumer: /usr/local/bin/top -d1 –osize Or sar -r

How do you check cpu usage per user? prstat -u root How do you find out which process is consuming most

of the CPU?

(5)

How do you monitor the performance of CPU? Total number of CPUs #psrinfo

Activity per CPU #mpstat

Important columns are usr - percent user time sys - percent system time wt - percent wait time idl - percent idle time

To report processes waiting to be executed (to figure out shortage of processors) #vmstat 5 5

Important fields under Procs and CPU are: r - in run queue

b - blocked for resources w - swapped

us - percent user time sy - percent system time id - percent idle time

Red Light:

r is higher than the total number of processors on the system and sy is double us

What is the difference between /usr/ucb/ps -auxwww and /sbin/ps -elf output?

auxwww shows %cpu and %memory used whereas elf shows tty and Parent PID. How do you monitor the performance of disks? #iostat –xnmpz (shows activities for disks)

Important columns are r/s - read per sec w/s - write per sec Kr/s - KB read per sec Kw/s - KB write per sec

wait - avg number of transactions waiting in the queue to write

%w - percent of time there are transactions waiting for service (queue non empty) %b - percent of time the disk is busy (transactions in progress)

svc_t - average service time Red Light

r/w/s are consistently higher AND %b is higher than 5 AND

svc_t is higher than 30 milliseconds

How do you restore the corrupted superblock? Find out backup superblocks

elonsapactd7# newfs -N /dev/vx/rdsk/dg01/ems

/dev/vx/rdsk/dg01/ems: 1433600 sectors in 700 cylinders of 32 tracks, 64 sectors 700.0MB in 44 cyl groups (16 c/g, 16.00MB/g, 7680 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

32, 32864, 65696, 98528, 131360, 164192, 197024, 229856, 262688, 295520, 1114272, 1147104, 1179936, 1212768, 1245600, 1278432, 1311264, 1344096, 1376928, 1409760,

Restore the superblock

mkfs -f ufs -o b=32864 /dev/vx/rdsk/dg01/ems

How do you install boot block on a system disk? # installboot /usr/platform/„uname -i„/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 /usr/platform/„uname -i„/lib/fs/ufs/bootblk - Is the boot block code /dev/rdsk/c0t0d0s0 - is the raw device of the root (/) file system What are different run levels in Solaris? • S : Single user state (useful for recovery – few FS are mounted)

• 0 : Access Sun Firmware ( ok> prompt)

• 1 : System administrator mode (all file systems are mounted, user‘s can‘t login) • 2 : Multi-user w/o NFS

• 3 : Multi-user with NFS • 4 : Unused

• 5 : Completely shutdown the host (like performing a power-off @ OBP) • 6: Reboot but depend upon initdefault entry in /etc/inittab

What is ssh ? What is it used for? OpenSSH is a FREE version of the SSH connectivity tools. It encrypts all traffic to effectively eliminate eavesdropping, connection hijacking, and other attacks. RSA is used by 1.3 and 1.5. DSA is used by 2.0.

Where are rsa and dsa keys installed? RSA key in $HOME/.ssh/identity (private)& $HOME/.ssh/identity.pub (public) DSA key in $HOME/.ssh/id_dsa (private) & $HOME/.ssh/id_dsa.pub (public) How would you diagnose SSH problems? ssh –v –v –v –v hostname

Why can‘t I ssh in as root? You need to set "PermitRootLogin" to "yes" in /etc/ssh/sshd_config. How do you login through ssh without entering

password?

Copy either $HOME/.ssh/identity.pub to $HOME/.ssh/authorized_keys OR $HOME/.ssh/id_dsa.pub to $HOME/.ssh/authorized_keys2 on remote machine.

How RSA/DSA works? Copy RSA or DSA public keys from local box to authorized_keys or authorized_keys2 on remote box. When connected from local, remote encrypts a random number using public key copied over and send to local to decrypt. Local sys decrypts it using private key (identity or id_dsa) and send the number to remote sys. This grants the access.

How do you set up the environment variables in sh, csh, bash, ksh?

sh/ksh/bash: TERM=vt100; export TERM CSH: setenv TERM vt100

(6)

Which port NTP uses? 123

What is NPT strata? Each NTP node has a stratum. Stratum is an integer between 0 and 16, inclusively; stratum 0 means a physical clock, never a computer. Examples of physical clocks include:

• Cesium oscillator: Definition of time (subject to relativistic effects) • Rubidium oscillator: found in cell towers, very stable

• GPS receiver: accuracy circa 10 ns • CDMA receiver: accuracy circa 10 µs

Stratum 16 is reserved for devices that are not synchronized. The stratum of any NTP-synchronized device is the stratum of the device it is synchronized to, plus 1. Thus:

• GPS receiver: stratum 0

• Computer connected to it by a serial line: stratum 1 • Client that gets the time from that computer: stratum 2 How would you add and configure new NTP clients? 1. Create the file /etc/inet/ntp.conf with the following entries:

server <NTP Master hostname/IP> driftfile /etc/ntp.drift

2. Create the file /etc/ntp.drift with the following entry: 0.0 3. Bounce NTP service. #> /etc/rc2.d/S74xntd stop #> /etc/rc2.d/S74xntd start 4. Check Status #> ntpq ntpq> peers

The files would look as below:

[root@elonxapdcsu1 .ssh]# more /etc/ntp.conf driftfile /etc/ntp/drift

server ntp1.uk.ml.com server ntp2.uk.ml.com server ntp3.uk.ml.com

[root@elonxapdcsu1 .ssh]# more /etc/ntp/drift 24.305

/etc/inet/ntp.client or ntp.server can be copied over to ntp.conf to make the host either a client or server. NTP runs reading ntp.conf file only. This is similar to various nsswitch files (.dns, .nis, .file etc)

How to find servers you are synchronising time from? ntpq –p

What is drift file in NTP? A driftfile /etc/ntp.driftfile will be used to store the clock drift. It contains the latest estimate of clock frequency error. This will enable faster synchronization on restart of the xntpd daemon. Many boxes clocks do drift along on their own, a check every hour or day is generally a good idea. It contains something like

0.0 OR 24.305

Why does hosts drift in time? Because of latency in traffic between master and clients on network, because of CPU execution delay, and other variables

What is a potential problem between hardware clock

and ntp clock management One may try to bring the time forward whereas other wants to bring it backward. This causes split brain. Let NTP do it. Stop hardware time management by adding following to /etc/system file: set dosynctodr=0

Which port is SWAT? 901

How do you configure samba to start by inetd? Edit /etc/inet/services file and Insert

netbios-ns 137/udp #samba nmbd netbios-ssn 139/tcp #samba smbd After sunrpc 111/tcp #rpcbind ---Insert swat 901/tcp #swat After

ldaps 636/udp #LDAP

Edit /etc/inetd.conf and add

netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd netbios-ns stream udp wait root /usr/local/samba/bin/nmbd nmbd swat stream tcp nowait.400 root /usr/local/samba/bin/swat swat

What are different samba daemons? nmbd - name registration and resolution requests. Used for network browsing, it should be started first.

Smbd - handles all TCP/IP based connection servers for file and print operations. It manages authentication. Should start after nmbd.

Winbindd - starts when samba is a member of ADS domain. it is also needed when samba has trust relationships with another domain.

It samba is not running as WINS server, there will be one single instance of nmbd running. If it is running as WINS, there will be 2 instances of nmbd. One of them handles WINS request and second requests name server message daemon. smbd hadles all connection requests. It spawns a new process for each client connection made. winbindd will run as one or 2 daemons.

List various samba commands List the shares on a foreign host: #smbclient -L <hostname> -U% To mount samba mount: #smbmount //hostname/public /mnt/samba To change passwd for smb user: #smbpasswd -a local_user Which is the samba config file? How do you locate and

(7)

How would you test if samba mounts are working/authenticating correctly?

Check the share using smbclient. Also, check the log file /var/log/smb/samba.%m.

How would you configure samba clients? There is no configuration required on windows client from unix server. Just start|run the share. There is no configuration on unix client from nt/2k/2k3 servers. However, share is mounted differently.

CLI: smbmount //<windows machine name>/<shared folder> /<mountpoint> -o username=<user>,password=<pass>,uid=1000,umask=000

/etc/fstab:

//<windows machine name>/<shared folder> /<mountpoint> smbfs auto,username=<user>,password=<pass>,uid=1000,umask=000,user 0 0 To make the password secure:

/etc/fstab:

//<windows machine name>/<shared folder> /<mountpoint> smbfs

auto,username=<user>,credentials=/root/.credentials,uid=1000,umask=000,user 0 0 /root/.credentials takes the form

username=blah password=blahs-secret

CIFS support should be enabled in kernel. How would you configure samba server to use

encrypted password?

Create a separate password file for Samba based on your existing /etc/passwd file: #cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/samba/smbpasswd

If the system uses NIS, type the following command:

#ypcat passwd | /usr/bin/mksmbpasswd.sh > /etc/samba/smbpasswd #chmod 600 /etc/samba/smbpasswd

The script does not copy user passwords to the new file. To set each Samba user's password, use the command smbpasswd username. A Samba user account will not be active until a Samba password is set for it.

Enable encrypted passwords in smb.conf. Verify that the following lines are not commented out: encrypt password = yes

smb passwd file = /etc/samba/smbpasswd Start smb service: # service smb restart

To start smb automatically, use ntsysv, chkconfig, or serviceconf.

The pam_smbpass PAM module can be used to sync users' Samba passwords with their system passwords when it is changed by passwd command. To enable this feature, add the following line to /etc/pam.d/system-auth below the pam_cracklib.so invocation:

password required /lib/security/pam_smbpass.so nullok use_authtok try_first_pass What is CIFS and SMB? Common Internet File system is enhancement of SMB protocol for sharing data across platform What's difference between gunzip and uncompress? gunzip can uncompress both .z and .gz whereas uncompress can only uncompress .z files. How do you set the IP, hostname & netmask of an

interface during bootup?

On boot the OS checks for the existence of the file /etc/hostname.interface, which contains the hostname. This hostname is compared with /etc/hosts to lookup the IP address. This IP is matched against /etc/netmasks to work out the netmask. The interface card is plumbed, the IP assigned and the netmask set. The interface is brought up onto the network.

What is the command for assigning the IP 192.10.10.10, netmask 255.255.255.0 against interface hme1 and connect it to the network?

One way of achieving this is:

# ifconfig hme1 plumb (if not currently plumbed in)

# ifconfig hme1 [inet] 192.10.10.10 netmask 255.255.255.0 up What is a virtual network interface ? How would you

assign a new IP 192.10.10.2, netmask 255.255.255.0 against it?

Solaris allows up to 256 IP addresses to be assigned against one physical network interface card. This is achieved using virtual (software) NICs. A virtual NIC is denoted by interface:[0-255], e.g. hme0:0.

One way of achieving this is:

# ifconfig hme1:1 [inet] 192.10.10.20 netmask {255.255.255.0|0xffffffff} up What does the terms state , speed and duplex mean

with regards to a network interface?

State indicates whether the interface has made a connection with the switch to State indicates whether the interface has made a connection with the switch to which it is patched.

Speed indicates bit rate at which the interface communicates, usually 10 or 100Mbit/sec. Duplex indicates whether the interface is synchronous (full duplex) or asynchronous (half duplex), i.e. whether the interface can send and receive packets at the same time.

How would you verify speed and mode of BGE and IPRB interfaces?

kstat bge:interface number | grep parameters (eg kstat bge:1 | grep ifspeed) link_duplex 1 (half) 2 (full) ifspeed 10000000 - 10 mbps 100000000 - 100 mbps 1000000000 - 1000 mbps How would you verify speed and mode of LE

interfaces?

le interfaces are always half duplex/10mbps How would you verify speed and mode of ce

interfaces?

kstat –m ce –i 1

link_duplex = 1 (half), 2 (full) link_speed = 10, 100, 1000 How would you verify speed and mode of QFE

interfaces?

link_speed = 0 (10), 1 (100), 1000 (1000) link_mode = 0 (half), 1 (full), * (None) How would you verify speed and mode of hme

interfaces?

# ndd –set /dev/hme instance 1 # ndd -get /dev/hme link_status # ndd -get /dev/hme link_speed # ndd -get /dev/hme link_mode

(8)

How can you set the speed/duplex of hme1 without rebooting?

ndd -set /dev/hme instance 1 ndd -set /dev/hme adv_100T4_cap 0 ndd -set /dev/hme adv_100fdx_cap 1 ndd -set /dev/hme adv_100hdx_cap 0 ndd -set /dev/hme adv_10fdx_cap 0 ndd -set /dev/hme adv_10hdx_cap 0 ndd -set /dev/hme adv_autoneg_cap 0

Run above commands exactly in the same sequence. Interface will negotiate the speed with switch after the last command.

To force the interfaces to a certain speed/duplex at boot time?

To force the above settings at boot time, you could either make an rc.d script to call the above commands for each interface individually, or can all types of interface en-mass in /etc/system. How do you add default route in Solaris? #route add default 10.10.10.1

How do you test IPMP setttings? root@host# if_mpadm -d bge0

What are different jumpstart servers and services? 4 services: boot services, identification services, configure services, install services. They can all run on the same server or different servers. Boot server must present in each subnet because ARP can't cross subnets.

Tell something about boot server. To boot the JumpStart client using the network, clients require support from a server that can respond to their Reverse Address Resolution Protocol (RARP), Trivial File Transfer Protocol (TFTP), and BOOTPARAMS requests. A system that provides these services is called a boot server. The files which should be configured are:

/etc/ethers - MAC to hostname /etc/hosts - hostname to IP

/tftpboot - contains boot image to tftp

/etc/bootparams - provides location of boot image and other dirs required by client to boot /etc/dfs/dfstab - used by boot server to share directories for other services

You can configure boot services using the add_install_client script. The add_install_client script allows you to specify all of the information required in the files that support boot services. This script also creates the required files in the /tftpboot directory and appropriately modifies the inetd service configuration to support tftp requests.

Tell something about identification server. JumpStart clients require support from a server to automatically get the answers to system identification questions that the client systems issue. The identification service is often provided by a boot server, but the service can be provided by any network server configured to provide

identification.

The information can be provided either by NIS/LDAP or sysidcfg file or combination of both. sysidcfg file superseeds everything. it must be edited manually.

Tell about configuration server. JumpStart clients require support from a server to obtain answers for system configuration questions that they issue. A system that provides this service is called a configuration server.

A configuration server provides information that specifies how the Solaris Operating System installation proceeds on the JumpStart client. Configuration information can include: - Installation type

- System type

- Disk partitioning and file system specifications - Configuration cluster selection

- Software package additions or deletions

On the configuration server, files known as profile files store the configuration information. A file called rules.ok on the configuration server allows JumpStart clients to select an appropriate profile file.

Which are the files residing on configuration server? rules file - it associates a group of clients with specific installation profiles. The groups are identified using predefined keywords that include hostname, arch, domainname, memsize, model. Client selects a profile by matching their own characteristics with an entry in rules file.

profiles file - it specifies how the installation is to proceed and what software is to be installed. A separate profile file may exist for each group of clients.

check script - this script is to run after creating rules and profile file. it verifies the syntax and creates rules.ok file.

rules.ok file - jumpstart program reads this file during automatic installation (rules file is not read) begin and finish scripts - to carry out post and preinstallation

Tell about installation server. JumpStart clients require support from a server to find an image of the Solaris OS to install. A system that provides this service is called an install server. An install server shares a Solaris OS image from a CD-ROM, DVD, or local disk. JumpStart clients use the NFS service to mount the installation image during the installation process.

The image could be served from a CD/DVD or a spooled image or flash archive. A spooled image will be the one which is spooled on the server from the CD using setup_install_server and

add_to_install_server script. setup_install_server -b will spool only the boot image on a boot server. Boot server will then direct the client to separate install server for the installation image.

Flash archive is an archive/image created from master server which is then distributed to hosts using jumpstart for cloning purpose.

Describe the jumpstart process and main commands. 1. Connect new host to the network and run #boot net –install.

2. Using ARP/RARP, host gets IP address from boot server which is running in.rarpd daemon. Boot server checks /etc/ethers for hostname matching MAC address and then checks /etc/hosts for IP address matching hostname.

3. Host gets bootimage from boot server using tftp request (sent by OBP). Boot server holds boot image in /tftpboot directory.

4. After getting boot image, client requests identification, software and configuration information from boot server. Boot server has this information stored in /etc/bootparams and the daemon running is rpc.bootparamd.

5. After mounting the root file system, client connects to configuration server (known from /etc/bootparams file), carries out the installation and configuration. Configuration server holds the necessary information for the client to identify itself (sysidtool) and run a proper installation (suninstall).

(9)

Which are the important files in jumpstart? /etc/ethers – Contains MAC and hostname /etc/hosts – contains hostname and IP

/tftpboot (dir) - contains IP address (hexadecimal) and bootimage

/etc/bootparams – hostname, location of kernel, install software dir (class file), sysidcfg file, begin_script, finish_script, rules file

host_class file (also known as profile) – Tells client whether it is an initial install or upgrade, which software packages or software cluster it should get, partition table

Sysidcfg – information such as locale, timezone, name service, terminal, time server, IP address, root password etc

Begin_script – it is run before host_class is run. Contains instructions.

Finish_script – it is run after host_class is run. Contains instructions such as root password. Rules file – for a keyword (eg hostname) with a specific value, it specifies which begin_script, host_class, finish_script needs to be executed.

Rules.ok – Created by check command. Client read the rules.ok file for booting information. Say something about sysidcfg. This file can not have other names. A generic sysidcfg for many clients can reside in /export/config

dir. But a client specific sysidcfg should reside in /export/config/hostname dir. This location can be passed on to client via bootparams file.

How do you work with jumpstart for x86 and SPARC? Use DHCP for both or use DHCP for x86 and /etc/ethers for SPARC

What are few of jumpstart installation commands? /cdrom/0/s0/Solaris_2.8/Tools/setup_install_server (copy cdrom contents into install directory) /cdrom/0/s0/Solaris_2.8/Tools/setup_install_server –b (installs software for booting the client) /export/install/Solaris_2.8/Tools/add_install_client (to add the client and its related information such as MAC, jumpstart dir path, sysidcfg path etc)

/usr/sbin/flarcreate - to create flare archive

/usr/sbin/flar - archive command to extract information from archieve When jumpstarting, troubleshoot following message:

―Timeout waiting for ARP/RARP‖

ARP/RARP can‘t cross the subnet. Check boot server is in the same subnet as client. Check /etc/ethers and /etc/hosts on boot server.

What is a naming/information service and why should we use one? Give examples of naming/information services?

Naming services provides a managed hostname/IP lookup service, e.g. DNS, NFS.

Information service provides the above and other items, such as username/password, homedir locations, phone directories, e.g. NIS, NIS+, LDAP, DCE.

What is a NIS master ? slave ? client ? A NIS master manages and distributes the maps for a given domain. The principle copy of a NIS maps are held on the master.

How would you configure a NIS client? Enter NIS server information in /etc/hosts Set domain name # domainname nisdomain

Start yp client # ypinit –c OR /usr/lib/netsvc/yp/ypbind -broadcast OR

Enter NIS server information in /etc/hosts. Set the domainname

Edit /var/yp/binding/`domainname`/ypservers file Reboot (or /etc/init.d/rpc start)

What processes would you expect to be running on the YP master?

ypbind (to itself, usually) ypserv

ypxfrd

rpc.yppasswd, rpc.ypupdated Which script starts NIS startup? /etc/rc2.d/S71rpc

How do you determine it is NIS master? ps -ef | grep ypserv What processes run on the YP slave? ypserv, ypbind

How does logging on NIS master work? While starting ypserv, create # cat /dev/null > /var/yp/ypserv.log How do you force ypbind to use particular NIS server

on SunOS?

#/usr/lib/netsvc/yp/ypbind -ypsetme #ypset NIS_server

NIS and broadcast? NIS usually works on broadcast way hence NIS server ought to be in the same subnet. However, if it is in different subnet, then initialize the client with -c flag (ypinit -c) or set using ypsetme.

"passwd (NIS): Couldn‘t change passwd for user" -

how do fix this issue? rpc.yppasswd daemon is probably running, but not pointing to the directory containg NIS maps. By default it looks in /var/yp. If maps are in /var/yp/maps, start rpc.yppasswd as below: /usr/lib/netsvc/yp/rpc.yppasswd -D /var/yp/maps

How does NIS master know which slaves should have

access to transfer? Master looks at ypservers map.

Whats the difference between passwd: files compat and passwd: compat?

The addition of files before compat is accepted in nsswitch.conf but should not be necessary on a "neat" server. "compat" makes /etc/passwd to be read but the entries in /etc/passwd plays a major role in resolving the name. the lines are checked in the order in which they are encountered. So, if the DB token (eg @<netgroupnam>) that refers to NIS-netgroup-style entries are found BEFORE a line containing the local "files" configuration, they will be checked before those lines later in the file. Adding "files" before "compat" forces the /etc/passwd file to be read first as a plain file (non-nis-style) before compat reads it again in teh nis-compatible manner.

What does ypset do? It is used in place of ypbind. It makes ypbind talk to ypserv. Use ypset if the network doesn't support broadcasting, supports broadcasting but does not have an NIS server, or accesses a map that exist only on a particular NIS server.

An alternative to using ypset is to use /var/yp/bindin/domainname/ypservers file. this file contains a list of NIS servers to attempt to bind to, one server per line. If ypbind can't bind to any of the servers from this file, it will attempt to use the server specified by ypset. if that fails, it will broadacst on the subnet for a NIS server.

What port number is rpc? 111

While "make"ing the maps on master, it can't push the maps to slaves, why?

Perhaps because slaves don't have initial maps. In this case, first make the maps on master without pushing it. #cd /var/yp; #make -DNOPUSH mapname.byname mapname.bynumber. Copy over the maps to slaves. Next time when you run make, it should push the maps.

How do you restrict various servers from getting NIS map distributed?

Carete /var/yp/securenets. Ypxfr will respond to hosts that are listed in this file. IF NIS appears to hang when pushing maps from NIS

master to slave, what do you do?

(10)

With NIS+, how do you find out which server a client is bound to?

NIS+ clients do not hard bind to NIS+ servers (as in NIS). Clients have a list of NIS+ servers within the cold-start file. When they need to do a lookup, they do a type of broadcast called a manycast and talk to the first server that responds.

Special about NIS+ and netgroup. You can‘t ypcat on netgroup. You can only ypmatch.

What is the nscd process? Potential issues? Name Service Caching Daemon. Can contain misinformation which hinders troubleshooting. Say something about DNS? DNS daemon is named. Package name contains bind. Main file is /etc/named.conf which specifies

zone directories - /var/named, name servers, zone names, IP addresses of hosts etc. Zone section specifies masetr, slave and stub, allow-update, allow-transfer etc.

Zone files contain forward/reverse look up, different kind of records such as SOA, NULL, RP, PTR, A, NS, MX, CNAME

What does [NOTFOUND=return] in nsswitch.conf

mean? It means that the name service should bt authoritative. If it‘s up and it says such a name doesn‘t exist, believe it and return instead of continuing to hunt for an answer. What is a NFS? What is an NFS server? Client? Network File System a methodology allowed machine to manipulate files held on a remote server as

if they were local. NFS2/3 were designed by Sun. NFS4 was drafted by Sun but given to IETF later on to make it industry standard. There is no NFS1.

An NFS server exports/shares directories to a subset of hosts on the network.

An NFS client mounts these shares onto a mountpoint, and offers the filesystem like any other (assuming correct authentication, permissioning, etc.)

Difference between NFS4 and NFS2/3 While NFS3 was an upgrade to NFS2, NFS4 is a complete rewrite of protocol. NFS2/3 are stateless, NFS4 is stateful.

NFS version 3 (NFSv3) has more features, including variable size file handling and better error reporting, but is not fully compatible with NFSv2 clients.

NFS version 4 (NFSv4) includes Kerberos security, works through firewalls and on the Internet, no longer requires portmapper, supports ACLs, and utilizes stateful operations.

Some key features of NFS4? Mount mechanism is incorporated into protocol itself so no need of separate mountd.

COMPOND RPC Procedure is introduced that allows the client to group traditional file operations into a single request to send to the server.

It uses TCP to transmit the data.

It is less dependent upon RPC procedures, instead the work is accomplished via operations. Such operations are grouped into COMPOUND procedure. Combining them reduces latency and traffic on expensive WAN/LAN.

Which are the NFS daemons? nfsd - handles client requests from remote systems. Default instances are 4. More instances will demand more CPU.

biod - handles block i/o requests for NFS client processes. Default number of instances are 4 mountd - rpc.mountd handles mount requests from remote systems

lockd - manages file locking

statd - manges lock crash and recovery services for both client and server systems rpcbind - it is not NFS daemon but it is essential to NFS.

For linux it is - nfsd, biod, rpc.mountd, rpc.lockd, rpc.statd, and portmap (instead of rpcbind) How do you configure NFS logs? /etc/nfs/nfslog.conf and /etc/default/nfslogd. Logs are different for different shares. Where do you see all the shares shared out? /etc/dfs/sharetab

What are different NFS commands? share, shareall, unshare, unshareall, dfshares (run on client - shows resources shared by server), dfmounts (run on server - shows resources mounted by clients), showmount -a ( run on server - shows resources mounted by clients), nfsstat

How does rpc, rpcbind work? rpcbind runs on port 111.

hostA send query to rpcbind hostB on port 111 by providing program number. rpcbind on hostB checks /etc/rpc to find out service name vs program number. rpcbind on hostB checks /etc/inet/services to find out port number for service name. rpcbind sends the port number of hostA

All services on a hostB usually should have registered themselves with portmap. From hostB, How do you find out which rpc programs

are registered on hostA?

#rpcinfo -p hostname

#rpcinfo -t/u hostname programname (t for tcp and u for udp) How would you setup and NFS server service without

rebooting? share a filesystem in /etc/dfs/dfstabstart /etc/init.d/nfs.server How would you mount this /export/files share on host? # mount [-F nfs] h1:/export/files /mnt Solaris 2+ supports file system sizes upto 16TB.

Problem with NFS?

No. NFS doesn‘t transmit size of underlying file systems. There might be trouble with du and df but normal filesystem size is just fine.

What is the major and minor number? Major number – which device driver should be used to access a particular device Minor number – a number serving as a flag to device driver

For example, there would be a different major number for hard drives and serial terminal. All IDE HD will have same major number (indicating same device driver). Each partition on each HD will have different minor number.

What are NFS file handles? Since NFS is cross-platform protocol, it needs a way to uniquely identify files. Typically, this is done using NFS file handles. It is made by combining the following:

• Major number of the block device holding the file system • Minor number of the block device holding the file system • Inode number of the file on the file system

By combining these numbers, the server can assign a value that uniquely identifies a file. On NFS cluster, major/minor numbers of file system may not match on two machines. This may cause in having a stale file handles. In such case override the use of major/minor numbers by the use of fsid= export option on the server. This assumes that all cluster nodes have a consistent file system ID.

/var/share/icons *(async,rw,fsid=X) where X is any 32 bit number that can be used but must be unique amongst all the exported file systems.

(11)

What is the automounter ? How does this help administration? Where is the master automounter map held?

The automounter is a daemon process able to mount/unmount NFS shares without user intervention. Once properly configured, it greatly reduces administrative overhead by removing the need for a root user to run the commands. It also reduces the risk of NFS issues (e.g. hangs) because the NFS filesystems are only mount when necessary and are unmounted shortly after they have not been used for a little while (default is 5 minutes).

The auto_master map is looked-up in /etc/nsswitch.conf, usually ―files nis‖. This would look to the /etc/auto_master first.

What is a direct and indirect automount map? Advantages of each?

A direct map explicitly states the directory on which the NFS filesystem is to be mounted. It explicitly indicates the NFS share to be mounted. Think of it as mounting a known directory on a known directory. An advantage is that direct maps are uncomplicated and quick.

An indirect map can only imply the mountpoint and the NFS sharename. Think of is as mounted an unknown directory into a directory, e.g. mount server1:/export/home/implicit-username on client1:/home/implicit-username. An advantage is not having to explicitly list all possible actual mount points (useful for homedirs) and not necessary to restart (or signal) automountd when a new implied share is created on the NFS server.

What‘s the use of an executable automount map? Allows the target directory to be determined based on possibly changing information What are default values for serverroot, config and log

for httpd daemon? serverroot (/usr/local/apache2), config (serverroot/conf/httpd.conf), log (/var/log/https/errorlog) What is the structure of httpd.conf? It is divided into 3 sections: global, main, and virtual servers. Some of the options are ServerRoot,

PidFile, TimeOut, MaxClients, KeepAlive (all Global), DocumentRoot, ServerAdmin, ServerName, ErrorLog (all main), NameVirtualHost, VirtualHost, DocumentRoot (all Virtual)

What are virtual servers in http? Multiple websites from single server. 2 types of Vritual Servers:

IP Based (each site has different IP), Name based (each IP has multiple names. SSL can't be used). What are IP based Virtual servers? It can run in 2 modes: multiple daemons and single daemon. MD has separate daemon for different sites. This is used when each site's pages/files are to be kept separate from each other and you've enough resources. Separate https installation for each virtual host. SD has a single daemon for all sites. This is used in rest of the conditions. Single https installtion.

What are Name based Virtual servers? DNS directs all names to single IP and apache identifies name in HTTP request header. Write the structure of for loop, test statement and

while loop.

for VAR in value1 value2 value3 … do

# statements here done

if [ $VAR -eq 0 ]; then # statements here fi

while [ $VAR -neq 10] do

# statements here done

What do the following Kourne-shell variables return?

$4 The fourth argument passed to the command/script.

$? The return code of the command last executed.

$# The number of parameters passed to the command/script.

$* All parameters passed to the script, delimited by $IFS and ignoring quotes.

$0 The commmand/scriptname itself (with path if typed).

$@ All parameters passed to the script, not delimited by $IFS and heeding quotes.

A=‖this.is.a.string‖; echo ${A%%.*} A=‖this.is.a.string‖; echo ${A%%.*} == this A user can‘t login to a Solaris server. Talk through the

troubleshooting steps.

Check network connectivity, check user account in NIS, check ssh is running, check through console if something weird is going on, make sure the default login shell is defined in /etc/passwd entry, password is not expired, account is not locked

A user complains that the ―server is slow‖. Talk

through the troubleshooting steps. Mentions of vmstat / iostat / top / prstat / netstat

What is swap space? A temporary space where process related pages are held while moving between the kernel and the memory. It is used when system‘s memory requirements exceed the size of available RAM. Default page size is 8KB.

Solaris defines swap space as the sum of total physical memory not otherwise used and physical swap slice/file. This means swap is not just the physical swap space.

swap –s shows size of virtual swap (physical swap slice + part of physical memory)

It is usually larger than physical memory because when the system crashes, it dumps all its memory content to the swap space. If swap size is smaller than physical memory, then system will not be able to dump the memory.

Why is tmpfs not a true reflection of swap space? Tmpfs is a filesystem that takes memory from the available swap space (swap slice + part of RAM). What it lists as size of swap is the sum of the space currently taken by the file system and the available swap space unless the size is limited with the size=xxxx option in vfstab.

What is the difference between paging and swapping? Solaris will "page out" VM pages of memory that haven't been accessed recently when more memory is needed (Least Recently Used); that activity is called "paging".

Solaris will swap out entire processes when a critical low point in memory is reached, which is a less efficient way to handle memory and is there only for memory emergencies. That is called

"swapping". Swapping is very unusual in Solaris and indicates a very severe memory shortage. For swapping to occur, you must have either some idle processes, or a lot of processes.

Can you dynamically remove swap space online? How? # swap -d /dev/dsk/c1t0d0s3 # swap -d /export/data/swapfile # rm /export/data/swapfile

(12)

Can you dynamically add swap space online? By adding a swap slice: # swap -a /dev/dsk/c1t0d0s3 By adding a file:

# mkfile 1000m /export/data/swapfile # swap -a /export/data/swapfile How much swap space is available? swap –s, top, sar –r Why do swap –l, swap –s and /tmp disagree about the

amount of swap? Tmpfs file system is a FS that takes the memory from virtual memory pool. What it lists as size of swap is the sum of the space currently taken by the FS and available swap space unless the size is limited with the size=xxxx option. In other words, size of a tmpfs filesystem has nothing to do with the size of swap; at most with the available swap.

Solaris defines swap as the sum total of phys memory not otherwise used and physical swap. This is confusing to some who believe that swap is just the physical swap space.

The swap –l command will list the swap devices and files configured and how much of them is already in use.

The swap –s command will list the size of virtual swap (Phys swap plus phys mem). On a system with plenty of memory, swap –l will typically show little or no swap space use but swap –s will show a lot of swap space used.

How do you change the 'uname -a' output? Before: # uname -a

SunOS homer 5.10 SunOS_Development sun4u sparc SUNW,Ultra-5_10 Run the script:

#!/usr/sbin/dtrace -s #pragma D option destructive syscall::uname:entry { self->addr = arg0; } syscall::uname:return { copyoutstr("SunOS", self->addr, 257); copyoutstr("PowerPC", self->addr+257, 257); copyoutstr("5.5.1", self->addr+(257*2), 257); copyoutstr("gate:1996-12-01", self->addr+(257*3), 257); copyoutstr("PPC", self->addr+(257*4), 257); } After: # uname -a

SunOS PowerPC 5.5.1 gate:1996-12-01 PPC sparc SUNW,Ultra-5_10

How do you differentiate whether the card is an

Emulex or Sun Branded Emulex? First way: Do a "prtdiag -v". If you get something like :

PCI 8 A 0 66 66 1,0 ok SUNW,emlxs-pci10df,fc00/fp (fp) LP10000-S Then the "S" at the end of the card model tells you that you have a SUN branded HBA. Second way:

Install EMLXemlxu package and run /opt/EMLXemlxu/bin/emlxdrv. It lets you install Sun emlx driver or lpfc driver.

Sun branded Emulex cards can only use Sun emlxs driver.

1. Verify which disk drive corresponds with which logical device name and physical device name. Listed below is the table for the v440 disk devices:

Disk Slot Number Logical Device Name[1] Physical Device Name

---Slot 0 c1t0d0 /devices/pci@1f,700000/scsi@2/sd@0,0 Slot 1 c1t1d0 /devices/pci@1f,700000/scsi@2/sd@1,0 Slot 2 c1t2d0 /devices/pci@1f,700000/scsi@2/sd@2,0 Slot 3 c1t3d0 /devices/pci@1f,700000/scsi@2/sd@3,0

2. Verify that a hardware disk mirror does not exist. If it does, see infodoc 73040. #raidctl

No RAID volumes found.

3. View status of SCSI devices #cfgadm -al

Ap_Id Type Receptacle Occupant Condition c0 scsi-bus connected configured unknown c0::dsk/c0t0d0 CD-ROM connected configured unknown c1 scsi-bus connected configured unknown c1::dsk/c1t0d0 disk connected configured unknown c1::dsk/c1t3d0 disk connected configured unknown c2 scsi-bus connected configured unknown c2::dsk/c2t2d0 disk connected configured unknown usb0/1 unknown empty unconfigured ok 4. Remove the disk drive from the device tree

#cfgadm -c unconfigure <Ap_Id>

example -> #cfgadm -c unconfigure c1::dsk/c1t3d0

This example removes c1t3d0 from device tree. The blue OK-to-Remove LED for the disk being removed will become lit.

(13)

5. Verify that the device has been removed from the device tree #cfgadm -al

Ap_Id Type Receptacle Occupant Condition c0 scsi-bus connected configured unknown c0::dsk/c0t0d0 CD-ROM connected configured unknown c1 scsi-bus connected configured unknown c1::dsk/c1t0d0 disk connected configured unknown c1::dsk/c1t3d0 unavailable connected unconfigured unknown c2 scsi-bus connected configured unknown c2::dsk/c2t2d0 disk connected configured unknown usb0/1 unknown empty unconfigured ok

*NOTE that c1t3d0 is now unavailable and unconfigured. The disks blue OK-to-Remve LED is lit. 6. Remove the disk drive

7. Install a new disk drive 8. Configure the new disk drive #cfgadm -c configure <Ap_Id>

example->#cfgadm -c configure c1::dsk/c1t3d0

*NOTE that the green activity LED flashes as the new disk at c1t3d0 is added to the device tree 9. Verify that the new disk drive is in the device tree

#cfgadm -al

Ap_Id Type Receptacle Occupant Condition c0 scsi-bus connected configured unknown c0::dsk/c0t0d0 CD-ROM connected configured unknown c1 scsi-bus connected configured unknown c1::dsk/c1t0d0 disk connected configured unknown c1::dsk/c1t3d0 disk connected configured unknown c2 scsi-bus connected configured unknown c2::dsk/c2t2d0 disk connected configured unknown usb0/1 unknown empty unconfigured ok

How do you check process running on a particular port?

Listing all the pids:

/usr/bin/ps -ef | sed qd | awk '{print $2}' Mapping the files to ports using PIDs:

/usr/prod/bin/pfiles <PID> 2>/dev/null | /usr/xpg4/bin/grep <PID> OR /usr/bin/ps -o pid -o args -p <PID> | sed d1

Mapping the socket name to port using port number:

for i in `ps -e|awk '{print $1}'`; do echo $i; pfiles $i 2>/dev/null | grep 'port:8080'; done

OR pfiles -F /proc/* | nawk '/^[0-9]+/{proc=$2};/[s]ockname: AF_INET/{print proc"\n"$0}'

What is the bug with lsof and solaris 10? Using lsof -i shows incorrect mapping of TCP ports to processes that have socket open as using port 65535. eg:

sshd 8005 root 8u IPv4 0x60007ebdac00t0 TCP *:65535 (LISTEN) sendmail 1116 root 5u IPv4 0x60007ecce000t0 TCP *:65535 (LISTEN)

When rebooting the system gives error INIT: failed

write of utmpx entry. What does it mean? If you have a separate /var, this operation will happen after /var is unmounted and init complains:INIT: failed write of utmpx entry:"s6" INIT: failed write of utmpx entry:"rb"

You can safely ignore these messages

What is psio? It is solaris ps with additional column I/O per process. It is a tool developed by Brendan Gregg at http://www.brendangregg.com/psio.html.

If you can't change the date on E420, what could be the other reason?

TOD clock or battery might have gone bad. You have to replace the motherboard because it is welded directly into the motherboard.

How do you check WWN name of target drives? /usr/sbin/lpfc/dfc> nodeinfo - displays the target number and all FC devices on the network How do you check WWN number of the HBA? bash-3.00# more get_lpfc_wwn

#!/bin/sh

# Script to get WWNs from Emulex lpfc cards

HBAS=`echo "exit" | /usr/sbin/lpfc/dfc | grep "^Adapter" | awk '{print $2 $3}'` for a in $HBAS

do

BRD=`echo $a | cut -d: -f1` LPFC=`echo $a | cut -d: -f2`

WWN=`echo "set board $a\nportattr\nexit" | /usr/sbin/lpfc/dfc | grep Portname: | awk '{print $1}' | cut -d: -f2-9`

echo "Card $BRD = $LPFC = $WWN" done

bash-3.00# How to prevent snooping of high-traffic interface from

filling up the partition? Use tcpdump which has rotation of the output built in with the switch -s. root@box# tcpdump -I <foo> -w something.pcap -C <number of megabytes> -s 0 <capture spec> Can you use other RAM on Sun v490/v890 instead of

sun? what is the condition? you can use kingston. But sun will not provide hardware support until u remove 3rd party ram. Also, it will give problem if you run SunVTS on the machine. how do you find out the physical location of failed

disk? You can see it failed in fomrat output.

Command iostat -En gives the serial number of the disk. From there you can locate the disk. If you get an error /usr/lib/ld.so.1 not found. What do

you do?

boot off CDROM and copy a good version. Netstat will show some connections "ESTABLISHED"

whereas those connections doesn‘t exit. Why? Because client didn‘t send "FIN" call to close the connection and went down abruptly. On the server, that connection will remain in ESTABLISHED condition until the service is restarted to send CLOSE call manually.

anything special about /etc/netmask file? It should contain network entry instead of subnet entry. Eg 172.31.215.0 255.255.254.0 (wrong)

172.31.0.0 255.255.254.0 (right)

Disadvantage is you cant mention 2 subnets from the same network. In such cases, use the scripts in /etc/rc.d to manually set the ip and netmask.

Any performance issues if you change min 10%

reserved in file systems using tunefs? less than 5% will force space optimization - overhead for the system. FS can either try to minimize the time spent allocating blocks, or it can attempt to minimize the space fragmentation. What is the difference betn solaris 8/10 in terms of

ftp? earlier Solaris versions had /usr/platform/`uname -i`/lib/libc_psr.so.1, but it is replaced with /usr/sbin/ftpconfig in solaris 10. it creates an anonymous ftp user and sets up its environment. How do you replace internal hard disk in V440?

(14)

How do you disable SNMP? Either edit /etc/snmp/conf/snmpd.conf and comment the private and public lines. Also disable the /etc/rc3.d/S99ucd-snmp and /etc/rc3.d/S76snmpdx

Can Daylight Saving Time (DST) patch be applied

without reboot? Reboot is required. Else only new processes will see the new timezone files. Any process that was launced before the patches will have the old data in memory. After you remove a patch, you still see directory under

/var/sadm/pkg/SUNWxxxx/save/*.

You can remove that directory without the problem. How do you see which modules are being loaded while

booting?

Adding set moddebug=0x80000000 into /etc/system. This may help reboot the server in case it is stuck at loading a particular driver: exclude: drv/qus

How do you use luxadm? luxadm probe - shows the logical/multipathd disks

luxadm display <path_from_above_command> - shows real disk names and which are pri and sec How do you check the paths for emc? /etc/powermt display dev=all

How do you check whether the OS is 32 or 64bits? isainfo -b Where do you find details of Solaris 10 on OS? /etc/release How do you get OS, kernel, domain etc information? #showrev

Diff between prtconf -b and uname -i? same but prtconf -b shows product, banner, family, model etc

whats specific about /var/adm/lastlog? ls -l shows large size but ls -s shows very little because ls -s shows actual blocks consumed how do you find sizes larger than 400 blocks? find . -size +400 -print

How to create a forceful dump? halt -d

Why are halt, poweroff commands bad? It doesn‘t shutdown all processes and unmount any remaining FS Diff between SunOS andd Solaris? SunOS (Berkley), Solaris (Sys V)

Unix History? Bill Joy prepared 1BSD, 2 BSD, vi, c shell in 1977/78 at UCB. He was cofounder of Sun Microsystems

What is Sun history? OS Based on

SunOS 1.0 4.1BSD (1982) SunOS2.0 4.2BSD (1985) SunOS3.0 4.3BSD (1986)

SunOS4.0 4.3BSD (1989) + a bit of Sys V (Renamed as Solaris 1) Solaris 2 No BSD - alll Sys V Rel 4 - 1992

SunOS 4.14 (Solaris 1.1.2) - 1994

Core of Solaris OS is identified as SunOS 5. SunOS 5 (SVR4) is different than actual SunOS x.x (BSD).

Solaris 2.4 Incorporated SunOS5.4 Solaris 2.6 Incorporated SunOS5.6 Solaris 2.7 Incorporated SunOS5.7 Solaris 2.10 Incorporated SunOS5.10

History of BSD? 1BSD came in 1977, 4.4BSD came in 1994. CSRG (Computer Systems Research Group) at UCB developed it all the way. After 4.4 it was dissolved. Now FreeBSD and OpenBSD (focussing on security) are available.

History of development of SVR4 and Standards AT&T and Sun formed a company Unix International to develop SVR4 (solaris 2). Sun was out of UI after release of SVR4. USL (Unix Sys Lab) at AT&T continued dev of SVR4. Was bought over by Novell. HP, IBM and others formed OSF (Open Software Foundation) to oppose UI. This was a big failure. Many vendors formed a consortium called X/Open Company Ltd to limit too many Unix flavors and device the standards. UI merged with OSF in 1996. OSF then merged with X/Open Compan to form The Open Group. TOG worked with IEEE to set a single standard. TOG now sets Unix standards and releases Single Unix Specifications. POSIX are IEEE standards but IEEE is expensive, hence industry preferred Single Unix Standards.

What are the enhancements in Solaris in diff versions? Solaris 2.6 (SunOS 5.6) - Included Kerberos, PAM, TrueType, Fonts, WebNFS, Large File support Solaris 7 (SunOS 5.7) - First 64-bit UltraSpARC release, UFS logging

Solaris 8 - Multipath I/O, IPv6, IPSec, RBAC, Last update was Solaris 8 2/04

Solaris 9 - iPlanet Directory Server, Resource Manager, Solaris Volume Manager, Linux Compatibility added, Open Windoes dropped

Solaris 10 - includes x64 bits support, DTrace, Solaris Containers, Service Manager Facility, NFSv4, iSCSI, GNOME based Java Desktop System as default desktop, ZFS, GRUB for x86 systems SPARC and big endian? SPARC is big endian. 4A3B2C1D is stored at memory location with lowest address at 100. 100 (4A),

101 (3B), 102 (2C), 103 (1D). 4A is most significant byte and is stored at lowest address In IPMP, can you group virtual IPs? no

Which is ipmp daemon? in.mpathd

Can IPMP can have interfaces with different speeds? Yes but it can't have different types such ethernet and ATM Deprecated in IMP means wat? Do not use the underlying NIC for communication as source address

How do you run a command in vi? :! Command

Which problems can be fixed in UFS using fsck? Discard the log and continue? (Uncommitted transactions are gone) FREE BLK COUNT WRONG IN SUPERBLK (salvage)

IMPOSSIBLE MIN FREE=percent IN SUPERBLOCK

BAD SUPERBLOCK (provide alternate locaiton to restore from) UNDEFINED OPTIMIZATION IN SUPERBLOCK (set to default) BAD NODE: Make it a file

INCORRECT BLOCK COUNT I=inode# and many other How is the disk structure in Solaris? Disk consists of Slices.

Slice consist of Cylinder groups which consits of cylinders Cylinders consist of blocks.

4 types of blocks in a CG - boot block, superblock, inode, storage or data block.

Boot block is always in first CG of a slice. It is 16 blocks in size (8K). Except first CG of root file system (which contains boot code), all the other CGs in root and other file systems have first 16 blocks empty.

References

Related documents