Documente Academic
Documente Profesional
Documente Cultură
Workouts - 1
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.
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
WORKOUTS -2
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 ?
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?
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 ...
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
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.
17. Display top ten largest files/directories ? - du -sk * | sort -nr | head
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
29. Display the top most process utilizing most CPU ? - top .b 1
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.
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?
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.
6) What are different type of RAID , explain each in brief , which is better for
performance
10) Explain Solaris boot process and Redhat Linux boot process
15) How will you map a SAN lun onto a Solaris host
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
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
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?
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
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.
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.
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).
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:
'r w x -r w x- r w x'
'r' is 4
'w' is 2
'x' is 1
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:
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.
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.
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.
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:
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
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.
Getting the value of an environment variable is done by using `getenv()'. Setting the
value of an environment variable is done by using `putenv()'.
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.)
Q: How do you display your running kernel version? (Solaris, AIX, Linux)
A: Linux # uname r , Solaris # showrev
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 command would you use to view partitions and their sizes on Solaris?
A: # df -kh
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 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
-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 &.
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.
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
What is the most graceful way to get to run level single user mode?
What does the following command line produce? Explain each aspect of this line.
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.
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.
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.
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.
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.
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.
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 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.