Posts

Showing posts from May, 2011

Reducing Swap on an LVM2 Logical Volume

To reduce an LVM2 swap logical volume (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend): Replace /dev/VolGroup00/LogVol01 with your HD partition. Disable swapping for the associated logical volume: # swapoff -v /dev/VolGroup00/LogVol01 Reduce the LVM2 logical volume by 512 MB: # lvm lvreduce /dev/VolGroup00/LogVol01 -L -512M Format the new swap space: # mkswap /dev/VolGroup00/LogVol01 Enable the extended logical volume : # swapon -va Test that the logical volume has been reduced properly: # cat /proc/swaps or # free     !Enjoy Kuldeep Sharma

15 Examples To Master Linux Command Line History

When you are using Linux command line frequently, using the history effectively can be a major productivity boost. In fact, once you have mastered the 15 examples that I’ve provided here, you’ll find using command line more enjoyable and fun. 1. Display timestamp using HISTTIMEFORMAT Typically when you type history from command line, it displays the command# and the command. For auditing purpose, it may be beneficial to display the timepstamp along with the command as shown below. # export HISTTIMEFORMAT='%F %T ' # history | more 1 2008-08-05 19:02:39 service network restart 2 2008-08-05 19:02:39 exit 3 2008-08-05 19:02:39 id 4 2008-08-05 19:02:39 cat /etc/ redhat -release 2. Search the history using Control+R I strongly believe, this may be your most frequently used feature of history. When you’ve already executed a very long command, you can simply search history using a keyword and re-execute the same command without having to type it fully. Press Control+R ...

10 iozone Examples for Disk I/O Performance Measurement on Linux

Along with Monitoring different aspects on Linux server measuring IO subsystem performance is also going to be very important.        If someone is complaining that a database (or any application) running on one server (with certain filesystem, or RAID configuration) is running faster than the same database or application running on another server, you might want to make sure that the performance at the disk level is same on both the server. You can use iozone for this situation.            If you are running your database (or any application) on certain SAN or NAS environment, and would like to migrate it to different SAN or NAS environment, you should perform filesystem benchmakring on both the systems and compare it. You can use iozone for this situation.       If you know how to use iozone, you can pretty much use it for various filesystem benchmarking purpose. Download and Install IOZone Iozone is an open so...

Linux File Systems: Ext2 vs Ext3 vs Ext4

Linux File Systems: Ext2 vs Ext3 vs Ext4 ext2, ext3 and ext4 are all filesystems created for Linux. This article explains the following: High level difference between these filesystems. How to create these filesystems. How to convert from one filesystem type to another. Ext2 Ext2 stands for second extended file system. It was introduced in 1993. Developed by Rémy Card. This was developed to overcome the limitation of the original ext file system. Ext2 does not have journaling feature. On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling. Maximum individual file size can be from 16 GB to 2 TB Overall ext2 file system size can be from 2 TB to 32 TB Ext3 Ext3 stands for third extended file system. It was introduced in 2001. Developed by Stephen Tweedie. Starting from Linux Kernel 2.4.15 ext3 was available. The main benefit of ext3 is that it allows journaling. Journaling has a dedicated area in the file system, where...

How to Increase Screen Size or Resolution in Virtualbox for Ubuntu or Linux

Image
When a new Virtual Machine, or Virtual PC, is setup in Virtualbox for Ubuntu, or another Linux flavor, the screen size and screen resolution may be fixed smaller than your maximum resolution setting. This problem can be fixed by installing Guest Additions. Guest Additions comes with Virtualbox, but is installed after you setup your Virtual Machine, or Guest OS, to add features such as increased screen size or screen resolution. On the test PC for this example the maximum resolution is 1280 x 1024. After loading Ubuntu under Virtualbox bring up the Display Preference by going into System -> Preferences -> Display. The maximum resolution option listed is 800 x 600. Installing Guest Additions from Gnome Desktop To get a bigger screen resolution we will need to install Guest Additions. On the Virtualbox File Menu click on Devices -> Install Guest Additions.   You should now see a vboxadditions_x file now located on your Ubuntu desktop.   To o...

Dovecot POP3/IMAP Server Setup Howto for RHEL/CentOS 5

Image
 Dovecot:        Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory .   Install Dovecot:   Installing and setting up Dovecot in Red Hat Enterprise Linux 5 or CentOS 5 is easy. All we have to do is to enable the services we would like to provide and we are good to go.   Make the use of yum or download dovecot and install it. Here I have  installed it using yum. i.e use  # yum install dovecot Configure Postfix: Go to the main configuration file dovecot.conf in /etc/dovecot.conf . We need to change a few key items.   Find the following keys and change its values as follows protocols = pop3 pop3s imap imaps mail_location = maildir:~/Maildir/ pop3_uidl_format = %08Xu%08Xv imap_client_workarou...

Postfix MTA Configuration

Image
Firstly Lets Introduce with Term POSTFIX: Postfix:  In computing, Postfix is a free and open-source mail transfer agent (MTA) that routes and delivers electronic mail. It is intended as a fast, easier-to-administer, and secure alternative to the widely-used Sendmail MTA. Install Postfix: Make the use of yum or download postfix and install it. Here I have  installed it using yum. i.e use  # yum install postfix   Configure Postfix: Go to the main configuration file main.cf in /etc/postfix/ directoy W e need to make it listen to network request, accept mails bound to our domain and use maildir which is a better mailbox format than mbox the default.   Find the following keys and change its values as follows. inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain home_mailbox = Maildir/   In main.cf, lines starting with # are comments. Save the file after completing your changes. Make sure that all mail_spool_directory li...

DNS Server Interview Questions And Answers for linux admin

DNS Server Interview Questions And Answers for linux admin Q: - which are the important configuration files for DNS server ? BIND uses /etc/named.conf as its main configuration file, the /etc/rndc.conf file as the configuration file for name server control utility rndc, and the /var/named/ directory for zone files and the like. Q: - What is BIND ? BIND stands for Berkeley Internet Name Domain which is the most commonly used Domain Name System (DNS) server on the Internet. Q: - On which version of bind u have worked ? BIND 9 Q: - What is the role of DNS ? A DNS server, or name server, is used to resolve an IP address to a hostname or vice versa. Q: - On which port DNS server works ? DNS servers use port 53 by default. Incoming and outgoing packets should be allowed on port 53. Also allow connections on port 921 if you configure a lightweight resolver server. The DNS control utility, rndc, connects to the DNS server with TCP port 953 by default. If you are running rn...