Tag Archives: install

Arch Linux on a T400 – Log

Trying out Arch Linux on a Lenovo T400!

First step after getting the T400 Dual Core Centrino 2.26GHz 4GB RAM: replace the 160GB spinning rust to a 120GB Samsung 840. Very easy to take out the old disk and put the new SSD in the carrier.

https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T400 has some details.

https://wiki.archlinux.org/index.php/Installation_Guide and the Beginner’s Guide are quite helpful.

To make it easy, the partition layout I created with parted was:

mklabel: MSDOS
mkpart: pri, 0%, 300M /boot ext4 – flag bootable
mkpart: pri, 300M, 100%, /, ext4
No swap!

Install base and some important packages to disk after mkfs and mounting and setting up mirrors:

pacstrap /mnt base dialog iw wpa_supplicant grub parted sudo alsa-utils vim ttf-dejavu openssh screen

Beginners’_Guide had sufficient instructions to set up the boot loader, except this was needed or the grub-mkconfig would fail with syntax error.

echo “GRUB_DISABLE_SUBMENU=y” >> /etc/default/grub

After successful boot time to get a graphical display up and running :)

Beginner’s guide to the rescue: Beginners’_Guide#Graphical_User_Interface

Lightdm was easy to set up and worked right out of the box, which GDM did not. DWM was easy too, I think I can get used to using the ABS/makepkg stuff. Nicer than compiling it and copying the binary around.

Windows key is Mod4Key in config.h for DWM.

Packages and getting chromium-pepper-flash working:

  1. Install all the dependencies for Aura
  2. Download aura and makepkg -i install it
  3. aura -A chromium-pepper-flash

alsamixer and pressing “m” mutes/unmutes a channel :)

Running Ubuntu on a Desktop

Introduction

Recently I’ve had the pleasure of installing Ubuntu on my desktop. Here are some thoughts and what I initially do:

Machine is a:

Motherboard: Gigayte GA-EX58-UD3R
CPU: Intel Core i7
Memory: 8GB
Disks: Intel i300 SSD, 2x500GB and 1x3TB Western Digital Drives.
Graphics Card: AMD HD6800

Here are some of the things figured out along the way:

  • grub2 does not like keyboard, but if I boot on the Ultimate Boot CD (grub) – the keyboard does work. This is with flipping all the USB keyboard, mouse, storage, legacy .. settings on and off in BIOS.
    • After removing Ubuntu 12.10 and installing 12.04 (this is with USB things enabled in BIOS) – the keyboard works in grub2 menu.
  • to install better drivers, easiest is to open Ubuntu Software, edit sources and allow post-release things.
    • then go to settings and “additional drivers”
  • after upgrading to fglrx,
    • to change speed of the GPU fan to 20% hit: aticonfig –pplib-cmd “set fanspeed 0 20”
    • to view the speed of the GPU fan hit: aticonfig –pplib-cmd “get fanspeed 0”
    • to view the GPU temperature hit: aticonfig –adapter=0 –od-gettemperature

If you do decide to try with newer drivers for the ATI – card, make sure you have the installation CD/DVD handy. Or even better, get it on a USB-drive, way faster.

To find the devices for / and /boot – at least when I boot up there are these disk icons in the side-bar on the left side. If you hover over the icon you’ll see the size, if you click, it mounts and then a folder is opened. Then in the output of ‘mount’ you can see which device it is. Unmount and then proceed with these to get a working chroot:

sudo mount /mnt /dev/devicethathasroot
sudo mount /mnt/boot /dev/devicethathasslashboot
sudo mount ‐‐bind /dev /mnt/dev
sudo mount ‐‐bind /proc /mnt/proc
sudo mount ‐‐bind /sys /mnt/sys
xhost +local:
# above xhost is to get x things working from within a chroot (possibly unsafe?).
chroot /mnt
# you can get network working, it needs a good /etc/resolv.conf first. Either overwrite the existing one or somehow get the local nameserver up and running

Install some good software

apt-get install screen openssh-server tmux openjdk-6-jre unrar p7zip pidgin vim

Spotify Repository – http://www.ubuntuupdates.org/ppa/spotify

Google Chrome Repository – http://www.ubuntuupdates.org/ppa/google_chrome

Universal Media Server

For UMS you’ll also need:

apt-get install ffmpeg mplayer mencoder libzen-dev mediainfo

You also need to make sure zen and mediainfo works – check trace log in UMS to see if there are any errors in the beginning that they are not found. If so the hack is to create symlinks. For me the libzen.so and libmediainfo.so are in the /usr/lib/x86_64-linux-gnu/ directory.

Getting graphite running (for graphing / system monitoring )

One reason was that I wanted to learn more about this tool – but another reason is that it’s quite light weight, especially if you’re going to be running an httpd anyway.

To install it, follow this guide: http://coreygoldberg.blogspot.fi/2012/04/installing-graphite-099-on-ubuntu-1204.html

Carbon-cache initd-script: https://gist.github.com/1492384

To monitor temperature and fan speed of your AMD/ATI card put this script in /usr/local/bin/atitemp.sh:

#!/bin/bash
# Script to monitor temp and fanspeed of an AMD/ATI card.
# amdccle required? Also X?

HOST1="$(hostname -s)"
DEBUG="0"

CMD="$(which aticonfig)"

if [ "$?" != "0" ]; then
        echo "Cannot find aticonfig, check paths and if it's even installed."
        exit $?
fi

while [ 1 ];
do

TEMP=$(/usr/bin/aticonfig --adapter=0 --od-gettemperature|grep Sensor|awk '{print $5}'|sed -e 's/\.00//')
SPEED=$(/usr/bin/aticonfig --adapter=0 --pplib-cmd "get fanspeed 0"|grep Result|awk '{print $4}'|tr -d "%")
DATU="$(date +%s)"
LOGF="/tmp/atitemp.log"

echo "##########" >> $LOGF

if [ "$TEMP" != "" ]; then
echo "servers.$HOST1.atitemp $TEMP $DATU"|nc localhost 2003

if [ "$DEBUG" == "1" ]; then
echo $TEMP >> $LOGF
fi

fi

sleep 1
if [ "$SPEED" != "" ]; then
echo "servers.$HOST1.atifanspeed $SPEED $DATU"|nc localhost 2003

if [ "$DEBUG" == "1" ]; then
echo $SPEED >> $LOGF
fi

fi

sleep 60;
done

To graph useful system resources (network bandwidth, cpu/mem-usage, disk space)

Would be good to install collectl and just export to graphite. But this does not work well currently because the version of collectl with Ubuntu 12.04 LTS is 3.6.0 (3.6.3 with 12.10).
3.6.1 is needed to make it work with graphite and 3.6.5 to make it work good if you want to group servers.

There are plenty of other options though. You can write some scripts yourself, use diamond or a few other tools that has graphite-support.

Diamond is another option, to install follow these two links https://github.com/BrightcoveOS/Diamond/wiki/Installation (only addition is first you have to clone the git repository, from in there you run make builddeb).

How to manually configure a custom collector: https://github.com/BrightcoveOS/Diamond/wiki/Configuration

Setup a 3 Node Lustre Filesystem

Introduction

Lustre is a filesystem often used by clusters because many computers can mount the filesystem simultaneously.

This is a small log/instruction for how to setup Lustre in 3 virtualized machines (one metadata server, one object storage server and one client).

Basic components:

VMWare Workstation
3 x CentOS 6.3 VMs.
Latest Lustre from Whamcloud

To use Lustre your kernel needs to support it. There’s a special one for server and one for the client. Some packages are needed on both.

Besides lustre you’ll need an updated version of e2fsprogs as well (because the version that comes from RHEL6.3 does not support large partitions).

Starting with the MDS. When the basic OS setup is done will make a copy of that to use for OSS and Client.

Setup basic services.

Install an MDS

This will run the MDT – the metadata target.

2GB RAM, 10GB disk, bridged networking, 500GB for /boot, rest for / (watch out, it may create a really large swap). Minimal install. Setup OS networking (static ip for servers, start on boot, open port 988 in firewall, possibly some for outgoing if you decide to restrain that too), run yum update and setup ntp. Download latest lustre and e2fsprogs to /root/lustre-client, lustre-server and e2fsprogs appropriately (x86_64). Lustre also does not support selinux, so disable that (works fine with it in enforcing until time to create mds/mdt, also fine with permissive until it’s time to mount).
Put all hostnames into /etc/hosts.
Poweroff and make two full clones.
Set hostname.

Install an OSS

This will contain the OST (object storage target). This is where the data will be stored.

Networking may not work (maybe device name changed to eth1 or eth2).
You may want to change this afterwards to get the interface back to be called (eth0). A blog post about doing that.

Install a client

This will access and use the filesystem.

Clone of the OSS before installing any lustre services or kernels.

Install Lustre

Before you do this it may be wise to take a snapshot of each server. In case you screw the VM up you can then go back :)

Starting with the MDS.

Installing e2fsprogs, kernel and lustre-modules.

Skipping debuginfo and devel packages, installing all the rest.

yum localinstall \ 
kernel-2.6.32-220.4.2.el6_lustre.x86_64.rpm kernel-firmware-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
kernel-headers-2.6.32-220.4.2.el6_lustre.x86_64.rpm \
lustre-2.2.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \ 
lustre-ldiskfs-3.3.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm \
lustre-modules-2.2.0-2.6.32_220.4.2.el6_lustre.x86_64.x86_64.rpm

The above was not the order they were installed. Yum changed the order so that for example kernel-headers was last.

yum localinstall e2fsprogs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-debuginfo-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-devel-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-libs-1.42.3.wc3-7.el6.x86_64.rpm \
e2fsprogs-static-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-1.42.3.wc3-7.el6.x86_64.rpm \
libcom_err-devel-1.42.3.wc3-7.el6.x86_64.rpm \
libss-1.42.3.wc3-7.el6.x86_64.rpm \
libss-devel-1.42.3.wc3-7.el6.x86_64.rpm

After boot, confirm that you have lustre kernel installed by typing:

uname -av

and

mkfs.lustre --help

to see if you have that and

rpm -qa 'e2fs*'

to see if that was installed properly too.

By the way, you probably want to run this to exclude automatic yum kernel updates:

echo "exclude=kernel*" >> /etc/yum.conf

After install and reboot into new kernel it’s time to modprobe lustre, start creating MDT, OST and then mount things!
But hold on to your horses, first we ned to install the client :)

 

And then the Client

Install the e2fsprogs*

We cannot just install the lustre-client packages, because we run a different kernel than the ones that whamcloud have compiled the lustre-client against.

We can either back-pedal and install an older kernel. Or we can build (from source / SRPMS) a lustre-client that works on a kernel of our choosing. The later option seems like a better way, because we can then upgrade the kernel if we want to.

 

Build custom linux-client rpms

Because of a bug it appears that some ext4 source packages are needed – while they are not. You need to add some parameters to ./configure. This will be the topic of a future post.

The above rpmbuild should create rpms for the running kernel. If you want to create rpms for a non-running kernel you are supposed to be able to run.

Configure Lustre

Whamcloud have good instructions. Don’t be afraid to check out their wiki or use google.

/var/log/messages is the place to look for more detailed errors.

On the MDS

Because we do not have infiniband you want to change the parameters slightly for lnet to include tcp(eth0). These changes are not reflected until reboot (quite possibly something else) – but just editing a file under /etc/modprobe.d/ called for example lustre.conf is not enough.

Added a 5GB disk to the mds.

fdisk -cu /dev/sdb; n, p, 1, (first-last)

modprobe lustre lnet

mkfs.lustre –mdt –mgs

mount

On the OSS

Also add the parameters into modprobe.

mkfs.lustre –ost

mount

On the client

Add things into modprobe.

mount!

Write something.

Then hit: lfs df -h

To see usage!

 

Get it all working on boot

You want to start the MDS, then the OSS and last the client.
But while it’s running you can restart any node and eventually it will start working again.

Fstab on the client:
ip@tcp:/fsname /mnt lustre defaults,_netdev 0 0

Fstab on the OSS and MDS:
/dev/sdb1 /mnt/MDS lustre defaults,_netdev 0 0

While it’s running you can restart any node and eventually it will start working again.

Install FreeBSD in VirtualBox

The Past

I used to run FreeBSD 5 and 6 about eight years ago on a Pentium III 900MHz machine with maybe 768MB RAM. It was very slow but after a lot of tinkering with the kernel I got it to boot and run very nicely.

Fluxbox was the window manager I used then together with Eterm and pico :)

The Install

Installing it $today in a VirtualBox 4.1.6 on an IBM T40 running RHEL 6 x64.

I used the ‘disc1’ .iso of FreeBSD 8.2. Give it enough of RAM and bridged networking is probably what you want. If you have it set to NAT and then want to change you can do that ‘online’ while the virtual machine is online. Might be good to run another dhcp discover after though. And also don’t forget to remove default route before that. (route del default).

Defaults are pretty OK I suppose on a VM. No need to mess around with the partitions or labels.

It’s all done in the console menus and you can go back and forth between the menus. You probably want to enter the ‘post-install’ section to set ip, password, chose to install sshd. Add a new user and add it to the group ‘wheel’. That way you can hit ‘su -‘ to get root access.

Using FreeBSD

After it’s up you probably want to get root access: ‘su -‘
Run ‘dhclient INTERFACE’ to get a dhcp ip. Find the interface name via ifconfig.

Install Bash

If you chose to install Ports during install, you can go to /usr/ports and hit ‘make search name=”bash”. You can use this to search for packages called bash. Then cd /usr/ports/shells/bash; make; make install; make clean

Then ‘chsh’ and change to /usr/local/bin/bash. Vi-syntax works so press i to insert, r to replace, x to remove or :wq! to write and quit.

Update and use ports.

You can also search on freshports.org.

csup is a tool that you use to update the ports collection. Another is portsnap.
Portsnap appears to be a bit simpler and it came by default when I installed it.

portsnap fetch; portsnap extract; port portsnap update

Basically Ports consists of softwares’ make files and some files pointing where to download the softwares when you decide to install them. You only need to run the portsnap extract the first time. Rest of the times fetch and update should do it. Or ‘portsnap cron’ if you do it in the scheduler/crontab.

Portaudit is a tool that checks for vulnerabilities in the softwares you use. This was very quick to install though. To see if you have any issues, hit ‘portaudit -Fda’.

Each port or software should have a file called pkg-descr, you can use this to see what it does.

portsearch is one that you can use to search for ports instead of the ‘make search’.

sshd

You can ssh into the machine directly after installing, as long as it has IP connectivity (if you can ping it). You also cannot ssh in as root by default.

firewalling

the firewall is ‘ipfw’. This is not enabled by default. To enable it set firewall_enable to YES in /etc/rc.conf. Make sure you add some good fw rules first. Or you can set firewall_type=”open” in rc.conf and then firewall_script=”/etc/ipfw.rules”.

See http://www.freebsd.org/doc/handbook/firewalls-ipfw.html . There is a sample called ‘inclusive ruleset’. This one you can paste into /etc/ipfw.rules , edit to your liking (change your public interface name, add dns-servers, comment out services you don’t need (like port 80 if you for example do not have a web-server). You could then edit this script to have a

$cmd 00411 allow tcp from 192.168.0.0/24 to me 22 in via $pif setup limit src-addr 2

This would allow only addresses from the 192.168.0.0/24 network to ssh into your machine if you comment the rule that allows incoming on port 22 from anywhere.

ipfw list # to see the current firewall

Conclusion

FreeBSD is special compared to a few other operating systems because you get to compile all the software. You can of course get binaries if you want and install via pkg_add. But that’s not so cool right? It’s also a good idea to tweak the kernel, especially if you have a little slower system and want some better performance. If you have a slower system (like in a virtual machine), it could be painfully slow to install something. For example bash took what felt like forever to install for me.

This means a bit more patience is required with FreeBSD, but on the other hand maybe this way there will much be less crap installed.

Apparently FreeBSD 8.2 is not so cool because there is a 9 in beta or PC-BSD. If you want you can even get a ‘snapshot’ in the CURRENT subset, which is basically as new as it gets.