Next Image
Make the current image sticky.
Previous Image
randys.org - randys.org

Archive for August, 2007

Sliced Goodness

Welp, I’ve switched over this domain (randys.org) to Slicehost’s DNS servers so you should be reading this from a freshly installed Archlinux running Ruby on Rails and Mephisto (along with MySQL, PHP, Apache, yadda yadda yadda). It appears to be a noticeable improvement in terms of speed.

void appears to be a little off. Looks like my static file server isn’t configured properly… or something.

• • •

How-To: Install Archlinux on Slicehost

I recently acquired a 256 Slice from Slicehost. While their distribution selection is good, I was hoping for something, well, different. My old VPS is rocking Ubuntu (quite well) but I just want something else. Slicehost’s other distributions weren’t going to cut it.

  1. Ubuntu Dapper – Already running that.. that’s how I got here.
  2. CentOS 4.3 – Um, no. Never liked RedHat. Hate RPMs. Package management is a nightmare.
  3. Gentoo 2006.1 – I’ve used Gentoo in the past (a lot) and enjoyed it. I even tried it on my old VPS. I just don’t have the patience to wait for shit to compile.
  4. Debian Etch – Debian is a true soldier. Secure and stable. However, not up-to-date enough for my tastes (that’s why I went with Ubuntu).
  5. Fedora 6 – See #2.

Enter Archlinux.

This little how-to was taken from various places on the net, but the bulk of it is from Anders’ Blargh post and a couple of comments in a previous post of mine. So, let’s dive in.

Back It Up!

If you have any valuable information on your slice, now would be the time to make a backup of the important stuff you want to keep.

Bootstrapping

First thing you want to do is bootstrap Arch64 to directory on your current distribution. If you happen to have a 64bit version running at home, you could do this locally and it should still work (in theory).

# export PACMAN_VERSION=3.0.5-2

export XEN_MODULES_VERSION=2.6.16.29

wget http://www.randys.org/assets/2007/8/17/archbootstrap-packages-20070817

wget ftp://ftp.archlinux.org/current/os/x86_64/pacman-${PACMAN_VERSION}.pkg.tar.gz

tar zxvf pacman-${PACMAN_VERSION}.pkg.tar.gz -C /

mkdir /arch

At this point, you might want to edit /etc/pacman.conf and /etc/pacman.d/current to your liking. Picking a close/fast mirror will help speed things along.

# pacman.static -Sy cat archbootstrap-packages-20070817 -r /arch

Now you need to bind /dev, /sys and /proc to the bootstrap directory so you can chroot in.

# for s in dev sys proc; do mount /$s /arch/$s --bind; done

Copy some important files for the chroot.

# cp /etc/mtab /arch/etc/

cp /etc/fstab /arch/etc/

cp /etc/resolv.conf /arch/etc/

We also need to copy the all important xen kernel modules from the existing slice into our Arch64 bootstrap directory.

# cp -r /lib/modules/${XEN_MODULES_VERSION}-xen /arch/lib/modules/

Now we’re ready to chroot into your new Arch64 directory.

# chroot /arch /bin/bash

One of gotchas I had was when I went to SSH into my newly booted Arch64 Slice. It would connect and I could enter my password, but it would hang and never drop me to a command line prompt. Did a little searching and found that it was all because /dev/pts was not being mounted at boot time. Easy fix.

#[] echo "none  /dev/pts    devpts  gid=5,mode=620  0 0" >> /etc/fstab

Edit /etc/locale.gen and enable any locales you require. en_US.UTF-8 UTF-8 and en_US ISO-8859-1 are popular choices. Now generate the locales.

#[] locale-gen

Edit /etc/pacman.conf and /etc/pacman.d/(current|extra|community) in your chroot to your liking. If you don’t do it here, you can always do it when you get it running. But we’re about to install openssh, so now is as good a time as any.

#[] pacman -Sy openssh

Now you nee to add sshd to our DAEMONS array in /etc/rc.conf file

#[] vim /etc/rc.conf
    ...
    DAEMONS=(syslog-ng network netfs crond sshd)
    ...

While you’re in /ect/rc.conf, go ahead and setup your network interfaces and gateway. You can get the current information from your running Slice (for Ubuntu cat /etc/network/interfaces)

    ...
    eth0="eth0 XXX.XXX.XXX.XXX netmask 255.255.255.0 broadcast XXX.XXX.XXX.XXX"
    INTERFACES=(lo eth0)
    gateway="default gw XXX.XXX.XXX.XXX"
    ROUTES=(gateway)
    ...

Next, you’ll need to modfy /etc/hosts.allow so you can actually connect to our new Arch64 VPS via ssh.

#[] echo "sshd : ALL : allow" >> /etc/hosts.allow

If there’s any other tweaks you want to make, make them now. Otherwise, exit the chroot.

One thing I did before exiting the chroot to cut down on the bootstrap size is to clear pacman’s cache directory. It should probably save you 100MB+ and there’s no need to keep them at this point.

#[] pacman -Scc

[] exit

Unmount the dev, sys and proc filesystems you mounted earlier.

# umount /arch/dev

umount /arch/sys

umount /arch/proc

Now we’ll archive the files.

# cd /arch && tar cjvf /archbootstrap-$(date +%Y%m%d).tar.bz2 *

That’s it. You’re all set. If you want to keep a copy of this so you don’t have to do all this again, do it now.

# scp /archbootstrap-$(date +%Y%m%d).tar.bz2 <username>@<hostname>:<path>

Dealing with Slicehost

At this point you should have a working Arch64 install ready to be installed. Now you need to login to the Slicehost manager and put your slice into Rescue Mode. Login to your slice via SSH. Once logged in you’ll need to mount your slice’s partition and copy the archive to the rescue disk.

#[r] mkdir /mnt/oldslice

[r] mount /dev/sda1 /mnt/oldslice

[r] cp /mnt/oldslice/archbootstrap-* /root

[r] umount /mnt/oldslice

Next, format your old slice partition and re-mount it so you can install Arch64.

#[r] mke2fs -j /dev/sda1

[r] mount /dev/sda1 /mnt/oldslice

[r] tar xjvfp /root/archbootstrap-*.tar.bz2 -C /mnt/oldslice/

And that’s about it. You should now have a working Arch64 installation on your new Slice! Probably a good idea to double check all your settings before rebooting your slice, but, then you do have access to the rescue console.

Enjoy! And thanks to Anders for pointing me in the right direction.


If you find any errors or have any additions, please let me know and I’ll update this post.

• • •

VPSLink, I’m breaking up with you

It’s not you, it’s me (again)

It’s been a year since I first signed up with VPSLink. They’ve been a decent host for the most part. They had some troubles in the beginning with disk I/O and server loads, but those have pretty much been kept at a minimum as of late. I still experience high server load from time to time (like earlier today), but for the most part it’s generally OK. Nonetheless, I’ve decided to move on (again). Try something different. Something new. Something, better?

It’s not that I don’t like VPS technology. I do. In fact, I don’t think I could go back to a shared hosting environment again (sorry DH). I think it’s the virtualization technology (and perhaps the limitations of OpenVZ/Virtuozzo(TM)).

How you doin’?

When I first started looking for a VPS provider last year, I briefly signed up for one particular Xen provider. The server itself was pretty good, but the support and communication were lacking. I quickly ditched that host for VPSLink. Unfortunately, I paid for a year in advance and they don’t refund unused months so I was stuck in a mediocre relationship with a host I wasn’t happy with.

Then I met Slicehost. They use Xen and are reasonably priced for the same stats I’m getting over at VPSLink (actually, Slicehost is a smidgen cheaper). It’s build by developers, for developers and has a growing community. Last week I emailed support to ask a question just to see how quickly they respond. I got a response within 30 minutes. Fast enough for me.

Here’s a list:

  • Xen based virtualization
  • Proper VPS/Server ratio (<= 24 per Server depending on the Slice)
  • Quad Core, 64bit CPUs and OS
  • OS of choice. If I don’t like what they offer, I can install what I want
  • Growing community of users (Wiki, Forum, IRC, and Campfire)

To Close for Comfort

My VPSLink account is now due (by the 18th) and I just submitted a request for a new Slice yesterday. I’m cutting a little close. I’m trying to get things setup locally so help migrate everything over as quickly as possible, however, I’m fairly confident that nothing will go as planned. There will inevitably be some down time… the question is, how much?

• • •

All content Copyright © 1999 — 2010 Randy Sesser | Happily Hosted by WebFaction
Entries (RSS) | Comments (RSS)