Sunteți pe pagina 1din 26

SUN SOLARIS EXERCISES Page 1 Page 1 of 26

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 2 Page 2 of 26

Workouts - 1

1. Combine the packages SUNWman, SUNWbash, SUNWftp into a single package


cluster.
2. Create a slice
a. Mount the slice as R/W in the local system
b. Should be mounted as RO in the network

3. Apply a ACL for a script file named xyz.sh, in such a way a user named Shivan
can only execute the file.
4. Implement Autofs for /usr/share/man
5. Enable diag-switch at OK prompt
6. Enable auto-boot as true in the OK prompt
7. Create a user account named Jai. Login in as Jai and mount a slice.
8. Create a user account named Che. Login as Che, and Shutdown the system.
Note: Che has to the only Shutdown the system. No other system administration
activity should be performed by him.

9. Perform snapshot for the /export/home directory.


10. Create the folder with the following condition:
a. All user should able to create a file or folder inside the newly created
folder named test
b. Only the owner of the file/dir have to delete it.
c. The file/directory created under test should be owned by different
group to which the owner is not belong to.

11. 3 category of users are there. For eg:


Admin Guru, Vandanaa
Sales Stalin, Sujatha
Tech Shivan, Hari

Whenever these users login to the system, a script file has to be executed by
default.
Note: Each set of users have different script file.

12. Find out which package is associated with the command #newfs
13. As a Root user, he like to execute the command
# whoami instead of # /usr/ucb/whoami
14. Save the newly created slices information to the file /etc/slices_info
15. Save the VTOC file contents to the file /etc/prtvtoc_bkp
16. a. Create a slice-3 with 2gb
b. Create a slice-4 with 4 gb
c. Mount the slice-3 as RW at the mount point /mnt/test
d. Mount the slice-4 as RO at the mount point /mnt/test

17. What is meant by free hog?


18. Create a SUID file.
19. Copy only the files and folders that starts with new to the folder /test/new
20. Create a script file to know the following information:
a. Who is logged to the system?
b. What they are doing?
c. Who dont have the passwords?
d. What services are on online?
Sun Workouts/UNIX, Storage Interview Questions Manickam
Kamalakkannan
SUN SOLARIS EXERCISES Page 3 Page 3 of 26
e. Who is using the ftp service?
21. Disable root login to the local server.
22. Find out the information, when the system is rebooted and save to the file
/etc/reboot_info
23.
24. Collect the information, when the /etc/passwd file is updated recently.
25. Restore only the selected files to the current location.
26. Find out what package is associated with the Star office application
27. Find out the location of the file md.tab
28. List the condition to run fsck command for the slice /dev/dsk/c0t0d0s7
29. drwxr-xr-x 1 shivan admin 234 12jan2009 hai
jai- belongs to tech group.
Hai- belongs to tech group.
But both hai & jai want to access all the files owned by admin group. Do the
needful.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 4 Page 4 of 26

WORKOUTS -2

1. Find out what are the packages are partially installed.


2. Find out how many packages are partially installed.
3. Find out how many packages are totally installed.
4. How to start the ftp and telnet services?
5. How to stop the nfs client side service?
6. How to disable telnet login for the root user?
7. How to deny ftp service for root user and a user named hari?
8. What are the fields in the crontab file? List out in sequence
9. How can you know what are the schedules in queue?
10. Find out the property of the mounted slice /dev/dsk/c0t0d0s5
11. Find out what are the process that are running by a user named hari
12. What is the use of snoop command?
13. How will you find out the alternate backup blocks for the slice
/dev/dsk/c0t0d0s7?
14. How will you change the forgotten password of root in Sparc machine?
15. How will you install a grub to the corrupted system?
16. How to enable telnet service for the root user?
17. What is the format of the patch?
18. What is the difference between patch and packages?
19. What is the difference between /etc/dfs/sharetab and/etc/dfs/dfstab file
20. What is the difference between direct mapping and indirect mapping?
21. Change the user login name Hari to Shivan. And make sure that Shivan can
store some of his newly created documents to the existing home directory.
22. Change the ownership and group for the folder along with its contents.
23. Create a SUID file
24. Find out last 10 reboots and save to the file /etc/reboot
25. What is the function of check script?
26. How will you identify the default printer?
27. How will you identity what the crond jobs scheduled?
28. How will you find out for how many hour the system is in the running state?
29. Where will you define the password security policy?
30. What are the features of Sun Solaris 10?
31. What is the difference between hard link and soft link?
32. How will you find out what are the recent files that are currently accessed?
33. How will you find out the disk usage?
34. What is meant by instance name?
35. How will you change the home directory of the user hari?
36. How will you identify the dump device?
37. How will you mount the /dev/fssnap/0 devices?
38. Where the logs of SULOG are stored?
39. How will you distinguish between the successful and failure sulog?
40. What is the purpose of loginlog file. Location of loginlog file
41. How will you kill a process?
42. What is the use of # fmthard command?
43. List out the ways to make the OS to recognize the newly connected hard disks.
44. What is the difference between boot r and boot a at OK prompt?
45. How will you assign a alias name for the physicial disk at OK prompt?
46. What is the function of # eeprom command
47. What is the difference between # eeprom and printenv command?

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 5 Page 5 of 26
48. How will you boot from cdrom in the single user mode at Sparc machine?
49. List out the permitted tag names to the slice?
50. What is the default flag for the swap slice?

Vertitas Volume Manager Interview questions

1) File do you modify to change the mail aliases (Provide the full path)?
2) What command do you run after modifying the aliases file make the
changes active?
3) How do you enable logging on a UFS file system?
What 4) What commands can you use to dynamically add scsi disks to a sun
system?
5) How do you install package to a specific directory? e.g like to
install wget in /home/vin/wget rather than the default one "/usr". ----
This was not answered by me.
6) What command shows what modules are loaded into the Kernel?
7) What command increases the priority of a process and all sub
processes on a solaris system?
8) What command in Solaris, do you use to setup aliases for devices?
9) How do you watch network traffic on interface qfe3?
10 ) What command shows TCP/IP parameter settings?
11) How do you set Network cards to 100 full interactively &
permanently?
12) What tools in Solaris help you diagnose harware failures?
13) How do you determine by how much a Veritas Volume can be expanded?
14) How do you grow a Veritas VXVM volume?
15) Where is the dump from a system crash normally kept? Can we
customize it?
16) How do you determine Volume Status in Veritas VxVM?
17) Why would you deport a diskgroup in VxVM?
18) How do you create additional state databases in solaris volume
manager? -- This was the tough one..!!
19) Does Solaris Volume Manager have soft partitioning?
20) How do you clear volume information from a solaris volume manager
disk?
21) How do you shutdown a Veritas Cluster Server, leaving the
applications running from the command line?
22) How do you speed up processing of a process and All it's child
processes? -- This was quite tricky..!!

1. Name the mandatory disk group in VxVM 3.5 ? How will configure VxVM in 3.5 ?
2. How will you create private and shared disk group using VxVM ?
3. Which are the different layouts for volumes in VxVM ?
4. What is the basic difference between private disk group and shared disk group ?
5. How will you add new disk to the existing disk group ?
6. How will grow/shrink the volume/file system ? What is the meaning of growby and
growto options ? What is the meaning on shrinkto and shrinkby options ?
7. How will you setup and unsetup disks explicitly using VxVM ?
8. How will list the disks, which are in different disk groups ?
9. What is private region in VxVM ?
10. If, vxdisk list command gives you disks status as "error", what steps you will follow
to make the respective disks online ?

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 6 Page 6 of 26

Some good questions on VERITAS Volume Manager. Before asking these questions
make sure that candidate is familiar with LVM or VxVM and knows the benefits of these
tools over traditional partitioning/file system.

1. Name the mandatory disk group in VxVM 3.5 ? How will configure VxVM in 3.5 ?
2. How will you create private and shared disk group using VxVM ?
3. Which are the different layouts for volumes in VxVM ?
4. What is the basic difference between private disk group and shared disk group ?
5. How will you add new disk to the existing disk group ?
6. How will grow/shrink the volume/file system ? What is the meaning of growby and
growto options ? What is the meaning on shrinkto and shrinkby options ?
7. How will you setup and unsetup disks explicitly using VxVM ?
8. How will list the disks, which are in different disk groups ?
9. What is private region in VxVM ?
10. If, vxdisk list command gives you disks status as "error", what steps you will follow
to make the respective disks online ?

These are some questions which I feel every storage professional should know. Please
let me know if these are useful, answers will be posted in coming posts.

Creating Volumes
Explain How will you create extra Volumes?

TELNET and SSS


If a server is pingable but unable to TELNET or SSS what will you check and how will
you resolve it?
Latest Answer: We have to enable the telnet and ssh servicessvcadm enable
telnetsvcadm enable sshAfter that we have to start the telnet servicesvcadm restart
telnetsvcadm restart ssh ...

Check SOLARIS System


How will you check whether a Solaris system is alive or not? If it is down what checks
will you do and how will you bring it up?

User Creation
What are ways we can create users in Solaris?
Latest Answer: There are 3 ways to create users: 1. Using `useradd` command 2.
Using `smuser` command 3. Adding user by modifying the following files: a. ...

IOSTAT Counter
How will you clear counter of iostat without rebooting the Solaris OS
Latest Answer: vxdmpadm iostat reset ...
Sun Workouts/UNIX, Storage Interview Questions Manickam
Kamalakkannan
SUN SOLARIS EXERCISES Page 7 Page 7 of 26

ACL -s -m Options
How to use -s and -m in acl ? Give two examples?
Latest Answer: HiYou can add acls for user "user1" using folowing command-#setfacl
-m u:user1:r--,g:testgroup:r-- File1Thanks,Amit Shiknis ...

Solaris Boot Disk


How do you determining current booted disk in sun Solaris OS?
Latest Answer: eeprom boot-device ...

Solaris Administration System Message


Which command is used to check System Messages?
Latest Answer: The "dmesg" command is uset to check the System messages. This
command just read and reflect the contents of /var/adm/messages file. ...

Kernal Initialization Files


What are the kernal initialization files?
Latest Answer: Kernel config file /etc/systemAll module independent files /kernelAll
Platform dependent files /platform/"h/w version"/kernelfor intel base it should be
i86pcfor sparc it should be sun4u ...

Public Private Regions


What are Private and Public region?
Latest Answer: Private region is where all the configuration information is there and
public region is where the user data is there (generally its related to VXVM) ...

1. What does the pkgadd command do?


2. What is OBP and how do you access it?
3. What is /etc/system for?
4. What does init 5 do?
5. What does init 0 do?
6. How do you boot from CD-ROM?
7. What is jumpstart?
8. How do you boot from a Network with jumpstart?
9. What does fmthard do?
10. Display the Disk Usage of file sizes under each directory in current Directory?
11. Display the processes, which are running under a particular username?
12. How do you find out drive statistics ?
13. How much space is used for users in kilobytes ?
14. Alternative for top command ?
15. Explain about RBAC?
16. Explain about sudo
17. Explain about umask?
18. What is free hog?
19. Give the syntax for combing the 3 packages into a software cluster
20. What command is used to check the network interface status at OK prompt?
21. What command will install bootblk to the disk drive at the time of OS
installation?

1.List the files in current directory sorted by size ? - ls -l | grep ^- | sort nr

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 8 Page 8 of 26
2. List the hidden files in current directory ? - ls -a1 | grep ^\.

3. Delete blank lines in a file ? - cat sample.txt | grep -v ^$ > new_sample.txt

4. Search for a sample string in particular files ? - grep .Debug. *.confHere grep uses
the string .Debug. to search in all files with extension..conf. under current directory.

5. Display the last newly appending lines of a file during appendingdata to the same file
by some processes ? - tail .f Debug.logHere tail shows the newly appended data into
Debug.log by some processes/user.

6. Display the Disk Usage of file sizes under each directory in currentDirectory ? - du -k
* | sort .nr (or) du .k . | sort nr

10. Display the processes, which are running under yourusername ? - ps .aef | grep
MaheshvjHere, Maheshvj is the username.

11. List some Hot Keys for bash shell ? - Ctrl+l . Clears the Screen. Ctrl+r . Does a
search in previously given commands in shell. Ctrl+u - Clears the typing before the
hotkey. Ctrl+a . Places cursor at the beginning of the command at shell. Ctrl+e . Places
cursor at the end of the command at shell. Ctrl+d . Kills the shell. Ctrl+z . Places the
currently running process into background.

12. Display the files in the directory by file size ? - ls .ltr | sort .nr .k 5

13. How to save man pages to a file ? - man | col .b >

Example : man top | col .b > top_help.txt

or # man rcs | col -bx > rcs.txt

14. How to know the date & time for . when script is executed ? - Add the following
script line in shell script.eval echo Script is executed at `date` >> timeinfo.infHere,
.timeinfo.inf. contains date & time details ie., when script is executed and history
related to execution.

15. How do you find out drive statistics ? - iostat E

16. Display disk usage in Kilobytes ? - du k

17. Display top ten largest files/directories ? - du -sk * | sort -nr | head

18. How much space is used for users in kilobytes ? - quot af

19. How to create null file ? - cat /dev/null > filename1

20. Access common commands quicker ? - ps -ef | grep -i $@

21. Display the page size of memory ? - pagesize a

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 9 Page 9 of 26
22. Display Ethernet Address arp table ? - arp a

23. Display the no.of active established connections to localhost ? - netstat -a | grep
EST

24. Display the state of interfaces used for TCP/IP traffice ? - netstat i

25. Display the parent/child tree of a process ? - ptree Example: ptree 1267

26. Show the working directory of a process ? - pwdx Example: pwdx 1267

27. Display the processes current open files ? - pfiles Example: pfiles 1267

28. Display the inter-process communication facility status ? ipcs

29. Display the top most process utilizing most CPU ? - top .b 1

30. Alternative for top command ? - prstat -a

1) Explain about Solaris?


Solaris is a UNIX based operating system which is available for free. It supports
workstations and servers from sun. It is widely recognized for its scalability. This
product is almost supported by many server vendors. It is the famous successor to sun
operating systems.

2) Explain the interoperability features of Solaris?


Solaris UNIX version runs on intel, AMD and SPARC platforms. It has migrated from
solely a SPARC platform to include other platforms from leading companies. It provides
interoperability across various technologies such as developer products, desktop
applications, data center, etc.

3) Describe about Logical Domains and its functions?


LDOMS system administrator center provides resources and links to developers who are
trying to install Ldoms technology. It gives you flexibility to group system resources and
discrete systems within a computer system physically. It allows you to group system
resources physically within its own operating system, identity and resources.

4) Explain about RBAC?


RBAC is introduced into Solaris for managing specific tasks. These specific tasks are
based and defined in the administrator profile. It is based on the standard developed by
NIST. RBAC is a very important tool for performing multiple tasks. It also separates
tasks which require high technical knowledge from low ones.

5) Explain about Roles?


RBAC implementation depends upon the role specified in the administrator profiles.
Roles are implemented according to the profile. Also access to certain files and
configuration can be assigned by the user profile. It also allows RBAC to differentiate
high technical knowledge roles from low ones.

6) What are the three different system management roles?


There are three different roles specified by Solaris they are

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 10 Page 10 of 26
1) Primary administrator who is responsible for security
2) System administrator is responsible for day to day roles
3) Operator is responsible for data back up and maintenance.

7) What are the different ways to execute profiles?


Profiles can be executed in many different ways some of them are
1) Pfexec executes a single command in profile
2) With some restrictions pfsh and pfcsh can be executed.
3) By directly logging into the account using su.

8) Explain about sudo?


Sudo maintains database of all the privileges assigned to a user name. These privileges
can be indentified by different commands present in the database. This feature helps a
user to format a disk but the root system cannot be changed.

9) Explain about the limitations present in sudo?


There are some limitations for sudo which makes RBAC popular they are
1) It is not possible to assign a user to work on specific file or profile.
2) It is also not possible to assign a user to work on a specific command.
3) By using shell commands and certain functions it is possible to have some
restrictions on a user but it would consume time for a larger setup.

10) Explain about the command ls?


Ls command gives a way to the main directory and also gives access permissions for
files in Solaris. It displays and prints user and group ownerships, file access
permissions, filename and files size and creation date.

11) Explain about sticky bit permissions?


This command helps the network administrator to relax a bit. This command will not
allow the deletion of the common files present in the common area. This command
helps the users by not allowing them to rewrite on other files. Certain permissions can
be set which will restrict users to delete files created by them.

12) How can you determine whether a file is setUID?


The easiest way to determine whether a file is setUID or not by checking for files which
are owned by the root and after checking for files that are owned by root you can check
for s flag files assigned to the user permissions. In the permission table the first s refers
to setUID root.

13) Explain about umask?


Wide set permissions can be set by using umask which can set write, read and execute
permissions on new files created by the user. These settings can be made from the
command line to reflect broad settings. It can also be set from the global system
settings file. Umask command displays all the settings made with that command.

14) What is the best solution to avoid large number of groups?


The best solution for not creating large number of groups lies with the system
administrator. It is best to use structural group membership which reflects
Sun Workouts/UNIX, Storage Interview Questions Manickam
Kamalakkannan
SUN SOLARIS EXERCISES Page 11 Page 11 of 26
organizational divisions. To manage file access a system admin can use access control
lists.

15) Explain the differences between setting files using octal codes and symbolic
codes?
The main difference between setting files using octal and symbolic code files is symbolic
codes are relative whereas octal codes are numeric codes. These settings will remain
unless you change the settings explicitly by using symbolic codes. If group execute
access gets executed it automatically removes write access permission.

16) Explain about the command prof_attr?


This forms the RBAC profile database. It displays the relationship between among the
profiles in the database. It also gives authorizations between navigation for those files.
One of the samples is
Solaris.admin.fsmgr.read.solaris.admin.serialmgr.read.

17) Explain about kadmin command?


Local kerbeors services can be managed by administering policies, keytabs and
principles by managing the kadmin command. Kadmin.local is used to master KDC and
it does not require any authentication. On the server login information is passed
through a secured server. It checks the principle name by the value of the user
environment variable.

1. You can ping servers on the subnet your workstation is on, but not other
subnets. What is wrong?
2. If you can ping a server, but can't telnet or ssh to it, what could be the problem?
3. If a user logs in to UNIX, it displays the desktop and then immediately logs you
back out, what could be wrong?
4. If you mistype a password, how do you clear it out to retype the password again.
5. When would you want to reconfigure the kernel and how would you do it?
6. Which is your favorite editor, shell, programming shell and why?
7. Why should you never have '.' in root's path?
8. If fsck is running, what is the one thing you shouldn't do?
9. What are the 3 or 4 major flavors of UNIX and what are their SA tools?
10. What kind of PC - UNIX connectivity programs are you familiar with?
11. What are: UFS, NFS, SaMBa, LDAP, NIS, DNS, Veritas
12. If you send an e-mail to someone and it comes back "Message Undeliverable",
what could be wrong.
13. How do you give a user access to an application or program that needs to run as
root without giving them the root password?
14. When you "ping server" and "ping server.domainname", you get different results.
Why?
15. Someone pings a server from another location and gets a different result than if
you ping the same server onsite. What is going on?
16. You know the reason the server won't boot is because of ODS, but the root
partition isn't on ODS. How do you go about fixing it?
17. How would you truncate a log file that is growing too large if you don't have
space to compress it or to move it somewhere else? How would you do it "hot"?
18. When the key is in the lock position on a Sun Enterprise server, can you do a
Stop-A? Explain.
19. What does "boot -a" do?
20. What is uadmin and what does it do?
21. What does "ypwhich servername" do? Why would you use it?

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 12 Page 12 of 26
22. If you have multiple ethernet interfaces, how do you keep it from routing
between them?
23. Can you add HDD's to a Sun server and not have to do a reconfiguration reboot?
Explain.

24. You can receive e-mail, but can't send any. What is wrong?
25. If you have forgotten the root password for a server, how do you get back in?
26. What makes NIS+ more secure than NIS?
27. After displaying the banner page, it says: Clock TOD does not match TOD on
any IO boards
How do you go about fixing this and what is it telling you?
28. What are the differences between Solaris 2.6 and lower and 7 and higher?
29. How can you search for commands at the boot prompt if you only know part of
the command?
30. What are the two settings you can change to make a system boot faster?
31. What are the differences between Sun OS and Solaris?
32. What do soft partitions buy you with Solaris Volume Manager?
33. How can you set EEPROM settings from Solaris?

These questions are asked in Dell,Invensys and collected from other interview
experiences of blog readers.

1 ) Difference between Solaris 8, Solaris 9 and Solaris 10

2) How to list disk in vertitas volume manager

3) What is initilization in veritas volume manager

4) What is encapsulation in veritas volume manager

5) How to secure direct remote login of root in solaris

6) What are different type of RAID , explain each in brief , which is better for
performance

7) What are the key compontents in Veritas Cluster Server

8) Difference between veritas cluster server and Microsoft cluster server

9) How to check whether installed solaris is of 32 bit or 64 bit

10) Explain Solaris boot process and Redhat Linux boot process

11) How to secure solaris installed on a machine

12) What are different run levels in Solaris & in Linux

13) Explain the hardware configuration steps in Solaris

14) How will you configure a NAS in Solaris,Linux

15) How will you map a SAN lun onto a Solaris host

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 13 Page 13 of 26
On Solaris 8 where is the log file for a failed patch installation stored?
/tmp/log.
Answer : /var/sadm/patch/patch-number ...

What file is the controlling file for the volume manager?


/etc/vold.conf
Answer : we got 2 controlling files for the volume manager1. /etc/vold.conf 2.
/etc/rmmount.conf ...

How would you find out what version of Solaris is currently running?
uname -a or uname -r
Answer : uname- -r Prints the operating system release level. -s ...

At the OBP how would see the device tree which will be used by the kernel during
boot to configure
At the OBP how would see the device tree which will be used by the kernel during boot
to configure devices?
show-devs

How to install win xp after installing solaris for dual booting?


Latest Answer : if you want to operate 2 OS's then you should install XP first after
solaris, why because XP will over right boot record of Solaris, so you can not get boot
menu, and if you install solaris after XP then it will Edit old boot record and places an

How can we find RAM size in solaris server ?


Latest Answer : prtconf | grep Memory ...

How to configure mail server in sun solaris?


Latest Answer : hii need configure the mail server for remote client & to take the back of
those mailsthankssathiya ...

When user login into solaris 8 it is repeatedly asking for user name and
password.What could be the
When user login into solaris 8 it is repeatedly asking for user name and password.What
could be the reason and what files has to be checked to fix this and which log file we
have to refer to know more details about the problem?

If in solaris 8 one server has more than one network interface cards, how do you
determine which is
If in solaris 8 one server has more than one network interface cards, how do you
determine which is primary? In solaris 8 how do you determine how many Ram cards
exist in a server and in which slots are they inserted?

What is the command for Install any software like oracle in Unix/Solaris? Why am
I not getting colors

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 14 Page 14 of 26
What is the command for Install any software like oracle in Unix/Solaris? Why am I not
getting colors while installing solaris9 even though it displays colors during test of KDM
configuration?How to install solaris9 in NON GUI mode?

General UNIX
1. What are the main differences between Apache 1.x and 2.x?
2. What does the route command do?
3. What are the read/write/execute bits on a directory mean?
4. What does iostat do?
5. what does vmstat do?
6. What does netstat do?
7. What is the most graceful way to bring a system into single user mode?
8. How do you determine disk usage?
9. What is AWK?
10. What is SED?
11. What is the difference between binaries in /bin, and /usr/bin?
12. What is a dynamically linked file?
13. What is a statically linked file?

UNIX Password change issue


Hi,While trying to change the password of a normal user [ I logged in as root], I am
getting the following message :-[root@localhost root]# passwd someuserChanging
password for user someuser.passwd: Authentication
Latest Answer: run pwdck command at the command line.this command will ensure the
consistency with all the user authentication files like1. /etc/security/passwd2.
/etc/passwd3. /etc/security/login.cfg4. /etc/security/user ...

How do you mount Linux partition on windows

UNIX Maximum simultaneous logins


how many simultaneous logins are allowed in Linux/Solaris for a single user ?
Latest Answer: The Linux PAM (Pluggable Authentication Modules) where we can set
useful limits for users or login, which can be configured in the /etc/security/limits.conf
file.You can control the total limitation with the maxlogins option. Entries within
limits.conf ...

Inter process command


inter process command in UNIX be achieved by a)pipes b)messages c)semaphores
d)shared memory e)all
Latest Answer: d)ALL ...

If device driver is put inside RTOS Kernel or User Application, What are the
advantages and disadvantages
If device driver is put inside RTOS Kernel or User Application, What are the advantages
and disadvantages ? How can you debug

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 15 Page 15 of 26
What is the main purpose of using UNIX for the software testing process ? please
explain ?
Latest Answer: To ad to that ....UNIX is also used by about 30% of the population using
computers. Remember not everyone likes windows or microsoft.expand your scope as
you will cover the majority ...

What are Trace files and Log Files in Unix and How do they help in conducting
back end testing?
Latest Answer: Hope this does anser your question - General System Information
Tools/Utilitiesuname -a -- brief OS and kernel information. dmesg -- kernel messages
given during booting. cat /var/log/messages -- is the same as dmesg tail -f
/var/log/messages -- show ...

Explain design philosophy of UNIX operating system and explain the mechanism
of inter process communication
Explain design philosophy of UNIX operating system and explain the mechanism of
inter process communication and synchronization.

How do you find OS block size in UNIX TRU64


Latest Answer: Block size will vary with respect to the OS configuration. The following
table shows the most common log block sizes and some of the operating systems that
use them. Log Block Size Operating Systems 512 bytes Solaris, AIX, Windows NT/2000,
Linux, Irix, ...

What is the difference between Daemon & Server process.


Please give examples of both Daemon and Server processes. Thanks.
Latest Answer: A Daemon is a software process that runs in the background
(continuously) and provides the service to client upon request. For example named is a
daemon. When requested it will provide DNS service. Other examples are: xinetd (it is a
super-daemon, ...

1. How are devices represented in UNIX?


2. What is 'inode'?
3. Brief about the directory representation in UNIX
4. How do you change File Access Permissions?
5. What are links and symbolic links in UNIX file system?
6. What is a FIFO?
7. How do you create special files like named pipes and device files?
8. Discuss the mount and unmount system calls
9. How does the inode map to data block of a file?
10. What is a shell?
11. Brief about the initial process sequence while the system boots up.
12. What are various IDs associated with a process?
13. What Happens when you execute a program?
14. What Happens when you execute a command?
15. What is a Daemon?
16. What is 'ps' command for?
17. How would you kill a process?

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 16 Page 16 of 26
18. What is an advantage of executing a process in background?
19. What is the difference between Swapping and Paging?
20. What is a Map?
21. What do you mean by u-area (user area) or u-block?
22. What do you mean by nice value?
23. Explain different types of Unix systems.
24. Explain kernal and shell.
25. What is ex and vi ?
26. Which are typical system directories below the root directory?
27. Construct pipes to execute the following jobs.
28. Explain the following commands.
29. What is the significance of the tee command?
30. What does the command $who | sort logfile > newfile do?
31. What does the command $ls | wc l > file1 do?
32. Which of the following commands is not a filter man , (b) cat , (c) pg , (d) head
33. How is the command $cat file2 different from $cat >file2 and >> redirection
operators ?
34. Explain the steps that a shell follows while processing a command.
35. What difference between cmp and diff commands?
36. What is the use of grep command?
37. What is the difference between cat and more command?
38. Write a command to kill the last background job?
39. Which command is used to delete all files in the current directory and all its
sub-directories?
40. Write a command to display a files contents in various formats?
41. What will the following command do?
42. Is it possible to create new a file system in UNIX?
43. Is it possible to restrict incoming message?
44. What is the use of the command "ls -x chapter[1-5]"
45. Is du a command? If so, what is its use?
46. Is it possible to count number char, line in a file; if so, How?
47. Name the data structure used to maintain file identification?
48. How many prompts are available in a UNIX system?
49. How does the kernel differentiate device files and ordinary files?
50. How to switch to a super user status to gain privileges?
51. What are shell variables?
52. What is redirection?

53. How to terminate a process which is running and the specialty on command kill
0?
54. What is a pipe and give an example?
55. Explain kill() and its possible return values.

UNIX - LINUX Interview Questions and Answers :

1. How are devices represented in UNIX?

All devices are represented by files called special files that are located in/dev directory.
Thus, device files and other files are named and accessed in the same way. A 'regular
file' is just an ordinary data file in the disk. A 'block special file' represents a device with
characteristics similar to a disk (data transfer in terms of blocks). A 'character special
file' represents a device with characteristics similar to a keyboard (data transfer is by
stream of bits in sequential order).

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 17 Page 17 of 26
2. What is 'inode'?

All UNIX files have its description stored in a structure called 'inode'. The inode
contains info about the file-size, its location, time of last access, time of last
modification, permission and so on. Directories are also represented as files and have
an associated inode. In addition to descriptions about the file, the inode contains
pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a
block of pointers to additional data blocks (this further aggregates for larger files). A
block is typically 8k.
Inode consists of the following fields:

File owner identifier


File type
File access permissions
File access times
Number of links
File size
Location of the file data

3. Brief about the directory representation in UNIX

A Unix directory is a file containing a correspondence between filenames and inodes. A


directory is a special file that the kernel maintains. Only kernel modifies directories, but
processes can read directories. The contents of a directory are a list of filename and
inode number pairs. When new directories are created, kernel makes two entries named
'.' (refers to the directory itself) and '..' (refers to parent directory).
System call for creating directory is mkdir (pathname, mode).

5. How do you change File Access Permissions?

Every file has following attributes:


owner's user ID ( 16 bit integer )
owner's group ID ( 16 bit integer )
File access mode word

'r w x -r w x- r w x'

(user permission-group permission-others permission)


r-read, w-write, x-execute
To change the access mode, we use chmod(filename,mode).
Example 1:
To change mode of myfile to 'rw-rw-r' (ie. read, write permission for user - read,write
permission for group - only read permission for others) we give the args as:
chmod(myfile,0664) .
Each operation is represented by discrete values

'r' is 4
'w' is 2
'x' is 1

Therefore, for 'rw' the value is 6(4+2).


Example 2:
To change mode of myfile to 'rwxrr' we give the args as:
Sun Workouts/UNIX, Storage Interview Questions Manickam
Kamalakkannan
SUN SOLARIS EXERCISES Page 18 Page 18 of 26
chmod(myfile,0744).

6. What are links and symbolic links in UNIX file system?

A link is a second name (not a file) for a file. Links can be used to assign more than one
name to a file, but cannot be used to assign a directory more than one name or link
filenames on different computers.
Symbolic link 'is' a file that only contains the name of another file.Operation on the
symbolic link is directed to the file pointed by the it.Both the limitations of links are
eliminated in symbolic links.
Commands for linking files are:

Link ln filename1 filename2


Symbolic link ln -s filename1 filename2

7. What is a FIFO?

FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file
which is said to be data transient. Once data is read from named pipe, it cannot be read
again. Also, data can be read only in the order written. It is used in interprocess
communication where a process writes to one end of the pipe (producer) and the other
reads from the other end (consumer).

8. How do you create special files like named pipes and device files?

The system call mknod creates special files in the following sequence.
1. kernel assigns new inode,
2. sets the file type to indicate that the file is a pipe, directory or special file,
3. If it is a device file, it makes the other entries like major, minor device numbers.
For example:
If the device is a disk, major device number refers to the disk controller and minor
device number is the disk.

9. Discuss the mount and unmount system calls

The privileged mount system call is used to attach a file system to a directory of another
file system; the unmount system call detaches a file system. When you mount another
file system on to your directory, you are essentially splicing one directory tree onto a
branch in another directory tree. The first argument to mount call is the mount point,
that is , a directory in the current file naming system. The second argument is the file
system to mount to that point. When you insert a cdrom to your unix system's drive,
the file system in the cdrom automatically mounts to /dev/cdrom in your system.

10. How does the inode map to data block of a file?

Inode has 13 block addresses. The first 10 are direct block addresses of the first 10
data blocks in the file. The 11th address points to a one-level index block. The 12th
address points to a two-level (double in-direction) index block. The 13th address points
to a three-level(triple in-direction)index block. This provides a very large maximum file
size with efficient access to large files, but also small files are accessed directly in one
disk read.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 19 Page 19 of 26
11. What is a shell?

A shell is an interactive user interface to an operating system services that allows an


user to enter commands as character strings or through a graphical user interface. The
shell converts them to system calls to the OS or forks off a process to execute the
command. System call results and other information from the OS are presented to the
user through an interactive interface. Commonly used shells are sh,csh,ks etc.

12. Brief about the initial process sequence while the system boots up.

While booting, special process called the 'swapper' or 'scheduler' is created with
Process-ID 0. The swapper manages memory allocation for processes and influences
CPU allocation. The swapper inturn creates 3 children:

the process dispatcher,


vhand and
dbflush

with IDs 1,2 and 3 respectively.


This is done by executing the file /etc/init. Process dispatcher gives birth to the shell.
Unix keeps track of all the processes in an internal data structure called the Process
Table (listing command is ps -el).

13. What are various IDs associated with a process?

Unix identifies each process with a unique integer called ProcessID. The process that
executes the request for creation of a process is called the 'parent process' whose PID is
'Parent Process ID'. Every process is associated with a particular user called the 'owner'
who has privileges over the process. The identification for the user is 'UserID'. Owner is
the user who executes the process. Process also has 'Effective User ID' which
determines the access privileges for accessing resources like files.

getpid() -process id
getppid() -parent process id
getuid() -user id
geteuid() -effective user id

14. Explain fork() system call.

The `fork()' used to create a new process from an existing process. The new process is
called the child process, and the existing process is called the parent. We can tell which
is which by checking the return value from `fork()'. The parent gets the child's pid
returned to him, but the child gets 0 returned to him.

18. How can you get/set an environment variable from a program?

Getting the value of an environment variable is done by using `getenv()'. Setting the
value of an environment variable is done by using `putenv()'.

19. How can a parent and child process communicate?

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 20 Page 20 of 26
A parent and child can communicate through any of the normal inter-process
communication schemes (pipes, sockets, message queues, shared memory), but also
have some special ways to communicate that take advantage of their relationship as a
parent and child. One of the most obvious is that the parent can get the exit status of
the child.

20. What is a zombie?

When a program forks and the child finishes before the parent, the kernel still keeps
some of its information about the child in case the parent might need it - for example,
the parent may need to check the child's exit status. To be able to get this information,
the parent calls `wait()'; In the interval between the child terminating and the parent
calling `wait()', the child is said to be a `zombie' (If you do `ps', the child will have a `Z' in
its status field to indicate this.)

21. What are the process states in Unix?

As a process executes it changes state according to its circumstances. Unix processes


have the following states:
Running : The process is either running or it is ready to run .
Waiting : The process is waiting for an event or for a resource.
Stopped : The process has been stopped, usually by receiving a signal.
Zombie : The process is dead but have not been removed from the process table.

What is the command in UNIX to see a list of opened files?


lsos
Latest Answer: lsof - List open files on the system. Normally, it only lists files you (or
processes you own) have open; if run as root, it lists all open files. ...

When Grub is crashed then how i start the linux os?


Latest Answer: boot frm 1st cd type1) chroot /mnt/sysimage2) grub-install /dev/sda .

Q: How do you display your running kernel version? (Solaris, AIX, Linux)
A: Linux # uname r , Solaris # showrev

Q: Which command do you use to display a table of running processes? (Solaris,


AIX, Linux)
A: Linux # ps -ef and top , Solaris # prstat

Q: Which file do you modify to configure a domain name resolver? (Solaris, AIX,
Linux)
A: Linux # /etc/resolv.conf , Solaris # /etc/resolv.conf

Q: Which file contains a list of locally defined hostnames and corresponding IP


addresses? (Solaris, AIX, Linux)
A: Linux # /etc/hosts , Solaris # /etc/hosts and linked file /etc/inet/hosts

Q: How do you display a routing table? (Solaris, AIX, Linux)


A: Linux # ip route show or #netstat -nr or #route -n and Solaris # netstat -nr and
#route -n

Q: Which command would you use to view partitions and their sizes on Solaris?
A: # df -kh

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 21 Page 21 of 26
Q: Which OpenBoot command would you use to print/view OpenBoot environment
variables on a SUN server?
A: #printenv

Q: What does # ypwhich command do? (Solaris, AIX, Linux)


A: # Will display NIS server to which client is connected to and which NIS Server is
master for particular map specified with this command

Q: which command would you use to create an OS user on Solaris and Linux?
A: Linux # useradd and Solaris #useradd

Q: Which file contains passwords for local users on Solaris, Linux and on AIX?
A: Linux #/etc/shadow and Solaris # /etc/shadow

Q: Which command would you use to list partitions on Linux?


A: Linux # mount -l or # df -kh

Q: Which command/commands would you use to manage installed packages on


RedHat Linux?
A: Linux # rpm

Q: What is the default port for SSH server?


A: 22

Q: Which command/commands would you use to manage installed packages on


Solaris?
A: #pkginfo #pkgrm # pkgadd #pkgchk

Q: What command would you use to install an OS patch on Solaris?


A: #showrev -p and #patchadd -p

Q: Which Veritas command would you use to display a list of Veritas volumes?
A: # vxprint

Q: Which Veritas command would you use to display a list of disks on a system?
A: # vxdx list

Q: Which file has a list of filesystems to be mounted at boot time on Solaris, Linux
and AIX?
A: Linux # /etc/fstab and Solaris #/etc/vfstab

-Job Scheduling; mainly crontab, at, batch command


Backup strategy; incremental, full system back up; diff between tar & ufsdump
-diff between hard link & soft link
-How to list only the directories inside a directory (Ans. ls -l|grep "^d")
-RAID levels; pros & cons of different levels; what is RAID 1+0

-How to recover a system whose root password has lost?


-What is a daemon?
-How to put a job in background & bring it to foreground?
-What is default permissions for others in a file?
-Questions on shell initialization scripts?
-Questions on restricted shell

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 22 Page 22 of 26
-What is diff between grep & find?
-What is egrep?
-Questions on shell programming
-What is a pipe?
-Questions on Solaris patch management like pkgadd etc
-Questions on file system creation; actually what happens when we create a file system?
-Questions on RBAC? what is a role account & what is a profile?
-From command line how will you add a user account? The full commands will all
arguments.
-Fs it advisable to put a swap partition in RAID1 (mirroring?) pros & cons?

Linux admin interview questions

-Write a script to list all the differences between two directories.


-Write a program in any language you choose, to reverse a file.
-What are the fields of the password file?
-What does a plus at the beginning of a line in the password file signify?
-Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
-What is an MX record?
-What is the prom command on a Sun that shows the SCSI devices?
-What is the factory default SCSI target for /dev/sd0?
-Where is that value controlled?
-What happens to a child process that dies and has no parent process to wait for it and
what is bad about this?
-What is wrong with sendmail? What would you fix?
-What command do you run to check file system consistency?
-What is wrong with running shutdown on a network?
-What can be wrong with setuid scripts?
-What value does spawn return?
-Write a script to send mail from three other machines on the network to root at the
machine you are on. Uses are here to but include in the mail message the name of the
machine the mail is sent from and the disk utilization statistics on each machine?
-Why cannot root just cd to someone iss home directory and run a program called a.out
sitting there by typing a.out, and why is this good?
-What is the difference between UDP and TCP?
-What is DNS?
-What does nslookup do?
-How do you create a swapfile?
-How would you check the route table on a workstation/server?

-How do you find which ypmaster you are bound to?


-How do you fix a problem where a printer will cutoff anything over 1MB?
-What is the largest file system size in solaris? SunOS?
-What are the different RAID levels?

Linux admin interview questions

-How do you list the files in an UNIX directory while also showing hidden files? ls -ltra

-How do you execute a UNIX command in the background? Use the &.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 23 Page 23 of 26
-What UNIX command will control the default file permissions when files are created?
umask
-Explain the read, write, and execute permissions on a UNIX directory. Read allows you
to see and list the directory contents. Write allows you to create, edit and delete files
and subdirectories in the directory. Execute gives you the permissions to run programs
or shells from the directory.
-What is the difference between a soft link and a hard link? A symbolic (soft) linked file
and the targeted file can be located on the same or different file system while for a hard
link they must be located on the same file system.
-Give the command to display space usage on the UNIX file system. df -lk
-Explain iostat, vmstat and netstat. iostat reports on terminal, disk and tape I/O
activity. vmstat reports on virtual memory statistics for processes, disk, tape and CPU
activity. netstat reports on the contents of network data structures.
-How would you change all occurrences of a value using VI? %s/(old value)/(new
value)/g
-Give two UNIX kernel parameters that effect an Oracle install. SHMMAX & SHMMNI
-Briefly, how do you install Oracle software on UNIX? Basically, set up disks, kernel
parameters, and run orainst.

Unix/Linux administration interview questions

What is LILO?

LILO stands for Linux boot loader. It will load the MBR, master boot record, into the
memory, and tell the system which partition and hard drive to boot from.

What is the main advantage of creating links to a file instead of copies of the file?

A: The main advantage is not really that it saves disk space (though it does that too)
but, rather, that a change of permissions on the file is applied to all the link access
points. The link will show permissions of lrwxrwxrwx but that is for the link itself and
not the access to the file to which the link points. Thus if you want to change the
permissions for a command, such as su, you only have to do it on the original. With
copies you have to find all of the copies and change permission on each of the copies.

Write a command to find all of the files which have been accessed within the last
30 days.

find / -type f -atime -30 > December.files

This command will find all the files under root, which is /, with file type is file.
-atime -30 will give all the files accessed less than 30 days ago. And the output

will put into a file call December.files.

What is the most graceful way to get to run level single user mode?

A: The most graceful way is to use the command init s.


If you want to shut everything down before going to single user mode then do init 0 first
and from the ok prompt do a boot -s.

What does the following command line produce? Explain each aspect of this line.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 24 Page 24 of 26

$ (date ; ps -ef | awk {print $1} | sort | uniq | wc -l ) >> Activity.log

A: First lets dissect the line: The date gives the date and time as the first command
of the line, this is followed by the a list of all running processes in long form with UIDs
listed first, this is the ps -ef. These are fed into the awk which filters out all but the
UIDs; these UIDs are piped into sort for no discernible reason and then onto uniq (now
we see the reason for the sort - uniq only works on sorted data - if the list is A, B, A,
then A, B, A will be the output of uniq, but if its A, A, B then A, B is the output)
which produces only one copy of each UID.

These UIDs are fed into wc -l which counts the lines - in this case the number of
distinct UIDs running processes on the system. Finally the results of these two
commands, the date and the wc -l, are appended to the file "Activity.log". Now to answer
the question as to what this command line produces. This writes the date and time into
the file Activity.log together with the number of distinct users who have processes
running on the system at that time. If the file already exists, then these items are
appended to the file, otherwise the file is created.

Unix admin questions

How do you list the files in an UNIX directory while also showing hidden files?
How do you execute a UNIX command in the background?
What UNIX command will control the default file permissions when files are created?
Explain the read, write, and execute permissions on a UNIX directory.
What is the difference between a soft link and a hard link?
Give the command to display space usage on the UNIX file system.
Explain iostat, vmstat and netstat.
How would you change all occurrences of a value using VI?
Give two UNIX kernel parameters that effect an Oracle install
Briefly, how do you install Oracle software on UNIX.

Linux command line Q&A

You need to see the last fifteen lines of the files dog, cat and horse. What
command should you use?
tail -15 dog cat horse
The tail utility displays the end of a file. The -15 tells tail to display the last fifteen lines
of each specified file.

Who owns the data dictionary?


The SYS user owns the data dictionary. The SYS and SYSTEM users are created when
the database is created.

You routinely compress old log files. You now need to examine a log from two
months ago. In order to view its contents without first having to decompress it,
use the _________ utility.
zcat
The zcat utility allows you to examine the contents of a compressed file much the same
way that cat displays a file.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 25 Page 25 of 26

You suspect that you have two commands with the same name as the command is
not producing the expected results. What command can you use to determine the
location of the command being run?
which
The which command searches your path until it finds a command that matches the
command you are looking for and displays its full path.

You locate a command in the /bin directory but do not know what it does. What
command can you use to determine its purpose?
whatis
The whatis command displays a summary line from the man page for the specified
command.

You wish to create a link to the /data directory in bobs home directory so you
issue the command ln /data /home/bob/datalink but the command fails. What
option should you use in this command line to be successful.
Use the -F option
In order to create a link to a directory you must use the -F option.

When you issue the command ls -l, the first character of the resulting display
represents the files ___________.
type
The first character of the permission block designates the type of file that is being
displayed.

What utility can you use to show a dynamic listing of running processes?
__________
top
The top utility shows a listing of all running processes that is dynamically updated.

Where is standard output usually directed?


to the screen or display
By default, your shell directs standard output to your screen or display.

You wish to restore the file memo.ben which was backed up in the tarfile
MyBackup.tar. What command should you type?
tar xf MyBackup.tar memo.ben
This command uses the x switch to extract a file. Here the file memo.ben will be
restored from the tarfile MyBackup.tar.

You need to view the contents of the tarfile called MyBackup.tar. What command
would you use?
tar tf MyBackup.tar
The t switch tells tar to display the contents and the f modifier specifies which file to
examine.

You want to create a compressed backup of the users home directories. What
utility should you use?
tar
You can use the z modifier with tar to compress your archive at the same time as
creating it.

What daemon is responsible for tracking events on your system?


syslogd

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan
SUN SOLARIS EXERCISES Page 26 Page 26 of 26
The syslogd daemon is responsible for tracking system information and saving it to
specified log files.

You have a file called phonenos that is almost 4,000 lines long. What text filter
can you use to split it into four pieces each 1,000 lines long?
split
The split text filter will divide files into equally sized pieces. The default length of each
piece is 1,000 lines.

You would like to temporarily change your command line editor to be vi. What
command should you type to change it?
set -o vi
The set command is used to assign environment variables. In this case, you are
instructing your shell to assign vi as your command line editor. However, once you log
off and log back in you will return to the previously defined command line editor.

What account is created when you install Linux?


root
Whenever you install Linux, only one user account is created. This is the superuser
account also known as root.

What command should you use to check the number of files and disk space used
and each users defined quotas?
repquota
The repquota command is used to get a report on the status of the quotas you have set
including the amount of allocated space and amount of used space.

Sun Workouts/UNIX, Storage Interview Questions Manickam


Kamalakkannan

S-ar putea să vă placă și