Fujitsu P1620 a new hope…

I have had for a while a Fujitsu P1620 small form factor convertable. I have had for a while Windows Seven working upon the machine, but with only two gigabytes of ram, performance was limited at best. I have decided to install ubuntu 11.04, 64 bit desktop, and remove the gnome desktop for the xfce desktop. The other issue is the very slow 4200rpm 100gb hard disk. The installation was about sixty minutes to install. Half of the installation was downloading packages from the ubuntu repository. I used a external usb dvd rom drive to install ubuntu 11.04, 64 bit desktop. I will further along the way try to document the configuration of software and hardware as in the touchscreen which seems a tricky issue.

Converting RHEL to CentOS:

One of the biggest issues when running RedHat Linux in any verison is how to get updates when you do not pay for mantenance. As far as I know, you cannot get the updates from redhat for free once your 30 day trail is over. Many companies need to run redhat due to the applications we designed around redhat in linux. There are many ways to get around this when running different flavours of linux, but they necessary become a pain in the backside when it comes to this, as the next update of the flavour may break the application. A workaround is too use the free version of redhat enterprise linux which is CentOS. You can convert a redhat machine to CentOS, very easily. Below will show you the process of how it is done.

CentOS 5:

# yum clean all

# mkdir ~/centos

# cd ~/centos/

# wget http://mirror.centos.org/centos/5.7/os/i386/RPM-GPG-KEY-CentOS-5

# wget http://mirror.centos.org/centos/5.7/os/i386/CentOS/centos-release-5-7.el5.centos.i386.rpm

# wget http://mirror.centos.org/centos/5.7/os/i386/CentOS/centos-release-notes-5.7-0.i386.rpm

# wget http://mirror.centos.org/centos/5.7/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm

# wget http://mirror.centos.org/centos/5.7/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm

# wget http://mirror.centos.org/centos/5.7/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm

# rpm –import RPM-GPG-KEY-CentOS-5

# rpm -e –nodeps redhat-release

# rpm -e yum-rhn-plugin

# rpm -Uvh –force *.rpm

# yum upgrade

At the time of this post CentOS 5.7 is the highest release to upgrade a redhat enterprise 5 installation. I am yet to work out howto upgrade a redhat enterprise 6 release to CentOS 6.

No-IP for those with no static IP…

So people do not have a permanent ip and it makes supporting those users/clients. As you need to keep track of there ip when you need to log into there system/server. A handy way to do this is to use a third party service that tracks your clients non static ip to a dynamic name service. On of these services is no-ip.org This service requires you to install software upon your clients server/machine. Every 30 minutes the software talks to the no-ip.org domain name service and inserts the ip of the clients wan into the no-ip.org name server. So instead of remembering the clients ip address you can remember there name and attach the no-ip.org address. There are many other domains no-ip.org allows you to choose from but this is the domain I have choosen. e.g. client.no-ip.org. better than remembering a ip address. To install no-ip, there following steps are required on you clients server/machine.

Generic:

You must create a on no-ip.org for you to be able to add hostnames. Once this is done you will need to log into your account and be able to add hosts which are the machines that have the dynamic ip. Note, do not create the hosts into groups or one machine will change all the machines ip to the same ip as the machine that does the update. Leave them ungrouped. Below is a image of the buttons that need to be ticked.

CentOS:

Download the no-ip.org unix client.

# wget https://www.no-ip.com/client/linux/noip-duc-linux.tar.gz

# tar xvfz www.no-ip.com/client/linux/noip-duc-linux.tar.gz

You can compile the source code yourself, but for the purposes of the excercise

# cd noip-2.1.9-1/binaries

# noip2.i686 /usr/local/bin/noip2

# chown root:root /usr/local/bin/noip2

# chmod 755 /usr/local/bin/noip2

Now we run noip for the first time to configure for connection to the no-ip service.

# /usr/local/bin/noip2 -C

# cd ..

We now create the startup script so no-ip starts up when the machine starts up.

# cp redhat.noip.sh /etc/rc.d/init.d/noip2

# chmod 755 /etc/rc.d/init.d/noip2

# cd /etc/rc.d/rc5.d

# ln -s /etc/rc.d/init.d/noip2 S99noip2

# cd ../rc6.d

# ln -s /etc/rc.d/init.d/noip2 K99noip2

We can now start the no-ip service

# /etc/rc.d/init.d/noip2 stop

# /etc/rc.d/init.d/noip2 start

Install Virtualbox Headless Server for Guests Operating Systems.

To install Virtualbox which is a free virtual machine software, that allows you to run machines/containers upon a physical server. Virtualbox is free open source technology. It is available for all platforms e.g. Mac OSX, Centos, Windows etc. Virtualbox is very easy to setup upon linux variants as there is software packages already available that you can install in one easy command. Below I will show you howto install Virtualbox and create a container. Virtualbox has a very active community, where help can be found very easily.

This installation will show you how to install via headless solution where no gui isused.

CENTOS:

To install Virtualbox upon Centos is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/yum.repos.d

# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

# yum –enablerepo rpmforge install dkms

Below we will now install the kernel drivers for Virtualbox.

# yum groupinstall “Development Tools”

# yum install kernel-devel

Now we will install the Virtualbox package itself.

# yum install VirtualBox-4.1

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# usermod -G vboxusers username

Ubuntu:

To install Virtualbox upon Ubuntu is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/apt

# vi sources.list

Add the following line below to the sources.list file so we can talk to the Virtualbox repository.

deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free

Now we will install the Virtualbox package itself.

# wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# sudo apt-get update

# sudo apt-get install virtualbox-4.1

Below I use the root user, you can use any user you believe you want to run

# usermod -a vboxusers

Next we will now post howto setup/create a virtual machine in our next post.

Gigabyte G41MT-S2P Motherboard:

g41mt-s2p

g41mt-s2p

Again back on my quest to build new nas unit. I popped throu my regular computer store. After choosing the cheapest bang for buck motherboard, that could take my dual core cpu. I upgraded to 16gb of DDR 1333 ram, for this reason to run many virtual machines on virtualbox. To get over the four usb disk limit, I am looking for pci express four port sata cards. I expect to shop them off ebay due to the cost. Onboard video, no pci express video card needed for the server. I think this is a good choice till I upgrade to a i based cpu, and motherboard comes along.

 

Disable SELinux:

CentOS:

To disable SElinux, the security system within centos, you need to modify the SElinux file. Reasons for wanting to disable SElinux, would be that your server is internal, and to configure each service is a waste of time. SELinux is good for machines that are facing the internet, within a De-militarized Zone.

The SELinux configuration file is located at

/etc/selinux/config

To disable SELinux go to the configuration file look for the following line

SELINUX

then change the line to

SELINUX=disabled

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection. SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definitition file.
SETLOCALDEFS=0

The above with take effect during the next reboot, but if you need the effect to be immediate you can disable SELinux immediately at the command line with the following command

# setenforce 0

Network Time Protocol:

Keeping track of time on your server can become a bit daunting, when you start having multiple number of servers. A solution is called ntp (network time protocol). The machine ever so often, loses time, by going out up to a few hours. Defined period checks with a main time server, and adjusts your machines time if it is out from the main timeserver.

CentOS:

The following commands below will install and configure ntp under CentOS.

# yum install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/rc.d/init.d/ntpd restart

The results will be shown as below.

Shutting down ntpd:    [ OK ]
Starting ntpd:              [ OK ]

Ubuntu:

The following commands below will install and configure ntp under Ubuntu.

# apt-get install ntp

# /etc/init.d/ntp restart

Configuring the ntp.conf files will not be needed as they are automatically configured during installation.

Generic

Another way around this issue is to manually have the ntpdate application run directly via the cron to update the time. This issue is caused on virtual machines where the virtual software forces the virtual machine to sync with the host machine. Below is a work around. Just enter this into cron. The ip of the time server is au.pool.ntp.org

# crontab -e

*/5 * * * * /sbin/ntpdate -u 149.20.68.17

Thermaltake v6 BackX Edition Case:

thermaltake v6 blacx edition

thermaltake v6 blacx edition

Its time again to upgrade my home made nas running ubuntu server. Current machine is a core duo running five 500gb seagate hard disks. One of my pet peeves of the current nas server is when I disk dies I need to shutdown the disk, pull the case apart, take out the disk then assemble the unit back to operating normality. I have decided with the new server that the disks shall be hot swappable. In order for this to be achieved in need to have a computer case where all the disks can be accessed from the front of the computer. Hence where the thermaltake v6 comes into play. I have been shopping around for some cases and found the prices too rediculous to do anything about this. It was not today when I turned up to my regular computer store that the sales person told me they had the thermaltake cases without power supplies for $79. I thought this was a bargain, due to most cases come with a 420 watt power supply that you automatically replace anyway. With the main piece of gear found, to make the new nas a reality, I now seek a new motherboard, with as many onboard sata ports, and hot swappable bays. The thermaltake v6 specs can be seen here.

Change System Hostname:

CentOS:

To change the hostname, the hostname is located in the following configuration file

/etc/sysconfig/network

The file contains three lines. We are only interested in changing the third linux beginning with hostname as this is the hostname. You can add whatever suits your fancy after the equals symbol.

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=bob

Then you need to restart the networking process, via the following command

# /etc/rc.d/init.d/network restart

Now you can restart the network services that control the hostname at startup. Manually starting the  above command should show you the results below.

Shutting down interface eth0:                             [  OK  ]
Shutting down loopback interface:                    [  OK  ]
Setting network parameters:                                [  OK  ]
Bringing up loopback interface:                          [  OK  ]
Bringing up interface eth0:                                   [  OK  ]

Now your hostname should be changed. You can check your hostname with the hostname command

# hostname
bob

Ubuntu:

Under ubuntu to change the hostname as of this writing using ubuntu version 10.04.03 you need to modify the following file

/etc/hostname

There will be one line with the name of the machine. Just change the name from what exists to the new name you want the machine to be called. There is a issue I have with ubuntu 10.04.03. It seems that the init script to restart the hostname does not work, nor the hostname service. The only way I have been able to get around this is to reboot the machine. This may be fixed in versions afterwards.

Creating a Software Raid Array in 600 seconds…

Recently I decided that I was going to build a array, after my disk failure on my previous server. This would allow my data to be redundant, even with a disk failure. I debated between hardware and software raid. Hardware raid would be faster, limited to one hardware controller. While with software raid or sometimes called fake raid. I can have the disks across multiple controllers. This again slows the performance of the software raid, but it is the tradeoff, I am willing to accept. I decided on software raid because, if a disk dies, and I cannot get a the same size. I can use a larger disk, and downsize the disk to the size of the other disks in the array.  Also with technology, larger disks do come down in price.

Ubuntu:

1. We need to first install the the raid software.

# apt-get install mdadm

2. Create the partitions on the hard disks.

# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa3e937ed
Device Boot Start End Blocks Id System
/dev/sda1 1 60801 488384001 fd Linux raid autodetect

Next we need to change the partition type to “Linux raid auto”.

Command (m for help): t
Selected partition 1
fd  Linux raid auto
Hex code (type L to list codes): fd

3. Create the software raid array.

# mdadm –create /dev/md0 –chunk=4 –level=5 –raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sdc1

–create creates the software array.
/dev/md0 is the name of the array, the array needs to be md[number]
–chunk the block size of the software array.
–raid-devices how many disks in the array.
/dev/sda1 is the disks that will be included in the array

4. Assemble the software raid array.

# mdadm –assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1

–assemble bundle the disks together.
/dev/md0 the name of the array.
/dev/sda1 the disks in the array.

5. To see the software raid sync you can use the following command.

# watch -n 10 cat /proc/mdstat

When the array is sync’ed it will have 100%. Time it takes depends on the size of the software array.

6. Create the file System upon the software array. You can partition the software array with fdisk.

# mkfs.ext3 /dev/md0

7. Now you can use the software disk array.