Wednesday, February 16, 2011

solaris adm faq



1. What does the pkgadd command do?


2. How do you create a solaris package?

3. How do you view shared memory statistics?

4. How do you get system diagnostics information?

5. What is OBP and how do you access it?

6. What is LOM and how do you access it?

7. What is VTS?

8. What is an alternative to the “top” command on Solaris?

9. What is /etc/system for?

10. What does ndd do?

11. What does init 5 do?

12. What does init 0 do?

13. How do you boot from CD-ROM?

14. What is jumpstart?

15. How do you boot from a Network with jumpstart?

16. What is JASS?

17. What is the difference between NFS version 2 and NFS version 3?

18. What is RPC? Why do I need it?

19. Are kernel parameters tunable during runtime?

20. What does fmthard do?
1) What files control user administration?
A) /etc/passwd file: 7 Fields: loginid:x:userid:groupid:comment:homedir:shell
/etc/shadow: 9 Fields: loginid:password:lastchng:min:max:warn:inactive:expire
/etc/group : 4 Fields : groupname:password:groupid:username list)

2) What does the “pwconv” command do?
A) It updates the /etc/shadow file with information from /etc/passwd file.

3) Where are the failed login attemps to system logged?
A) /var/adm/loginlog (We need to create this file as it does not exist by default)

4) Which command shows the users currently logged in to system?
A) who ( It reads the information from /var/adm/utmpx file)

5) Which command will show detailed information about a user?
A) finger –m

6) Which command displays all login and logouts?
A) last (It reads the information from /var/adm/wtmpx file)

7) What is the “StickyBit” file permission?
A) Sticky Bit permission protects the file within a public writable directory.
File set with sticky bit will not allow any user to delete the file except the Owner of file, owner of the group or the root user.

8) How is ACL (Access Control Lists) implemented?
A) 8.1) “getfacl”command : To display an ACL on file.
Syntax : getfacl

8.2) setfacl command : To set the ACL on file
Syntax : setfacl

8.3) setfacl –m command : To modify ACL entries
Syntax : setfacl –m

8.4) setfacl –s command : Remove old ACL entries and replace with new one.
Syntax : setfacl –s

8.5) setfacl –d command : Delete ACL entry
Syntax : setfacl –d

9) Imp “root(/)” subdirectories and their purpose :
9.1) / : Root of overall file system.
9.2) /bin : Symbolic link to /usr/bin. Stores standard system commands and binary files.
9.3) /dev : Primary location for “logical” device names
he network file system (NFS)

NFS iss the system that can be used to access file systems over the network. NFS version 4 is the default NFS in Solaris 10. The NFS service is managed by the Service Management Facility. That means NFS can be managed (enabled, disabled, or restarted) by the svcadm command, and the status of NFS service can be obtained by using the svcs command. The benefit here is sharing files over the network among computers possibly running different operating systems.

The NFS Service

The NFS service is a network service that enables computers of different architectures running different operating systems to share file systems across the network. A wide spectrum of operating systems ranging from Windows to Linux/UNIX support NFS. It has become possible to implement the NFS environment on a variety of operating systems because it is defined as an abstract model of a file system, rather than an architectural specification. Each operating system applies the NFS model to its specific file system semantics. This means that file system operations such as reading and writing work for the users as if they were accessing a file on the local system.

The benefits of the NFS service are described here:

1) It enables users on the network to share data, because all computers on the network can access the same set of files.

2) It reduces storage costs by letting computers share applications and common files instead of needing local disk space on each computer for each common file and user application.

3) It provides data consistency and reliability, because all users can read the same set of files, and whenever changes are made, they are made only at one place.

4) It makes the mounting of file systems accessing the remote files transparent to users.

5) It supports heterogeneous environments and red
Basic Boot PROM Commands

When the system is turned on or reset, it first runs POST, and then one of the following two things can happen:

The system will automatically reboot if the value of the configuration variable auto-boot? is true, the value of the boot-command variable is boot, and OpenBoot is not in diagnostic mode. In order to boot, the system will automatically load, and executes the program and its arguments specified by the boot-file variable from the device described by the boot-device variable.

If the configuration variable auto-boot? is false, the system may stop at the OpenBoot user interface without booting the system and will display the ok prompt.

You can issue the Boot PROM commands at the ok prompt. One obvious command is the boot command to boot the system, which you can use in one of the following ways:

Issue the boot command without any arguments if you want to boot the system from the default boot device using the default boot arguments.

Issue the boot command with an explicit boot device as an argument if you want to boot the system from the specified boot device using the default boot arguments.

Issue the boot command with explicit boot arguments if you want to boot the system from the default device by using the specified arguments.

Issue the boot command with an explicit boot device and with explicit arguments if you want to boot the system from the specified device with the specified arguments.

The general syntax of the boot command is shown here:

boot [device] [arguments]

Arguments and options are described here:

{device}. Specifies the full path or the alias for the boot device. The typical values are:

ok cdrom for CD-ROM drive

ok disk for hard disk

ok floppy for 3.5 inch diskette drive

ok net for network
Creation of user and group in solaris10
From command mode :-

#groupadd -g gid groupname - to create a new group.
eg:- groupadd -g 200 newgroup

#more /etc/groups
to check if the group is created

#useradd -u -g -d /export/home/userhomedirectory -m -s /bin/sh username

eg:- useradd -u 200 -g 200 -d /export/home/naveen -m -s /bin/sh naveen.

#passwd naveen
enter passwd

#more /etc/passwd
#more /etc/shadow
-This is used to check the user and passwd entries are available.

GUI MODE :-

Type SMC at command mode

#smc - solaris management console

Backup Interview questions

Q)How to create backup by ufs dump

A)ufsdump –0(zero)cvf /dev/rmt/0 /naveen

How to list the files

Ufsrestore –tvf /dev/rmt/0
Ufsdump –uvf /dev/rmt/0 /naveen – to updates
Ufsrestore –ivf /dev/rmt/0 /naveen

Q)How to back up using tar

A)Tar –cvf /dev/rmt/0 /naveen - copy
Tart –tvf /dev/rmt/0 - Extract
Tar –uvf /dev/rmt/0 /naveen - Update
Tar –xvf /dev/rmt/0 /naveen - Extract

NIS Interview questions and answers

How to create a nis master

#Domainname sun.com
#Echo sun.com > /etc/defaultdomain
#Vi /etc/hosts
Sun1 192.168.0.1
Sun2 192.168.0.2 add all the host connected to the network
Wq!

#Cp /etc/nsswitch.nis /etc/nsswitch.conf
#Vi /etc/nsswitch.conf
File nis – add this entry
Wq!

#Cd /var/yp
#Ypinit –m – master server
Enter host 192.168.0.1
Stop at errors say no here
Yes-yes-yes


#Cd /var/yp
#/usr/lib/netsvc/yp/ypstop
#/usr/lib/netsvc/yp/ypstart

Here you can see all the deamon get restarted .

Q)which command display the default nis server
A)ypwhich

Q)which command will display all the master and slave servers
A)Ypcat –k ypservers

Q)how to see the nis users
A)Ypcat passwd

Q)what are the deamons for nis master
A)Ypserv ypbind ypxfrd rpc.ypassword rpc.ypupdates.

Q)what is map
A)Map is table which consist of a key and a file which consist of the information of the key

Q)how to create nis slave server(192.168.0.2)

#Vi /etc/host
Sun1 192.168.0.1 master server ip
Wq!

#Cp /etc/nsswitch.nis /etc/switch.conf
#Vi nsswitch.con
Files nis
Wq!

#Domainname sun.com
#Echo sun.com> /etc/defaultdomain or to maintain more security /var/yp/ypservers

#Cd /var/yp
#Ypinit –s sun1 (master server)
Yes give master server ip or hostname
Error say no
Yes-yes

#Cd /var/up if u r in that directory then its okay
#/usr/lib/netsvc/yp/ypstop
#/usr/lib/netsvc/yp/ypstart
Ypserv ypbind

#Ypwhich – will display master and slave servers
#Ypcat –k ypservers – list master and slave server



Q)what are the daemon for nis slave server
A)Ypserv ypbind

User Administration solaris interview

How to breakroot passwd


#ok boot cdrom –s

TERM=ansi

Export TERM

Mkdir /demo

Mount /dev/dsk/c0t0d0s0 /demo
Vi /naveen/etc/passwd

Root:KHGHGHGGFG:-remove this junk passwd

Wq!

Reboot it logins with out asking for passwd

# Passwd – enter new password.
Q)how to create a user

A)Useradd –u uid –g gid –d /export/home/naveen –m –s /bin/sh naveen

Q)whats are the files which maintain user informations

/etc/passwd
/etc/group
/etc/shadow

Q)fields in /etc/passwd
User-passwd-uid-gid-homedirectory-shell


Q)fields in /etc/group
A)groupname-gid


Q)fields in /etc/shadow
A)username:encrypted passwd-min-max-lastchange-inactive-warn-expire


Q)how to create a quotas
A)Cd /export/home
Touch quotas
Chmod u+rw quotas
Edquota naveen
Soft=5000 hard=6000 inodes=5000 inode=5500
Quotaon –v /export/home
Repqupota –v /export/home or quota –v naveen to see quota

solaris interview question Raid levels and File systems

Q) How to create raid 0 concatination

A) # metainit d0 2 1 c0t0d0s1 1 c0t1d0s1

Q)How to see the meta device information

A)# metastat

Q)How to format and mount a slice

A)newfs /dev/md/rdsk/d0
Mount /dev/md/dsk/d0 /nav

Q) how to create raid 0 stripping

A) #metainit d1 1 2 c0t0d0s1 c0t0d0s2
   #metastat
   #newfs /dev/md/rdsk/d1
  #mount /dev/md/dsk/c1 /naveen

Q) How to differentiate concatenation and stripping

A)when used metastat command stripping will show an interlace value 32KB this shows it is striped

Q)how to clear metadevices

A)#metaclear d0
   #metaclear d1

Q)How to create mirroring raid -1
  #metainit d1 1 1 c0t0d0s1
  Metainit d2 1 1 c0t0d0s2
  Metainit d3 –m d1
  Metattach d3 d2
  Metastat

Q)how to create stripe with parity
  #metainit d1 –raid5 c0t0d0s0 c0t0d0s0 c0t2d0s0
  Metastat
  Newfs /dev/md/rdsk/d1
  Mount /dev/md/rdsk/d1 /naveen

Q)how to grow the size of the volume
  #growfs –M /d1 c0t0d0s1-(new device)

Q)how to create raids using veritas volume manager concationation

A)#vxassit –g rootdg make vol01 20g
#newfs /dev/vx/rdsk/rootdg/vol01
#mount /dev/vx/dsk/rootdg/vol01 /naveen

Stripping
A)
vxassit –g rootdg make vol02 20g layout=stripe st_width=32
#newfs /dev/vx/rdsk/rootdg/vol02
#mount /dev/vx/dsk/rootdg/vol02 /naveen

mirroring

A)vxassit –g rootdg make vol03 20g layout=mirror
  newfs /dev/vx/rdsk/rootdg/vol03
  mount /dev/vx/dsk/rootdg/vol03 /naveen

stripping with parity.

A)vxassit –g rootdg make vol4 20g layout=raid5,nologs
newfs /dev/vx/rdsk/ro

No comments:

Post a Comment