Sie sind auf Seite 1von 7

1. How do u force a user to change password on next login in linux?

A. chage -d 0 "User"

2.What command can be used to findout server architechure (x86 or x64) apart
from
uname?
A. arch
3. How do u findout the users who are NOT logged in for more than 30 days?
which file u
will check?
A. last , lastlog,

/var/log/wtmp

4. whats is called 1.5 stage in boot process of linux?


A. Which contains extra code to allow cylinders above 1024, or LBA type drives, to be read.
The
1.5 boot loader is stored (if needed) in the MBR or the boot partition.The great thing
about
GRUB is that it includes knowledge of Linux file systems. Instead of using raw sectors on
the
disk, as LILO does, GRUB can load a Linux kernel from an ext2 or ext3 file system. It
does this
by making the two-stage boot loader into a three-stage boot loader. Stage 1 (MBR) boots
a
stage 1.5 boot loader that understands the particular file system containing the Linux
kernel
image. Examples include reiserfs_stage1_5 (to load from a Reiser journaling file
system) or
e2fs_stage1_5 (to load from an ext2 or ext3 file system). When the stage 1.5 boot
loader is
loaded and running, the stage 2 boot loader can be loaded."
So Basically,
Stage 1 Boot loader is MBR
Stage 2 Boot loader is GRUB

Stage 1.5 Boot loader is e2fs_stage1_5


(Basically this module will load the knowledge of Filesystem to Grub to read the kernel)
5. When u try to create a file, u got a error that "No space available". But actually
space
available on volume? How do u resolve this issue?
A. Try this df -i list inode information instead of block usage [Perhaps are you out of inodes
on
this file system.], To "rectify it", remove unwanted files or move them somewhere else.]

What command can you use to review boot messages?


The dmesg command can be used to display the system messages during
boot time.
What are the fields in the /etc/passwd file. Explain them?
There are 7 fields in /etc/passwd:
username:x:UID:GID:comment:home

directory:shell

1)Username.
2)Password. Dummy value x denotes that its using shadow passwords
3)UID.
4)Primary
5)Comment
6)Home
7)Shell assigned to the user.

group
directory

ID.
/description.
path.

Whats the journaling data contains in ext3?


A journaled file system records information in a log area on a disk. It logs
the "metadata" i.e ownership, date stamp information etc..Once the log is
updated the system then writes the actual data to the appropriate areas of
the filesystem and marks an entry in the log to say the data is committed.
After a crash the filesystem can very quickly be brought back on-line using
the journal logs
using fsck there is considerably less chance of data loss or corruption.

How do u extend the LV in Linux?


First check whether is there free space available in the VG where the LV
resides.
# vgdisplay or
# vgs
Now, extend the LV using below command: "L" option to specify the size to
be increased.
# lvextend -L +5G /dev/vg00/lv01
Finally, extend the File system space:
# resize2fs /dev/vg00/lv01
What is the major difference between ext2 and ext3 file systems?
The main difference between ext2 and ext3 is, ext3 allows journaling. (Journaling is a type of log file,
which tracks all the file system changes. so that you can recover in case of filesystem crash)
Explain Linux Booting Process?

When the computer is switched on, it automatically invokes BIOS [a ROM chip embedded in
the motherboard].

The BIOS will start the processor and perform a POST [power on self test] to check whether
the connected device are ready to use and are working properly.

Once the POST is completes BIOS will check for the booting device. The boot sector is
always the first sector of the hard disk and BIOS will load the MBR into the memory. MBR
holds the boot loader of the OS.

From here the boot loader takes the control of the booting process.

GRUB is the boot loader for Linux.

Depending on the boot option selected the kernel is loaded first.

After kernel is loaded the kernel will take the control of the booting process

Initrd will be loaded which contains drivers to detect hardware (Initialization of RAM Disk)

Then it will initialize all the hardware including I/O processors etc.

Kernel then mounts the root partition as read-only

INIT is loaded as the first process.

INIT will mount the root partition and other partitions as read/write and checks for file system
errors.

Sets the System Clock, hostname etc..

Based on the Runlevel, it will load the services and runs the startup scripts which are located
in /etc/rcX.d/ (Network, cups, nfs, SSH etc.)

Finally it runs the rc.local script.

Now the login prompt will appear.

How do you extend a LV? For example, How do you expand /var file system with additional
2GB space?

Check which logical volume (LV) holds the /var file system using df h

Now, find out this particular LV belongs to which VG using lvdisplay <lv_name>

Check the free space available in that Volume Group (VG) using vgdisplay <vgname>. Look
for "Free PE / Space" line in the ouput.

If the free space available in VG, now you can expand the LV using lvextend L +2G
<lv_name>. Now, Logical Volume has been expanded. Now we have to expand the file
system using resize2fs /var. All these can be done in online without unmounting the
filesystems.

How do you find out hardware errors inside Linux?

dmesg

/var/log/messages

dmidecode t system

IML (Integrated Management Logs) - An iLO console feature

hpacucli - To check RAID array status

use grep or less commands on


o

/var/log/messages and /var/log/warn

/var/log/debug

/var/log/kern.log

/var/log/mcelog

How do find out what are the files inside an RPM before installing it?
rpm -qlp package.rpm (Example : $ rpm -qlp rpm -qlp gnupg-1.4.5-1.i386.rpm)

Linux Important File Summary

File

Directory

Description

at.allow,
at.deny

/etc

If at.allow exists, then only the user accounts listed in


the
file
may
use
the at or batch commands.
If at.denyexists, then any user account listed in the file
may not use the at or batch commands.

.bash_logout

/home/<user> Shell script to clean up any personalized environment


settings during logout.

.bash_profile

/home/<user> Shell script to set personalized environment settings for


each login.

.bashrc

/home/<user> Shell script to set personalized functions and aliases for


each newly created shell or subshell.

bashrc

/etc

Shell script to set system-wide functions and aliases.


Usually called by /home/<user>/.bashrc.

cron.allow,
cron.deny

/etc

If cron.allow exists, then only the user accounts listed in


the
file
may
use
the crontab command.
If cron.denyexists, then any user account listed in the
file may not use the crontab command.

crontab

/etc

Master cron scheduling file for system-wide jobs. On


Red Hat systems, the crontab file uses the runpartsscript to schedule any script in the appropriatelynamed/etc/cron.* directory.

fstab

/etc

Filesystem declaration and default mount configuration


settings.

group

/etc

List of all user groups on the system and the user


membership list for each group.

grub.conf

/boot/grub

GRUB bootloader configuration settings. Usually linked


to from /etc/grub.conf.

inittab

/etc

init process configuration settings: virtual terminals,


default
runlevel,
runlevel-dependent
rc
scripts,
Ctrl+Alt+Del interrupt handler, X Windows display
manager.

lilo.conf

/etc

LILO bootloader configuration settings.

login.defs

/etc

Default configuration settings for newly created user


accounts and user groups.

logrotate.conf

/etc

Configuration
settings
for
the
cronscheduled logrotatejob. On Red Hat distributions,
the logrotate.conf file usually includes other logrotate
configuration files from the /etc/logrotate.d directory.

lpd.conf

/etc

Configuration settings for the lpd print daemon, and


defaults for the printcap file.

module-info

/boot

Kernel Loadable Module definitions and device driver


parameters.

modules.conf

/etc

Configuration files for loading Kernel Loadable Modules


during startup. Also known as conf.modules on some
Linux distributions.

passwd

/etc

List of all user accounts on the system. Also includes


the user's UID, GID, full name, home directory, and
default
shell.
Passwords
tend
to
be
stored

in /etc/shadow on most systems.


printcap

/etc

Configuration settings for print queues, used by both


thelpr command and lpd daemon. Some distributions
automatically regenerate this file during startup and use
the /etc/printcap.local file to store user customizations.

profile

/etc

Shell script to set system-wide shell environment


settings for all logins.

rc

/etc/rc.d

Shell script responsible for running the runleveldependent


shell
scripts
under
the
appropriate /rc.d/rcN.ddirectory,
where N is
the
runlevel.

rc.local

/etc/rc.d

Last rc shell script run, usually as part of all startup


runlevels (1-5). A common location for user-defined
startup commands.

rc.sysinit

/etc/rc.d

Runlevel-independent
shell
script
that
mounts
filesystems, enables virtual memory swapping, and
synchronizes the OS time with the CMOS clock.

services

/etc

Reference list of common TCP and UDP port numbers


and their related services.

shadow

/etc

Encrypted passwords for all user accounts on the


system. Also contains password aging and expiry
settings.

syslog.conf

/etc

Configuration settings for the syslogd and klogd logging


daemons.

useradd

/etc/default

Default configuration settings for newly created user


accounts using the useradd command.

XF86Config

/etc/X11

Configuration settings for X Windows (XFree86). On


some
systems,
this
file
may
be
in
the/usr/X11R6/lib/X11 directory.

vmlinuz

/boot

Compressed Linux kernel image. Usually a symbolic link


to the current image file.

Das könnte Ihnen auch gefallen