Monday, August 13, 2007

Some amazing solaris notes

1. shadow file
username:password:days_from_1_jan_1970:min:max:warn:inactive:expire

2. group file
groupname:group-password:gid:user-list

3. /etc/skel directory sets enviornment for each shell

4. useradd

5. Terminfo
setenv lang de

6.admintool

7. share user home directory
a. check weather mountd is running or not ---- ps -ef| grep mountd
b. if not then run /etc/init.d/nfs.server start
c. check which all shares are shared ---- share
d. if not shared then add /etc/dfs/dfstab ----share -F nfs /export/home
e. share the filesystems in the /etc/dfs/dfstab ---- shareall -F nfs ----so that it will executes all the share commands in /etc/dfs/dfstab
f. fire --- share --- to check the shared folder

8. how to mount a user's home directory
vi /etc/vfstab
system-name:/export/home/vivek - /export/home/vivek nfs - yes rw
mkdir -p /export/home/vivek
mountall mount all the enteries in the vfstab
run ---- mount --- to cheeck weather mounted or not


9. If you decide to register your solaris user troubleshooting problems
then run the following commands first remove the
rm $HOME/.solregis/uprops
/usr/dt/bin/solregis


10.Servers and clients
a. servers contain / , /usr, swap , /opt,
servers can also contain solaris cd image or boot software for networked systems to perform remote installations
b. jumpstart directory for networked systems to perform custom jump start installations

11. shutting down and booting a system
a. runlevel -- who -r
b. init states
c. for shutting down use shutdown and init commands

shutdown -i init state -ggrace period -y yes
init --mention runlevel
grace -- grace period or time
runlevel 3 -- networking mode -- /sbin/rc3 each script i having a file in /etc/rc3.d/ to perform various actions for that runlevel
runlevel 6 -- stops the operating system and boots to the runlevel defined in inittab.
runlevel 0/5 -- shutdown cleanly and can be poweroff
runlevel S/1 -- this will boot in a single user mode


11. Kernel Parameters can be changed by changing the parameters in /etc/system
while changing the kernel parameters the in /etc/system file you need to boot in runlevel 6 to reflect the changes on the local machine.

12. performing a reconfiguration boot
adding any hardware you need to boot in reconfiguration mode

13. how to start and stop a service
/etc/init.d/filename start/stop/status
pgrep -f service # check is that the service running or not.
ex --- /etc/init.d/nfs.server stop -- -- pgrep -f nfs

14. adding a run control script
cp filename /etc/init.d/filename
chmod 0744 /etc/init.d/filename
chmod root:sys /etc/init.d/filename
ln /etc/init.d/filename /etc/rc3.d/S00filename
ln /etc/init.d/filename /etc/rc0.d/K00filename

ls /etc/init.d/ /etc/rc3.d/ /etc/rc3.d/ -- this should display the links

15.disable the script
cd /etc/rc3.d/
mv filename _filename
ls /etc/rc3.d


16. change default boot device
#init 0
>n -- type n and ok prompt will be displayed
ok setenv boot-device device[n]
ok printenv boot-device -- verify the default booting device change by using prntenv command
probe-scsi-all -- to find out the disk number
ok reset to save the configuration


boot in single user mode
ok boot -s

To boot the system interactively
ok boot -a

17. boot a system for recovery purposes
>ok boot cdrom -s -- for booting from a cd rom or ok boot net -s
#mount /dev/dsk/device-name /a
#cd /a/etc/
#TERM=sun
#export TERM
#vi passwd -- remove the invalid entry
#umount /a
#init 6

18. forcing a crash dump and rebooting the system
press
ok sync
This sync command will force a crash dump and rebooting the system.


19. Booting a system with kernel debugger
go to ok prompt and write kadb

20. boot in in x86
b -s and type cntrl -d to have a normal setup

To boot the system interactively
b -a

21. boot a system for recovery purposes
>ok b cdrom -s -- for booting from a cdrom or ok boot net -s
#mount /dev/dsk/device-name /a
#cd /a/etc/
#TERM=sun
#export TERM
#vi passwd -- remove the invalid entry
#umount /a
#init 6

22. forcing a crash dump and rebooting the system
press
ok sync
b kadb

This sync command will force a crash dump and rebooting the system.

Booting a system with kernel debugger
go to ok prompt and write kadb

23. mounting the removable media
1. manual mounting
-- insert media -- become superuser-- determine location of media device -- create a mount point -- mount the devices using the proper mount options
2. automatic mounting
-- insert media -- run volcheck -v -- it will do all the tasks reqiored to manually mount and work with CD's and diskettes -- work with files on media ---- eject media


CD will be there on /cdrom/cdrom0 and diskettes will be there on /floppy/floppy0

chceckin the CD is in use or not
fuser -u -k /cdrom/cdrom0
-u gives the user accessing the cD rom
-k kills the process accessing the CD

ejecting a CD-ROM
eject cdrom0

24. how to access cd-Rom Manually from a remote system
#mkdir directory
#showmount -e system-name
-- system-name =remote system name
#mount -F nfs -o ro system-name:/cdrom/cd-name local-mount-point
-- local mount point=where you want to mount this CD

25. how to make CD available to Other systems
a. become a super user
b. check nfsd is running or not -- pgrep -f nfsd -- /etc/init.d/nfs.server start
c. check is that CD folder shared or not --- share --
d. add a entry in /etc/dfs/dfstab
share -F nfs -o ro /cdrom/cdrom0/
e. mountall -- it runs all the commands in dfstab file
f. mount -- that will show all the shared files
run share to see the files share commands output

26. Prepare a system for a new CD-ROM Drive
touch /reconfigure
init 6

27. Configuring volume management
1.Become superuser
2.stop volmgt ----- /etc/init.d/volmgt stop

28. how to restart the volume manager
restart volmgt -----/etc/init.d/volmgt start


29. formatiing a floppy drive
fdformat -z -- this will list all the options to format the floppy

30. Volume management
/vol/dev/dsk/c0t6d0/ mounted on /cdrom
/vol/dev/rdiskette0 mounted on /floppy


31. software management in solaris
pkginfo
pkgrm
pkgadd