Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

1.15.2011

How to install Linux PAE enabled kernel?

If you are testing 32-bit RHEL5, please make sure that we use PAE kernel instead of the default kernel that is installed.With the default kernel, 32-bit RHEL5 will not recognize more than 4GB of guest memory even though you configure it on the VM..
So please verify the following before you so the testing....

a) Check the kernel that is installed when you install the distribution
(RHEL5 32-bit & 64-bit)


[root@localhost ~]# uname -r
2.6.18-8.el5

The above output indicates that the kernel that is installed is neither PAE / huge mem kernel.


You can find the list of installed kernel using:

# rpm -qa | grep -i kernel

kernel-2.6.18-8.el5
kernel-headers-2.6.18-8.el5
kernel-devel-2.6.18-8.el5

For the guest to use more than 4GB, we need to install the PAE kernel (You will get that from RHEL5 CD1..)

rhel-5-server-i386-disc1.iso


c) Mount the cdrom

mount /dev/cdrom /mnt


d) You will see something similar to this:

# ls /mnt/Server/ | grep -i 2.6.18-8
kernel-2.6.18-8.el5.i686.rpm
kernel-devel-2.6.18-8.el5.i686.rpm
kernel-doc-2.6.18-8.el5.noarch.rpm
kernel-headers-2.6.18-8.el5.i386.rpm
kernel-PAE-2.6.18-8.el5.i686.rpm
kernel-PAE-devel-2.6.18-8.el5.i686.rpm
kernel-xen-2.6.18-8.el5.i686.rpm
kernel-xen-devel-2.6.18-8.el5.i686.rpm



At a shell prompt, change to the directory that contains the kernel RPM packages. Use -i argument with the rpm command to keep the old kernel.

Caution: Do not use the -U option, since it overwrites the currently installed kernel, which creates boot loader problems.

For example:

[root@localhost]# rpm -ivh kernel-PAE-2.6.18-8.el5.i686.rpm

warning: kernel-PAE-2.6.18-8.el5.i686.rpm: Header V3 DSA signature: NOKEY,
key ID 37017186
Preparing... ########################################### [100%]
1:kernel-PAE ########################################### [100%]


Verify the initial RAM disk image.

To verify that an initial RAM disk already exists, use the command ls -l /boot to make sure the initrd-.img file was created (the version should match the version of the kernel just installed).

# ls -l /boot/ | grep img

-rw------- 1 root root 2318314 Jun 2 06:41 initrd-2.6.18-8.el5.img
-rw------- 1 root root 2319154 Jun 4 08:18 initrd-2.6.18-8.el5PAE.img

This shows the new image that is created...

Verifying the boot loader..

[root@localhost]# cat /boot/grub/grub.conf | grep PAE
title Red Hat Enterprise Linux Server (2.6.18-8.el5PAE)
kernel /vmlinuz-2.6.18-8.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb
quiet
initrd /initrd-2.6.18-8.el5PAE.img



Done. Restart the guest and at the grub menu press the key "e" and select the PAE kernel.

[root@localhost ~]# uname -r
2.6.18-8.el5PAE

[root@localhost ~]# cat /proc/meminfo | grep -i memtotal

MemTotal: 4934652 kB (I set only 5GB and it should go upto 64GB


If you want to always boot with PAE kernel, please do the changes in /etc/grub.conf.

Edit /etc/grub.conf to make default=0 (on my server new kernel is 0th kernel).

This is how it looks like:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-8.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-8.el5PAE.img

title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-8.el5.img

1.06.2011

Linux Kernel 2.6.37 Announced

The Linux kernel 2.6.37 is finally announced by Linus Torvald on 4 January 2011.The announcement can be found here.The kernel is now stable and can be downloaded from http://kernel.org.

The kernel includes several SMP scalability improvements for Ext4 and XFS, removal of the BKL (Big Kernel Lock) from the core code,a network device based in the Ceph cluster filesystem, new Btrfs capabilities (namely the Btrfs space cache option), more efficient static probes, perf support to probe modules and listing of accesible local and global variables, PPP over IPv4 support, improvements and new drivers.

The Linux 2.6.37 kernel is already been shipped with an upcoming Ubuntu 11.04 Alpha 2 release yesterday.The detail information of advancement and new features which came with this kernel release can be explored through http://kernelnewbies.org/Linux_2_6_37

1.03.2011

Need to add extra swap space? Read this

"Can Linux be installed without swap space?". This question might sound confusing for those who listen it for the first time and never tried out. But the reality is "Yes". But if you did this, you should be ready to cope up with your Linux box next time you put extra load on your box.It will crash someday.
Its always recommended to provide extra space for swap partition.Swap is only used when you have maximum load.

This article discuss how to increase the swap space through adding swap file on Linux machine.

Lets proceed with the requisite steps to add swap file as shown below:

Lets use dd command to create swapfile. Then you need to use mkswap command to set up a Linux swap area on a device or in a file.

a) Log in as root user.

b) Run this command to create 512MB swap file (1024 * 512MB = 524288 block size):

# dd if=/dev/zero of=/swapf1 bs=1024 count=524288

c) Set up a Linux swap area:

# mkswap /swapf1

d) Activate /swapfile1 swap space immediately:

# swapon /swapf1

e) To activate /swapf1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:

# vi /etc/fstab

Then,append following line:

/swapf1 swap swap defaults 0 0

So next time Linux comes up after reboot, it enables the new swap file for you automatically.

Verifying if the swap is activated or not?

$ free -m

Hope the article proves useful for everyone who wants an extra swap space therein.

12.31.2010

Changing default logs and deploy path location in JBOSS Application Server

This article discusses the method to change the default logs and deploy path in JBOSS Application Server.
 
1.       In JBOSS default logs path will be ‘$JBOSS_HOME/server//log’
 
2.       Create the directory path where logs need to stored
 
 
          $ mkdir –p /logs/tep/test/jboss
 
 
3.       Go to ‘$JBOSS_HOME/server//conf’ folder
 
4.       Update the ‘jboss-log4j.xml’ file with below entries.
 
 
         < param name="File" value="/logs/tep/test/jboss/server.log" />
         < param name="File" value="/logs/tep/test/jboss/audit.log" />
 
 
5.       Restart the JBOSS Instance.
 
Changing default deploy path
 
1.       Default deploy path will be ‘$JBOSS_HOME/server//conf’
2.       Create the directory path where war/ear files will be deployed.
 
 
          $ mkdir –p /production/tep/
 
 
3.       Go to ‘$JBOSS_HOME/server//conf’ folder
 
4.       Edit ‘jboss-service.xml’ file
 
5.       Search for URLs in ‘jboss-service.xml’ and update the file as below
 
 
         
                        deploy/, /production/tep/
         

 
 
6.       Restart the JBOSS Instance.

12.28.2010

Missing xorg.conf file on Fedora 14?

Fedora 14 doesn't create /etc/X11/xorg.conf by default.For making manual changes to X configuration for any reason,one need to create a /etc/X11/xorg.conf file. You can follow these steps to change settings for Xorg.


Xorg -configure

Create a basic xorg.conf through these command:


#Xorg -configure

The above command will create the file /root/xorg.conf.new. You need to copy this file to xorg.conf through this step:

#cp /root/xorg.conf.new /etc/X11/xorg.conf


[Note that this will only work if no X server is currently running]
If in case the above stuff din't work, try tweaking through:

#system-config-display --noui

The above command creates a clean /etc/X11/xorg.conf file using the automatically detected driver for your video card.

To specify a particular driver for your card you can simply create a standard /etc/X11/xorg.conf file and then edit it by hand, but you can also do this directly with system-config-display.

For example, to specify the nv driver, you could do:

system-config-display --noui --set-driver=nv
When using the --set parameters, --noui is implied, so you do not really need to include it. For more information on ways you can use system-config-display, run system-config-display --help.

Hope it helps !!!

12.26.2010

rpm2cpio - How to List files under RPM?

rpm2cpio, as its name suggest, takes an RPM package file and convert it into cpio archive. The cpio is a binary file archiver and is a stream of files and directories in a single archive.

rpm2cpio takes only only one argument. The interesting part is its optional.
It is  the name of the package file to be converted. Under no filename specified o n the command line,  rpm2cpio will simply read from standard input and convert that to a cpio archive.


Let's download the subversion RPM (as an example) and see how rpm2cpio can be used to display the files.








How to extend LVM partition online?

Logical Volume Management ( LVM) is a disk management utility which comes by default with Linux system nowadays. It is always recommended to use LVM as it is useful whenever disk space is needed to be extended without any interruption.

Though it extends the space but one must be careful while extending the partition of the production servers where numbers of sophisticated applications are running.A Utility ext2online helps in extending the LVM space without any disruption.Let us look at this utility in little details.


Say, we created our logical volumes alpha (40GB), beta (5GB), and gamma (1GB) in the volume group emission.








 
 

Say, if you want to extend the size of gamma from 1GB to 2GB, we need to follow the following steps:

ajeet:~#lvextend -L+1024M /dev/emission/gamma

Extending logical volume media to 2 GB
  Logical volume media successfully resized

ajeet:~#ext2online -d /dev/emission/gamma

The ext2online is useful as it extends the LVM partition without disturbing the overall process ongoing on the linux machine related to the particular partition.

12.15.2010

How to enable SSH for Root User?

SSH is more secure than telnet. Telnet which transfer the date through port 23 flows the password in unencrypted form which is not secure. SSH is a secure shell which works on port 22 and does encrypted data transfer.

For security reasons, the new upcoming  Linux distributions doesn't enable the SSH login for root by default.

To enable the SSH login for root, follow the workaround:

1.  Open the file /etc/sshd/sshd_config with your favourite editor. Search for the line PermitRootLogin and uncomment it:

Change


#PermitRootLogin no

to


PermitRootLogin yes

Save the file through :wq

2. Restart the ssh service through:

/etc/init.d/sshd restart


or


service sshd restart

3. Try to SSH for root user through putty and it should work.

12.06.2010

X.Org 1.9.3 RC2 Announced, Final Release expected next week


Jeremy Huddleston from Apple yesterday announced the Second release candidate of X.Org Server 1.9.2.902 ( 1.9.3 RC2).The Release included more bug and build fixes, majority related to Apple XQuartz:

XQuartz: Don't use bashism in uninstall-hook
XQuartz dri: Don't check CoreGraphics version
XQuartz: Remove existing localization files on install to avoid conflicts
XQuartz: Localization Updates
include: let BitIsOn() return a boolean value.
XQuartz: Disable the Mac OS X screensaver when in full screen mode
XQuartz: Cleanup some compiler warnings
XQuartz: RandR: Fix mode changing for multi-monitor configurations.
Version bumped to 1.9.2.902 (1.9.3 RC2)


There is a speculation around the Mac OS 10.7 to be using X.Org 1.9.3. Reportedly, Ubuntu 11.04 and Fedora 15 Lovelock too will be expected to be next on line.

Jeremy intends to announce the final Release of X.Org 1.9.3 next week in case no regression occurs furtherhand. X.Org 1.10 merge window timeline has been shifted to remain open till next week and the final Release of X.Org 1.10 is expected to occur in Feb 2011.


The X.Org 1.9.3 RC2 announcement was found in the X.Org mailinglist http://lists.freedesktop.org/archives/xorg-announce/2010-December/001554.html