Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Ans: LVM stands for Logical Volume Manager , to resize filesystems size online we
required LVM partition in Linux. Size of LVM partition can be extended and reduced
using the lvextend & lvreduce commands respectively.
Ans: Using free & vmstat command we can display the physical and virtual
memory statistics respectively.With the help of sar command we see the CPU
utilization & other stats.
Q:3 What does Sar provides and at which location Sar logs are stored ?
Ans: Sar Collect, report, or save system activity information. The default version of
the sar command (CPU utilization report) might be one of the first facilities
the user runs to begin system activity investigation, because it monitors major
system resources. If CPU utilization is near 100 percent (user + nice + system), the
workload sampled is CPU-bound.
By default log files of Sar command is located at /var/log/sa/sadd file, where the dd
parameter indicates the current day.
Ans: Below are the logical Steps to reduce size of LVM partition :
-Umount the filesystem using umount command,
-use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G
-Now use the lvreduce command , e.g lvreduce -L 10G /dev/mapper/myvg-mylv
Above Command will shrink the size & will make the filesystem size 10GB.
Q:6 How to create partition from the raw disk ?
Ans: Using fdisk utility we can create partitions from the raw disk.Below are the steps
to create partition from the raw dsik :
fdisk /dev/hd* (IDE) or /dev/sd* (SCSI)
Type n to create a new partition
After creating partition , type w command to write the changes to the partition
table.
Ans: umask stands for User file creation mask, which determines the settings of a
mask that controls which file permissions are set for files and directories when they
are created.
Ans: To set this value permanently for a user, it has to be put in the appropriate
profile file which depends on the default shell of the user.
Ans: To change the run level we have to edit the file /etc/inittab and change
initdefault entry ( id:5:initdefault:). Using init command we change the run level
temporary like init 3 , this command will move the system in runlevl 3.
Ans: To share a directory using nfs , first edit the configuration file /etc/exportfs ,
add a entry like
/<directory-name> <ip or Network>(Options) and then restart the nfs service.
Ans: Using showmount command we can see what directories are shared via nfs
e.g showmount -e <ip address of nfs server>.Using mount command we can mount
the nfs share on linux machine.
Q:13 What are the default ports used for SMTP,DNS,FTP,DHCP,SSH and squid
?
Ans: Service Port
SMTP 25
DNS 53
FTP 20 (data transfer) , 21 ( Connection established)
DHCP 67/UDP(dhcp server) , 68/UDP(dhcp client)
SSH 22
Squid 3128
Ans: Network bonding is the aggregation of multiple Lan cards into a single bonded
interface to provide fault tolerance and high performance. Network bonding is also
known as NIC Teaming.
Q:16 How to check and verify the status the bond interface.
Ans: Using the command cat /proc/net/bonding/bond0 , we can check which mode
is enabled and what lan cards are used in this bond. In this example we have one
only one bond interface but we can have multiple bond interface like bond1,bond2
and so on.
Ans: Using the Commands netstat -nr and route -n we can see the default route
and routing tables.
Q:19 List the services that are enabled at a particular run level in linux server ?
Ans: With the help of command chkconfig list | grep 5:on we can list all the service
that are enabled in run level5. For other run levels just replace 5 with the respective
run level.
Ans: We should never upgrade Linux Kernel , always install the new New kernel
using rpm command because upgrading a kenel can make your linux box in a
unbootable state.
Q:22 How To scan newly asssigned luns on linux box without rebooting ?
Ans: We can find the WWN numbers of HBA cards using the command systool -c
fc_host -v | grep port_name
Ans: To Set the kernel parameters in linux , first edit the file /etc/sysctl.conf after
making the changes save the file and run the command sysctl -p , this command
will make the changes permanently without rebooting the machine.
Ans: Manifests in Puppet are the files in which the client configuration is specified.
Ans: /var/lib/puppet/ssl/ca/signed
Ans: Load Average is defined as the average sum of the number of process waiting
in the run queue and number of process currently executing over the period of 1,5
and 15 minutes. Using the top and uptime command we find the load average of a
linux sever.
What makes one sys admin stand out from others? Curiousity, according to Ski
Kacoroski, who services more than 3,000 users as assistant systems administrator
for the Northshore School District in Bothell, Wash. He also serves as vice president
for LOPSA, the League of Professional Systems Administrators.
During interviews, Kacoroski asks these questions to identify system admins with
deep knowledge of operating systems and inquiring minds.
What Most People Say: Youll connect to the Wikipedia server through port 80.
What You Should Say: How much time do I have to answer? Fifteen minutes?
Great. Ill walk you through every step and connection in the process.
Why You Should Say It: A systems administrator must be able to troubleshoot the
entire stack because you never know where the source of a problem lies, says
Kacoroski. You need to prove that you know where to look for problems to distinguish
yourself during an interview.
A stakeholder gives you a six-hour task that must be completed today. Later,
another user gives you a six-hour project with the same deadline. Neither user
will budge. What do you do?
What Most People Say: Id prioritize the most high profile project or the request
from the well-connected stakeholder. Or, Id stay until I finish both projects.
What You Should Say: Id come up with a few solutions and run them by my
manager.
Why You Should Say It: Systems admins make recommendations, not decisions,
notes Kacoroski. Inexperienced professionals dont understand their role, so theyll
mistakenly try to complete both projects. Systems administrators dont understand
all the political ramifications, cost constraints or technical challenges that impact
decisions, Kacoroski says. Its better to play a supporting role and let your manager
make the tough calls.
An HTTP monitor says the website is down. You can telnet to the port. What do
you do?
What Most People Say: Id check to see if the Web page is up. If it is, Id assume
there was something wrong with the monitor and alert the hardware guys.
What You Should Say: If the Web page is up when I telnet to the port, Id ask how
long the monitor has been down. Then, Id check to see if the outage was due to
flapping, a system outage or a system overload that occurred during back-up. Ill
modify the monitor, once I identify the issue. Should I describe my troubleshooting
process?
Why You Should Say It: The best systems admins want to understand why a
problem occurred to keep it from cropping up again. Be ready to walk the interviewer
through your troubleshooting process even if they ask you to fix a simulated problem
on a virtual machine.
How have you used your knowledge of operating systems to optimize the
network?
What Most People Say: Ive connected users to the underlying hardware and used
the operating system as a resource manager.
What You Should Say: Ive used an operating systems to track files, manage data
input and output on multiple devices and allocate resources such as CPU, RAM,
disk, network, video and sound to various processes. Beyond the basics, Ive used
my knowledge of various operating systems to improve system design and
architecture and run apps more efficiently. May I share an example?
Why You Should Say It: Systems admins do more than troubleshoot: Theyre
responsible for optimizing the processing environment. The more you know about
how an operating system works, the better youll be at planning and designing a
stable and efficient network and ensuring that all components work effectively
together.
What Most People Say: Im a good communicator with great troubleshooting skills.
I cant think of a third.
What You Should Say: I like helping people. Im curious about how systems work
and Im passionate about fixing things right.
Why You Should Say It: Understanding the traits that lead to success is critical.
Other desirable traits for systems admins include risk aversion, persistence and the
ability to get things done.
What Most People Say: I keep trying different things until the problem is fixed.
What You Should Say: I always have a Plan B and a Plan C in case my initial
solutions fails. Heres an example.
Why You Should Say It: Systems admins cant be afraid to fail, Kacoroski believes.
You always need a back-up plan because the first fix rarely works, he says. Top
candidates can articulate their problem-solving progression and what theyve learned
from their mistakes.
[] General Questions:
What do the following commands do and how would you use them?
o tee
o awk
o tr
o cut
o tac
o curl
o wget
o watch
o head
o tail
What does a & after a command do?
What does & disown after a command do?
What is a packet filter and how does it work?
What is Virtual Memory?
What is swap and what is it used for?
What is an A record, an NS record, a PTR record, a CNAME record, an MX record?
Are there any other RRs and what are they used for?
What is a Split-Horizon DNS?
What is the sticky bit?
What does the immutable bit to a file?
What is the difference between hardlinks and symlinks? What happens when you
remove the source to a symlink/hardlink?
What is an inode and what fields are stored in an inode?
Howto force/trigger a file system check on next reboot?
What is SNMP and what is it used for?
What is a runlevel and how to get the current runlevel?
What is SSH port forwarding?
What is the difference between local and remote port forwarding?
What are the steps to add a user to a system without using useradd/adduser?
What is MAJOR and MINOR numbers of special files?
Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is
free space.
Describe a scenario when deleting a file, but 'df' not showing the space being freed.
Describe how 'ps' works.
What happens to a child process that dies and has no parent process to wait for it
and whats bad about this?
Explain briefly each one of the process states.
How to know which process listens on a specific port?
What is a zombie process and what could be the cause of it?
You run a bash script and you want to see its output on your terminal and save it to a
file at the same time. How could you do it?
Explain what echo "1" > /proc/sys/net/ipv4/ip_forward does.
Describe briefly the steps you need to take in order to create and install a valid
certificate for the site https://foo.example.com.
Can you have several HTTPS virtual hosts sharing the same IP?
What is a wildcard certificate?
Which Linux file types do you know?
What is the difference between a process and a thread? And parent and child
processes after a fork system call?
What is the difference between exec and fork?
What is "nohup" used for?
What is the difference between these two commands?
o myvar=hello
o export myvar=hello
How many NTP servers would you configure in your local ntp.conf?
What does the column 'reach' mean in ntpq -p output?
You need to upgrade kernel at 100-1000 servers, how you would do this?
How can you get Host, Channel, ID, LUN of SCSI disk?
How can you limit process memory usage?
[] Networking Questions:
[] MySQL questions:
[] DevOps Questions:
[] Fun Questions:
A careless sysadmin executes the following command: chmod 444 /bin/chmod - what
do you do to fix this?
I've lost my root password, what can I do?
I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what
can be wrong?
If you were stuck on a desert island with only 5 command-line utilities, which would
you choose?
You come across a random computer and it appears to be a command console for
the universe. What is the first thing you type?
Tell me about a creative way that you've used SSH?
You have deleted by error a running script, what could you do to restore it?
[] Demo Time:
++++++++++++++++++++++++++++++
Imagine you are logged on to another computer remotely using ssh and you want to run a
command that takes a long time and then exit the ssh session but leave the command
running even though you are no longer connected then nohup lets you do just that.
To use nohup all I have to type is nohup followed by the command as follows:
You can store number of URLs in text file and download them with -i option. Below we have
created tmp.txt under wget directory where we put series of URLs to download.
# wget -i /wget/tmp.txt
In case of big file download, it may happen sometime to stop download in that case we can
resume download the same file where it was left off with -c option. But when you start
download file without specifying -c option wget will add .1 extension at the end of file,
considering as a fresh download. So, its good practice to add -c switch when you download
big files.
# wget -c http://mirrors.hns.net.in/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-
LiveDVD.iso
With -b option you can send download in background immediately after download start and
logs are written in /wget/log.txt file.
With Option limit-rate=100k, the download speed limit is restricted to 100k and the logs will
be created under /wget/log.txt as shown below.