I am here to share my knowledge in Linux with all.The opinions expressed and topics discussed on this blog are my own and don't necessarily reflect those of my employer.
Wednesday, December 17, 2008
IPMI
Monday, December 1, 2008
Introduction to Dump
These utilities handle files as the target to be archived and they are capable of excluding specific files and/or directories from the target.
They can even create a single archive that contains files from multiple filesystems.In contrast, dump handles a physical filesystem as an archiving target and the restore command usually uses the archive to restore the filesystem as it was dump’ed.
Each file is managed by the i-node number and basically, dump cannot exclude specific files from the archive (actually, you may do so in a different manner.
Dump is indeed a simplistic and primitive tool, but it does come with a brilliant feature for incremental archiving. It identifies newly created or modified files after the previous backup and efficiently stores them to an archive very fast.
For example, suppose a file ‘foo’ was backed up during the last archiving and removed afterwards. On the next incremental archiving, dump puts the record in the archive as ‘there used to be a file foo, but it was removed’.
If you use tar for your regular incremental backup tasks and attempt a full restoration one day, you may run out of the disk space by trying to restore a large number of files that had already been removed.
With dump, you will never face such a problem.In summary, it would be fair to say² Cpio, tar or afio is suitable for archiving specific files or directories.² Dump is suitable for archiving whole filesystems.Just pick a right tool for you job.
Dump and Restore
Saturday, November 15, 2008
Using Yum
yum install package …..
Yum will check the repository for the package if it finds the package it will install the latest version, pulling in dependencies if needed.
yum remove package ….
Yum will remove the package named by you from your system. If any other package depends on the package then yum will prompt you and gives the option to remove those package too. –yum update package ……
•yum check the repository for the updated version of the package and then install them. If when no package are specified then yum search for updates to all of your currently installed packages.
What yum ?
RPM Verification
•rpm –V
•rpm –Va verifies all installed RPMS against the RPM database
•rpm –Vp
•Signature Verification before package install
•rpm –import RPM –GPG-KEY
•By default when the linux is install in the system the GPG-KEY for the redhat is stored in /etc/pki/rpm-gpg
•rpm –qa gpg-pubkey
RPM Queries
rpm –q what_packages what_information
Or rpmquery
Installed Package Options :
rpm –qa queries all installed packages
rpm –qf filename #shows owning package
rpm –qi package_name #general information
rpm –ql package_name # lists files in package
Upgrading software
When rpm –U is used for the software it will save the old config file as *.rpmsave.
But make a Note when you try to upgrade the kernel the old kernel will be deleted.
Do not use rpm –U or rpm –F for kernel software Upgradation.
Always use rpm –ivh kernel-version.acrh.rpm
Boot and test the new kernel
Installing and Removing software
Install : rpm -i , -- install
Upgrade : rpm -U , --upgrade
Freshen : rpm -F , --freshen
Erase : rpm -e , --erase
Output Options :
-v for verbose mode
-h for hash mode
Package Management in Linux
The Software to installed using RPM is distributed through rpm package files
Rpm packages are named as Name–version–release.Architecture.rpm
The version refers to the open source version of the project
The release refers to Redhat internal patches to the open source code
Tuesday, November 4, 2008
HOW TO INSTALL AND TEST SAMBA
1. Obtaining and Installing Samba
Binary packages of Samba are included in almost any Linux or UNIX distribution.
There are also some packages available at the Samba home page.
Refer to the manual of your operating system for details on installing packages
for your specific operating system.
1. Configuring Samba (smb.conf)
Samba's configuration is stored in the smb.conf file, which usually resides
in /etc/samba/smb.conf or /usr/local/samba/lib/smb.conf. You can
either edit this file yourself or do it using one of the many graphical tools
that are available, such as the Web-based interface SWAT, that is included
with Samba.
Friday, October 10, 2008
Some Terms in quota
Soft Block Limit - the maximum amount of disk space that can be used. However, unlike the hard limit, the soft limit can be exceeded for a certain amount of time. That period is called Grace Period.
Grace Period – It can be expressed in seconds, minutes, hours,
days, weeks, or months.
If any of the values are set to 0, that limit is not set.
Implementing Quotas for User
# edquota username
Perform this step for each user who needs a quota.
For example , output will be as follows,
Disk quotas for user testuser (uid 501): Filesystem blocks soft hard inodes
soft hard /dev/VolGroup00/LogVol02 440436 0 0 37418 0 0
The text editor defined by the EDITOR environment variable is used by edquota.
Configuring Disk Quotas
1. Enable quotas per file system by modifying the /etc/fstab file.
2. Remount the file systems.
3. Create the quota database files and generate the disk usage table.
4. Assign quota policies.
Each of these steps is discussed in detail in the following sections.
Monday, October 6, 2008
Disk Quotas
Saturday, September 20, 2008
Secure Shell
Tuesday, September 16, 2008
VNC configuration in RHEL 4 and RHEL 5
#chkconfig vncserver on
Restart the service
#service vncserver start
#vncserver
New '
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/Server_Ip_Address:3.log
#vncpasswd
Password:
Verify:
# vim /root/.vnc/xstartup
The entry should look like as follows,
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Now u can view through vnc viewer using Server_Ip_Address:1
Thursday, September 11, 2008
What is in /etc/fstab?
The first field, (fs_spec), describes the block special device or remote filesystem to be mounted.
A block special device node (like /dev/cdrom or /dev/sdb7. For procfs, use proc.
The second field, (fs_file), describes the mount point for the filesystem. For swap partitions, this field should be specified as none.
The third field, (fs_vfstype), describes the type of the filesystem. Linux supports lots of filesystem types, such as adfs, affs, autofs, coda, coher-ent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs, sysv, tmpfs, udf,ufs, umsdos, vfat, xenix, xfs, and possibly others.
For the filesystems currently supported by the running kernel, see /proc/filesystems. An entry swap denotes a file or partition to be used for swapping, cf. swapon (8). An entry ignore causes the line to be ignored.This is useful to show disk partitions which are currently unused.
The fourth field describes the mount options associated with the filesystem. By Default, it will be defaults.
The fifth field is used for these filesystems by the dump command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.
The sixth field is used by the fsck program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.
Wednesday, September 10, 2008
What is Iptables ?
Tuesday, September 9, 2008
Some Basic Commands in Linux
Basics commands in Linux
The ls command
ls ----- Command is equivalent of the DOS dir command. It lists the files and subdirectories contained within the present directory.
Some possible flags which can be used with the ls command are:
ls -a List all files including hidden files which starts with.(Dot).these hidden files will not be displayed with simple ls command
ls | more Lists files and directories page after page on keystroke. The above command actually is a combination of two commands. It introduces a new concept called
ls –R It lists the files and subdirectories of a directory and further lists the contents of each subdirectory recursively. The ou
pwd The pwd or the present working directory command gives you the path to the directory in which you presently are. It is used without flags simply as
su Many times you might have logged in as a normal used and might need to be root to install a software or for some other small task. You could logout then login as root complete the work logout and login back as a normal user. Instead, you can just use the su command. The format is:
su username
e.g.: su root
When you
whoami It will tell you which user you are logged in as. Useful when you have used
cp This one copies files / directories from one place to another its syntax is
cp source_file_with_path destination_path
e.g.: cp /home/bala/secret.txt /f
This would make a copy of secrets.txt from /home/bala to /f
cp –i Interactive copying, prompts before overwriting files or directories
cp -l source_file_with_path destination_path
Makes a link (shortcut) to the source_file at the destination path instead of actually copying it there.
cp –p Preserve file attributes while copying if possible
cp –R Copy Recursively. Used when copying directories. This command also copies the contents of the subdirectories.
cp –u Update i.e. Copy only if the source file is newer than the destination file or the destination file does not exist.
rm The rm command is used to remove or delete files or directories. Its general format is:
rm -flag file_or_directory_with_path
Eg: rm /home/bala/recycle.txt
Some flags which can be used with the rm command are
rm -v test.txt
Remove verbosely, explain what is being done.
rm -r directory
Remove the directory and its contents recursively.
mkdir This command is used to create new a new directory. Its syntax is
mkdir -optional_flag directory_name
The possible flags are
mkdir -v directory_name
Tell what is going on.
mkdir -p directory_with_path
This is a cool command. Suppose you need a directory named data within another directory called report in /usr/local and the parent directory report itself does not exist, then you can use :
mkdir -p /usr/local/report/data
This command creates the report directory and the data subdirectory in one go.
man For someone new to linux, the man command is one of the most important commands. The syntax is:
man command_name
Suppose you have not understood fully one of the above commands or want to find out about a new command you have learnt, the man command provides a manual for that command
Ansible Playbook to collect uptime of servers
Hi, This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...
-
Hi, This is to explain how we can write a small playbook to collect uptime of all servers in our environment. We can use our own server l...
-
Operating system: RHEL 5 Problem: Network card driver is not getting installed in RHEL 5 Error: If the command # make install is gi...
-
First check whether telnet-server rpm in installed, # rpm -q telnet-s erver telnet-server-0.17-38.el5 If it is installed, then edit # vi ...