CentOS to MS Hyper-V Volume Issues

After making an image of a physical linux box (Dell hardware running CentOS), I converted the IMG file to a VDH file and after booting had many issue. One of which was the following error which caused all databases on the respective volume to fail because the volume was in read-only mode.

EXT3-fs error (device hda3) in start_transaction: Journal has aborted

Turns out, the system is telling me that it’s detected a file system/journal mismatch, and it can’t utilize the journal any longer. When this situation pops up, the file system gets mounted read-only. To fix the situation, I had to boot the system (now in the VM environment) in single user mode, dismount the volume and fix it.

I first started by removing the journal from the file system:

# tune2fs -O ^has_journal /dev/hda3

Then I tried to fsck it to correct any possible problems:

# e2fsck -p -f -v /dev/hda3

Unfortunately this lead me to another error: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. (i.e., without -a or -p options).

Ugh. fsck again….I had originally run it without the -f option and it found no errors, yet it refused to mount in read-write mode. So now running it sans the -p option, -f forcing it to check it anyway, seems to have helped- but this time I needed to be present to hit y to every single error. There were hundreds.

Once that finished I ran it again with the -y option to see if it picked up anything and it was clean!

Time to make a new journal which makes the partition an ext3 file system again:

# tune2fs -j /dev/hda3

I can now mount the partition as an ext3 partition:

# mount -t ext3 /dev/hda3 /mnt/fixed

After rebooting the system seems happy once again with no mounting errors. Quick and simple!

Holy SSL Batman…

Just for fun and, well, a learning experience I have SSL’d my site. Why? Why not.

Every good Infrastructure Engineer/Manager should know how and now I do. It was much simpler than I thought.

If you need a good, simple SSL certificate that will cost you nothing I recommend www.startssl.com They offer a simple Class 1 SSL certificate that is great for blogs and non-eCommerce platforms. They’re not as secure as Class 2 or 3 but you have to understand what the classes mean.

Basically a Class 1 doesn’t require any extensive proof of who you or your organization are. The other Classes verify more information about who is getting the certificate and what they’re doing with it. Since my site is just my useless thoughts, Class 1 is just fine.

Hit them up if you need a simple SSL cert. Class 1 certificates are free so if you’re experimenting that’s definitely the way to go.

More on what I did after the jump.

Continue reading “Holy SSL Batman…”

Jeff’s Raspberry Pi Setup Notes

Raspberry Pi Setup Notes

These are the notes I keep for initial setups of the base Raspberry Pi Linux images.  They were collected from all over the internet and from personal experiences. If you find errors let me know. I’m always updating it so check back if you’re looking to add a feature that you can’t find
anywhere else.

Everything here relies on what exists on the internet already. Nothing here is original except that it’s all in one place.

LAMP Setup

sudo apt-get install apache2

OR

sudo apt-get install nginx

 

sudo apt-get install mysql-server

sudo apt-get install php5 php5-mysql

Further  LAMP features

sudo apt-get install php5-fpm php5-cgi php5-cli php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache

More Stuff

sudo apt-get install chkconfig snmp net-snmp* imagemagick htop webalizer

 

sudo pear channel-update pear.php.net sudo pear install MDB2

sudo pear install pear/MDB2_Driver_mysql

Webmin

To install Webmin open a terminal and add the following repository:

1- Edit /etc/apt/sources.list file

sudo nano /etc/apt/sources.list

2- Add the following lines

Save and exit the file

3- Now you need to import GPG key

wget http://www.webmin.com/jcameron-key.asc

sudo apt-key add jcameron-key.asc

4- Update the source list

sudo apt-get update

5- Now install Webmin

sudo apt-get install webmin

Now to access Webmin open your browser and enter:  http://serverip:10000/

You can get your ip address by issuing this command:

ifconfig

 

Remove any unneeded packages

There will eventually be packages that are unneeded. Apt-get can get rid of them by issuing this command:

 

sudo apt-get autoremove

Remote Desktop

Installing this allows you to connect via RDP on Windows.

sudo apt-get install xrdp

Add Chrome/Chromium to Desktop

Adds “Chrome” web browser to the GUI interface.

sudo apt-get install chromium-browser

Check CPU Clock Speed

This will show the current CPU clock speed in hertz

 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

Raspi-config

This is the initial configuration utility. I always forget its name..

sudo raspi-config

Microcontrollers, Embedded Systems and Single Board Computers

Many different terms are used for the devices that run our small computing projects. In addition there are lots of different hardware/software platforms. Many are pin compatible, similar in size and function and can achieve the same result in different ways.

Here are some of the common terms:

Microcontroller
A microcontroller is a small computer built into a single chip. This chip contains the processor, RAM, EPROM and I/O pins. These generally are designed for executing I/O and small computational functions.

The Arduino is not just a microcontroller. It’s a platform that includes a microcontroller. Usually an ATMega chip. An Arduino also includes other chips and components to make it easy to communicate with, program and prototype with.

Embedded Systems
Embedded systems are also small computers all on one chip (also called SoC for System On a Chip). These are generally more powerful (32 bit as opposed to 8 or 16 bit CPUs on microcontrollers) than a microcontroller and can run full operating systems like Linux or Windows. They too have other chips for communication and I/O and offer programming in higher level languages supported by the operating system. The Raspberry Pi is considered an embedded system but also falls under the next classification. Embedded Systems are also found in many consumer electronics like MP3 players and cell phones. In these cases they aren’t for prototyping or user programming but their features are very similar. iPhone and Android phones/tablets also use SoCs extensively.

Single Board Computer
A single board computer is an Embedded System with ALL the bells and whistles on a small board. This usually includes USB, Ethernet, Video, GPIO, Storage and possibly expandable memory. The Raspberry Pi is definitely a single board computer. It also has prototyping components like most microcontroller platforms. It’s a powerful fully featured system.