Monday, April 22, 2013

CentOS - How to install kernel-debuginfo

First, check if you have the following this file (CentOS-Debuginfo.repo) in /etc/yum.repos.d
[root@abc yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo

The content of CentOS-Debuginfo.repo is as shown below, from this file, we know the repo is debug (the name is enclosed with [ ]) and this repo is not enabled by default (enabled=0).
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#

# All debug packages from all the various CentOS-5 releases
# are merged into a single repo, split by BaseArch
#
# Note: packages in the debuginfo repo are currently not signed
#

[debug]
name=CentOS-6 - Debuginfo
baseurl=http://debuginfo.centos.org/6/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6
enabled=0

To install kernel-debuginfo for your kernel, use yum as shown below
[root@abc yum.repos.d]# yum --enablerepo=debug install kernel-debuginfo-2.6.32-220.el6

If you omit kernel version, yum will pull the latest kernel-debuginfo file as shown below
[root@abc yum.repos.d]# yum --enablerepo=debug install kernel-debuginfo
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
 * base: mirror.rndc.or.id
 * extras: kartolo.sby.datautama.net.id
 * updates: buaya.klas.or.id
base                                                     | 3.7 kB     00:00
debug                                                    | 1.9 kB     00:00
debug/primary_db                                         | 753 kB     00:19
extras                                                   | 3.5 kB     00:00
updates                                                  | 3.5 kB     00:00
updates/primary_db                                       | 1.5 MB     00:34
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-debuginfo.x86_64 0:2.6.32-358.2.1.el6.centos.plus will be installed
--> Processing Dependency: kernel-debuginfo-common-x86_64 = 2.6.32-358.2.1.el6.centos.plus for package: kernel-debuginfo-2.6.32-358.2.1.el6.centos.plus.x86_64
--> Running transaction check
---> Package kernel-debuginfo-common-x86_64.x86_64 0:2.6.32-358.2.1.el6.centos.plus will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                      Arch   Version                        Repository
                                                                           Size
================================================================================
Installing:
 kernel-debuginfo             x86_64 2.6.32-358.2.1.el6.centos.plus debug 249 M
Installing for dependencies:
 kernel-debuginfo-common-x86_64
                              x86_64 2.6.32-358.2.1.el6.centos.plus debug  38 M

Transaction Summary
================================================================================
Install       2 Package(s)

Total download size: 287 M
Installed size: 1.6 G
Is this ok [y/N]: N

Another option is to download both the rpm packages (kernel-debuginfo and kernel-debuginfo-common) from this link. (look for the correct architecture as well as kernel version)

Wednesday, April 17, 2013

How to increase max_sectors_kb for MegaRaid 9280 in CentOS

The quick way to adjust it is to follow the steps listed in this blog

Basically is

rmmod megaraid_sas
modprobe megaraid_sas max_sectors=2048

Please take note that the unit is in sector. If sector size is 512 bytes, setting 2048 is equivalent to 1024kb.

If your boot drive is also from Megaraid card, you will not be able to rmmod as the system will complaint it is in use. In that situation, you need to create a file call megaraid_sas.conf in /etc/modprobe.d with the following contents

options megaraid_sas max_sectors=2048

After that, you need to generate a new initramfs.

Backup your existing initramfs file (take note you have to find the correct img for your kernel version)

mv initramfs-2.6.32-220.el6.x86_64.img initramfs-2.6.32-220.el6.x86_64.img.bk

Create the new initramfs file

dracut initramfs-2.6.32-220.el6.x86_64.img 2.6.32-220.el6.x86_64

After that reboot your system and your max_hw_sectors_kb should show 1024 and you can increase your max_sectors_kb to the maximum 1024.

Wednesday, April 10, 2013

Reuse PC Power Supply

To reuse PC power supply without motherboard, you have to short 2 pins on the 24 pin ATX power connector which is the connector that connect to your motherboard. To know which pin to connect together, you can refer to this site which has a detailed pin layout.

As shown in the diagram below, you need to short pin 16 (power Supply On) and pin 17 (Ground) together and this have to stay there as long as you want to use the power supply. Please take note that there are few other ground pins and i choose pin 17 is for convenient.


Picture below shows my setup and i use DVD ROM to test out the power supply.


A closer look on the 24 pin ATX power connector with the cable to short pin 16 and 17.


Tuesday, April 9, 2013

Xrdp not working on CentOS 6.2

If you install Xrdp (xrdp-0.5.0-0.13.el6.x86_64.rpm) on CentOS 6.2 without any update. You might face the following problem when you try to RDP to your Linux machine.


And when you check your error log (/var/log/xrdp-sesman.log), you find the following
[20130410-09:39:03] [WARN ] [init:45] libscp initialized
[20130410-09:39:03] [CORE ] starting sesman with pid 4374
[20130410-09:39:03] [INFO ] listening...
[20130410-09:40:15] [INFO ] scp thread on sck 7 started successfully
[20130410-09:40:16] [INFO ] ++ created session (access granted): username root,
ip 10.217.242.65:2137 - socket: 7
[20130410-09:40:16] [INFO ] starting Xvnc session...
[20130410-09:40:25] [ERROR] X server for display 10 startup timeout
[20130410-09:40:25] [INFO ] starting xrdp-sessvc - xpid=4841 - wmpid=4840
[20130410-09:40:26] [ERROR] X server for display 10 startup timeout
[20130410-09:40:26] [ERROR] another Xserver is already active on display 10
[20130410-09:40:26] [DEBUG] aborting connection...
[20130410-09:40:26] [INFO ] ++ terminated session:  username root, display :10.0
, session_pid 4839, ip 10.217.242.65:2137 - socket: 7

You can try to solve this problem by doing update on your OS. And if that is not the option, because you have certain driver that will not work with the updated OS. You can choose to update these 2 packages:

yum install pixman libXfont

After updating these 2 packages, restart your xrdp service

service xrdp restart

In my case, these updates solve my problem.