Archive for the ‘CentOS’ Category.

Mounting LVM Parition inside an image file

As I am working on a project which required me to extract a script from an image file which was backup using dd tool.

It is possible to mount the image file on a linux server.

1) you need to scan the image file and see partition

[root@c10 sax]# kpartx -v IPC-2Sep2015.img
loop0p1 : 0 409600 /dev/loop0 2048
loop0p2 : 0 1024000 /dev/loop0 411648
loop0p3 : 0 123621376 /dev/loop0 1435648

2) add the partitionto the system

[root@c10 sax]# kpartx -a -v IPC-2Sep2015.img
add map loop0p1 (253:3): 0 409600 linear /dev/loop0 2048
add map loop0p2 (253:4): 0 1024000 linear /dev/loop0 411648
add map loop0p3 (253:5): 0 123621376 linear /dev/loop0 1435648

Continue reading ‘Mounting LVM Parition inside an image file’ »

V2V Critix to VMWare CentOS 6

As I was trying to convert using VMware convertor from Critix to VMWare guest OS which is using CentOS 6, I bump into a difficult problem which took me at least 24 hours trying to resolve it.

The system fails to boot up and when grub is modified to show the output text of the console, it always hang after “Probing EDD (edd=off to disable)”

This include trying to following task
1) rebuild initramfs
2) downgrade lvm2 version (this fails as one of the rpm depends on latest lvm2 to work)
3) reinstall grub
4) performing a V2V using Acronis
5) removing xe-guest tools

This solutions works for me. I have to remove the following line from the GRUB boot loader for it to work.
console=hvc0

The above line is meant for Xen Console thus VMWare does not have such feature

I do really hope this helps someone out there as I have spend alot of time troubleshooting it.

ESET ANTIVIRUS CentOS installation

Trying to install ESET ANTIVIRUS on CentOS 6 and bump into a slight issues.

Problem

error: Failed dependencies:
        /lib/ld-linux.so.2 is needed by esets-4.0-10.x86_64
        /usr/lib/gconv/UTF-16.so is needed by esets-4.0-10.x86_64

I will just need to install the necessary dependencies

yum install ed glibc.i686

Enjoy!

Migrating GPG keys

As I am storing backup remotely, I used GPG to encrypt my stuff on-the-fly using duplicity.

Due to the upgrading of the current machine to a more powerful machine, I need to move my GPG keys too.

Here is how I do it.

List the available GPG key in the store.

 
[root@svr ~]# gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub   1024D/A1FC0247 2011-01-07
uid                  tanfwc <tanfwc@happylife.sg>
sub   2048g/F96387B6 2011-01-07

Let’s export the keys accordingly.
Continue reading ‘Migrating GPG keys’ »

Cluster Glue

As I am installing Cluster Glue, I bump into the following error. I was looking around the Internet and unable to find a answer thus I have to look into what package CentOS build libuuid into 🙂

Problem:

./.libs/libplumb.so: undefined reference to `uuid_parse'
./.libs/libplumb.so: undefined reference to `uuid_generate'
./.libs/libplumb.so: undefined reference to `uuid_copy'
./.libs/libplumb.so: undefined reference to `uuid_is_null'
./.libs/libplumb.so: undefined reference to `uuid_unparse'
./.libs/libplumb.so: undefined reference to `uuid_clear'

Solution:

yum install -y e2fsprogs-devel

Hope the above helps someone out there.

Changing Linux Network Interface Bonding

WARNING: The following steps will stop your network interface, please ensure that you have KVM-Over-IP before attempting to do it remotely.

If you ever had to change the bonding type while the server is live, follow the steps:

[db2:/root]# ifdown bond0
[db2:/root]# modprobe -r bonding
[db2:/root]# modprobe bonding mode=1 miimon=100
[db2:/root]# ifup bond0
[db2:/root]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
 
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth2
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
 
Slave Interface: eth2
MII Status: up
Link Failure Count: 0
Permanent HW addr: 
 
Slave Interface: eth3
MII Status: up
Link Failure Count: 0
Permanent HW addr:

Hope this helps someone out there.

Detecting Creative Sound Card in Linux

As I am working on a project where I need to play external audio into a application, as you are aware that dealing with audio in Linux can be challenging.

As such, here is a simple solution to it =)

My test environment:
CentOS 5.5 64bit
Creative Blaster S80490 (USB)

yum install -y alsa-utils

Once I installed Advanced Linux Sound Architecture (known as ALSA), I can run the following command to see whether my audio is detected by the system.

[root@localhost src]# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: External [SB Live! 24-bit External], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I got my audio devices detected by the Linux system. So now, I can move on to the next stage of integrating into my applications now. 🙂

Hope this helps someone out there…

Windows 7 cause “mount: Cannot allocate memory”

Had a friend who want to backup all his files (300GB+) from a Linux server to a laptop harddisk, we hit with a error message that cause Linux unable to mount the shared folder in laptop.

Problem:

[root@localhost ~]# mount -t cifs "//192.168.1.10/abc" -o username=admin,password=1234
ed /mnt/laptop/
mount: Cannot allocate memory

The server has at least 3GB cached RAM available in the memory pool. So that’s not possible with memory issues.

Take a look at dmesg and you should see this error

Oct  3 00:33:18 localhost kernel:  CIFS VFS: Send error in SessSetup = -12
Oct  3 00:33:18 localhost kernel:  CIFS VFS: cifs_mount failed w/return code = -12

If you have the above error, most likely it is due to your Windows 7 machine. Let’s move to the Windows 7 and troubleshoot.
Continue reading ‘Windows 7 cause “mount: Cannot allocate memory”’ »

WARNING: mismatch_cnt is not 0 on /dev/md0

I was about to head to bed when I receive a disturbing email from my BlackBerry phone.

A email from weekly cron.d send me this:

WARNING: mismatch_cnt is not 0 on /dev/md0

A quick command shows that the RAID array (md0) is the number of
unsynchronized blocks in the raid.

As you can see below, md0 is having 128 count of unsynchronized blocks.

[svr4:/root]# cat /sys/block/md0/md/mismatch_cnt
128
[svr4:/root]# cat /sys/block/md1/md/mismatch_cnt
0

Let’s attempt to fix it.
Continue reading ‘WARNING: mismatch_cnt is not 0 on /dev/md0’ »

3ware Controller soft-reset

Problems:

sd 0:0:0:0: WARNING: (0x06:0x002C): Command (0x2a) timed out, resetting card.
3w-9xxx: scsi0: AEN: INFO (0x04:0x005E): Cache synchronization completed:unit=0.
sd 0:0:0:0: WARNING: (0x06:0x002C): Command (0x28) timed out, resetting card.
3w-9xxx: scsi0: AEN: INFO (0x04:0x005E): Cache synchronization completed:unit=0.

As I am facing soft-reset on my controller card, the latest version of the firmware will fix the problem.
Continue reading ‘3ware Controller soft-reset’ »