1.
Type in the file name and full path of the
configuration file where you would set the
variable HISTSIZE for all users of the system.
Explanation
Explanation: /etc/profile is the global login scripts, parsed by all users with
Borune-style shells including bash and sh. Usually used to set the default path,
values assign on variable, startup program execution.
Sample /etc/profile Configuration
# /etc/profile
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc
pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}
# Path manipulation
if [ `id -u` = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
pathmunge /usr/X11R6/bin after
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
USER="`id -un`"
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
unset pathmunge
2.
Type only
the name of the file or utility that will show you the last system bootup
messages.
Explanation
dmesg command helps users to print out their bootup messages.
3.
What does
the Filesystem Hierarchy Standard enable? (Select TWO answers)
Correct Answer(s)
A. Software to predict the location of installed files and directories
C. Users to predict the location of installed files and directories.
Explanation
This standard enables:
1. Software to predict the location of installed files and directories, and
2. Users to predict the location of installed files and directories.
This is done by:
1. Specifying guiding principles for each area of the filesystem,
2. Specifying the minimum files and directories required,
3. Enumerating exceptions to the principles, and
4. Enumerating specific cases where there has been historical conflict.
4.
You have a
machine which serves 100 users. You don't want to include their data in the
location
database. Where would you specify excluded directories for locate?
Correct Answer
D. /etc/exclude_dir
Explanation
In order to specify excluded directories for the locate command, you would need to specify them in the /etc/exclude_dir file. This file allows you to list directories that you do not want to include in the locate database. By adding the directories to this file, the locate command will skip indexing those directories and their contents.
5.
Identify
the proper device for the third partition, on the second hard disk, on the
first IDE
controller on a PC system.
Correct Answer
A. /dev/hdb3
Explanation
Harddisk Recognization
Primary Master /dev/hda
Primary Slave /dev/hdb
Secondary Master /dev/hdc
Secondary Slave /dev/hdd
According To question, Device name is /dev/hdb and paratition number is 3.
/dev/hdb3
6.
You have just upgraded your PC to a 60 gigabyte IDE drive. While partitioning thedrive, you notice that only 32 gigabytes are available. Which of the following willmost likely allow you to use the entire drive?
Correct Answer
E. Upgrade the PC BIOS to the latest version available.
Explanation
Not being able to use new, big harddrives is usually connected to the
BIOS in the computer.
7.
On an ext2
partition, what portion is reserved for the root user?
Correct Answer
D. 5%
Explanation
Specify the percentage of the filesystem blocks reserved for the super-user. This value defaults to 5%. If you want to change the percentage for super user: mke2fs -m percentage partition
8.
You have a
Linux system with a 100GB ext2 partition containing large amounts of
data. To
minimize the boot time, you decide to convert it to a journaling filesystem.
Which
journaling file system would be easiest to convert the partition to (without
destroying
existing data)?
Correct Answer
C. Ext3
Explanation
The easiest journaling file system to convert the ext2 partition to without destroying existing data would be ext3. Ext3 is a journaling file system that is backward compatible with ext2, meaning it can be easily converted from ext2 without losing any data. It provides the benefits of journaling, which helps improve system reliability and recovery in case of power failures or system crashes.
9.
Tamika is planning the partition table for her new workstation. Assuming she will give each of the following directories its own partition, which partition should be the largest?
Correct Answer
A. /usr
Explanation
When we install, most of the user's commands, administrative commands and
applications are installed on /usr by creating sub directories ie /usr/bin, /usr/sbin. So we
required more space then other partitions.
10.
You have run out of disk space on a partition. Which of the following would be an easy way to move data to a new partition without reconfiguring the path to the data in existing applications?
Correct Answer
C. Use a symbolic link.
Explanation
A Symbolic link points to another file and the contents of link file is referenced file. So, symbolic linked file occupied the very less space the original file.
11.
To build a fresh new Linux system, how much free space should you reserve for theLinux partition?
Correct Answer
D. 700 - 800MB
Explanation
According to the technical information available at Linux From Scratch Ver 3.0, Before we can build our new Linux system, we need to have an
empty Linux partition on which we can build our new system. I recommend a partition size of at least 750 MB. This gives enough space to store all the tarballs
and to compile all packages without worrying about running out of the necessary
temporary disk space. But you probably want more space than that if you plan to
use the LFS system as your primary Linux system.
12.
Which directory is used to store undelivered user email by default?
Correct Answer
B. /var/spool/mail
Explanation
The /var/spool/mail directory contains the spooling mail. Under
/var/mail/spool file with same as username are here, which contains the user's spooling mail.
13.
What would be the device name of the 2nd SCSI disk on your system? Include thefull path to the device file
Correct Answer
/dev/sdb
Explanation
First SCSI disk device is filename is /dev/sda and second /dev/sdb.
14.
What is the device file for the first logical drive in the extended partition of theSecondary Master IDE drive? Include the full path and filename.
Correct Answer
/dev/hdc5
Explanation
Harddisk Recognization
Primary Master /dev/hda
Primary Slave /dev/hdb
Secondary Master /dev/hdc
Secondary Slave /dev/hdd
According To QUESTION, drive is secondary master, then device name is /dev/hdc and
Logical partition start from 5.
So /dev/hdc5
15.
Which of the following directories would be the least likely to need backing up?Choose Two.
Correct Answer(s)
D. /tmp
E. /swap
Explanation
Backup and Restore depends on the importance of data, the /usr, /etc,
/home contains the importance data then /tmp and /swap. /usr/bin, /bin contains all
user commands, /usr/sbin, /sbin contains the administrative commands, /etc/
contains the configuration files. So these directory contains the important files.
16.
With a Linux 2.2 Kernel-based machine configuration of 133 MHZ, 32 MB RAMand a 1 GB HD, how much swap should be configured?
Correct Answer
D. 64MB
Explanation
Swap also called the virtual memory, we should give the swap space as
double of RAM size.
17.
Which of the following file system types causes the least impact when upgrading anExt2 file system?
Correct Answer
A. Ext3
Explanation
What are the advantages of ext3?
Why do you want to migrate from ext2 to ext3? Four main reasons: availability, data
integrity, speed, and easy transition.
Availability
After an unclean system shutdown (unexpected power failure, system crash), each ext2
file system cannot be mounted until its consistency has been checked by the e2fsck
program. The amount of time that the e2fsck program takes is determined primarily by
the size of the file system, and for today's relatively large (many tens of gigabytes) file
systems, this takes a long time. Also, the more files you have on the file system, the
longer the consistency check takes. File systems that are several hundreds of gigabytes in
size may take an hour or more to check. This severely limits availability.
By contrast, ext3 does not require a file system check, even after an unclean system
shutdown, except for certain rare hardware failure cases (e.g. hard drive failures). This is
because the data is written to disk in such a way that the file system is always consistent.
The time to recover an ext3 file system after an unclean system shutdown does not
depend on the size of the file system or the number of files; rather, it depends on the size
of the "journal" used to maintain consistency. The default journal size takes about a
second to recover (depending on the speed of the hardware).
Data Integrity
Using the ext3 file system can provide stronger guarantees about data integrity in case of
an unclean system shutdown. You choose the type and level of protection that your data
receives. You can choose to keep the file system consistent, but allow for damage to data
on the file system in the case of unclean system shutdown; this can give a modest speed
up under some but not all circumstances. Alternatively, you can choose to ensure that the
data is consistent with the state of the file system; this means that you will never see
garbage data in recently-written files after a crash. The safe choice, keeping the data
consistent with the state of the file system, is the default.
Speed
Despite writing some data more than once, ext3 is often faster (higher throughput) than
ext2 because ext3's journaling optimizes hard drive head motion. You can choose from
three journaling modes to optimize speed, optionally choosing to trade off some data
integrity.
1. One mode, data=writeback, limits the data integrity guarantees, allowing old data to
show up in files after a crash, for a potential increase in speed under some circumstances.
(This mode, which is the default journaling mode for most journaling file systems,
essentially provides the more limited data integrity guarantees of the ext2 file system and
merely avoids the long file system check at boot time.)
2. The second mode, data=ordered (the default mode), guarantees that the data is
consistent with the file system; recently-written files will never show up with garbage
contents after a crash.
3. The last mode,
data=journal, requires a larger journal for reasonable speed in most cases and therefore
takes longer to recover in case of unclean shutdown, but is sometimes faster for certain
database operations.
The default mode is recommended for general-purpose computing needs. To change the
mode, add the data=something option to the mount options for that file system in the
/etc/fstab file, as documented in the mount man page (man mount).
Easy Transition
It is easy to change from ext2 to ext3 and gain the benefits of a robust journaling file
system, without reformatting. That's right, there is no need to do a long, tedious, and
error-prone backup-reformat-restore operation in order to experience the advantages of
ext3. There are two ways to perform the transition:
1. The Red Hat Linux installation program offers to transition your file systems when
you upgrade your system. All you have to do is select one checkbox per file system.
The tune2fs program can add a journal to an existing ext2 file system. If the file system is
already mounted while it is being transitioned, the journal will be visible as the file
.journal in the root directory of the file system. If the file system is not mounted, the
journal will be hidden and will not appear in the file system. Just run tune2fs -j /dev/hda1
(or whatever device holds the file system you are transitioning) and change ext2 to ext3
on the matching lines in /etc/fstab. If you are transitioning your root file system, you will
have to use an initrd to boot. Run the mkinitrd program as described in the manual and
make sure that your LILO or GRUB configuration loads the initrd. (If you fail to make
that change, the system will still boot, but the root file system will be mounted as ext2
instead of ext3 - you can tell this by looking at the output of the command cat
/proc/mounts.) More information on tune2fs can be found in the tune2fs man page (man
tune2fs).
18.
According to the Filesystem Hierarchy Standard, what directory trees areconsidered optional on a system's root filesystem? Choose all that apply.
Correct Answer(s)
C. /usr
D. /var
E. /opt
Explanation
Optional root filesystem means these filesystem can be separate from the root. Like
/var, /usr, /opt, /home, /tmp etc filesystem can create in separate partaions but some
filesystem can't separate from the / (root) filesysteme eg, /lib, /dev/, /etc/, /sbin, /bin
and /.
19.
When partitioning a disk with more than 1024 cylinders, which of the followingcould affect the systems ability to boot?
Correct Answer
B. Location of /boot on disk
Explanation
If size to boot partitions assigns after the 1024 cylinder then, lilo boot
loader unable to load the kernel so it effects to boot partaiton. If you are using the
LILO boot loader boot partitions should be within 1024 cylinder.
20.
Which of the following is a typical rule for allocating swap space for a Linuxinstallation?
Correct Answer
D. Use 200% of total RAM for the size of a swap partition.
Explanation
The Convention for swap partition is Double of Physical RAM size.
21.
You are building a server that will undergo many hardware and operating systemupgrades. The server is the file server for all users on your 100 user network.Which directory should have its own mountpoint and/or hard drive?
Correct Answer
C. /home
Explanation
/home is called typical user's home directory. All user's home directory will be created on /home. So, it should own mount point.
22.
You are formatting a single hard disk for a Linux install. What is the maximumnumber of primary partitions you can create?
Correct Answer
E. 4
Explanation
Generally in one System we can connect four Physical Harddisks. As a
Primary Master, Primary Slave, Secondary Master, Secondary Slave.
In One System: Either four Primary partitions or 1 Primary or 2 Primary or 3 Primary + 1
extended and all logical partitions will be create under extended partations.
Hardisk device recognized as follows
Primary Master : /dev/hda
Primary Slave : /dev/hdb
Secondary Master : /dev/hdc
Secondary Slave : /dev/hdd
Suppose you have only single harddisk and going to install Linux, Maximum you can
create 4 primary partitions. If you create four primary partitions you can't create extended
partitions that mean no logical partitions can create.
23.
In GRUB's configuration file you find the line root (hd1, 4)What is corresponding device name on a Linux system?
Correct Answer
D. /dev/hdb5
Explanation
hd0 Primary Master hda
hd1 Primary Slave hdb
hd2 Secondary Master hdc
hd3 Secondary Slave hdd
Similarly partition number starts from 0 like array index in programming.
24.
When you are looking for brief information about a program in your PATH with itsassociated man pages, you would use ...
Correct Answer
B. Whereis
Explanation
Whereis - locate the binary, source, and manual page files for a
command
Syntax: whereis [options] command
Options:
-b à Search only for binaries
-m à Search only for manual section
-s à Search only for sources.
25.
Select the default $PATH set by the init command
Correct Answer
C. /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
Explanation
To display the default set path use echo $PATH command.
26.
Which TWO commands will find the path for the binary vim?
Correct Answer(s)
B. Whereis vim
D. Which vim
Explanation
which and whereis command displays the executable path of
commands. Example: which clearà Shows actually where clear is stored similarly
whereis clear.
27.
You want to uninstall lilo. Which of the following would you do to accomplish this?
Correct Answer
A. Lilo -u
Explanation
Using lilo command we can install the lilo boot loader on MBR. To uninstall lilo bootloader from MBR use the lilo -u command.
28.
You want to set a 30 second delay before your system boots to the default kernel.Which of the following command lines would do this?
Correct Answer
B. Lilo -d 30
Explanation
-d delay
If you have specified several kernels, and press Shift at boot time, the boot loader will
present you with a choice of which system to boot. After a timeout period the first kernel
in the list is booted. This option specifies the timeout delay in deciseconds.
Sample Configuration of /etc/lilo.conf
prompt
timeout=20
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear
image=/boot/vmlinuz-2.6.9-5.EL
label=linux
initrd=/boot/initrd-2.6.9-5.EL.img
read-only
append="rhgb quiet root=LABEL=/"
29.
Which lilo.conf parameter will specify the amount of time the system will waitbefore booting to the default image?
Correct Answer
B. Delay
Explanation
-d delay
If you have specified several kernels, and press Shift at boot time, the boot loader will
present you with a choice of which system to boot. After a timeout period the first kernel
in the list is booted. This option specifies the timeout delay in deciseconds.
Example: lilo -d 50
30.
What lilo option will list the name and location of available kernels?
Correct Answer
A. -q
Explanation
-q List the currently mapped files. lilo maintains a file, by default /boot/map, containing
the name and location of the kernel(s) to boot. This option will list the names therein.
Example: lilo -q
31.
What lilo.conf parameter is used to specify vga text mode?
Correct Answer
C. Vga
Explanation
vga=mode
This specifies the VGA text mode that should be selected when booting. The following
values are recognized (case is ignored):
normal: select normal 80x25 text mode.
extended (or ext): select 80x50 text mode.
ask: stop and ask for user input (at boot time).
: use the corresponding text mode. A list of available
modes can be obtained by booting with vga=ask and pressing
[Enter].
32.
You want to set a script to run when your Linux system reboots. What lilo option should you use?
Correct Answer
A. -R
Explanation
-R command line
This option sets the default command for the boot loader the next time it executes. The
boot loader will then erase this line: this is a once-only command. It is typically used in
reboot scripts, just before calling shutdown -ra.
33.
You have a system that uses LILO from the Master Boot Record. You have justrecompiled a new kernel. You already have a backup kernel setup to boot fromLILO so you overwrite your existing kernel with new kernel image using the samename and location. When you reboot, you find the system does not boot.What is likely to be the problem?
Correct Answer
A. The new kernel image is above the 1024 cylinder and therefore cannot be loaded.
Explanation
Lilo boot loader can't load the OS installed above 1024 cylinder so we can use linear option in /etc/lilo.conf file.
34.
Where can lilo place boot code?
Correct Answer
D. The MBR on a hard drive
Explanation
lilo command installs the bootloader on MBR (Master Boot Record) and activated on next boot time.
35.
From the LILO: or Boot: prompt you wish to start the kernel named linux and setthe machine at run level 1. Type the command line to do this?
Correct Answer
linux 1
linux s
linux S
linux single
Explanation
Standard Runlevel
0 - halt
1 or s or single or S- Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
To boot the kernel parameter from lilo bootloader, press ctrl+x and then kernel name runlevel. Example to boot linux system on runlevel 3: linux 3
36.
What lilo.conf parameter will cause the root file system to be mounted read only?
Correct Answer
D. Read-only
Explanation
Here is the sample Configuration
prompt
timeout=20
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear
image=/boot/vmlinuz-2.6.9-5.EL
label=linux
initrd=/boot/initrd-2.6.9-5.EL.img
read-only à Mounts the root filesystem on read only mode
append="rhgb quiet root=LABEL=/"
37.
What lilo.conf parameter is used to specify what device should be mounted as rootby default?
Correct Answer
A. Root
Explanation
Here is the sample Configuration
prompt
timeout=20
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear
image=/boot/vmlinuz-2.6.9-5.EL
label=linux
initrd=/boot/initrd-2.6.9-5.EL.img
read-only
append="rhgb quiet root=LABEL=/" Ã Here specifying the root partation
38.
While troubleshooting a boot issue you wish to know exactly what parameters are passed to the kernel from your bootloader. One way to do this is to execute cat /proc/__________
Correct Answer
Explanation
The Linux /proc Directory is a Virtual Filesystem provided by linux kernel. /proc
contains files and directories that let system administrators and programmers access
system information.
If you misconfigured the bootloader, you can't load the Linux. We have different Boot
loader like lilo, grub etc. If you try to load the Linux using misconfigured bootloader you
will get kernel panic, no init found or Kernel Panic - Not Suyncing: Attempt to kill init
etc Error. At this time you can boot the system by passing different parameters from the
bootloader. If you are using LILO bootloader press ctrl+x, If you are using grub, press a
or e and edit or pass the different parameter.
Before passing kernel parameter, you should know what to pass, the file /proc/cmdline
contains the parameter can pass from bootloader.
For Grub
Contains of /proc/cmdline
ro root=LABEL=/ rhgb queit
or
/proc/cmdline
ro root=/dev/hda2
This file shows the parameters passed to the kernel at the time it is started.This tells us
that the kernel is mounted read-only (signi_ed by (ro)) off of the second partition on the
first IDE device (/dev/hda2).
For LILO
BOOT_IMAGE=linux ro BOOT_FILE=/boot/vmlinuz-2.6.9-5.EL rhgb quiet
root=LABEL=/1
39.
What run level represents basic multi-user?
Correct Answer
A. 2
Explanation
0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
Runlevel 2 is called the multi user without NFS ( Not Networking services available).
40.
What run level represents multi-user?
Correct Answer
A. 3
Explanation
Explanation:
0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
Runlevel 3 is called full multi user and Runelvel 5 is called X Window System
41.
Which of the following can be used to switch your system to run level 3?
Correct Answer
A. Init 3
Explanation
System boots in Default Runlevel defined in /etc/inittab file.
id:3:initdefault:
After booting the system we can switch from one runlevel to another by using the init
runlevel command.
42.
What run level represents a system reboot?
Correct Answer
A. 6
Explanation
Runlevel 6 is called reboot. To switch runlevel 6: init 6
43.
What run level represents a power down?
Correct Answer
B. 0
Explanation
Runlevel 0 is called Halt
To switch runlevel 0:
init 0
44.
What run level represents administration mode?
Correct Answer
B. 1
Explanation
Single user mode is used for Troubleshooting and maintenance of System boot problem. So, s or S or single or 1 runlevel is called the administration mode.
45.
Which of the following can be used to switch your system to run level 1?
Correct Answer
A. Init 1
Explanation
System boots in Default Runlevel defined in /etc/inittab file.
id:3:initdefault:
After booting the system we can switch from one runlevel to another by using the init
runlevel command.
46.
What command can be used to find the current run level?
Correct Answer
A. Runlevel
Explanation
runlevel -- find the current and previous system runlevel.
It means currently system running on runlevel 3 and not switched to any runlevel.
47.
What line do you need to add to the /etc/inittab file to boot in runlevel 5?
Correct Answer
id:5:initdefault:
Explanation
To boot the system in runlevel 5 we should specify the id:5:initdefault:
in /etc/inittab file. By passing kernel arguments from boot loader we can override
the specified runlevel in /etc/inittab. If default runlevel is not specified, system boots
on runlevel 9(unknown runlevel).
48.
Linux is a(n) _________ operating system, meaning the source code is freely available.
Correct Answer
A. Open sourced
Explanation
Open source software is that software, which is freely available to
download from the Internet with source code and no restriction to modify,
redistribute the software. So, Linux is the Open source OS.
49.
You have compiled a program from source successfully, but you are gettingpermission errors when you try to install the binaries.What is most likely the problem?
Correct Answer
D. The binaries need to be installed into directories that need root privileges to write to them.
Explanation
when we install the binaries files, it creates the files, directories into the directory. To write the files or directories, there should be the write permission.
Before examine the Directory permission.
ls -ld directoryname
drwxr-xr-x
50.
Which utility would be used to verify the checksum of a downloaded archive file?
Correct Answer
C. Md5sum
Explanation
md5sum - compute and check MD5 message digest.