How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

January 17, 2014

Mapping Linux kernel ATA errors to a device

Filed under: Linux — Tags: , , , , , , , — admin @ 10:05 am

So .. my problem is that I see some error into dmesg log about ata2 , however I don’t know what hard drive is mapped to that ata. So , how can we find this ?

[16380082.599294] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
[16380082.599340] ata2.00: failed command: FLUSH CACHE EXT
[16380082.599369] ata2.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0
[16380082.599370] res 40/00:00:80:2b:0a/00:00:70:00:00/40 Emask 0x4 (timeout)
[16380082.599435] ata2.00: status: { DRDY }
[16380082.599461] ata2: hard resetting link
[16380082.919117] ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[16380082.921248] ata2.00: configured for UDMA/133
[16380082.921279] ata2: EH complete

Well to find out we have to look into /sys file-system :

ls -l /sys/block/sd{a,b}


lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Jan 17 08:01 /sys/block/sdb -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb

To get that ID, Instead of looking into the target structure, we’re looking into the scsi_host structure. It has a directory for the host and in it a file unique_id. That’s the ID appended to ata.

for host in 0 1 ; do echo -n host${host}:; cat /sys/devices/pci0000:00/0000:00:1f.2/host${host}/scsi_host/host${host}/unique_id; done


host0:1
host1:2

So the answer is on ata2 I have sdb mounted.

Also I found this php code on internet

January 28, 2013

Centos 6 pecl install memcached error

Filed under: Linux — Tags: , , , — admin @ 5:50 pm

Today I try to install memcached on a server with centos 6. So basically when I hit
pecl install memcached
I get a lot of errors
checking for libmemcached location... configure: error: memcached support requires libmemcached 1.0.x. Use --with-libmemcached-dir= < DIR> to specify the prefix where libmemcached headers and library are located
ERROR: `/var/tmp/memcached/configure' failed

So if I try to install libmemcached by using
yum install libmemcached libmemcached-devel
I see that version of libmemcached will be smaller then 1.0.x

So to install it
cd /usr/local/src
wget https://launchpad.net/libmemcached/1.0/1.0.15/+download/libmemcached-1.0.15.tar.gz
tar -zxvf libmemcached-1.0.15.tar.gz
cd libmemcached-1.0.15
./configure
make
make install

After this try
pecl install memcached

For me this was the working version.

May 21, 2012

How to disable from console “Ubuntu 12.04 has experienced an internal error” message

Filed under: Linux — Tags: , , , , , , — admin @ 3:06 pm

Well this appear on lates lubuntu, and on latest Ubuntu. After a time this error is showing up on monitor.
So how to fix this ?
Sorry, Ubuntu 12.04 has experienced an internal error
This error is reported by apport service on ubuntu.
So to disable it just edit /etc/default/apport and modify the value of enable from 1 to 0

sudo vi /etc/default/apport

After modification the file should look something like this

# set this to 0 to disable apport, or to 1 to enable it
# you can temporarily override this with
# sudo service apport start force_start=1
enabled=0

Powered by WordPress