Solaris Questions & Solutions


 1)How do you start the DNS service in solaris10?
Ans) #svcadm enable dns
          Check that /etc/resolv.conf contains the ip address of the correct nameservers.

2)How to shutdown a ethernet interface?
Ans) ifconfig hme0 down (up)

3)How can you change the attributes of ethernet interfaces?
Ans) using ifconfig and ndd command

4)How to change the java to point to another version.
Ans) SUppose that now the java is pointing to Java1.5 and you want to point that to Java1.6
#java -vesion
java 1.5.024

as root: change the symlink.
      rm /usr/java; ln -s jdk/jdk1.6.0_7 /usr/java
    (don't forget to delete the old symlink, or the new symlink
    will be created somewhere else than in /usr)

 as user:
    create some $HOME/bin, make sure it's in the path, and link into
    it all the important binaries from /usr/jdk/instances/jdk1.6.0_07
    and finally make sure, that $HOME/bin is in your PATH.

 as anyone:
    Change the PATH variable to contain
      /usr/jdk/instances/jdk1.6.0_07/bin
    before /usr/bin (or /bin, which is usually the same on solaris)

5)How to change a restart he syslogd in solaris
Ans) svcadm restart system-log

6)My system doesn't boot because the boot archive is corrupt. What do I do?

Ans)The boot archive contains the kernel modules and configuration files that are required to boot your machine. Boot up in Solaris failsafe mode. Your Solaris image should be mounted on /a. Type the following:
rm -f /a/platform/i86pc/boot_archive; bootadm update-archive -R /a


7)What is the location of GCC

Ans) /usr/sfw/bin

8)How to find the boot-device using eeprom
Ans)eeprom boot-device
#eeprom -i | grep bootpath ( solaris x86)



9)How to mount a cdrom in solaris?
Ans) If vold service is not running then you must start that
#/usr/sbin/vold &
CDROM on Solaris is usually linked to device /dev/sr0
#ls -al /dev/sr* |awk '{print "/" $11}'
/dev/dsk/c1t0dos0

#mount -F hsfs -o ro /dev/dsk/c1t0d0s0 /cdrom


10)How to check the vendor names of the hardisk and cdrom

Ans)#iostat -En
11)How to reboot a server into another disk

Ans)(At OK prompt)If the system doesn't boot in the present boot disk then you must use "nvalias" command to make secondary disk as boot disk
In case system can not boot from primary disk and it is needed to make another boot disk to access the data , nvalias command is used. nvalias command makes the device alias and assigns an alternate name to a physical disk. Physical address of target disk is required which can be had by show-disk command on ok>. ok> nvalias disk2 /iommu@f,e0000000/sbus@f,e0001000/dma@3,81000/esp@3,80000/sd2,0 The new aliased disk can be named as boot disk or can be used for booting by referring its name ok> setenv boot-device disk2 ok>reset or ok> boot disk2


{{{{{{{{or}}}}


#reboot disk2

12)How to get GUI on text solaris 11 ?
Ans) #pkg install slim_install

13)How to disable firewall in solaris 10?
Ans) #pfexec ipf -D

14)To set global environment variables in solaris?
Ans) #vi .bashrc
copy all the variables like
export HOSTNAME=solaris
export CMD_HOME=/etc/opt/cmd/home

15)Adding route to the solaris
  Ans)      #route add net 128.50.3.0 bigbox
Delete router
#route delete destination source
Lookup and display the route for a destination:
# route get 128.50.2.0
Get routing reports continuously
# route monitor
Flush the routing table:
# route flush
Add the multicast path for 224.0.0.0:
# route add 224.0.0.0 `uname -n` 0
Use the "route add net" command with the -netmask option to make the route command to take the netmask specified on the command line

# route add net 192.168.68.0 128.50.1.250 1 -netmask 255.255.255.192

16)How to copy an entire deirectory from one location to another?
Ans) #cp -R directorytobecopied/ /destinationdirectory

17)SSH without passord?
Ans) #cd .ssh
#ssh-keygen -t rsa
#cat id_rsa.pub | ssh user@remotemachine "cat - >> .ssh/authorized_keys"
#ssh root@remotemachine

18) SCP files from one machine to another machine without password?
Ans) make the machines SSH without password and you can copy the files without passwords
#scp destinationfile root@remotemachine:/destinationfolder


19)What is the command to find the RAM size in solaris?
Ans)  #sdtwsinfo (to get the complete system configuration  in GUI)
         #prtconf
         #prtdiag
20)How do you check crontab of other users (you are root user)?
Ans) #crontal -l <username>

21)how do you find the MAC address of remote machines
netstat -p
how to find the DHCP configuration
netstat -D

No comments:

Post a Comment