Posts Tagged Linux

How to fix “disk contains BIOS metadata error”

Posted by on Monday, 22 June, 2015

Recently I’ve tried to use an old ssd disk on a refurbished laptop. The disk used to be part of a RAID. When installing Oracle Linux 6, I got this message:

“Disk contains BIOS metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sda”

Since there was no other drive, this would not allow me to install the system. After searching the web I’ve found a site that had the solution. As mentioned in the article, the dmraid -r -E /dev/sda did not work for me either.

The solution seems to be to wipeout the first and the last disk sectors.

This post summarizes what I did to fix this particular system:

STEP 1: Boot from the original install media (USB, DVD) and choose the “Rescue installed system” option (ignore the fact that you do not have a system installed!)

STEP 2: When you get to the last screen (ignore the error message) choose “shell Start shell”

STEP 3: Assuming the drive to wipeout is sda (make sure to check) type the following at the prompt line (replace XXX with the device in your case, example: sda) :

D=XXX; dd if=/dev/zero of=/dev/$D bs=1k count=1; dd if=/dev/zero of=dev/$D bs=1k seek=$((`fdisk -s /dev/$D` - 2))

STEP 4: To confirm that the RAID information is cleared, type the following command:

dmraid -r /dev/sda

You should see:
no raid disks and with names: "/dev/sda"

STEP 5: reboot

That should fix it. Of course, one could choose just to simply wipeout all the disk, but that is not as cool as this.


Install lxde desktop in Fedora 19/20

Posted by on Thursday, 16 January, 2014

sudo yum install @lxde-desktop


Linux CPU benchmark for the Console

Posted by on Thursday, 12 December, 2013

A simple way to compare the CPU speed between two servers:

time echo "scale = 5000; a (1) * 4" | bc -l

This commands calculates Pi to the 5000th decimal place, and returns the time needed to do it.

Sample result:
real 0m16.809s
user 0m15.529s
sys 0m0.024s


How to get CPU information under Linux

Posted by on Tuesday, 7 February, 2012

From time to time I have the need to get basic CPU information out of a server.
There are several tricks available online (like this one and this other one) but I decided to write a small bash script that would spit all this information on a easy to read format.
A friend of mine mentioned that he saw this before somewhere but the writing of the script was a nice exercise.

PHYSICAL=`grep -i "physical id" /proc/cpuinfo | sort -u | wc -l`
LOGICAL=`grep -i "processor" /proc/cpuinfo | sort -u | wc -l`
CORES=`grep -i "cpu cores" /proc/cpuinfo|head -1|awk '{print $4}'`
grep -i "^flags" /proc/cpuinfo|head -1|grep " ht ">/dev/null
if [ $? -eq 0 ] ; then HT="YES" ; else HT="NO"; fi
SIBLINGS=`grep siblings /proc/cpuinfo |head -1 |awk '{print $3}'`
if [ $SIBLINGS -gt $CORES ] ; then HTACTIVE="YES" ; else HTACTIVE="NO" ; fi
echo "Physical CPUs : $PHYSICAL"
echo "Logical CPUs : $LOGICAL"
echo "Cores per CPU : $CORES"
echo "Spport for HT : $HT"
echo "Siblings : $SIBLINGS"
echo "Is HT active : $HTACTIVE"


How to install and access the CM15A X10 controller in Fedora 15

Posted by on Thursday, 6 October, 2011

Following the previous post about how install and access the CM15A X10 controller in Ubuntu, I’m now publishing similar instructions for Fedora 15.
I use the mochad, Multiple Online Controllers for Home Automation Daemon.
“mochad” is a Linux TCP gateway daemon for the X10 CM15A RF (radio frequency) and PL (power line) controller and the CM19A RF controller.

To get it up and running on Fedora follow these steps.

1 ) Install libusb1 and libusb1-devel (if not already installed):
sudo yum install libusb1 libusb1-devel

2 ) Download mochad:
Visit the mochad homepage and download the latest version OR get this version that is probably not the latest but it works on Fedora 15 at the time my writing this.

3 ) Untar, compile and install mochad:
tar -zxvf mochad-0.1.12.tar.gz
cd mochad-0.1.12
sudo make install

Replace the mochad-0.1.12 with whatever version you download.

4 ) Plug in the CM15A device via the USB port to the box

5 ) Check that the system can see it:
Should return a line like this:
Bus 002 Device 065: ID 0bc7:0001 X10 Wireless Technology, Inc.

The Bus and Device might be different in your case.
6 ) Launch the mochad daemon:
sudo /usr/local/bin/mochad

It should return to the prompt with no errors.

8 ) Use it!
To use the mochad daemon you can talk to it on port 1099 (by default) on the localhost using netcat (nc) like this example:
To turn on module A1
nc -c "echo pl a1 on" localhost 1099
To turn off module A1
nc -c "echo pl a1 off" localhost 1099

And that’s it. Check out the mochad homepage for further details.